additional_tags 3.1.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -5
  3. data/app/controllers/additional_tags_controller.rb +1 -1
  4. data/app/helpers/additional_tags_helper.rb +29 -17
  5. data/app/helpers/additional_tags_wiki_helper.rb +9 -11
  6. data/app/models/migrate_tag.rb +1 -1
  7. data/app/models/migrate_tagging.rb +1 -1
  8. data/app/models/query_tags_column.rb +1 -1
  9. data/app/views/additional_tags/settings/_general.html.slim +4 -2
  10. data/app/views/additional_tags/settings/_manage_tags.html.slim +5 -5
  11. data/app/views/common/_tag_summary_block.html.slim +1 -1
  12. data/app/views/dashboards/blocks/_issue_tags.html.slim +16 -16
  13. data/app/views/issues/_tags_form_details.html.slim +1 -1
  14. data/app/views/issues/_tags_sidebar_after.html.slim +2 -0
  15. data/app/views/issues/_tags_sidebar_before.html.slim +2 -0
  16. data/app/views/wiki/_tags_form_bottom.html.slim +1 -1
  17. data/app/views/wiki/_tags_show.html.slim +1 -1
  18. data/app/views/wiki/tag_index.html.slim +1 -1
  19. data/config/locales/bg.yml +1 -0
  20. data/config/locales/cs.yml +1 -0
  21. data/config/locales/de.yml +1 -0
  22. data/config/locales/en.yml +1 -0
  23. data/config/locales/es.yml +1 -0
  24. data/config/locales/fa.yml +45 -0
  25. data/config/locales/fr.yml +1 -0
  26. data/config/locales/it.yml +1 -0
  27. data/config/locales/ja.yml +1 -0
  28. data/config/locales/ko.yml +1 -0
  29. data/config/locales/pl.yml +1 -0
  30. data/config/locales/pt-BR.yml +1 -0
  31. data/config/locales/ru.yml +1 -0
  32. data/config/settings.yml +1 -0
  33. data/db/migrate/20201123093214_migrate_existing_tags.rb +5 -5
  34. data/init.rb +6 -6
  35. data/lib/additional_tags/hooks/view_hook.rb +2 -1
  36. data/lib/additional_tags/patches/agile_query_patch.rb +1 -1
  37. data/lib/additional_tags/patches/issue_patch.rb +1 -1
  38. data/lib/additional_tags/patches/issue_query_patch.rb +4 -3
  39. data/lib/additional_tags/patches/query_patch.rb +6 -7
  40. data/lib/additional_tags/patches/time_entry_query_patch.rb +1 -1
  41. data/lib/additional_tags/patches/wiki_controller_patch.rb +1 -1
  42. data/lib/additional_tags/patches/wiki_page_patch.rb +1 -1
  43. data/lib/additional_tags/plugin_version.rb +1 -1
  44. data/lib/additional_tags/tags.rb +12 -11
  45. metadata +11 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30f90dcfc93dd66550bb8087b9f3a94fa411484f4876ccb9d837548edf0b64ae
4
- data.tar.gz: df63312af11e2ce492b5b36bb3b0b1ce9f3e0b28c7d901512301226e06dcd65b
3
+ metadata.gz: 941c8111797b91a7678dc2a387b792699a95f98e129c34348974980171c8913d
4
+ data.tar.gz: 88af7551ac94803ed51804a266606125fc9fd870922426718560b23546e9477b
5
5
  SHA512:
6
- metadata.gz: 40e8517cddee11354aa8979506352abdbbb4e10774ce74f7f3d5c637b7bb2c03fd1fc75bd0e51f39ea23525aa8da2a54cb8089e3738b49d42718e5ea54031657
7
- data.tar.gz: 429ea55984a5c3225db53f9a5699bf897a54ae09f9c4bf76fb24b5358702a6bb7547c9efba57938bfeb3c6e3b877f3ce7bffafef7069f645914d6b9b38f8f4a9
6
+ metadata.gz: 2bcad3378a0309df1df4a967a6e6877959310c8d6577470f504ad8d3f66257531a1d78166284b46a6d9769928f23464fd60d7777e24fe87b3b324a45dc5ec382
7
+ data.tar.gz: 01a32c8d39b97fbaa2d4fbfc01b00441e1bfda74eaa552e2eebbbe869637d97bfb5ec04138f1a3b86d236b35dc509d4ef92b88a5bfc5c841b6419289e41fe54f
data/README.md CHANGED
@@ -5,11 +5,11 @@
5
5
  ## Features
6
6
 
7
7
  - Tags for issues. To use them you need to:
8
- - *Activate issue tags* in the plugin configuration
9
- - and update your role permissions in the Redmine administration *Roles & permissions / Issue tracking*.
8
+ - *Activate issue tags* in the plugin configuration
9
+ - and update your role permissions in the Redmine administration *Roles & permissions / Issue tracking*.
10
10
  - Tags for wiki pages. To use them you need to:
11
11
  - *Activate wiki tags* in the plugin configuration
12
- - and update your role permissions in the Redmine administration *Roles & permissions / Wiki*
12
+ - and update your role permissions in the Redmine administration *Roles & permissions / Wiki*
13
13
  - Available role permissions for issue tags (section *Issue tracking*):
14
14
  - Add issue tags
15
15
  - Edit issue tags
@@ -59,7 +59,7 @@ Start using it, too. The example image shows the centralized tag management in t
59
59
  ## Requirements
60
60
 
61
61
  - Redmine `>= 5.0`
