diff --git a/app/controllers/global_issue_templates_controller.rb b/app/controllers/global_issue_templates_controller.rb index 0b6be4af..ceda36be 100644 --- a/app/controllers/global_issue_templates_controller.rb +++ b/app/controllers/global_issue_templates_controller.rb @@ -2,15 +2,17 @@ # noinspection RubocopInspection class GlobalIssueTemplatesController < ApplicationController - layout 'base' + layout 'admin' + self.main_menu = false + menu_item :redmine_issue_templates + helper :issues helper :issue_templates include IssueTemplatesHelper include IssueTemplatesCommon - menu_item :issues - before_action :find_object, only: %i[show edit update destroy] - before_action :find_project, only: %i[edit update] - before_action :require_admin, only: %i[index new show], excep: [:preview] + before_action :find_object, only: %i[show update destroy] + before_action :find_project, only: :update + before_action :require_admin # # Action for global template : Admin right is required. @@ -62,21 +64,6 @@ def update save_and_flash(:notice_successful_update, :show) end - def edit - # Change from request.post to request.patch for Rails4. - return unless request.patch? || request.put? - - begin - @global_issue_template.safe_attributes = valid_params - rescue ActiveRecord::SerializationTypeMismatch - flash[:error] = I18n.t(:builtin_fields_should_be_valid_json, default: 'Please enter a valid JSON fotmat string.') - render render_form_params.merge(action: :show) - return - end - - save_and_flash(:notice_successful_update, :show) - end - def destroy unless @global_issue_template.destroy flash[:error] = l(:enabled_template_cannot_destroy) diff --git a/app/views/global_issue_templates/index.html.erb b/app/views/global_issue_templates/index.html.erb index fbcdf159..83322d59 100644 --- a/app/views/global_issue_templates/index.html.erb +++ b/app/views/global_issue_templates/index.html.erb @@ -1,4 +1,3 @@ -