Chris@0:
Chris@1115: <% if @block_options.present? %>
Chris@1115: <%= form_tag({:action => "add_block"}, :id => "block-form") do %>
Chris@1115: <%= label_tag('block-select', l(:label_my_page_block)) %>:
Chris@1115: <%= select_tag 'block',
Chris@1115: content_tag('option') + options_for_select(@block_options),
Chris@1115: :id => "block-select" %>
Chris@1115: <%= link_to l(:button_add), '#', :onclick => '$("#block-form").submit()', :class => 'icon icon-add' %>
Chris@1115: <% end %>
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@909: <% @blocks['top'].each do |b|
Chris@909: next unless MyController::BLOCKS.keys.include? b %>
Chris@909: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@909: <% end if @blocks['top'] %>
Chris@0:
Chris@0:
Chris@0:
Chris@909: <% @blocks['left'].each do |b|
Chris@909: next unless MyController::BLOCKS.keys.include? b %>
Chris@909: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@909: <% end if @blocks['left'] %>
Chris@0:
Chris@0:
Chris@0:
Chris@909: <% @blocks['right'].each do |b|
Chris@909: next unless MyController::BLOCKS.keys.include? b %>
Chris@909: <%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
Chris@909: <% end if @blocks['right'] %>
Chris@0:
Chris@0:
Chris@1115: <%= javascript_tag "initMyPageSortable('top', '#{ escape_javascript url_for(:action => "order_blocks", :group => "top") }');" %>
Chris@1115: <%= javascript_tag "initMyPageSortable('left', '#{ escape_javascript url_for(:action => "order_blocks", :group => "left") }');" %>
Chris@1115: <%= javascript_tag "initMyPageSortable('right', '#{ escape_javascript url_for(:action => "order_blocks", :group => "right") }');" %>
Chris@909:
Chris@0: <% html_title(l(:label_my_page)) -%>