fix mypage rendering

This should realign the "personalized my page" styles with the project
overview.

Also provides some necessary core style changes for the plugin.

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/2961/head
Florian Kraft 10 years ago
parent 0b070cf18a
commit d389670c86
  1. 9
      app/assets/stylesheets/content/_my_page.sass
  2. 62
      app/views/my/page.html.erb
  3. 67
      app/views/my/page_layout.html.erb

@ -41,6 +41,15 @@ div.box-actions
margin-right: 16px
z-index: 500
#invisible-grid
#list-top
padding: 0 4px
#list-right
padding: 0 4px 0 10px
#list-left
padding: 0 10px 0px
.block-receiver
border: 1px dashed $my-page-edit-box-border-color
margin-bottom: 20px

@ -27,37 +27,43 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% breadcrumb_paths(l(:label_my_page)) %>
<% content_for :action_menu_specific do %>
<%= link_to l(:label_personalize_page), { action: 'page_layout' }, accesskey: accesskey(:edit) %>
<% content_for :toolbar do %>
<li class="toolbar-item">
<%= link_to({ action: 'page_layout' }, accesskey: accesskey(:edit), class: 'button') do %>
<i class="icon-edit"></i> <%= l(:label_personalize_page) %>
<% end %>
</li>
<% end %>
<h2><%=l(:label_my_page)%></h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<div class="grid-block">
<div id="list-top" class="grid-content">
<% @blocks['top'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['top'] %>
<%= render :partial => 'layouts/toolbar' %>
<div id="invisible-grid">
<div class="grid-block">
<div id="list-top" class="grid-content">
<% @blocks['top'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['top'] %>
</div>
</div>
</div>
<div class="grid-block">
<div id="list-left" class="grid-content">
<% @blocks['left'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['left'] %>
</div>
<div id="list-right" class="grid-content">
<% @blocks['right'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['right'] %>
<div class="grid-block">
<div id="list-left" class="grid-content">
<% @blocks['left'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['left'] %>
</div>
<div id="list-right" class="grid-content">
<% @blocks['right'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<div class="mypage-box">
<%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %>
</div>
<% end if @blocks['right'] %>
</div>
</div>
</div>
<% html_title(l(:label_my_page)) -%>

@ -88,30 +88,57 @@ See doc/COPYRIGHT.rdoc for more details.
<li><%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %></li>
<% end %>
<% content_for :toolbar do %>
<li class="toolbar-item">
<%= styled_form_tag({:action => "add_block"}, :id => "block-form") do %>
<%= styled_select_tag 'block', "<option>--#{t(:button_add)}--</option>".html_safe + options_for_select(@block_options),
:id => "block-select",
class: '-small' %>
<% end %>
</li>
<li class="toolbar-item">
<%= link_to_remote l(:button_add),
{:url => { :action => "add_block" },
:with => "Form.serialize('block-form')",
:update => "list-top",
:position => :top,
:complete => "afterAddBlock();"
}, :class => 'button'
%>
</li>
<li class="toolbar-item">
<%= link_to({action: 'page'}, class: 'button') do %>
<i class="icon-cancel"></i> <%= l(:button_back) %>
<% end %>
</li>
<% end %>
<h2><%=l(:label_my_page)%></h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<%= render :partial => 'layouts/toolbar' %>
<div class="grid-block">
<div id="list-top" class="grid-content block-receiver">
<% @blocks['top'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['top'] %>
</div>
</div>
<div class="grid-block">
<div id="list-left" class="grid-content block-receiver">
<% @blocks['left'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['left'] %>
<div id="visible-grid">
<div class="grid-block">
<div id="list-top" class="grid-content block-receiver">
<% @blocks['top'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['top'] %>
</div>
</div>
<div id="list-right" class="grid-content block-receiver">
<% @blocks['right'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['right'] %>
<div class="grid-block">
<div id="list-left" class="grid-content block-receiver">
<% @blocks['left'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['left'] %>
</div>
<div id="list-right" class="grid-content block-receiver">
<% @blocks['right'].each do |b|
next unless MyController.available_blocks.keys.include? b %>
<%= render :partial => 'block', :locals => {:user => @user, :block_name => b} %>
<% end if @blocks['right'] %>
</div>
</div>
</div>
<%= sortable_element 'list-top',

Loading…
Cancel
Save