mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 15:54:00 +08:00
Merge pull request #6003 from okriuchykhin/ok_SCI_9028
Show only default label templates when feature is disabled [SCI-9028]
This commit is contained in:
commit
67042ce254
2 changed files with 3 additions and 1 deletions
|
@ -174,7 +174,7 @@ class LabelTemplatesController < ApplicationController
|
|||
end
|
||||
|
||||
def load_label_templates
|
||||
@label_templates = LabelTemplate.where(team_id: current_team.id)
|
||||
@label_templates = LabelTemplate.enabled? ? current_team.label_templates : current_team.label_templates.default
|
||||
end
|
||||
|
||||
def load_label_template
|
||||
|
|
|
@ -15,6 +15,8 @@ class LabelTemplate < ApplicationRecord
|
|||
|
||||
validate :ensure_single_default_template!
|
||||
|
||||
scope :default, -> { where(default: true) }
|
||||
|
||||
def self.enabled?
|
||||
ApplicationSettings.instance.values['label_templates_enabled'] == true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue