Redmine/app/views/my/page_layout.html.erb

68 lines
2.3 KiB
Plaintext
Raw Normal View History

<div class="contextual">
<% if @block_options.present? %>
<%= form_tag({:action => "add_block"}, :id => "block-form") do %>
<%= label_tag('block-select', l(:label_my_page_block)) %>:
<%= select_tag 'block',
content_tag('option') + options_for_select(@block_options),
:id => "block-select" %>
<%= link_to l(:button_add), '#', :onclick => '$("block-form").submit()', :class => 'icon icon-add' %>
<% end %>
<% end %>
<%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %>
</div>
<h2><%=l(:label_my_page)%></h2>
<div id="list-top" class="block-receiver">
<% @blocks['top'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['top'] %>
</div>
<div id="list-left" class="splitcontentleft block-receiver">
<% @blocks['left'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['left'] %>
</div>
<div id="list-right" class="splitcontentright block-receiver">
<% @blocks['right'].each do |b|
next unless MyController::BLOCKS.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['right'] %>
</div>
<%= sortable_element 'list-top',
:tag => 'div',
:only => 'mypage-box',
:handle => "handle",
:dropOnEmpty => true,
:containment => ['list-top', 'list-left', 'list-right'],
:constraint => false,
:url => { :action => "order_blocks", :group => "top" }
%>
<%= sortable_element 'list-left',
:tag => 'div',
:only => 'mypage-box',
:handle => "handle",
:dropOnEmpty => true,
:containment => ['list-top', 'list-left', 'list-right'],
:constraint => false,
:url => { :action => "order_blocks", :group => "left" }
%>
<%= sortable_element 'list-right',
:tag => 'div',
:only => 'mypage-box',
:handle => "handle",
:dropOnEmpty => true,
:containment => ['list-top', 'list-left', 'list-right'],
:constraint => false,
:url => { :action => "order_blocks", :group => "right" }
%>
<% html_title(l(:label_my_page)) -%>