62
- - Ruby `>= 3.0`
62
+ - Ruby `>= 3.1`
63
63
  - Redmine plugins: [additionals](https://www.redmine.org/plugins/additionals)
64
64
 
65
65
  ## Installing
@@ -94,6 +94,7 @@ git clone https://github.com/alphanodes/additional_tags.git plugins/additional_t
94
94
  ### 2. Install dependencies and migrate database
95
95
 
96
96
  ```shell
97
+ bundle config set --local without 'development test'
97
98
  bundle install
98
99
  bundle exec rake redmine:plugins:migrate RAILS_ENV=production
99
100
  ```
@@ -136,13 +137,39 @@ rm -rf plugins/additional_tags
136
137
  ## License
137
138
 
138
139
  This plugin is licensed under the terms of GNU/GPL v2.
139
- See LICENSE for details.
140
+ See [LICENSE](LICENSE) for details.
141
+
142
+ ## Redmine Copyright
143
+
144
+ The additional_tags is a plugin extension for Redmine Project Management Software, whose Copyright follows.
145
+ Copyright (C) 2006- Jean-Philippe Lang
146
+
147
+ Redmine is a flexible project management web application written using Ruby on Rails framework.
148
+ More details can be found in the doc directory or on the official website <http://www.redmine.org>
149
+
150
+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
151
+
152
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
153
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
154
+
155
+ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
140
156
 
141
157
  ## Credits
142
158
 
159
+ ### Code
160
+
143
161
  The source code is a (almost) rewrite of
144
162
 
145
163
  - [redmine_tags](https://github.com/ixti/redmine_tags)
146
164
  - [redmineup_tags](https://www.redmine.org/plugins/redmineup_tags)
147
165
 
148
166
  Special thanks to the original author and contributors for making this awesome hook for Redmine.
167
+
168
+ ### Icons
169
+
170
+ Thanks to:
171
+
172
+ - Font Awesome Free Icons (<https://fontawesome.com/license/free>) licenced under - Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License.
173
+ Copyright (c) 2018- Fonticons, Inc.
174
+ - Tabler Icons - Free and open source icons (<https://tabler.io/icons>) licensed under MIT License.
175
+ Copyright (c) 2020- Paweł Kuna
@@ -36,7 +36,7 @@ class AdditionalTagsController < ApplicationController
36
36
  def update
37
37
  @tag.name = params[:tag][:name] if params[:tag]
38
38
  if @tag.save
39
- flash[:notice] = l :notice_successful_update
39
+ flash[:notice] = flash_msg :update
40
40
  respond_to do |format|
41
41
  format.html do
42
42
  redirect_to @tag_list_path
@@ -32,14 +32,14 @@ module AdditionalTagsHelper
32
32
  counts: WikiPage.available_tags.to_h { |tag| [tag.id, tag.count] } }
33
33
  end
34
34
 
35
- call_hook :helper_additional_manageable_tag_columns, columns: columns
35
+ call_hook(:helper_additional_manageable_tag_columns, columns:)
36
36
 
37
37
  @manageable_tag_columns = columns
38
38
  end
39
39
 
40
40
  def manageable_tag_column_values(tag)
41
41
  columns = []
42
- manageable_tag_columns.each do |_column, column_values|
42
+ manageable_tag_columns.each_value do |column_values|
43
43
  cnt = column_values[:counts][tag.id]
44
44
  cnt = 0 if cnt.blank?
45
45
 
@@ -52,6 +52,10 @@ module AdditionalTagsHelper
52
52
  columns
53
53
  end
54
54
 
55
+ def values_for_sort_direction
56
+ [[l(:label_ascending), 'asc'], [l(:label_descending), 'desc']]
57
+ end
58
+
55
59
  def sort_tags_for_list(tags, sort_by: nil, sort_order: nil)
56
60
  return tags if tags.size < 2
57
61
 
@@ -123,9 +127,9 @@ module AdditionalTagsHelper
123
127
  use_colors = AdditionalTags.use_colors? if use_colors.nil?
124
128
  color_theme = AdditionalTags.setting :tags_color_theme if color_theme.nil?
125
129
 
126
- tag_info = AdditionalTag.new name: name.nil? ? tag_object.name : name,
130
+ tag_info = AdditionalTag.new(name: name.nil? ? tag_object.name : name,
127
131
  disable_grouping: !use_colors,
128
- color_theme: color_theme
132
+ color_theme:)
129
133
  tag_name = [tag_info.tag_name]
130
134
 
131
135
  tag_style = "background-color: #{tag_info.tag_bg_color}; color: #{tag_info.tag_fg_color}" if use_colors
@@ -202,7 +206,7 @@ module AdditionalTagsHelper
202
206
  sum = if entries.blank? || entries.empty?
203
207
  0
204
208
  else
205
- query = IssueQuery.new project: project, name: '_'
209
+ query = IssueQuery.new project:, name: '_'
206
210
  query.add_filter 'tags', '*'
207
211
  query.filters['status_id'][:operator] = '*' if !open_issues_only && query.filters.key?('status_id')
208
212
 
@@ -217,36 +221,44 @@ module AdditionalTagsHelper
217
221
 
218
222
  def issue_tag_status_filter(operator: nil, open_issues_only: false)
219
223
  if operator
220
- { field: :status_id, operator: operator }
224
+ { field: :status_id, operator: }
221
225
  elsif open_issues_only
222
226
  { field: :status_id, operator: 'o' }
223
227
  end
224
228
  end
225
229
 
230
+ def wiki_tags_on_show?
231
+ options = { enabled: AdditionalTags.setting?(:active_wiki_tags) }
232
+
233
+ call_hook(:helper_wiki_tags_on_show, options:)
234
+
235
+ options[:enabled]
236
+ end
237
+
226
238
  private
227
239
 
228
240
  def tag_url(tag_name, filter: nil, tag_action: nil, tag_controller: nil, project: nil, display_type: nil)
229
241
  action = tag_action.presence || (controller_name == 'hrm_user_resources' ? 'show' : 'index')
230
242
 
231
- fields = [:tags]
232
- values = { tags: [tag_name] }
233
- operators = { tags: '=' }
243
+ f = [:tags]
244
+ v = { tags: [tag_name] }
245
+ op = { tags: '=' }
234
246
 
235
247
  if filter.present?
236
248
  field = filter[:field]
237
- fields << field
238
- operators[field] = filter[:operator]
239
- values[field] = filter[:value] if filter.key? :value
249
+ f << field
250
+ op[field] = filter[:operator]
251
+ v[field] = filter[:value] if filter.key? :value
240
252
  end
241
253
 
242
254
  { controller: tag_controller.presence || controller_name,
243
- action: action,
255
+ action:,
244
256
  set_filter: 1,
245
- display_type: display_type,
257
+ display_type:,
246
258
  project_id: project,
247
- f: fields,
248
- v: values,
249
- op: operators }
259
+ f:,
260
+ v:,
261
+ op: }
250
262
  end
251
263
 
252
264
  def add_tags(style, tags, content, item_el, options)
@@ -16,26 +16,24 @@ module AdditionalTagsWikiHelper
16
16
  render_tags_list sidebar_tags, **options
17
17
  end
18
18
 
19
- def render_wiki_index_title(project: nil, name: nil, tag: nil, title: :label_wiki)
19
+ def render_wiki_index_title(title, project: nil, name: nil, tag: nil)
20
+ title = l title unless is_a? Symbol
21
+
20
22
  if tag.present?
21
23
  tag_object = ActsAsTaggableOn::Tag.new name: tag
22
24
 
23
25
  if project
24
26
  safe_join [l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' '
25
27
  else
26
- title = [link_to(l(title), wiki_index_path)]
27
- title << Additionals::LIST_SEPARATOR
28
- title << l(:label_wiki_index_for_tag)
29
- title << additional_tag_link(tag_object, link: '#')
30
- safe_join title, ' '
28
+ items = [link_to(title, wiki_index_path)]
29
+ items << safe_join([l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' ')
30
+ render_breadcrumb items
31
31
  end
32
32
  elsif name.present?
33
- title = [link_to(l(title), wiki_index_path)]
34
- title << Additionals::LIST_SEPARATOR
35
- title << name
36
- safe_join title, ' '
33
+ render_breadcrumb [link_to(title, wiki_index_path),
34
+ name]
37
35
  else
38
- l title
36
+ title
39
37
  end
40
38
  end
41
39
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MigrateTag < ActiveRecord::Base
3
+ class MigrateTag < AdditionalsApplicationRecord
4
4
  self.table_name = 'tags'
5
5
  has_many :migrate_taggings, dependent: :destroy, foreign_key: :tag_id, inverse_of: :migrate_tag
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MigrateTagging < ActiveRecord::Base
3
+ class MigrateTagging < AdditionalsApplicationRecord
4
4
  self.table_name = 'taggings'
5
5
  belongs_to :migrate_tag, foreign_key: :tag_id, inverse_of: :migrate_taggings
6
6
  belongs_to :taggable, polymorphic: true
@@ -2,6 +2,6 @@
2
2
 
3
3
  class QueryTagsColumn < QueryRelationsColumn
4
4
  def initialize(name = :tags, **options)
5
- super name, **options
5
+ super
6
6
  end
7
7
  end
@@ -15,8 +15,7 @@ fieldset.settings
15
15
  @settings[:tags_sort_by])
16
16
  '
17
17
  = select_tag 'settings[tags_sort_order]',
18
- options_for_select([[l(:label_ascending), 'asc'], [l(:label_descending), 'desc']],
19
- @settings[:tags_sort_order])
18
+ options_for_select(values_for_sort_direction, @settings[:tags_sort_order])
20
19
 
21
20
  p
22
21
  = additionals_settings_select :tags_suggestion_order,
@@ -31,6 +30,9 @@ fieldset.settings
31
30
  [l(:label_tag_color_theme, value: 5), 'd']],
32
31
  @settings['tags_color_theme'])
33
32
 
33
+ p
34
+ = additionals_settings_checkbox :show_tags_after_queries
35
+
34
36
  fieldset.settings
35
37
  legend = l :label_issue_plural
36
38
 
@@ -6,10 +6,10 @@
6
6
  tr
7
7
  th.checkbox.hide-when-print
8
8
  = check_box_tag 'ids[]', '', false, class: 'toggle-selection',
9
- title: "#{l :button_check_all}/#{l :button_uncheck_all}"
9
+ title: "#{l :button_check_all} / #{l :button_uncheck_all}"
10
10
 
11
11
  th = l :field_name
12
- - manageable_tag_columns.each do |_column, column_values|
12
+ - manageable_tag_columns.each_value do |column_values|
13
13
  th = column_values[:label]
14
14
  th
15
15
  tbody
@@ -20,10 +20,10 @@
20
20
  td.checkbox.hide-when-print
21
21
  = check_box_tag 'ids[]', tag.id, false, id: nil
22
22
  td
23
- = additional_tag_link tag,
23
+ = additional_tag_link(tag,
24
24
  link: edit_additional_tag_path(tag),
25
- use_colors: use_colors,
26
- color_theme: color_theme
25
+ use_colors:,
26
+ color_theme:)
27
27
 
28
28
  - manageable_tag_column_values(tag).each do |column|
29
29
  td = column
@@ -1,4 +1,4 @@
1
- ul.reporting-list.tag-summary
1
+ ul.dashboard-list.tag-summary
2
2
  li.amount-tags
3
3
  = l :label_amount_tags
4
4
  ' :
@@ -1,18 +1,18 @@
1
1
  h3 = block_definition[:label]
2
2
 
3
3
  - open_issues_only = RedminePluginKit.true? settings[:open_issues_only]
4
- - tags = Issue.available_tags project: @project, open_issues_only: open_issues_only
5
- - counts = AdditionalTags::Tags.entity_group_by scope: Issue.group_by_status_with_tags(@project),
6
- tags: tags,
4
+ - tags = Issue.available_tags(project: @project, open_issues_only:)
5
+ - counts = AdditionalTags::Tags.entity_group_by(scope: Issue.group_by_status_with_tags(@project),
6
+ tags:,
7
7
  statuses: { true => :closed, false => :open },
8
- group_id_is_bool: true
8
+ group_id_is_bool: true)
9
9
 
10
10
  = render 'common/tag_summary_block',
11
- tags: tags,
11
+ tags:,
12
12
  entities_label: l(:label_issue_plural),
13
13
  totals_link: link_to_issue_tags_totals(entries: counts,
14
14
  project: @project,
15
- open_issues_only: open_issues_only)
15
+ open_issues_only:)
16
16
 
17
17
  - if RedminePluginKit.true? settings[:with_table_of_values]
18
18
  - if tags.present?
@@ -31,30 +31,30 @@ h3 = block_definition[:label]
31
31
  - color_theme = AdditionalTags.setting :tags_color_theme
32
32
  - tags.each do |tag|
33
33
  tr
34
- td.name = additional_tag_link tag,
34
+ td.name = additional_tag_link(tag,
35
35
  tag_action: 'index',
36
36
  tag_controller: 'issues',
37
- filter: issue_tag_status_filter(open_issues_only: open_issues_only),
37
+ filter: issue_tag_status_filter(open_issues_only:),
38
38
  use_colors: RedminePluginKit.true?(settings[:use_colors]),
39
- color_theme: color_theme
39
+ color_theme:)
40
40
  - unless open_issues_only
41
- td.value = additional_tag_link tag,
41
+ td.value = additional_tag_link(tag,
42
42
  tag_action: 'index',
43
43
  tag_controller: 'issues',
44
44
  filter: issue_tag_status_filter(operator: 'o'),
45
45
  use_colors: false,
46
- name: counts[tag.name][:open]
47
- td.value = additional_tag_link tag,
46
+ name: counts[tag.name][:open])
47
+ td.value = additional_tag_link(tag,
48
48
  tag_action: 'index',
49
49
  tag_controller: 'issues',
50
50
  filter: issue_tag_status_filter(operator: 'c'),
51
51
  use_colors: false,
52
- name: counts[tag.name][:closed]
53
- td.value = additional_tag_link tag,
52
+ name: counts[tag.name][:closed])
53
+ td.value = additional_tag_link(tag,
54
54
  tag_action: 'index',
55
55
  tag_controller: 'issues',
56
- filter: issue_tag_status_filter(open_issues_only: open_issues_only),
56
+ filter: issue_tag_status_filter(open_issues_only:),
57
57
  use_colors: false,
58
- name: open_issues_only ? counts[tag.name][:open] : counts[tag.name][:total]
58
+ name: open_issues_only ? counts[tag.name][:open] : counts[tag.name][:total])
59
59
  - else
60
60
  p.nodata = l :label_no_data
@@ -3,4 +3,4 @@
3
3
  div
4
4
  p#issue_tags
5
5
  = label_tag l(:field_tag_list)
6
- = render tags_form, project: project
6
+ = render tags_form, project:
@@ -0,0 +1,2 @@
1
+ - if AdditionalTags.setting? :show_tags_after_queries
2
+ = render 'issues/tags_sidebar'
@@ -0,0 +1,2 @@
1
+ - unless AdditionalTags.setting? :show_tags_after_queries
2
+ = render 'issues/tags_sidebar'
@@ -1,4 +1,4 @@
1
1
  - if AdditionalTags.setting?(:active_wiki_tags) && User.current.allowed_to?(:add_wiki_tags, @project)
2
2
  p#wiki_tags
3
3
  = label_tag l(:field_tag_list)
4
- = render 'wiki/tags_form', project: project, page: page
4
+ = render 'wiki/tags_form', project:, page:
@@ -1,4 +1,4 @@
1
- - if AdditionalTags.setting? :active_wiki_tags
1
+ - if wiki_tags_on_show?
2
2
  .wiki-attributes
3
3
  = render 'additional_tags/tag_list',
4
4
  entry: page,
@@ -2,7 +2,7 @@
2
2
  - if User.current.allowed_to? :edit_wiki_pages, @project
3
3
  = link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), remote: true, class: 'icon icon-add'
