add edit page for contract templates
This commit is contained in:
@@ -5,8 +5,8 @@ class ContractTemplatesController < ApplicationController
|
||||
|
||||
layout 'project'
|
||||
|
||||
before_action :set_project, except: [:destroy]
|
||||
before_action :set_contract_template, only: [:destroy]
|
||||
before_action :set_project, except: [:destroy, :edit]
|
||||
before_action :set_contract_template, only: [:destroy, :edit]
|
||||
before_action :show_splash_screen, only: :index
|
||||
|
||||
def index
|
||||
@@ -32,6 +32,10 @@ class ContractTemplatesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@project = @contract_template.project
|
||||
end
|
||||
|
||||
def destroy
|
||||
@contract_template.archive
|
||||
redirect_to [@contract_template.project, :contract_templates], alert: t('.archived_notice')
|
||||
|
||||
@@ -23,6 +23,10 @@ class ContractTemplatePolicy < ApplicationPolicy
|
||||
create?
|
||||
end
|
||||
|
||||
def edit?
|
||||
create?
|
||||
end
|
||||
|
||||
def import?
|
||||
if user.account_manager?
|
||||
record.project.account = user.account
|
||||
|
||||
6
app/views/contract_templates/edit.html.erb
Normal file
6
app/views/contract_templates/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="card shadow-sm">
|
||||
<%= card_header text: t(".heading"), close_action_path: [@project, :contract_templates] %>
|
||||
<div class="card-body">
|
||||
<%= render "form", project: @project, contract_template: @contract_template %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user