redmineup 1.1.13 → 1.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4d2181d902dbfa9a13995df17ff80c6a9eaea15fd54c6a918a6695ced32ed40
4
- data.tar.gz: 88ee188a9626a4483f6ebc108a5f2ae174de4bde94e5d04128f60b0f3d6d8799
3
+ metadata.gz: 497432257e3dd60a1140adb02b491af3e36a669a8c2af4cb42fb810f09b26b4c
4
+ data.tar.gz: e07c21fc5a9358e9706fb2d922919c994a17013704d583cfd87282162a03c40e
5
5
  SHA512:
6
- metadata.gz: bbd631a43429432a3c3f2e208527b601dd3d1dca57d260d314f2808d485b96d8f8ef29baf31a6836c026c30cf5d453075082d6d65cf548efba7fe5393a862b75
7
- data.tar.gz: 49ccf2ace3f1af01aa00a748a94c93f6deb994fd5bc0e0a23db7f4e98c7ed371aeff27b8561a0c8cce1aeee19d9e8e5333ae4c7ee77c699bb9c8bb1c092daff3
6
+ metadata.gz: '09ea94ec0283833d3c2daa10ca34239374eb64dccbfd8130dabea3f292947c0d9f88e92e33b5e17c544bacf0014f782aa712fbc280a5b7e45e5368d1f07ebb17'
7
+ data.tar.gz: 959335aba0d22370913ced0db6b826a93eb2a856422aa0e22a3f85d21a2c6d0cba6a5788068391441944db221ac300a555b7339dca588ee40a6348011bc58ab4
@@ -10,6 +10,3 @@ table.cal td.odd p.day-num {color: #bbb;}
10
10
  table.cal td.today {background:#ffffdd;}
11
11
  table.cal td.today p.day-num {font-weight: bold;}
12
12
  table.cal td.nwday:not(.odd) {background-color:#f1f1f1;}
13
- table.cal .starting a.issue, p.cal.legend .starting {background: url(../../../images/bullet_go.png) no-repeat -1px -2px; padding-left:16px;}
14
- table.cal .ending a.issue, p.cal.legend .ending {background: url(../../../images/bullet_end.png) no-repeat -1px -2px; padding-left:16px;}
15
- table.cal .starting.ending a.issue, p.cal.legend .starting.ending {background: url(../../../images/bullet_diamond.png) no-repeat -1px -2px; padding-left:16px;}
@@ -432,9 +432,6 @@ table.cal td.odd p.day-num {color: #bbb;}
432
432
  table.cal td.today {background:#ffffdd;}
433
433
  table.cal td.today p.day-num {font-weight: bold;}
434
434
  table.cal td.nwday:not(.odd) {background-color:#f1f1f1;}
435
- table.cal .starting a.issue, p.cal.legend .starting {background: url(../../../images/bullet_go.png) no-repeat -1px -2px; padding-left:16px;}
436
- table.cal .ending a.issue, p.cal.legend .ending {background: url(../../../images/bullet_end.png) no-repeat -1px -2px; padding-left:16px;}
437
- table.cal .starting.ending a.issue, p.cal.legend .starting.ending {background: url(../../../images/bullet_diamond.png) no-repeat -1px -2px; padding-left:16px;}
438
435
 
439
436
  #admin-menu a.icon-redmineup-money:not(:has(svg)) {
440
437
  background-image: url(../images/money.png);
@@ -462,9 +459,6 @@ ul.cal {
462
459
  .cal .calbody.today p.day-num {font-weight: bold;}
463
460
  .cal .calbody .icon {padding-top: 2px; padding-bottom: 3px;}
464
461
  .cal .calbody.nwday:not(.odd) {background-color:#f1f1f1;}
465
- .cal .starting a.issue, p.cal.legend .starting {background: url(../images/bullet_go.png) no-repeat -1px -2px; padding-left:16px;}
466
- .cal .ending a.issue, p.cal.legend .ending {background: url(../images/bullet_end.png) no-repeat -1px -2px; padding-left:16px;}
467
- .cal .starting.ending a.issue, p.cal.legend .starting.ending {background: url(../images/bullet_diamond.png) no-repeat -1px -2px; padding-left:16px;}
468
462
  @media screen and (max-width: 899px) {
469
463
  ul.cal { display: block }
470
464
  .cal .calhead { display: none }
data/doc/CHANGELOG CHANGED
@@ -4,6 +4,15 @@ Redmine UP gem - general functions for plugins (tags, vote, viewing, currency)
4
4
  Copyright (C) 2011-2026 Kirill Bezrukov (RedmineUP)
5
5
  https://www.redmineup.com/
6
6
 
7
+ == 2026-10-11 v1.1.15
8
+
9
+ * Speeded up the tags list query (available_tags) on pages with a lot of tagged records
10
+
11
+ == 2026-10-09 v1.1.14
12
+
13
+ * Fixed missing calendar icons and extra padding in Redmine 6/7
14
+ * Fixed tag field width in forms
15
+
7
16
  == 2026-08-25 v1.1.13
8
17
 
9
18
  * Updated patches from include to prepend
@@ -129,43 +129,43 @@ module Redmineup
129
129
  #Return all avalible tags for a project or global
130
130
  #Example: Question.available_tags(:project => @project_id )
131
131
  def available_tags(options = {})
132
- projects = [[options[:project]], options[:projects]].flatten.compact
133
132
  limit = options[:limit].to_i.zero? ? 30 : options[:limit].to_i
134
- scope = Tag.where({})
135
- class_name = quote_string_value(base_class.name)
136
- join = []
137
- join << "JOIN #{Tagging.table_name} ON #{Tagging.table_name}.tag_id = #{Tag.table_name}.id "
138
- join << "JOIN #{table_name} ON #{table_name}.id = #{Tagging.table_name}.taggable_id
139
- AND #{Tagging.table_name}.taggable_type = #{class_name} "
140
- if attribute_names.include?('project_id') && projects.any?
141
- join << "JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id"
142
- scope = scope.where("#{table_name}.project_id IN (%s)", projects.map(&:id).join(','))
143
- end
133
+ counts_sql = Tag.connection.unprepared_statement { tagged_records_scope(options).to_sql }
144
134
 
135
+ scope = Tag.joins("JOIN (#{counts_sql}) tag_counts ON tag_counts.tag_id = #{Tag.table_name}.id")
136
+ scope = scope.select("#{Tag.table_name}.*, tag_counts.count AS count")
145
137
  if options[:name_like].present?
146
138
  scope = scope.where("LOWER(#{Tag.table_name}.name) LIKE LOWER(?)", "%#{options[:name_like]}%")
147
139
  end
140
+ scope.order("#{Tag.table_name}.name").limit(limit)
141
+ end
148
142
 
149
- group_fields = ''
150
- group_fields << ", #{Tag.table_name}.created_at" if Tag.respond_to?(:created_at)
151
- group_fields << ", #{Tag.table_name}.updated_at" if Tag.respond_to?(:updated_at)
152
- group_fields << ", #{Tag.table_name}.color" if Tag.column_names.include?('color')
143
+ # tag_id => number of visible taggables. Extension point for available_tags.
144
+ def tagged_records_scope(options = {})
145
+ projects = [[options[:project]], options[:projects]].flatten.compact
146
+ scope = Tagging.unscoped.
147
+ joins("JOIN #{table_name} ON #{table_name}.id = #{Tagging.table_name}.taggable_id").
148
+ where("#{Tagging.table_name}.taggable_type = ?", base_class.name).
149
+ group("#{Tagging.table_name}.tag_id").
150
+ select("#{Tagging.table_name}.tag_id, COUNT(DISTINCT #{Tagging.table_name}.taggable_id) AS count")
151
+
152
+ projects_joined = false
153
+ if attribute_names.include?('project_id') && projects.any?
154
+ scope = scope.joins("JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id").
155
+ where("#{table_name}.project_id IN (?)", projects.map(&:id))
156
+ projects_joined = true
157
+ end
153
158
 
154
159
  if base_class.respond_to?(:visible_condition)
155
160
  visible_condition = base_class.visible_condition(User.current)
156
- if visible_condition.include?('project_id') && join.all? { |jn| jn.exclude?('JOIN projects') }
157
- join << "JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id"
161
+ if visible_condition.include?('project_id') && !projects_joined
162
+ scope = scope.joins("JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id")
158
163
  end
159
164
  scope = scope.where(visible_condition)
160
165
  end
161
- scope = scope.joins(join.join(' '))
162
- scope = scope.select("#{Tag.table_name}.*, COUNT(DISTINCT #{Tagging.table_name}.taggable_id) AS count")
163
- scope = scope.group("#{Tag.table_name}.id, #{Tag.table_name}.name #{group_fields}")
164
- scope = scope.having('COUNT(*) > 0')
165
- scope = scope.order("#{Tag.table_name}.name")
166
- scope = scope.limit(limit)
167
166
  scope
168
167
  end
168
+
169
169
  # Returns an array of related tags.
170
170
  # Related tags are all the other tags that are found on the models tagged with the provided tags.
171
171
  #
@@ -67,7 +67,8 @@ module Redmineup
67
67
  options_for_select(value, value),
68
68
  {
69
69
  multiple: true,
70
- width: width || '95%',
70
+ style: "width: #{width || '95%'};",
71
+ width: 'style',
71
72
  url: url || auto_complete_taggable_tags_path(taggable_type: taggable_type, project_id: project_id),
72
73
  placeholder: placeholder || l(:lable_redmineup_add_tag),
73
74
  tags: true
@@ -1,3 +1,3 @@
1
1
  module Redmineup
2
- VERSION = '1.1.13'
2
+ VERSION = '1.1.15'
3
3
  end
data/redmineup.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://www.redmineup.com"
14
14
  spec.license = "GPL-2.0"
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0")
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?("doc/dev/") || %w[AGENTS.md GLOSSARY.md].include?(f) }
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
@@ -35,7 +35,16 @@ class TagsHelperViewTest < ActionView::TestCase
35
35
  width: '60%', tags: false,
36
36
  placeholder: '+ add tag')
37
37
  assert_includes result, 'name="issue[tag_list][]"'
38
- assert_includes result, '"width":"60%"'
38
+ assert_includes result, 'style="width: 60%;"'
39
+ assert_includes result, '"width":"style"'
39
40
  assert_includes result, '"tags":false'
40
41
  end
42
+
43
+ def test_tag_list_field_tag_with_default_width
44
+ result = tag_list_field_tag('issue[tag_list]', [],
45
+ url: '/auto_completes/taggable_tags',
46
+ placeholder: '+ add tag')
47
+ assert_includes result, 'style="width: 95%;"'
48
+ assert_includes result, '"width":"style"'
49
+ end
41
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmineup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.13
4
+ version: 1.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineUP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-25 00:00:00.000000000 Z
11
+ date: 2026-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -124,7 +124,6 @@ files:
124
124
  - app/assets/javascripts/select2.js
125
125
  - app/assets/javascripts/select2_helpers.js
126
126
  - app/assets/stylesheets/calendars.css
127
- - app/assets/stylesheets/money.css
128
127
  - app/assets/stylesheets/redmineup.css
129
128
  - app/assets/stylesheets/select2.css
130
129
  - app/controllers/redmineup_controller.rb
@@ -1,95 +0,0 @@
1
- #admin-menu a.icon-redmineup-money:not(:has(svg)) {
2
- background-image: url(../images/money.png);
3
- }
4
-
5
- /***** Calendar *****/
6
- ul.cal {
7
- list-style: none;
8
- width: 100%;
9
- padding: 0;
10
- display: grid;
11
- grid-template-columns: 2rem repeat(7, 1fr);
12
- margin: 0;
13
- border: 1px solid #c0c0c0;
14
- border-spacing: 0;
15
- border-radius: 3px;
16
- }
17
-
18
- .cal .calhead {
19
- background-color:#eee;
20
- text-align: center;
21
- font-weight: bold;
22
- padding: 4px
23
- }
24
-
25
- .cal .week-number {
26
- background-color:#eee;
27
- border:none;
28
- font-size: 1em;
29
- padding: 4px;
30
- text-align: center;
31
- }
32
-
33
- .cal .week-number .label-week {
34
- display: none;
35
- }
36
-
37
- .cal .calbody {
38
- border: 1px solid #d7d7d7;
39
- vertical-align: top;
40
- font-size: 0.9em;
41
- border-bottom: 0;
42
- border-right: 0;
43
- line-height: 1.2;
44
- min-height: calc(1.2em * 6);
45
- padding: 2px;
46
- }
47
-
48
- .cal .calbody p.day-num {font-size: 1.1em; text-align:right;}
49
- .cal .calbody .abbr-day {display:none}
50
- .cal .calbody.odd p.day-num {color: #bbb;}
51
- .cal .calbody.today {background:#ffd;}
52
- .cal .calbody.today p.day-num {font-weight: bold;}
53
-
54
- .cal .calbody .icon {padding-top: 2px; padding-bottom: 3px;}
55
- .cal .calbody.nwday:not(.odd) {background-color:#f1f1f1;}
56
- .cal .starting a.issue, p.cal.legend .starting {background: url(../images/bullet_go.png) no-repeat -1px -2px; padding-left:16px;}
57
- .cal .ending a.issue, p.cal.legend .ending {background: url(../images/bullet_end.png) no-repeat -1px -2px; padding-left:16px;}
58
- .cal .starting.ending a.issue, p.cal.legend .starting.ending {background: url(../images/bullet_diamond.png) no-repeat -1px -2px; padding-left:16px;}
59
-
60
-
61
- /* responsive.css */
62
- @media screen and (max-width: 899px)
63
- {
64
- ul.cal {
65
- display: block
66
- }
67
- .cal .calhead {
68
- display: none
69
- }
70
-
71
- .cal .calbody {
72
- min-height: calc(1.2em * 3);
73
- }
74
-
75
- .cal .calbody .abbr-day {
76
- display: inline;
77
- }
78
-
79
- .cal .week-number {
80
- border: 1px solid #c0c0c0;
81
- text-align: left;
82
- font-weight: bold;
83
- background-color: #def;
84
- }
85
-
86
- .cal .week-number .label-week {
87
- display: inline;
88
- }
89
-
90
- .cal .calbody p.day-num {
91
- font-size: 1.1em;
92
- text-align: left;
93
- }
94
- }
95
- /***** End Calendar *****/