4
4
 
5
- h2 = render_wiki_index_title project: @project, tag: @tag
5
+ h2 = render_wiki_index_title :label_wiki, project: @project, tag: @tag
6
6
 
7
7
  - if @pages.empty?
8
8
  p.nodata = l :label_no_data
@@ -15,6 +15,7 @@ bg:
15
15
  label_manage_tags: "Управление на маркерите"
16
16
  label_merge_selected_tags: "Обединение на избраните маркери"
17
17
  label_open_issues_only: "Показване само на отворените задачи"
18
+ label_show_tags_after_queries: "Показване на етикети след заявки"
18
19
  label_show_with_count: "Показване на брой маркирани обекти"
19
20
  label_tag_color_theme: "Тема на цвета %{value}"
20
21
  label_tags_color_theme: "Цвят"
@@ -15,6 +15,7 @@ cs:
15
15
  label_manage_tags: "Spravovat štítky"
16
16
  label_merge_selected_tags: "Sloučit vybrané značky"
17
17
  label_open_issues_only: "Zobrazit pouze otevřené problémy"
18
+ label_show_tags_after_queries: "Zobrazit TAGy po dotazech"
18
19
  label_show_with_count: "Zobrazit částku na značce"
19
20
  label_tag_color_theme: "Barevné téma %{value}"
