[issue #195] Change projects/sidebar to be more standart.

This commit is contained in:
George Vinogradov 2012-03-22 04:42:56 +04:00
parent 65e4e0f748
commit 401e570dc7
3 changed files with 18 additions and 17 deletions

View File

@ -1,18 +1,20 @@
- act = action_name.to_sym - content_for :sidebar do
- contr = controller_name.to_sym
%aside - act = action_name.to_sym
.admin-preferences - contr = controller_name.to_sym
%ul
- if can? :edit, @project %aside
%li{:class => (act == :edit && contr == :projects) ? 'active' : ''} .admin-preferences
= link_to t("layout.projects.edit"), edit_project_path(@project) %ul
- if can? :manage_collaborators, @project - if can? :edit, @project
%li{:class => (act == :sections && contr == :projects) ? 'active' : ''} %li{:class => (act == :edit && contr == :projects) ? 'active' : ''}
= link_to t("layout.projects.sections"), sections_project_path(@project) = link_to t("layout.projects.edit"), edit_project_path(@project)
- if can? :manage_collaborators, @project - if can? :manage_collaborators, @project
%li{:class => (act == :edit && contr == :collaborators) ? 'active' : ''} %li{:class => (act == :sections && contr == :projects) ? 'active' : ''}
= link_to t("layout.projects.edit_collaborators"), edit_project_collaborators_path(@project) = link_to t("layout.projects.sections"), sections_project_path(@project)
- if can? :manage_collaborators, @project
%li{:class => (act == :edit && contr == :collaborators) ? 'active' : ''}
= link_to t("layout.projects.edit_collaborators"), edit_project_collaborators_path(@project)
-#.block.notice -#.block.notice

View File

@ -1,4 +1,5 @@
= render :partial => 'projects/submenu' = render :partial => 'projects/submenu'
= render :partial => 'projects/sidebar'
= form_for @project, :html => { :class => :form, :multipart => true } do |f| = form_for @project, :html => { :class => :form, :multipart => true } do |f|
= render :partial => "form", :locals => {:f => f} = render :partial => "form", :locals => {:f => f}
@ -10,4 +11,3 @@
= link_to t("layout.delete"), project_path(@project), :method => :delete, :confirm => t("layout.projects.confirm_delete"), :class => 'button' if can? :destroy, @project = link_to t("layout.delete"), project_path(@project), :method => :delete, :confirm => t("layout.projects.confirm_delete"), :class => 'button' if can? :destroy, @project
.both .both
- content_for :sidebar, render('sidebar')

View File

@ -1,4 +1,5 @@
= render :partial => 'projects/submenu' = render :partial => 'projects/submenu'
= render :partial => 'projects/sidebar'
= form_for @project, :url => sections_project_path(@project), :method => :post, :html => { :class => :form, :multipart => true } do |f| = form_for @project, :url => sections_project_path(@project), :method => :post, :html => { :class => :form, :multipart => true } do |f|
.leftside.w25 .leftside.w25
@ -23,8 +24,6 @@
= submit_tag t("layout.save"), :class => 'button' = submit_tag t("layout.save"), :class => 'button'
.both .both
- content_for :sidebar, render('sidebar')
:javascript :javascript
// TODO: Replace this temporary hack by something more true // TODO: Replace this temporary hack by something more true
$('.right').addClass('bigpadding'); $('.right').addClass('bigpadding');