use toolbar component in user ...toolbar

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/3000/head
Florian Kraft 10 years ago
parent 4a35b93027
commit 66b0a86000
  1. 75
      app/views/users/_toolbar.html

@ -1,31 +1,52 @@
<div class="toolbar-container">
<div id="toolbar">
<div class="title-container">
<h2><%= link_to l(:label_user_plural), :controller => '/users', :action => 'index' %> &#187; <%= new_user ? l("label_user_new") : h(@user.name) %></h2>
</div>
<% unless new_user %>
<ul id="toolbar-items">
<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= toolbar(title: "#{link_to l(:label_user_plural), users_path} &raquo; #{@user.new_record? ? l(:label_user_new) : h(@user.name)}") do %>
<% unless @user.new_record? %>
<li class="toolbar-item">
<%= link_to user_path(@user), class: 'button' do %>
<i class="button--icon icon-user1"></i> <%= l(:label_profile) %>
<% end %>
</li>
<% unless current_user.id == @user.id %>
<%= form_for @user, :url => {:action => :change_status},
:method => :post do %>
<li class="toolbar-item">
<%= link_to user_path(@user), class: 'button' do %>
<i class="button--icon icon-user1"></i> <%= l(:label_profile) %>
<% end %>
<%= change_user_status_buttons(@user) %>
</li>
<% unless current_user.id == @user.id %>
<%= form_for @user, :url => {:action => :change_status},
:method => :post do %>
<li class="toolbar-item">
<%= change_user_status_buttons(@user) %>
</li>
<% end %>
<% end %>
<% if Setting.users_deletable_by_admins? %>
<li class="toolbar-items">
<%= link_to deletion_info_user_path(@user), class: 'button' do %>
<i class="button--icon icon-delete"></i> <%= l(:button_delete) %>
<% end %>
</li>
<% end %>
<% end %>
<% if Setting.users_deletable_by_admins? %>
<li class="toolbar-items">
<%= link_to deletion_info_user_path(@user), class: 'button' do %>
<i class="button--icon icon-delete"></i> <%= l(:button_delete) %>
<% end %>
</ul>
</li>
<% end %>
</div>
</div>
<% end %>
<% end %>

Loading…
Cancel
Save