Move add budget to toolbar

pull/6827/head
Mohamed Wael Khobalatte 9 years ago
parent e46de9c5a4
commit e2d0172353
  1. 3
      app/controllers/cost_objects_controller.rb
  2. 9
      app/views/cost_objects/index.html.erb
  3. 16
      lib/open_project/costs/engine.rb

@ -46,9 +46,6 @@ class CostObjectsController < ApplicationController
include WorkPackage::PdfExporter
include PaginationHelper
menu_item :new_budget, only: [:new]
menu_item :show_all, only: [:index]
def index
respond_to do |format|
format.html do end

@ -21,7 +21,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= render :partial => 'shared/costs_header' %>
<% html_title(l(:label_cost_object_plural)) %>
<%= toolbar title: l(:label_cost_object_plural) %>
<%= toolbar title: l(:label_cost_object_plural) do %>
<% if authorize_for(:cost_objects, :new) %>
<a href="<%= new_projects_cost_object_path(@project) %>" id="add-budget-button" title="Add budget" class="button -alt-highlight">
<i class="button--icon icon-add"></i>
<span class="button--text"><%= I18n.t(:button_add_cost_object) %></span>
</a>
<% end %>
<% end %>
<% if @cost_objects.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>

@ -82,22 +82,6 @@ module OpenProject::Costs
caption: :cost_objects_title,
html: { class: 'icon2 icon-budget' }
menu :project_menu,
:new_budget,
{ controller: '/cost_objects', action: 'new' },
param: :project_id,
caption: :label_cost_object_new,
parent: :cost_objects,
html: { class: 'icon2 icon-add' }
menu :project_menu,
:show_all,
{ controller: '/cost_objects', action: 'index' },
param: :project_id,
caption: :label_view_all_cost_objects,
parent: :cost_objects,
html: { class: 'icon2 icon-list-view1' }
Redmine::Activity.map do |activity|
activity.register :cost_objects, class_name: 'Activity::CostObjectActivityProvider', default: false
end

Loading…
Cancel
Save