Added units view and sidebar link
This commit is contained in:
parent
40f39a955c
commit
2cd9900cea
@ -1,10 +1,13 @@
|
||||
class BodyTrackersController < ApplicationController
|
||||
before_action :find_project, only: [:index]
|
||||
before_action :find_project, only: [:index, :units]
|
||||
before_action :authorize
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def units
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# :find_* methods are called before :authorize,
|
||||
|
@ -1,5 +1,4 @@
|
||||
class UnitsController < ApplicationController
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
|
@ -1 +1,9 @@
|
||||
<h3><%= t ".heading_body_trackers" %></h3>
|
||||
<ul>
|
||||
<li><%= link_to t(".link_summary"), project_body_trackers_path(@project) %></li>
|
||||
</ul>
|
||||
|
||||
<h3><%= t ".heading_common" %></h3>
|
||||
<ul>
|
||||
<li><%= link_to t(".link_units"), units_project_body_trackers_path(@project) %></li>
|
||||
</ul>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<h2><%= t ".heading" %></h2>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'sidebar' %>
|
||||
<%= render :partial => 'body_trackers/sidebar' %>
|
||||
<% end %>
|
||||
|
5
app/views/body_trackers/units.html.erb
Normal file
5
app/views/body_trackers/units.html.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<h2><%= t ".heading" %></h2>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'body_trackers/sidebar' %>
|
||||
<% end %>
|
@ -5,4 +5,9 @@ en:
|
||||
index:
|
||||
heading: 'Summary'
|
||||
sidebar:
|
||||
heading_body_trackers: 'Body trackers'
|
||||
heading_common: 'Common'
|
||||
link_summary: 'Summary'
|
||||
link_units: 'Units'
|
||||
units:
|
||||
heading: 'Units'
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
resources :projects do
|
||||
shallow do
|
||||
resources :body_trackers, :controller => 'body_trackers', :only => [:index]
|
||||
resources :body_trackers, :controller => 'body_trackers', :only => [:index] do
|
||||
collection do
|
||||
get 'units'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
4
init.rb
4
init.rb
@ -7,9 +7,9 @@ Redmine::Plugin.register :body_tracking do
|
||||
author_url 'https://github.com/cryptogopher'
|
||||
|
||||
project_module :body_tracking do
|
||||
permission :view_body_trackers, {:body_trackers => [:index]}, read: true
|
||||
permission :view_body_trackers, {:body_trackers => [:index, :units]}, read: true
|
||||
end
|
||||
|
||||
menu :project_menu, :body_trackers, {:controller => 'body_trackers', :action => 'index'},
|
||||
:caption => :body_trackers_menu_caption, :last => :true, :param => :project_id
|
||||
:caption => :body_trackers_menu_caption, :before => :settings, :param => :project_id
|
||||
end
|
||||
|
Reference in New Issue
Block a user