20
21
  label_tags_color_theme: "Barva"
@@ -15,6 +15,7 @@ de:
15
15
  label_manage_tags: TAGs verwalten
16
16
  label_merge_selected_tags: Ausgewählte TAGs zusammenführen
17
17
  label_open_issues_only: Zeige nur offene Tickets
18
+ label_show_tags_after_queries: "Zeige TAGs nach Abfragen"
18
19
  label_show_with_count: Zeige Anzahl zu TAG
19
20
  label_tag_color_theme: Farbschema %{value}
20
21
  label_tags_color_theme: Farbe
@@ -15,6 +15,7 @@ en:
15
15
  label_manage_tags: "Manage tags"
16
16
  label_merge_selected_tags: "Merge selected tags"
17
17
  label_open_issues_only: "Display open issues only"
18
+ label_show_tags_after_queries: "Show tags after queries"
18
19
  label_show_with_count: "Display amount on tag"
19
20
  label_tag_color_theme: Color theme %{value}
20
21
  label_tags_color_theme: Color
@@ -15,6 +15,7 @@ es:
15
15
  label_manage_tags: "Manejar tags"
16
16
  label_merge_selected_tags: "Fusionar tags seleccionadas"
17
17
  label_open_issues_only: "Mostrar sólo las peticiones abiertas"
