Move helper method to settings helper

This commit is contained in:
Alexander Meindl 2019-04-30 06:57:06 +02:00
parent 29712f5281
commit 3c6c7fb493
2 changed files with 15 additions and 17 deletions

View File

@ -1,4 +1,19 @@
module AdditionalsSettingsHelper
def additionals_settings_tabs
tabs = [{ name: 'general', partial: 'additionals/settings/general', label: :label_general },
{ name: 'content', partial: 'additionals/settings/overview', label: :label_overview_page },
{ name: 'wiki', partial: 'additionals/settings/wiki', label: :label_wiki },
{ name: 'macros', partial: 'additionals/settings/macros', label: :label_macro_plural },
{ name: 'rules', partial: 'additionals/settings/issues', label: :label_issue_plural },
{ name: 'projects', partial: 'additionals/settings/projects', label: :label_project_plural },
{ name: 'users', partial: 'additionals/settings/users', label: :label_user_plural },
{ name: 'web', partial: 'additionals/settings/web_apis', label: :label_web_apis }]
tabs << { name: 'menu', partial: 'additionals/settings/menu', label: :label_settings_menu } if User.current.try(:hrm_user_type_id).nil?
tabs
end
def additionals_settings_checkbox(name, options = {})
label_title = options.delete(:label).presence || l("label_#{name}")
value = options.delete(:value)

View File

@ -36,23 +36,6 @@ module Additionals
end
end
def additionals_settings_tabs
tabs = [{ name: 'general', partial: 'additionals/settings/general', label: :label_general },
{ name: 'content', partial: 'additionals/settings/overview', label: :label_overview_page },
{ name: 'wiki', partial: 'additionals/settings/wiki', label: :label_wiki },
{ name: 'macros', partial: 'additionals/settings/macros', label: :label_macro_plural },
{ name: 'rules', partial: 'additionals/settings/issues', label: :label_issue_plural },
{ name: 'projects', partial: 'additionals/settings/projects', label: :label_project_plural },
{ name: 'users', partial: 'additionals/settings/users', label: :label_user_plural },
{ name: 'web', partial: 'additionals/settings/web_apis', label: :label_web_apis }]
if User.current.try(:hrm_user_type_id).nil?
tabs << { name: 'menu', partial: 'additionals/settings/menu', label: :label_settings_menu }
end
tabs
end
def render_issue_macro_link(issue, text, comment_id = nil)
only_path = controller_path.split('_').last != 'mailer'
content = link_to(text, issue_url(issue, only_path: only_path), class: issue.css_classes)