Chris@0:
Chris@0:
Chris@0:
Chris@0: <% form_tag({:action => "add_block"}, :id => "block-form") do %>
Chris@0: <%= label_tag('block-select', l(:label_my_page_block)) %>
Chris@0: <%= select_tag 'block', "" + options_for_select(@block_options), :id => "block-select" %>
Chris@0: <%= link_to_remote l(:button_add),
Chris@0: {:url => { :action => "add_block" },
Chris@0: :with => "Form.serialize('block-form')",
Chris@0: :update => "list-top",
Chris@0: :position => :top,
Chris@0: :complete => "afterAddBlock();"
Chris@0: }, :class => 'icon icon-add'
Chris@0: %>
Chris@0: <% end %>
Chris@0: <%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %>
Chris@0:
Chris@0:
Chris@0: <%=l(:label_my_page)%>
Chris@0:
Chris@0:
Chris@0: <% @blocks['top'].each do |b|
Chris@0: next unless MyController::BLOCKS.keys.include? b %>
Chris@0: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@0: <% end if @blocks['top'] %>
Chris@0:
Chris@0:
Chris@0:
Chris@0: <% @blocks['left'].each do |b|
Chris@0: next unless MyController::BLOCKS.keys.include? b %>
Chris@0: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@0: <% end if @blocks['left'] %>
Chris@0:
Chris@0:
Chris@0:
Chris@0: <% @blocks['right'].each do |b|
Chris@0: next unless MyController::BLOCKS.keys.include? b %>
Chris@0: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@0: <% end if @blocks['right'] %>
Chris@0:
Chris@0:
Chris@0: <%= sortable_element 'list-top',
Chris@0: :tag => 'div',
Chris@0: :only => 'mypage-box',
Chris@0: :handle => "handle",
Chris@0: :dropOnEmpty => true,
Chris@0: :containment => ['list-top', 'list-left', 'list-right'],
Chris@0: :constraint => false,
Chris@0: :url => { :action => "order_blocks", :group => "top" }
Chris@0: %>
Chris@0:
Chris@0:
Chris@0: <%= sortable_element 'list-left',
Chris@0: :tag => 'div',
Chris@0: :only => 'mypage-box',
Chris@0: :handle => "handle",
Chris@0: :dropOnEmpty => true,
Chris@0: :containment => ['list-top', 'list-left', 'list-right'],
Chris@0: :constraint => false,
Chris@0: :url => { :action => "order_blocks", :group => "left" }
Chris@0: %>
Chris@0:
Chris@0: <%= sortable_element 'list-right',
Chris@0: :tag => 'div',
Chris@0: :only => 'mypage-box',
Chris@0: :handle => "handle",
Chris@0: :dropOnEmpty => true,
Chris@0: :containment => ['list-top', 'list-left', 'list-right'],
Chris@0: :constraint => false,
Chris@0: :url => { :action => "order_blocks", :group => "right" }
Chris@0: %>
Chris@0:
Chris@0: <%= javascript_tag "updateSelect()" %>
Chris@0: <% html_title(l(:label_my_page)) -%>