clean up reportings toolbar

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/3000/head
Florian Kraft 10 years ago
parent 0b54a9bb95
commit 5ac947d274
  1. 44
      app/views/reportings/_toolbar.html.erb
  2. 2
      app/views/reportings/edit.html.erb
  3. 11
      app/views/reportings/show.html.erb

@ -1,28 +1,18 @@
<% type ||= :show %>
<% actions ||= false %>
<div class="toolbar-container">
<div id="toolbar">
<div class="title-container">
<h2>
<%= l("timelines.reporting_for_project.#{type}",
:title => link_to_project(@reporting.reporting_to_project)).html_safe %>
</h2>
</div>
<% if actions %>
<ul id="toolbar-items">
<% if authorize_for :reportings, :edit %>
<li class="toolbar-item">
<%= link_to edit_project_reporting_path(@project, @reporting), class: 'button' do %>
<i class="button--icon icon-edit"></i> <%= l(:button_edit) %>
<% end %>
</li>
<% end %>
<% if authorize_for :reportings, :destroy %>
<%= link_to confirm_destroy_project_reporting_path(@project, @reporting), class: 'button' do %>
<i class="button--icon icon-delete"></i> <%= l(:button_delete) %>
<% end %>
<% end %>
</ul>
<%= toolbar title: l("timelines.reporting_for_project.show",
:title => link_to_project(@reporting.reporting_to_project)) do %>
<% if show_actions %>
<% if authorize_for :reportings, :edit %>
<li class="toolbar-item">
<%= link_to edit_project_reporting_path(@project, @reporting), class: 'button' do %>
<i class="button--icon icon-edit"></i> <%= l(:button_edit) %>
<% end %>
</li>
<% end %>
<% if authorize_for :reportings, :destroy %>
<%= link_to confirm_destroy_project_reporting_path(@project, @reporting), class: 'button' do %>
<i class="button--icon icon-delete"></i> <%= l(:button_delete) %>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% end %>

@ -39,7 +39,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title l('timelines.reporting_for_project.show',
:title => h(@reporting.reporting_to_project.name)) %>
<%= render partial: 'toolbar', locals: { type: :show} %>
<%= render partial: 'toolbar', locals: { show_actions: false } %>
<%= labelled_tabular_form_for :reporting,
:url => project_reporting_path(@project, @reporting),

@ -32,16 +32,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title l('timelines.reporting_for_project.show',
:title => h(@reporting.reporting_to_project.name)) %>
<% content_for :action_menu_specific do %>
<%= link_to_if_authorized(l(:button_edit),
{:action => :edit, :project_id => @project, :id => @reporting},
:class => 'icon icon-edit',
accesskey: accesskey(:edit)) %>
<%= link_to_if_authorized(l(:button_delete),
{:action => :confirm_destroy, :project_id => @project, :id => @reporting},
:class => 'icon icon-delete') %>
<% end %>
<%= render partial: 'toolbar', locals: { type: :show, actions: true } %>
<%= render partial: 'toolbar', locals: { show_actions: true } %>
<%= render :partial => 'show' %>

Loading…
Cancel
Save