additional_tags 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +6 -2
- data/.gitignore +1 -0
- data/.rubocop.yml +9 -3
- data/README.md +15 -16
- data/additional_tags.gemspec +5 -3
- data/app/helpers/additional_tags_helper.rb +71 -16
- data/app/helpers/additional_tags_issues_helper.rb +1 -1
- data/app/helpers/additional_tags_wiki_helper.rb +1 -25
- data/app/jobs/additional_tags_remove_unused_tag_job.rb +5 -0
- data/app/views/context_menus/_issues_tags.html.slim +1 -1
- data/app/views/dashboards/blocks/_issue_tags.html.slim +63 -0
- data/app/views/dashboards/blocks/_issue_tags_settings.html.slim +20 -0
- data/app/views/issue_tags/_edit_modal.html.slim +4 -2
- data/assets/javascripts/tags.js +4 -3
- data/config/initializers/zeitwerk.rb +6 -0
- data/config/locales/bg.yml +5 -0
- data/config/locales/cs.yml +5 -0
- data/config/locales/de.yml +5 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/es.yml +5 -0
- data/config/locales/fr.yml +5 -0
- data/config/locales/it.yml +5 -0
- data/config/locales/ja.yml +5 -0
- data/config/locales/ko.yml +5 -0
- data/config/locales/pl.yml +5 -0
- data/config/locales/pt-BR.yml +5 -0
- data/config/locales/ru.yml +28 -23
- data/init.rb +9 -6
- data/lib/additional_tags/hooks/model_hook.rb +13 -0
- data/lib/additional_tags/hooks/view_hook.rb +76 -0
- data/lib/additional_tags/patches/dashboard_content_patch.rb +28 -0
- data/lib/additional_tags/patches/issue_patch.rb +11 -4
- data/lib/additional_tags/patches/wiki_controller_patch.rb +1 -1
- data/lib/additional_tags/patches/wiki_page_patch.rb +43 -0
- data/lib/additional_tags/plugin_version.rb +7 -0
- data/lib/additional_tags.rb +51 -61
- metadata +26 -8
- data/app/views/reports/_tags_simple.html.slim +0 -11
- data/lib/additional_tags/hooks.rb +0 -75
- data/lib/additional_tags/patches/reports_controller_patch.rb +0 -34
- data/lib/additional_tags/version.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f425aa2c12ec481def256bfa8aab0bbcbd159635314a43f25be436c226b6a0f
|
|
4
|
+
data.tar.gz: a8a660768d48a774c25a22a4c3641d1e6a11e2afbe4697b43e28a9782ae16a3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8edc1a8edc5244203a2db5acff0cdd9cecb28765e1aa2967cd6ef17a62426eec82d7b45949b36d813106f5d089bc6646be4b3e03c68f05c36f5b1b16117dfafd
|
|
7
|
+
data.tar.gz: d7c2d394c72bd948896b6a0da32528bd92581fa94ab241aaddfb341225fabe572b5e769dc003e2359a0a0f1c234e796bfee1ac69e7af183f3b7ba39f916b0154
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -10,17 +10,21 @@ jobs:
|
|
|
10
10
|
|
|
11
11
|
strategy:
|
|
12
12
|
matrix:
|
|
13
|
-
ruby: ['2.7', '2.6', '
|
|
13
|
+
ruby: ['2.7', '2.6', '3.0']
|
|
14
14
|
redmine: ['4.1-stable', '4.2-stable', 'master']
|
|
15
15
|
db: ['postgres', 'mysql']
|
|
16
16
|
exclude:
|
|
17
17
|
- ruby: '2.7'
|
|
18
18
|
redmine: 4.1-stable
|
|
19
|
+
- ruby: '3.0'
|
|
20
|
+
redmine: 4.1-stable
|
|
21
|
+
- ruby: '3.0'
|
|
22
|
+
redmine: 4.2-stable
|
|
19
23
|
fail-fast: false
|
|
20
24
|
|
|
21
25
|
services:
|
|
22
26
|
postgres:
|
|
23
|
-
image: postgres:
|
|
27
|
+
image: postgres:14
|
|
24
28
|
env:
|
|
25
29
|
POSTGRES_DB: redmine
|
|
26
30
|
POSTGRES_USER: postgres
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -6,7 +6,7 @@ Rails:
|
|
|
6
6
|
Enabled: true
|
|
7
7
|
|
|
8
8
|
AllCops:
|
|
9
|
-
TargetRubyVersion: 2.
|
|
9
|
+
TargetRubyVersion: 2.6
|
|
10
10
|
TargetRailsVersion: 5.2
|
|
11
11
|
NewCops: enable
|
|
12
12
|
|
|
@@ -47,6 +47,14 @@ Style/ExpandPathArguments:
|
|
|
47
47
|
Rails/ApplicationJob:
|
|
48
48
|
Enabled: false
|
|
49
49
|
|
|
50
|
+
Lint/AmbiguousOperatorPrecedence:
|
|
51
|
+
Enabled: false
|
|
52
|
+
|
|
53
|
+
Rails/ContentTag:
|
|
54
|
+
Enabled: true
|
|
55
|
+
Exclude:
|
|
56
|
+
- app/helpers/additional_tags_issues_helper.rb
|
|
57
|
+
|
|
50
58
|
Rails/ApplicationRecord:
|
|
51
59
|
Enabled: false
|
|
52
60
|
|
|
@@ -83,8 +91,6 @@ Style/OptionHash:
|
|
|
83
91
|
- params
|
|
84
92
|
- parameters
|
|
85
93
|
- settings
|
|
86
|
-
Exclude:
|
|
87
|
-
- lib/additional_tags/patches/*.rb
|
|
88
94
|
|
|
89
95
|
Style/ReturnNil:
|
|
90
96
|
Enabled: true
|
data/README.md
CHANGED
|
@@ -2,29 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.redmine.org/plugins/additional_tags) [](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Linters%22) [](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Brakeman%22) [](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3ATests)
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## Features
|
|
7
6
|
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
7
|
+
- Tags for issues
|
|
8
|
+
- Tags for wiki pages
|
|
9
|
+
- Accented and non-latin characters supported for tag order
|
|
10
|
+
- View, edit and create tag permissions for issues
|
|
11
|
+
- Create permission for wiki tags
|
|
12
|
+
- Managing tags
|
|
13
|
+
- Custom tags and tagging tables (additional_tags and additional_taggings). If a other plugin
|
|
15
14
|
used tags or tagging tables for issue or wiki tagging, there tags will be migrated automatically
|
|
16
|
-
-
|
|
15
|
+
- Based on the very popular [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on)
|
|
17
16
|
|
|
18
17
|

|
|
19
18
|
|
|
20
19
|
Other plugins use additional_tags as framework in order to support tags for their entities.
|
|
21
20
|
At the moment this are:
|
|
22
21
|
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
22
|
+
- redmine_db (db entry tagging)
|
|
23
|
+
- redmine_passwords (password tagging)
|
|
24
|
+
- redmine_reporting (project tagging)
|
|
25
|
+
- redmine_hrm (holiday tagging)
|
|
26
|
+
- redmine_servicedesk (contact tagging)
|
|
28
27
|
|
|
29
28
|
Start using it, too. The example image shows the centralized tag management in the plugin configuration.
|
|
30
29
|
|
|
@@ -40,7 +39,7 @@ Start using it, too. The example image shows the centralized tag management in t
|
|
|
40
39
|
## Requirements
|
|
41
40
|
|
|
42
41
|
- Redmine `>= 4.1.0`
|
|
43
|
-
- Ruby `>= 2.
|
|
42
|
+
- Ruby `>= 2.6`
|
|
44
43
|
- Redmine plugins: [additionals](https://www.redmine.org/plugins/additionals)
|
|
45
44
|
|
|
46
45
|
## Installing
|
|
@@ -52,7 +51,7 @@ To install stable version of additional_tags, use
|
|
|
52
51
|
```shell
|
|
53
52
|
cd $REDMINE_ROOT
|
|
54
53
|
git clone -b stable https://www.github.com/alphanodes/additionals.git plugins/additionals
|
|
55
|
-
git clone -b
|
|
54
|
+
git clone -b stable https://www.github.com/alphanodes/additional_tags.git plugins/additional_tags
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
It is also possible to use stable version as a gem package as an alternative. If you want it, add this to your $REDMINE_ROOT/Gemfile.local:
|
data/additional_tags.gemspec
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
lib = File.expand_path '../lib', __FILE__
|
|
4
4
|
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
|
|
5
|
-
require 'additional_tags/
|
|
5
|
+
require 'additional_tags/plugin_version'
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'additional_tags'
|
|
9
|
-
spec.version = AdditionalTags::VERSION
|
|
9
|
+
spec.version = AdditionalTags::PluginVersion::VERSION
|
|
10
10
|
spec.authors = ['AlphaNodes']
|
|
11
11
|
spec.email = ['alex@alphanodes.com']
|
|
12
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
|
12
13
|
|
|
13
14
|
spec.summary = 'Redmine plugin for adding tag functionality'
|
|
14
15
|
spec.description = 'Redmine plugin for adding tag functionality'
|
|
@@ -21,9 +22,10 @@ Gem::Specification.new do |spec|
|
|
|
21
22
|
spec.bindir = 'exe'
|
|
22
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
|
23
24
|
spec.require_paths = ['lib']
|
|
24
|
-
spec.required_ruby_version = '>= 2.
|
|
25
|
+
spec.required_ruby_version = '>= 2.6'
|
|
25
26
|
|
|
26
27
|
spec.add_runtime_dependency 'acts-as-taggable-on', '~> 7.0'
|
|
28
|
+
spec.add_runtime_dependency 'redmine_plugin_kit'
|
|
27
29
|
|
|
28
30
|
spec.add_development_dependency 'bundler'
|
|
29
31
|
spec.add_development_dependency 'rake'
|
|
@@ -43,13 +43,13 @@ module AdditionalTagsHelper
|
|
|
43
43
|
columns
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def
|
|
47
|
-
return if tags.
|
|
46
|
+
def sort_tags_for_list(tags, sort_by: nil, sort_order: nil)
|
|
47
|
+
return tags if tags.size < 2
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
sort_by = AdditionalTags.setting :tags_sort_by if sort_by.blank?
|
|
50
|
+
sort_order = AdditionalTags.setting :tags_sort_order if sort_order.blank?
|
|
51
51
|
|
|
52
|
-
case "#{
|
|
52
|
+
case "#{sort_by}:#{sort_order}"
|
|
53
53
|
when 'name:desc'
|
|
54
54
|
tags = AdditionalTags::Tags.sort_tag_list(tags).reverse
|
|
55
55
|
when 'count:asc'
|
|
@@ -60,6 +60,16 @@ module AdditionalTagsHelper
|
|
|
60
60
|
tags = AdditionalTags::Tags.sort_tag_list tags
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
tags
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def render_tags_list(tags, **options)
|
|
67
|
+
return if tags.blank?
|
|
68
|
+
|
|
69
|
+
style = options.delete :style
|
|
70
|
+
tags = tags.all.to_a if tags.respond_to? :all
|
|
71
|
+
tags = sort_tags_for_list tags
|
|
72
|
+
|
|
63
73
|
case style
|
|
64
74
|
when :list
|
|
65
75
|
list_el = 'ul'
|
|
@@ -84,18 +94,22 @@ module AdditionalTagsHelper
|
|
|
84
94
|
content_tag(list_el, content, class: 'tags-cloud', style: (style == :simple_cloud ? 'text-align: left;' : ''))
|
|
85
95
|
end
|
|
86
96
|
|
|
87
|
-
def additional_tag_link(tag_object, link: nil, link_wiki_tag: false, show_count: false, use_colors: nil, **options)
|
|
97
|
+
def additional_tag_link(tag_object, link: nil, link_wiki_tag: false, show_count: false, use_colors: nil, name: nil, **options)
|
|
88
98
|
tag_name = []
|
|
89
|
-
tag_name <<
|
|
99
|
+
tag_name << if name.nil?
|
|
100
|
+
tag_object.name
|
|
101
|
+
else
|
|
102
|
+
name
|
|
103
|
+
end
|
|
90
104
|
|
|
91
105
|
options[:project] = @project if options[:project].blank? && @project.present?
|
|
106
|
+
use_colors = AdditionalTags.setting? :use_colors if use_colors.nil?
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
end
|
|
108
|
+
tag_style = if use_colors
|
|
109
|
+
tag_bg_color = additional_tag_color tag_object.name
|
|
110
|
+
tag_fg_color = additional_tag_fg_color tag_bg_color
|
|
111
|
+
"background-color: #{tag_bg_color}; color: #{tag_fg_color}"
|
|
112
|
+
end
|
|
99
113
|
|
|
100
114
|
tag_name << tag.span("(#{tag_object.count})", class: 'tag-count') if show_count
|
|
101
115
|
|
|
@@ -151,8 +165,10 @@ module AdditionalTagsHelper
|
|
|
151
165
|
use_colors ? ' ' : ', '
|
|
152
166
|
end
|
|
153
167
|
|
|
154
|
-
def
|
|
155
|
-
str.to_s.split(',')
|
|
168
|
+
def additional_tags_from_params(str)
|
|
169
|
+
tags = str.is_a?(Array) ? str : str.to_s.split(',')
|
|
170
|
+
tags.map!(&:strip)
|
|
171
|
+
tags.reject(&:blank?)
|
|
156
172
|
end
|
|
157
173
|
|
|
158
174
|
def additional_tag_links(tag_list, **options)
|
|
@@ -165,6 +181,45 @@ module AdditionalTagsHelper
|
|
|
165
181
|
additional_tag_sep(use_colors: options[:use_colors])
|
|
166
182
|
end
|
|
167
183
|
|
|
184
|
+
def scope_for_tags_aggr(project: nil, open_issues_only: nil)
|
|
185
|
+
Issue.available_tags project: project,
|
|
186
|
+
open_issues_only: open_issues_only
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def issues_count_group_by_tags(project, tags)
|
|
190
|
+
scope = Issue.group_by_status_with_tags project
|
|
191
|
+
|
|
192
|
+
issue_counts = {}
|
|
193
|
+
tags.each do |tag|
|
|
194
|
+
# binding.pry
|
|
195
|
+
open_issues = scope[[0, tag.id]] || scope[[false, tag.id]] || 0
|
|
196
|
+
closed_issues = scope[[1, tag.id]] || scope[[true, tag.id]] || 0
|
|
197
|
+
issue_counts[tag.name] = { open: open_issues,
|
|
198
|
+
closed: closed_issues,
|
|
199
|
+
total: open_issues + closed_issues,
|
|
200
|
+
tag: tag }
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
issue_counts
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def link_to_totals_for_tags(issue_counts:, project:, open_issues_only:)
|
|
207
|
+
sum = if issue_counts.blank? || issue_counts.size.zero?
|
|
208
|
+
0
|
|
209
|
+
else
|
|
210
|
+
query = IssueQuery.new project: project, name: '_'
|
|
211
|
+
query.add_filter 'tags', '*'
|
|
212
|
+
query.filters['status_id'][:operator] = '*' if !open_issues_only && query.filters.key?('status_id')
|
|
213
|
+
|
|
214
|
+
query.issue_count
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
link_to sum, _project_issues_path(project,
|
|
218
|
+
set_filter: 1,
|
|
219
|
+
tags: '*',
|
|
220
|
+
status_id: open_issues_only ? 'o' : '*')
|
|
221
|
+
end
|
|
222
|
+
|
|
168
223
|
private
|
|
169
224
|
|
|
170
225
|
def tag_url(tag_name, filter: nil, tag_action: nil, tag_controller: nil, project: nil)
|
|
@@ -193,7 +248,7 @@ module AdditionalTagsHelper
|
|
|
193
248
|
def add_tags(style, tags, content, item_el, options)
|
|
194
249
|
tag_cloud tags, (1..8).to_a do |tag, weight|
|
|
195
250
|
content << ' '.html_safe + content_tag(item_el,
|
|
196
|
-
additional_tag_link(tag, options),
|
|
251
|
+
additional_tag_link(tag, **options),
|
|
197
252
|
class: "tag-nube-#{weight}",
|
|
198
253
|
style: (style == :simple_cloud ? 'font-size: 1em;' : '')) + ' '.html_safe
|
|
199
254
|
end
|
|
@@ -15,7 +15,7 @@ module AdditionalTagsWikiHelper
|
|
|
15
15
|
link_wiki_tag: true,
|
|
16
16
|
project: @project }
|
|
17
17
|
|
|
18
|
-
render_tags_list sidebar_tags, options
|
|
18
|
+
render_tags_list sidebar_tags, **options
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def render_wiki_index_title(project, tag = nil)
|
|
@@ -32,28 +32,4 @@ module AdditionalTagsWikiHelper
|
|
|
32
32
|
l :label_wiki
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
|
|
36
|
-
def wiki_pages_with_tag(tag, project = nil)
|
|
37
|
-
wiki = project&.wiki
|
|
38
|
-
|
|
39
|
-
scope = if wiki
|
|
40
|
-
wiki.pages
|
|
41
|
-
else
|
|
42
|
-
WikiPage.joins wiki: :project
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
scope = scope.visible User.current, project: project if scope.respond_to? :visible
|
|
46
|
-
|
|
47
|
-
scope = scope.joins(AdditionalTags::Tags.tag_to_joins(WikiPage))
|
|
48
|
-
.where("LOWER(#{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.name) = LOWER(:p)",
|
|
49
|
-
p: tag.to_s.strip)
|
|
50
|
-
.with_updated_on
|
|
51
|
-
.joins(wiki: :project)
|
|
52
|
-
|
|
53
|
-
if wiki.nil?
|
|
54
|
-
scope.order "#{Project.table_name}.name, #{WikiPage.table_name}.title"
|
|
55
|
-
else
|
|
56
|
-
scope.includes(:parent).order "#{WikiPage.table_name}.title"
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
35
|
end
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
class AdditionalTagsRemoveUnusedTagJob < AdditionalTagsJob
|
|
4
4
|
def perform
|
|
5
|
+
# only once a minute to reduce load
|
|
6
|
+
cache_key = self.class.to_s
|
|
7
|
+
return if Rails.cache.read cache_key
|
|
8
|
+
|
|
9
|
+
Rails.cache.write cache_key, true, expires_in: 60
|
|
5
10
|
AdditionalTags::Tags.remove_unused_tags
|
|
6
11
|
end
|
|
7
12
|
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
h3 = block_definition[:label]
|
|
2
|
+
|
|
3
|
+
- open_issues_only = RedminePluginKit.true? settings[:open_issues_only]
|
|
4
|
+
- tags = scope_for_tags_aggr project: @project,
|
|
5
|
+
open_issues_only: open_issues_only
|
|
6
|
+
- issue_counts = issues_count_group_by_tags @project, tags
|
|
7
|
+
|
|
8
|
+
ul.reporting-list.tag-summary
|
|
9
|
+
li.amount-tags
|
|
10
|
+
= l :label_amount_tags
|
|
11
|
+
' :
|
|
12
|
+
span.value
|
|
13
|
+
= tags.to_a.size
|
|
14
|
+
li.amount-entities-with-tags
|
|
15
|
+
= l :label_amount_entities_with_tags, name: l(:label_issue_plural)
|
|
16
|
+
' :
|
|
17
|
+
span.value
|
|
18
|
+
= link_to_totals_for_tags project: @project,
|
|
19
|
+
issue_counts: issue_counts,
|
|
20
|
+
open_issues_only: open_issues_only
|
|
21
|
+
|
|
22
|
+
- if RedminePluginKit.true? settings[:with_table_of_values]
|
|
23
|
+
- if tags.present?
|
|
24
|
+
- tags = sort_tags_for_list tags
|
|
25
|
+
table.list.tags
|
|
26
|
+
thead
|
|
27
|
+
tr
|
|
28
|
+
th = l :field_name
|
|
29
|
+
- if open_issues_only
|
|
30
|
+
th = l :label_quantity
|
|
31
|
+
- else
|
|
32
|
+
th = l :label_open_issues_plural
|
|
33
|
+
th = l :label_closed_issues_plural
|
|
34
|
+
th = l :label_total
|
|
35
|
+
tbody
|
|
36
|
+
- tags.each do |tag|
|
|
37
|
+
tr
|
|
38
|
+
td.name = additional_tag_link tag,
|
|
39
|
+
tag_action: 'index',
|
|
40
|
+
tag_controller: 'issues',
|
|
41
|
+
filter: open_issues_only ? { field: :status_id, operator: 'o' } : nil,
|
|
42
|
+
use_colors: RedminePluginKit.true?(settings[:use_colors])
|
|
43
|
+
- unless open_issues_only
|
|
44
|
+
td.value = additional_tag_link tag,
|
|
45
|
+
tag_action: 'index',
|
|
46
|
+
tag_controller: 'issues',
|
|
47
|
+
filter: { field: :status_id, operator: 'o' },
|
|
48
|
+
use_colors: false,
|
|
49
|
+
name: issue_counts[tag.name][:open]
|
|
50
|
+
td.value = additional_tag_link tag,
|
|
51
|
+
tag_action: 'index',
|
|
52
|
+
tag_controller: 'issues',
|
|
53
|
+
filter: { field: :status_id, operator: 'c' },
|
|
54
|
+
use_colors: false,
|
|
55
|
+
name: issue_counts[tag.name][:closed]
|
|
56
|
+
td.value = additional_tag_link tag,
|
|
57
|
+
tag_action: 'index',
|
|
58
|
+
tag_controller: 'issues',
|
|
59
|
+
filter: open_issues_only ? { field: :status_id, operator: 'o' } : nil,
|
|
60
|
+
use_colors: false,
|
|
61
|
+
name: open_issues_only ? issue_counts[tag.name][:open] : issue_counts[tag.name][:total]
|
|
62
|
+
- else
|
|
63
|
+
p.nodata = l :label_no_data
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.box.tabular.settings
|
|
2
|
+
p
|
|
3
|
+
= additionals_settings_checkbox :with_table_of_values,
|
|
4
|
+
active_value: settings[:with_table_of_values],
|
|
5
|
+
tag_name: "settings[#{block}][with_table_of_values]"
|
|
6
|
+
|
|
7
|
+
/ p
|
|
8
|
+
/ = additionals_settings_checkbox :with_chart,
|
|
9
|
+
/ active_value: settings[:with_chart],
|
|
10
|
+
/ tag_name: "settings[#{block}][with_chart]"
|
|
11
|
+
|
|
12
|
+
p
|
|
13
|
+
= additionals_settings_checkbox :open_issues_only,
|
|
14
|
+
active_value: settings[:open_issues_only],
|
|
15
|
+
tag_name: "settings[#{block}][open_issues_only]"
|
|
16
|
+
|
|
17
|
+
p
|
|
18
|
+
= additionals_settings_checkbox :use_colors,
|
|
19
|
+
active_value: settings[:use_colors],
|
|
20
|
+
tag_name: "settings[#{block}][use_colors]"
|
|
@@ -9,7 +9,7 @@ h3.title = l :label_add_tags
|
|
|
9
9
|
h3
|
|
10
10
|
span = link_to_issue @issues.first
|
|
11
11
|
|
|
12
|
-
= form_tag issue_tags_path(ids: @issue_ids) do
|
|
12
|
+
= form_tag issue_tags_path(ids: @issue_ids, search: params[:search]) do
|
|
13
13
|
fieldset.box
|
|
14
14
|
legend = l :field_tags
|
|
15
15
|
#issue_tags
|
|
@@ -22,9 +22,11 @@ h3.title = l :label_add_tags
|
|
|
22
22
|
tags: User.current.allowed_to?(:create_issue_tags, @project)
|
|
23
23
|
p.most_used_tags
|
|
24
24
|
= safe_join @most_used_tags.collect { |t| tag.span t.name, class: 'most_used_tag' }, ', '
|
|
25
|
-
= javascript_tag "var mostUsedTags = #{@most_used_tags.map(&:name)}"
|
|
26
25
|
|
|
27
26
|
.buttons
|
|
28
27
|
= submit_tag l(:button_add), name: nil
|
|
29
28
|
'
|
|
30
29
|
= link_to_function l(:button_cancel), 'hideModal(this);'
|
|
30
|
+
|
|
31
|
+
javascript:
|
|
32
|
+
var mostUsedTags = #{raw @most_used_tags.map(&:name)};
|
data/assets/javascripts/tags.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* global mostUsedTags:writable */
|
|
2
|
+
$(function() {
|
|
3
|
+
$('body').on('click', '.most_used_tags .most_used_tag', function(e) {
|
|
3
4
|
var $tagsSelect = $('select#issue_tag_list');
|
|
4
5
|
var tag = e.target.innerText;
|
|
5
6
|
if ($tagsSelect.find('option[value=\'' + tag + '\']').length === 0) {
|
|
@@ -7,7 +8,7 @@ $(function () {
|
|
|
7
8
|
$tagsSelect.append(newOption).trigger('change');
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
mostUsedTags = $.grep(mostUsedTags, function(t) { return t != tag; });
|
|
11
12
|
var tagsHtml = mostUsedTags.map(function(tag) {
|
|
12
13
|
return '<span class="most_used_tag">' + tag + '</span>';
|
|
13
14
|
}).join(', ');
|
data/config/locales/bg.yml
CHANGED
|
@@ -31,3 +31,8 @@ bg:
|
|
|
31
31
|
tags_sort_by_name: "Име"
|
|
32
32
|
label_tags_sort_by: "Сортиране на маркерите по"
|
|
33
33
|
label_tags_suggestion_order: "Ред на предлагане"
|
|
34
|
+
label_with_table_of_values: "С таблица на стойността"
|
|
35
|
+
label_with_chart: "С графиком"
|
|
36
|
+
label_amount_tags: "Теги Сумма"
|
|
37
|
+
label_amount_entities_with_tags: "Сумма %{name} с тегами"
|
|
38
|
+
label_quantity: "Количество"
|
data/config/locales/cs.yml
CHANGED
|
@@ -31,3 +31,8 @@ cs:
|
|
|
31
31
|
tags_sort_by_name: "Název"
|
|
32
32
|
label_tags_sort_by: "Řazení značek podle"
|
|
33
33
|
label_tags_suggestion_order: "Objednávka návrhu"
|
|
34
|
+
label_with_table_of_values: "S tabulkou hodnot"
|
|
35
|
+
label_with_chart: "S grafem"
|
|
36
|
+
label_amount_tags: "Částka TAGy"
|
|
37
|
+
label_amount_entities_with_tags: "Částka %{name} s TAGy"
|
|
38
|
+
label_quantity: "Množství"
|
data/config/locales/de.yml
CHANGED
|
@@ -31,3 +31,8 @@ de:
|
|
|
31
31
|
tags_sort_by_name: Name
|
|
32
32
|
label_tags_sort_by: Sortiere TAGs nach
|
|
33
33
|
label_tags_suggestion_order: Reihenfolge der Vorschläge
|
|
34
|
+
label_with_table_of_values: Mit Wertetabelle
|
|
35
|
+
label_with_chart: Mit Chart
|
|
36
|
+
label_amount_tags: Anzahl TAGs
|
|
37
|
+
label_amount_entities_with_tags: Anzahl %{name} mit TAGs
|
|
38
|
+
label_quantity: Anzahl
|
data/config/locales/en.yml
CHANGED
|
@@ -31,3 +31,8 @@ en:
|
|
|
31
31
|
tags_sort_by_name: "Name"
|
|
32
32
|
label_tags_sort_by: "Sort tags by"
|
|
33
33
|
label_tags_suggestion_order: "Suggestion order"
|
|
34
|
+
label_with_table_of_values: "With table of values"
|
|
35
|
+
label_with_chart: "With chart"
|
|
36
|
+
label_amount_tags: "Amount tags"
|
|
37
|
+
label_amount_entities_with_tags: "Amount %{name} with tags"
|
|
38
|
+
label_quantity: "Quantity"
|
data/config/locales/es.yml
CHANGED
|
@@ -31,3 +31,8 @@ es:
|
|
|
31
31
|
tags_sort_by_name: "Nombre"
|
|
32
32
|
label_tags_sort_by: "Ordenar las tags por"
|
|
33
33
|
label_tags_suggestion_order: "Orden de sugerencia"
|
|
34
|
+
label_with_table_of_values: "Con tabla de valores"
|
|
35
|
+
label_with_chart: "Con tabla"
|
|
36
|
+
label_amount_tags: "Valor tags"
|
|
37
|
+
label_amount_entities_with_tags: "Cantidad %{name} con tags"
|
|
38
|
+
label_quantity: "Ctd."
|
data/config/locales/fr.yml
CHANGED
|
@@ -31,3 +31,8 @@ fr:
|
|
|
31
31
|
tags_sort_by_name: "Nom"
|
|
32
32
|
label_tags_sort_by: "Trier les balises par"
|
|
33
33
|
label_tags_suggestion_order: "Ordre de suggestion"
|
|
34
|
+
label_with_table_of_values: "Avec tableau de valeur"
|
|
35
|
+
label_with_chart: "Avec tableau"
|
|
36
|
+
label_amount_tags: "Montant tags"
|
|
37
|
+
label_amount_entities_with_tags: "Montant %{name} avec tags"
|
|
38
|
+
label_quantity: "Quantité"
|
data/config/locales/it.yml
CHANGED
|
@@ -31,3 +31,8 @@ it:
|
|
|
31
31
|
tags_sort_by_name: "Nome"
|
|
32
32
|
label_tags_sort_by: "Ordina i tag per"
|
|
33
33
|
label_tags_suggestion_order: "Ordine di suggerimento"
|
|
34
|
+
label_with_table_of_values: With table of values
|
|
35
|
+
label_with_chart: With chart
|
|
36
|
+
label_amount_tags: Amount tags
|
|
37
|
+
label_amount_entities_with_tags: Amount %{name} with tags
|
|
38
|
+
label_quantity: "Numero"
|
data/config/locales/ja.yml
CHANGED
|
@@ -31,3 +31,8 @@ ja:
|
|
|
31
31
|
tags_sort_by_name: "名前"
|
|
32
32
|
label_tags_sort_by: "タグを並べ替える"
|
|
33
33
|
label_tags_suggestion_order: "ご提案の順番"
|
|
34
|
+
label_with_table_of_values: "価値観のテーブル付き"
|
|
35
|
+
label_with_chart: "チャート付き"
|
|
36
|
+
label_amount_tags: "金額 tags"
|
|
37
|
+
label_amount_entities_with_tags: "金額 %{name} tags付き"
|
|
38
|
+
label_quantity: "数量"
|
data/config/locales/ko.yml
CHANGED
|
@@ -31,3 +31,8 @@ ko:
|
|
|
31
31
|
tags_sort_by_name: "이름"
|
|
32
32
|
label_tags_sort_by: "태그 정렬 기준"
|
|
33
33
|
label_tags_suggestion_order: "제안 순서"
|
|
34
|
+
label_with_table_of_values: "가치 테이블"
|
|
35
|
+
label_with_chart: "차트 포함"
|
|
36
|
+
label_amount_tags: "금액 태그"
|
|
37
|
+
label_amount_entities_with_tags: "TAG가 있는 금액 %{name}"
|
|
38
|
+
label_quantity: "수량"
|
data/config/locales/pl.yml
CHANGED
|
@@ -31,3 +31,8 @@ pl:
|
|
|
31
31
|
tags_sort_by_name: "Nazwa"
|
|
32
32
|
label_tags_sort_by: "Sortuj znaczniki według"
|
|
33
33
|
label_tags_suggestion_order: "Zamówienie ofertowe"
|
|
34
|
+
label_with_table_of_values: "Z tabelą wartości"
|
|
35
|
+
label_with_chart: "Z wykresem"
|
|
36
|
+
label_amount_tags: "Kwota Tags"
|
|
37
|
+
label_amount_entities_with_tags: "Kwota %{name} z Tags"
|
|
38
|
+
label_quantity: "Ilość"
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -31,3 +31,8 @@ pt-BR:
|
|
|
31
31
|
tags_sort_by_name: "Nome"
|
|
32
32
|
label_tags_sort_by: "Ordenar tags por"
|
|
33
33
|
label_tags_suggestion_order: "Pedido de sugestão"
|
|
34
|
+
label_with_table_of_values: "Com tabela de valores"
|
|
35
|
+
label_with_chart: "Com gráfico"
|
|
36
|
+
label_amount_tags: "Valor Etiquetas"
|
|
37
|
+
label_amount_entities_with_tags: "Quantidade %{name} com etiquetas"
|
|
38
|
+
label_quantity: "Quantidade"
|