18
+ label_show_tags_after_queries: "Mostrar TAGs tras las consultas"
18
19
  label_show_with_count: "Mostrar la cantidad en la tags"
19
20
  label_tag_color_theme: "Tema del color %{value}"
20
21
  label_tags_colors: "Color"
@@ -0,0 +1,45 @@
1
+ fa:
2
+ activerecord:
3
+ errors:
4
+ messages:
5
+ invalid_mutually_exclusive_tags: از تگ های منحصر به فرد متقابل استفاده شده است
6
+ field_issue_tags: تگ‌های مسئله
7
+ field_tag_list: تگ‌ها
8
+ field_tags: تگ‌ها
9
+ label_active_issue_tags: "تگ‌های فعال مسئله"
10
+ label_active_wiki_tags: "تگ‌های فعال ویکی"
11
+ label_add_tags: "افزودن تگ"
12
+ label_amount_entities_with_tags: "مقدار %{name} با تگ‌ها"
13
+ label_amount_tags: "تگ‌های مقدار"
14
+ label_edit_tags: "ویرایش تگ‌ها"
15
+ label_manage_tags: "مدیریت تگ‌ها"
16
+ label_merge_selected_tags: "ادغام تگ‌های انتخابی"
17
+ label_open_issues_only: "مشاهده مسائل باز"
18
+ label_show_tags_after_queries: "Show tags after queries"
19
+ label_show_with_count: "نمایش مقدار روی تگ"
20
+ label_tag_color_theme: تم رنگی %{value}
21
+ label_tags_color_theme: رنگ
22
+ label_tags_sidebar: "نمایش تگ‌ها در حاشیه به عنوان"
23
+ label_tags_sort_by: "مرتب سازی تگ‌ها بر اساس"
24
+ label_tags_suggestion_order: "سفارش پیشنهاد"
25
+ label_tags_tag: "تگ"
26
+ label_tags_without_color: بدون رنگ
27
+ label_use_colors: استفاده از رنگ‌ها
28
+ label_wiki_index_for_tag: "صفحه‌های ویکی با تگ"
29
+ label_with_chart: "با نمودار"
30
+ label_with_table_of_values: "با جدول مقادیر"
31
+ notice_failed_to_add_tags: "ناتوانی در افزودن تگ‌ها"
32
+ notice_tags_added: "تگ‌ها افزوده شدند"
33
+ permission_add_wiki_tags: "افزودن تگ‌های ویکی"
34
+ permission_create_issue_tags: "افزودن تگ‌های مسئله"
35
+ permission_edit_issue_tags: "ویرایش تگ‌های مسئله"
36
+ permission_view_issue_tags: "مشاهده تگ‌های مسئله"
37
+ tags_order_by_count: "بیشتر استفاده‌شده"
38
+ tags_order_by_last_created: "آخرین ساخته‌شده"
39
+ tags_order_by_name: "نام"
40
+ tags_sidebar_cloud: "ابر"
41
+ tags_sidebar_list: "لیست"
42
+ tags_sidebar_none: "هیچکدام"
43
+ tags_sidebar_simple_cloud: "ابر ساده"
44
+ tags_sort_by_count: "تعداد"
45
+ tags_sort_by_name: "نام"
@@ -15,6 +15,7 @@ fr:
15
15
  label_manage_tags: "Gérer les tags"
16
16
  label_merge_selected_tags: "Fusionner les tags sélectionnées"
17
17
  label_open_issues_only: "Afficher uniquement les demandes ouverts"
18
+ label_show_tags_after_queries: "Afficher les TAG après les requêtes"
18
19
  label_show_with_count: "Afficher le montant sur l'tags"
19
20
  label_tag_color_theme: "Thème de la couleur %{value}"
20
21
  label_tags_colors: "Couleur"
@@ -15,6 +15,7 @@ it:
15
15
  label_manage_tags: "Gestire i tag"
16
16
  label_merge_selected_tags: "Unisci i tag selezionati"
