add_block.rhtml
1.34 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
<div style='height:350px'>
<% form_tag do %>
<p><%= _('In what area do you want to put your new block?') %></p>
<% @boxes.each do |box| %>
<%= labelled_radio_button(_("Area %d") % box.position, :box_id, box.id, box.central?, { :class => 'box-position', 'data-position' => box.position }) %>
<% end %>
<script type="text/javascript">
(function ($) {
$(document).ready(function () {
$(".box-position").live('change', function () {
if ($(this).attr('data-position') == '1') {
$('#center-block-types').show();
$('#side-block-types').hide();
} else {
$('#center-block-types').hide();
$('#side-block-types').show();
};
});
})})(jQuery);
</script>
<p><%= _('Select the type of block you want to add to your page.') %></p>
<div id='center-block-types'>
<%= render :partial => 'block_types', :locals => { :block_types => @center_block_types } %>
</div>
<div id='side-block-types' style='display:none'>
<%= render :partial => 'block_types', :locals => { :block_types => @side_block_types } %>
</div>
<br style='clear: both'/>
<% button_bar do %>
<%= submit_button(:add, _("Add")) %>
<%= colorbox_close_button(_('Close')) %>
<% end %>
<% end %>
</div>