add_block.html.erb
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<div id="add-block-dialog">
<%= form_tag do %>
<p><%= _('In what area do you want to put your new block?') %></p>
<div id="box-position">
<% @boxes.each do |box| %>
<% name = box.central? ? _('Main area') : _('Area %d') % box.position %>
<%= labelled_radio_button(name, :box_id, box.id, box.central?, { 'data-position' => box.position }) %>
<% end %>
</div>
<script type="text/javascript">
jQuery('#box-position input').bind('change',
function () {
showCenter = jQuery(this).attr('data-position') == '1';
jQuery('#center-block-types').toggle(showCenter);
jQuery('#side-block-types').toggle(!showCenter);
}
);
</script>
<p><%= _('Select the type of block you want to add to your page.') %></p>
<div id="center-block-types" class="block-types">
<% @center_block_types.each do |block| %>
<div class='block-type'>
<%= labelled_radio_button(block.description, :type, block.name) %>
</div>
<% end %>
</div>
<div id="side-block-types" class="block-types" style="display:none">
<% @side_block_types.each do |block| %>
<div class='block-type'>
<%= labelled_radio_button(block.description, :type, block.name) %>
</div>
<% end %>
</div>
<br style='clear: both'/>
<% button_bar do %>
<%= submit_button(:add, _("Add")) %>
<%= modal_close_button(_('Close')) %>
<% end %>
<% end %>
</div>