17
17
  label_open_issues_only: "Mostra solo i segnalazione"
18
+ label_show_tags_after_queries: "Mostra i TAG dopo le query"
18
19
  label_show_with_count: "Visualizzare l'importo sul tag"
19
20
  label_tag_color_theme: "Tema colore %{value}"
20
21
  label_tags_colors: Colore
@@ -15,6 +15,7 @@ ja:
15
15
  label_manage_tags: "タグの管理"
16
16
  label_merge_selected_tags: "選択したタグをマージ"
17
17
  label_open_issues_only: "開いている問題のみを表示"
18
+ label_show_tags_after_queries: "クエリーの後にTAGを表示する"
18
19
  label_show_with_count: "タグに金額を表示"
19
20
  label_tag_color_theme: "カラーテーマ%{value}"
20
21
  label_tags_colors: "カラー"
@@ -15,6 +15,7 @@ ko:
15
15
  label_manage_tags: "태그 관리"
16
16
  label_merge_selected_tags: "선택한 태그 병합"
17
17
  label_open_issues_only: "미해결 문제 만 표시"
18
+ label_show_tags_after_queries: "쿼리 뒤에 태그 표시"
18
19
  label_show_with_count: "태그에 금액 표시"
19
20
  label_tag_color_theme: "색상 테마 %{value}"
20
21
  label_tags_colors: "색깔"
@@ -15,6 +15,7 @@ pl:
15
15
  label_manage_tags: "Zarządzaj tagami"
16
16
  label_merge_selected_tags: "Łączenie wybranych tagów"
17
17
  label_open_issues_only: "Wyświetlaj tylko sprawy otwarte"
18
+ label_show_tags_after_queries: "Pokaż TAGi po zapytaniach"
18
19
  label_show_with_count: "Wyświetlanie ilości na etykiecie"
19
20
  label_tag_color_theme: "Kolorowy motyw %{value}"
20
21
  label_tags_colors: Kolor
@@ -15,6 +15,7 @@ pt-BR:
15
15
  label_manage_tags: "Gerenciar etiquetas"
16
16
  label_merge_selected_tags: "Fundir tags selecionadas"
17
17
  label_open_issues_only: "Exibir apenas questões em aberto"
18
+ label_show_tags_after_queries: "Mostrar TAGs após consultas"
18
19
  label_show_with_count: "Mostrar quantidade na etiqueta"
19
20
  label_tag_color_theme: "Tema da cor %{value}"
20
21
  label_tags_colors: "Cor"
@@ -15,6 +15,7 @@ ru:
15
15
  label_manage_tags: "Управление метками"
16
16
  label_merge_selected_tags: "Объединить выбранные метки"
17
17
  label_open_issues_only: "Отображать только открытые задачи"
18
+ label_show_tags_after_queries: "Показывать теги после запросов"
18
19
  label_show_with_count: "Отображать количество на метке"
19
20
  label_tag_color_theme: "Цветовая тема %{value}"
20
21
  label_tags_colors: "Цвет"
data/config/settings.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  active_issue_tags: '0'
2
2
  active_wiki_tags: '0'
3
3
  open_issues_only: '0'
4
+ show_tags_after_queries: '0'
4
5
  show_with_count: '0'
5
6
  tags_color_theme: '1'
6
7
  tags_sidebar: 'none'
@@ -17,16 +17,16 @@ class MigrateExistingTags < ActiveRecord::Migration[5.2]
17
17
  context = tagging.respond_to?(:context) && tagging.context.present? ? tagging.context : 'tags'
18
18
 
19
19
  # old data can include dups
20
- next if ActsAsTaggableOn::Tagging.exists? tag_id: tag.id,
20
+ next if ActsAsTaggableOn::Tagging.exists?(tag_id: tag.id,
21
21
  taggable_id: tagging.taggable_id,
22
22
  taggable_type: tagging.taggable_type,
23
- context: context
23
+ context:)
24
24
 
25
- ActsAsTaggableOn::Tagging.create! tag_id: tag.id,
25
+ ActsAsTaggableOn::Tagging.create!(tag_id: tag.id,
26
26
  taggable_id: tagging.taggable_id,
27
27
  taggable_type: tagging.taggable_type,
28
- context: context,
29
- created_at: tagging.created_at
28
+ context:,
29
+ created_at: tagging.created_at)
30
30
  cnt += 1
31
31
  end
32
32
 
data/init.rb CHANGED
@@ -5,13 +5,13 @@ require 'additional_tags/plugin_version'
5
5
  loader = RedminePluginKit::Loader.new plugin_id: 'additional_tags'
6
6
 
7
7
  Redmine::Plugin.register :additional_tags do
8
- name 'Additional Tags'
9
- author 'AlphaNodes GmbH'
8
+ name 'Additional Tags'
9
+ author 'AlphaNodes GmbH'
10
10
  description 'Redmine tagging support'
11
- version AdditionalTags::PluginVersion::VERSION
12
- url 'https://github.com/alphanodes/additional_tags/'
13
- author_url 'https://alphanodes.com/'
14
- directory __dir__
11
+ version AdditionalTags::PluginVersion::VERSION
12
+ url 'https://github.com/alphanodes/additional_tags/'
13
+ author_url 'https://alphanodes.com/'
14
+ directory File.dirname(__FILE__)
15
15
 
16
16
  requires_redmine version_or_higher: '5.0'
17
17
 
@@ -11,7 +11,8 @@ module AdditionalTags
11
11
  partial: 'issues/tags_form_details',
12
12
  locals: { tags_form: 'issues/tags_form' }
13
13
  render_on :view_issues_show_details_bottom, partial: 'issues/tags'
