From d389670c867ac04ce5de05e41010ce217663d2fd Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Tue, 5 May 2015 13:38:10 +0200 Subject: [PATCH 1/2] 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 --- app/assets/stylesheets/content/_my_page.sass | 9 +++ app/views/my/page.html.erb | 62 ++++++++++-------- app/views/my/page_layout.html.erb | 67 ++++++++++++++------ 3 files changed, 90 insertions(+), 48 deletions(-) diff --git a/app/assets/stylesheets/content/_my_page.sass b/app/assets/stylesheets/content/_my_page.sass index d2441a2afb..c50f9e03b8 100644 --- a/app/assets/stylesheets/content/_my_page.sass +++ b/app/assets/stylesheets/content/_my_page.sass @@ -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 diff --git a/app/views/my/page.html.erb b/app/views/my/page.html.erb index 974e0c4698..30d01ffe0a 100644 --- a/app/views/my/page.html.erb +++ b/app/views/my/page.html.erb @@ -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 %> +
  • + <%= link_to({ action: 'page_layout' }, accesskey: accesskey(:edit), class: 'button') do %> + <%= l(:label_personalize_page) %> + <% end %> +
  • <% end %>

    <%=l(:label_my_page)%>

    -<%= render :partial => 'layouts/action_menu_specific' %> -
    -
    - <% @blocks['top'].each do |b| - next unless MyController.available_blocks.keys.include? b %> -
    - <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> -
    - <% end if @blocks['top'] %> +<%= render :partial => 'layouts/toolbar' %> +
    +
    +
    + <% @blocks['top'].each do |b| + next unless MyController.available_blocks.keys.include? b %> +
    + <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> +
    + <% end if @blocks['top'] %> +
    -
    -
    -
    - <% @blocks['left'].each do |b| - next unless MyController.available_blocks.keys.include? b %> -
    - <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> -
    - <% end if @blocks['left'] %> -
    -
    - <% @blocks['right'].each do |b| - next unless MyController.available_blocks.keys.include? b %> -
    - <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> -
    - <% end if @blocks['right'] %> +
    +
    + <% @blocks['left'].each do |b| + next unless MyController.available_blocks.keys.include? b %> +
    + <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> +
    + <% end if @blocks['left'] %> +
    +
    + <% @blocks['right'].each do |b| + next unless MyController.available_blocks.keys.include? b %> +
    + <%= render :partial => "my/blocks/#{b}", :locals => { :user => @user } %> +
    + <% end if @blocks['right'] %> +
    <% html_title(l(:label_my_page)) -%> diff --git a/app/views/my/page_layout.html.erb b/app/views/my/page_layout.html.erb index 5a80026f2d..cedf8a4c95 100644 --- a/app/views/my/page_layout.html.erb +++ b/app/views/my/page_layout.html.erb @@ -88,30 +88,57 @@ See doc/COPYRIGHT.rdoc for more details.
  • <%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %>
  • <% end %> +<% content_for :toolbar do %> +
  • + <%= styled_form_tag({:action => "add_block"}, :id => "block-form") do %> + <%= styled_select_tag 'block', "".html_safe + options_for_select(@block_options), + :id => "block-select", + class: '-small' %> + <% end %> +
  • +
  • + <%= link_to_remote l(:button_add), + {:url => { :action => "add_block" }, + :with => "Form.serialize('block-form')", + :update => "list-top", + :position => :top, + :complete => "afterAddBlock();" + }, :class => 'button' + %> +
  • +
  • + <%= link_to({action: 'page'}, class: 'button') do %> + <%= l(:button_back) %> + <% end %> +
  • +<% end %> +

    <%=l(:label_my_page)%>

    -<%= render :partial => 'layouts/action_menu_specific' %> +<%= render :partial => 'layouts/toolbar' %> -
    -
    - <% @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'] %> -
    -
    -
    -
    - <% @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'] %> +
    +
    +
    + <% @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'] %> +
    -
    - <% @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'] %> +
    +
    + <% @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'] %> +
    +
    + <% @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'] %> +
    <%= sortable_element 'list-top', From 66cd246571b493ded575b5f9f2986216ced621e4 Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Tue, 5 May 2015 15:18:05 +0200 Subject: [PATCH 2/2] remove legacy content_for call --- app/views/my/page_layout.html.erb | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/app/views/my/page_layout.html.erb b/app/views/my/page_layout.html.erb index cedf8a4c95..e4783705cd 100644 --- a/app/views/my/page_layout.html.erb +++ b/app/views/my/page_layout.html.erb @@ -64,29 +64,6 @@ See doc/COPYRIGHT.rdoc for more details. } //]]> -<% content_for :action_menu_specific do %> -
  • - <%= form_tag({:action => "add_block"}, :id => "block-form") do %> - - <%= label_tag('block-select', "#{l(:label_my_page_block)}:", class: 'form-label -transparent') %> - <%= select_tag 'block', "".html_safe + options_for_select(@block_options), - :id => "block-select", - class: 'form--select -small' %> - - <%= link_to_remote l(:button_add), - {:url => { :action => "add_block" }, - :with => "Form.serialize('block-form')", - :update => "list-top", - :position => :top, - :complete => "afterAddBlock();" - }, :class => 'icon icon-add' - %> - - - <% end %> -
  • -
  • <%= link_to l(:button_back), {:action => 'page'}, :class => 'icon icon-cancel' %>
  • -<% end %> <% content_for :toolbar do %>