Module: AdditionalTagsIssuesHelper
- Defined in:
- app/helpers/additional_tags_issues_helper.rb
Instance Method Summary collapse
-
#render_api_custom_values(custom_values, api) ⇒ Object
Hacked render_api_custom_values to add plugin values to issue api.
- #render_sidebar_tags ⇒ Object
- #sidebar_tags ⇒ Object
Instance Method Details
#render_api_custom_values(custom_values, api) ⇒ Object
Hacked render_api_custom_values to add plugin values to issue api
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/additional_tags_issues_helper.rb', line 5 def render_api_custom_values(custom_values, api) rc = super if @issue.present? && (defined?(controller_name) && controller_name == 'issues' && action_name == 'show' || !defined?(controller_name)) && AdditionalTags.setting?(:active_issue_tags) && User.current.allowed_to?(:view_issue_tags, @project) api.array :tags do # support tags, which are not saved to database if @issue.tag_list.present? if @issue..present? && @issue..map(&:name) == @issue.tag_list @issue..each do |tag| api.tag id: tag.id, name: tag.name end else @issue.tag_list.each do |tag_name| # there is no id for unsaved tags api.tag name: tag_name end end end end end if @time_entry.present? && (defined?(controller_name) && controller_name == 'timelog' && action_name == 'show' || !defined?(controller_name)) && AdditionalTags.setting?(:active_issue_tags) && User.current.allowed_to?(:view_issue_tags, @project) api.array :issue_tags do @time_entry..each do |tag| api.tag id: tag.id, name: tag.name end end end rc end |
#render_sidebar_tags ⇒ Object
56 57 58 59 60 61 62 |
# File 'app/helpers/additional_tags_issues_helper.rb', line 56 def = { filter: AdditionalTags.setting?(:open_issues_only) ? { field: :status_id, operator: 'o' } : nil, project: @project } [:tag_action] = 'show' if %w[gantts calendars].include? controller_name , ** end |
#sidebar_tags ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/helpers/additional_tags_issues_helper.rb', line 42 def # we do not want tags on issue import return if controller_name == 'imports' unless @sidebar_tags @sidebar_tags = [] if AdditionalTags. @sidebar_tags = Issue. project: @project, open_issues_only: AdditionalTags.setting?(:open_issues_only) end end @sidebar_tags.to_a end |