Fix permissions and form variables
This commit is contained in:
parent
c8c7c195e8
commit
1c032cc42e
|
@ -10,7 +10,7 @@ class JobsController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@job = Job.new.with_all_time_budgets
|
||||
@job = Job.new(project_id: @project.id).with_all_time_budgets
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_with model: @job, url: job_path(@job, project_id: @job.project.id), id: "job_form" do |f| %>
|
||||
<%= form_with model: @job, url: form_target, id: "job_form" do |f| %>
|
||||
<%= error_messages_for @job %>
|
||||
<div class="box tabular">
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% html_title "Edit #{@job.name}" %>
|
||||
<h2>Edit <%= @job.name %></h2>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render partial: "form", locals: { form_target: job_path(@job, project_id: @job.project) } %>
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<h2><%= link_to "Jobs", jobs_path(project_id: @project.id) %> » New</h2>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render partial: "form", locals: { form_target: jobs_path } %>
|
||||
|
|
2
init.rb
2
init.rb
|
@ -6,7 +6,7 @@ Redmine::Plugin.register :jobs do
|
|||
url 'http://tsvallender.co.uk'
|
||||
author_url 'http://tsvallender.co.uk'
|
||||
|
||||
permission :jobs, { jobs: [:index, :show, :new, :create, :edit, :update, :destroy] }, public: true
|
||||
permission :jobs, { jobs: [:index, :show, :new, :create, :edit, :update, :destroy] }, public: false
|
||||
menu :project_menu, :jobs, { controller: 'jobs', action: 'index' }, caption: 'Jobs', after: :issues, param: :project_id
|
||||
|
||||
TimeEntry.safe_attributes 'job_id'
|
||||
|
|
Loading…
Reference in New Issue