14
- render_on :view_issues_sidebar_planning_bottom, partial: 'issues/tags_sidebar'
14
+ render_on :view_issues_sidebar_planning_bottom, partial: 'issues/tags_sidebar_before'
15
+ render_on :view_issues_sidebar_queries_bottom, partial: 'issues/tags_sidebar_after'
15
16
  render_on :view_layouts_base_html_head, partial: 'additional_tags/html_head'
16
17
  render_on :view_layouts_base_body_bottom, partial: 'additional_tags/body_bottom'
17
18
  render_on :view_wiki_form_bottom, partial: 'tags_form_bottom'
@@ -6,7 +6,7 @@ module AdditionalTags
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  included do
9
- include AdditionalsQuery
9
+ include Additionals::Concerns::Query
10
10
  include InstanceMethods
11
11
 
12
12
  alias_method :initialize_available_filters_without_tags, :initialize_available_filters
@@ -35,7 +35,7 @@ module AdditionalTags
35
35
  scope = if project && Setting.display_subprojects_issues?
36
36
  visible(user).where(AdditionalTags::Tags.subproject_sql(project))
37
37
  else
38
- visible user, project: project
38
+ visible user, project:
39
39
  end
40
40
 
41
41
  scope.joins(:status)
@@ -6,7 +6,7 @@ module AdditionalTags
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  included do
9
- include AdditionalsQuery
9
+ include Additionals::Concerns::Query
10
10
  prepend InstanceOverwriteMethods
11
11
  include InstanceMethods
12
12
 
@@ -36,13 +36,14 @@ module AdditionalTags
36
36
  def sql_for_tags_field(field, _operator, values)
37
37
  build_sql_for_tags_field_with_permission klass: queried_class,
38
38
  operator: operator_for(field),
39
- values: values,
39
+ values:,
40
40
  permission: :view_issue_tags
41
41
  end
42
42
  end
43
43
 
44
44
  module InstanceMethods
45
- def issues_with_tags(**options)
45
+ def issues_with_tags(options = nil)
46
+ options ||= {}
46
47
  issues = issues_without_tags(**options)
47
48
  return issues unless has_column? :tags
48
49
 
@@ -13,12 +13,11 @@ module AdditionalTags
13
13
  def sql_for_tags_field(field, _operator, values)
14
14
  build_sql_for_tags_field klass: queried_class,
15
15
  operator: operator_for(field),
16
- values: values
16
+ values:
17
17
  end
18
18
 
19
- def initialize_tags_filter(position: nil)
20
- add_available_filter 'tags', order: position,
21
- type: :list_optional,
19
+ def initialize_tags_filter
20
+ add_available_filter 'tags', type: :list_optional,
22
21
  values: -> { available_tag_values queried_class }
23
22
  end
24
23
 
@@ -32,7 +31,7 @@ module AdditionalTags
32
31
  end
33
32
 
34
33
  def available_tag_values(klass)
35
- klass.available_tags(project: project)
34
+ klass.available_tags(project:)
36
35
  .pluck(:name)
37
36
  .map { |name| [name, name] }
38
37
  end
@@ -69,7 +68,7 @@ module AdditionalTags
69
68
  when '=', '!'
70
69
  ids_list = klass.tagged_with(values, any: true).ids
71
70
  # special case: filter with deleted tag
72
- return AdditionalsQuery::NO_RESULT_CONDITION if ids_list.blank? && values.present? && operator == '='
71
+ return Additionals::SQL_NO_RESULT_CONDITION if ids_list.blank? && values.present? && operator == '='
73
72
  else
74
73
  allowed_projects = Project.where(Project.allowed_to_condition(User.current, permission))
75
74
  .select(:id)
@@ -90,7 +89,7 @@ module AdditionalTags
90
89
  "(#{klass.table_name}.id #{compare} (#{ids_list.join ','}))"
91
90
  elsif values.present? && operator == '='
92
91
  # special case: filter with deleted tag
93
- AdditionalsQuery::NO_RESULT_CONDITION
92
+ Additionals::SQL_NO_RESULT_CONDITION
94
93
  end
95
94
  else
96
95
  entries = ActsAsTaggableOn::Tagging.where taggable_type: klass.name
@@ -36,7 +36,7 @@ module AdditionalTags
36
36
  end
37
37
 
38
38
  def sql_for_issue_tags_field(_field, operator, values)
39
- build_sql_for_tags_field klass: Issue, operator: operator, values: values
39
+ build_sql_for_tags_field klass: Issue, operator:, values:
40
40
  end
41
41
  end
42
42
  end
@@ -20,7 +20,7 @@ module AdditionalTags
20
20
  @page.safe_attributes = [:tag_list]
21
21
  @page.tag_list = params[:wiki_page][:tag_list].to_a.reject(&:empty?)
22
22
  flash[:notice] = if @page.save
23
- l :notice_successful_update
23
+ flash_msg :update
24
24
  else
25
25
  t :notice_failed_to_add_tags
26
26
  end
@@ -45,7 +45,7 @@ module AdditionalTags
45
45
  def with_tags(tag, project: nil, order: 'title_asc', max_entries: nil, exclude_page: nil)
46
46
  wiki = project&.wiki
47
47
 
48
- scope = with_tags_scope wiki: wiki, project: project
48
+ scope = with_tags_scope(wiki:, project:)
49
49
  scope = scope.where.not id: exclude_page.id if exclude_page
50
50
  scope = scope.limit max_entries if max_entries
51
51
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AdditionalTags
4
4
  module PluginVersion
5
- VERSION = '3.1.0' unless defined? AdditionalTags::PluginVersion::VERSION
5
+ VERSION = '3.3.1' unless defined? AdditionalTags::PluginVersion::VERSION
6
6
  end
7
7
  end
@@ -7,7 +7,7 @@ module AdditionalTags
7
7
  permission = options[:permission] || :view_issue_tags
8
8
  skip_pre_condition = options[:skip_pre_condition] || true
9
9
 
10
- tag_access permission, user, skip_pre_condition: skip_pre_condition
10
+ tag_access permission, user, skip_pre_condition:
11
11
  end
12
12
 
13
13
  def available_tags(klass, **options)
@@ -48,7 +48,7 @@ module AdditionalTags
48
48
  end
49
49
 
50
50
  def all_type_tags(klass, without_projects: false)
51
- ActsAsTaggableOn::Tag.joins(tag_for_joins(klass, without_projects: without_projects))
51
+ ActsAsTaggableOn::Tag.joins(tag_for_joins(klass, without_projects:))
52
52
  .distinct
53
53
  .order(:name)
54
54
  end
@@ -74,7 +74,8 @@ module AdditionalTags
74
74
  ActsAsTaggableOn::Tagging.transaction do
75
75
  tag = ActsAsTaggableOn::Tag.find_by(name: tag_name) || ActsAsTaggableOn::Tag.create(name: tag_name)
76
76
  # Update old tagging with new tag
77
- ActsAsTaggableOn::Tagging.where(tag_id: tags_to_merge.map(&:id)).update_all tag_id: tag.id
77
+ ActsAsTaggableOn::Tagging.where(tag_id: tags_to_merge.map(&:id))
78
+ .update_all tag_id: tag.id
78
79
  # remove old (merged) tags
79
80
  tags_to_merge.reject { |t| t.id == tag.id }.each(&:destroy)
80
81
  # remove duplicate taggings
@@ -114,22 +115,22 @@ module AdditionalTags
114
115
  def entity_group_by(scope:, tags:, statuses: nil, sub_groups: nil, group_id_is_bool: false)
115
116
  counts = {}
116
117
  tags.each do |tag|
117
- values = { tag: tag, total: 0, total_sub_groups: 0, groups: [] }
118
+ values = { tag:, total: 0, total_sub_groups: 0, groups: [] }
118
119
 
119
120
  if statuses
120
121
  statuses.each do |status|
121
122
  group_id = status.first
122
123
  group = status.second
123
- values[group] = status_for_tag_value scope: scope,
124
+ values[group] = status_for_tag_value(scope:,
124
125
  tag_id: tag.id,
125
- group_id: group_id,
126
- group_id_is_bool: group_id_is_bool
127
- values[:groups] << { id: group_id, group: group, count: values[group] }
126
+ group_id:,
127
+ group_id_is_bool:)
128
+ values[:groups] << { id: group_id, group:, count: values[group] }
128
129
  values[:total] += values[group]
129
130
  values[:total_sub_groups] += values[group] if sub_groups&.include? group_id
130
131
  end
131
132
  else
132
- values[:total] += status_for_tag_value scope: scope, tag_id: tag.id
133
+ values[:total] += status_for_tag_value scope:, tag_id: tag.id
133
134
  end
134
135
 
135
136
  values[:total_without_sub_groups] = values[:total] - values[:total_sub_groups]
@@ -210,13 +211,13 @@ module AdditionalTags
210
211
  projects_allowed = if permission.nil?
211
212
  Project.visible.ids
212
213
  else
213
- Project.where(Project.allowed_to_condition(user, permission, skip_pre_condition: skip_pre_condition)).ids
214
+ Project.where(Project.allowed_to_condition(user, permission, skip_pre_condition:)).ids
214
215
  end
215
216
 
216
217
  if projects_allowed.present?
217
218
  "#{Project.table_name}.id IN (#{projects_allowed.join ','})" unless projects_allowed.empty?
218
219
  else
219
- AdditionalsQuery::NO_RESULT_CONDITION
220
+ Additionals::SQL_NO_RESULT_CONDITION
220
221
  end
221
222
  end
222
223
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: additional_tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlphaNodes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
11
+ date: 2024-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts-as-taggable-on
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redmine_plugin_kit
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -79,6 +79,8 @@ files:
79
79
  - app/views/issues/_tags_form.html.slim
80
80
  - app/views/issues/_tags_form_details.html.slim
81
81
  - app/views/issues/_tags_sidebar.html.slim
82
+ - app/views/issues/_tags_sidebar_after.html.slim
83
+ - app/views/issues/_tags_sidebar_before.html.slim
82
84
  - app/views/wiki/_tags_form.html.slim
83
85
  - app/views/wiki/_tags_form_bottom.html.slim
84
86
  - app/views/wiki/_tags_show.html.slim
@@ -92,6 +94,7 @@ files:
92
94
  - config/locales/de.yml
93
95
  - config/locales/en.yml
94
96
  - config/locales/es.yml
97
+ - config/locales/fa.yml
95
98
  - config/locales/fr.yml
96
99
  - config/locales/it.yml
97
100
  - config/locales/ja.yml
@@ -148,14 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
151
  requirements:
149
152
  - - ">="
150
153
  - !ruby/object:Gem::Version
151
- version: '3.0'
154
+ version: '3.1'
152
155
  required_rubygems_version: !ruby/object:Gem::Requirement
153
156
  requirements:
154
157
  - - ">="
155
158
  - !ruby/object:Gem::Version
156
159
  version: '0'
157
160
  requirements: []
158
- rubygems_version: 3.4.10
161
+ rubygems_version: 3.4.19
159
162
  signing_key:
160
163
  specification_version: 4
161
164
  summary: Redmine plugin for adding tag functionality