redmineflux_icon_compat 0.1.0 → 0.1.2
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/CHANGELOG.md +32 -0
- data/README.md +43 -59
- data/lib/redmineflux_icon_compat/helper.rb +12 -2
- data/lib/redmineflux_icon_compat/version.rb +1 -1
- data/lib/redmineflux_icon_compat.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6086040e39bd5cf0e82f22f90afdc29853117f6ec8fffbc3ae76cfc5ab1a8b57
|
|
4
|
+
data.tar.gz: 207d95b7aece44166ec87a713bac13fbca6aef984ad9c9f0e576d6f96c2184c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1cda2877c0643b538626171e024e3046e68b6f74cc3fa314cc5b0e3988fb81e810a53e5ad6e7c54bb448f849e99e03539f3d2dba657d4660fb049e1ed506d9a8
|
|
7
|
+
data.tar.gz: 8c4995d5b73663acd7919ebd3fe02bf1f1b113a6a0d2bd342f1eb916bb97204a47a5572495228f5baad72b0fa9e7c8a71ae9ce00f0661ecb6bfd2cb2e17562cc
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `redmineflux_icon_compat` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.2] - 2026-04-17
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Updated README wording and usage clarity.
|
|
9
|
+
- Updated RubyGems dependency example to `~> 0.1.2`.
|
|
10
|
+
|
|
11
|
+
## [0.1.1] - 2026-04-16
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- Added comprehensive README usage guide for plugin integration.
|
|
15
|
+
- Added gem publishing documentation for RubyGems.
|
|
16
|
+
- Added test suite for icon helper behavior across fallback modes.
|
|
17
|
+
- Added YARD-style API comments for key helper methods.
|
|
18
|
+
- Added `CHANGELOG.md` to packaged gem files.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Improved icon rendering detection to rely on helper availability, not Redmine major version constants.
|
|
22
|
+
- Added fallback rendering path through `ApplicationController.helpers.sprite_icon` when local helper context does not expose `sprite_icon`.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Prevented incorrect fallback to legacy icon classes in Redmine 6 hook/view contexts.
|
|
26
|
+
|
|
27
|
+
## [0.1.0] - 2026-04-16
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Initial release.
|
|
31
|
+
- Introduced `rf_icon_link` helper for Redmine 5/6 icon compatibility.
|
|
32
|
+
- Added Railtie-based automatic helper inclusion for views/controllers.
|
data/README.md
CHANGED
|
@@ -1,105 +1,89 @@
|
|
|
1
1
|
# Redmineflux Icon Compat
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`redmineflux_icon_compat` provides one helper API for plugin links that works in both:
|
|
4
|
+
- Redmine 5 legacy icon classes (`icon icon-*`)
|
|
5
|
+
- Redmine 6 sprite icons (`sprite_icon`)
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
- Redmine 5 style icons (`icon icon-*` classes)
|
|
7
|
-
- Redmine 6 SVG sprite icons (`sprite_icon`)
|
|
7
|
+
Use `rf_icon_link` to keep one code path across Redmine versions.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Install In A Redmine Plugin
|
|
10
10
|
|
|
11
|
-
1
|
|
11
|
+
### 1) Add the gem to your plugin Gemfile
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
gem 'redmineflux_icon_compat', path: '../redmineflux_icon_compat'
|
|
15
|
-
```
|
|
13
|
+
Create or update `plugins/<your_plugin>/Gemfile`.
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Local development:
|
|
18
16
|
|
|
19
17
|
```ruby
|
|
20
|
-
|
|
18
|
+
gem 'redmineflux_icon_compat', path: '../redmineflux_icon_compat'
|
|
21
19
|
```
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
From RubyGems:
|
|
24
22
|
|
|
25
23
|
```ruby
|
|
26
|
-
|
|
24
|
+
gem 'redmineflux_icon_compat', '~> 0.1.2'
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
### 2) Install dependencies
|
|
30
28
|
|
|
31
29
|
From Redmine root:
|
|
32
30
|
|
|
33
31
|
```bash
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Or from gem directory:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
cd plugins/redmineflux_icon_compat
|
|
41
|
-
ruby test/helper_test.rb
|
|
32
|
+
bundle install
|
|
42
33
|
```
|
|
43
34
|
|
|
44
|
-
|
|
35
|
+
### 3) Require the gem in plugin init
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
2. Login from terminal:
|
|
37
|
+
In `plugins/<your_plugin>/init.rb`:
|
|
48
38
|
|
|
49
|
-
```
|
|
50
|
-
|
|
39
|
+
```ruby
|
|
40
|
+
require 'redmineflux_icon_compat'
|
|
51
41
|
```
|
|
52
42
|
|
|
53
|
-
|
|
54
|
-
- `plugins/redmineflux_icon_compat/lib/redmineflux_icon_compat/version.rb`
|
|
55
|
-
|
|
56
|
-
4. Run tests:
|
|
43
|
+
### 4) Include the helper (recommended)
|
|
57
44
|
|
|
58
|
-
```
|
|
59
|
-
|
|
45
|
+
```ruby
|
|
46
|
+
module MyPluginHelper
|
|
47
|
+
include RedminefluxIconCompat::Helper
|
|
48
|
+
end
|
|
60
49
|
```
|
|
61
50
|
|
|
62
|
-
5
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
cd plugins/redmineflux_icon_compat
|
|
66
|
-
gem build redmineflux_icon_compat.gemspec
|
|
67
|
-
```
|
|
51
|
+
### 5) Use `rf_icon_link` in views/helpers
|
|
68
52
|
|
|
69
|
-
|
|
53
|
+
ERB example:
|
|
70
54
|
|
|
71
|
-
```
|
|
72
|
-
|
|
55
|
+
```erb
|
|
56
|
+
<%= rf_icon_link(:add, 'Add Checklist', '#', class: 'add-checklist-btn') %>
|
|
73
57
|
```
|
|
74
58
|
|
|
75
|
-
|
|
76
|
-
- Open `https://rubygems.org/gems/redmineflux_icon_compat`
|
|
77
|
-
- Install test:
|
|
59
|
+
Helper example:
|
|
78
60
|
|
|
79
|
-
```
|
|
80
|
-
|
|
61
|
+
```ruby
|
|
62
|
+
rf_icon_link(:edit, l(:button_edit), edit_path(record))
|
|
81
63
|
```
|
|
82
64
|
|
|
83
|
-
|
|
65
|
+
### 6) Restart Redmine
|
|
84
66
|
|
|
85
|
-
|
|
67
|
+
Restart the app server after gem/helper changes so code reload is clean.
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
gem owner redmineflux_icon_compat --add teammate@example.com
|
|
89
|
-
```
|
|
69
|
+
## Troubleshooting
|
|
90
70
|
|
|
91
|
-
|
|
71
|
+
If you still see old icons:
|
|
72
|
+
- clear cache: `rm -rf tmp/cache/*`
|
|
73
|
+
- reinstall dependencies: `bundle install`
|
|
74
|
+
- restart Redmine
|
|
75
|
+
- hard refresh browser (`Ctrl+Shift+R`)
|
|
92
76
|
|
|
93
|
-
##
|
|
77
|
+
## Run Tests
|
|
94
78
|
|
|
95
|
-
|
|
79
|
+
From Redmine root:
|
|
96
80
|
|
|
97
|
-
```
|
|
98
|
-
|
|
81
|
+
```bash
|
|
82
|
+
ruby plugins/redmineflux_icon_compat/test/helper_test.rb
|
|
99
83
|
```
|
|
100
84
|
|
|
101
|
-
|
|
85
|
+
From this gem directory:
|
|
102
86
|
|
|
103
87
|
```bash
|
|
104
|
-
|
|
88
|
+
ruby test/helper_test.rb
|
|
105
89
|
```
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module RedminefluxIconCompat
|
|
4
|
+
# View helper methods for rendering icon links that work on both
|
|
5
|
+
# Redmine 5 (legacy CSS icons) and Redmine 6 (SVG sprite icons).
|
|
4
6
|
module Helper
|
|
5
7
|
RF_ICON_MAP = {
|
|
6
8
|
delete: { legacy: 'del', sprite: 'del' },
|
|
@@ -10,7 +12,13 @@ module RedminefluxIconCompat
|
|
|
10
12
|
save: { legacy: 'save', sprite: 'save' }
|
|
11
13
|
}.freeze
|
|
12
14
|
|
|
13
|
-
#
|
|
15
|
+
# Builds a link with icon markup compatible with Redmine 5/6.
|
|
16
|
+
#
|
|
17
|
+
# @param icon [Symbol, String] icon key (for example: :add, :edit, :delete)
|
|
18
|
+
# @param label [String] human readable label text
|
|
19
|
+
# @param href [String] target URL
|
|
20
|
+
# @param html_options [Hash] HTML options passed to +link_to+
|
|
21
|
+
# @return [String] HTML link markup
|
|
14
22
|
def rf_icon_link(icon, label, href = '#', html_options = {})
|
|
15
23
|
icon_names = rf_icon_names(icon)
|
|
16
24
|
options = (html_options || {}).dup
|
|
@@ -26,7 +34,9 @@ module RedminefluxIconCompat
|
|
|
26
34
|
link_to(content, href, options)
|
|
27
35
|
end
|
|
28
36
|
|
|
29
|
-
#
|
|
37
|
+
# Detects whether SVG sprite rendering is currently available.
|
|
38
|
+
#
|
|
39
|
+
# @return [Boolean]
|
|
30
40
|
def rf_sprite_icons_available?
|
|
31
41
|
respond_to?(:sprite_icon, true) || rf_global_sprite_helper_available?
|
|
32
42
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Entry point for the redmineflux_icon_compat gem.
|
|
3
4
|
require_relative 'redmineflux_icon_compat/version'
|
|
4
5
|
require_relative 'redmineflux_icon_compat/helper'
|
|
5
6
|
require_relative 'redmineflux_icon_compat/railtie' if defined?(Rails::Railtie)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redmineflux_icon_compat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Redmineflux
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -46,6 +46,7 @@ executables: []
|
|
|
46
46
|
extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
|
48
48
|
files:
|
|
49
|
+
- CHANGELOG.md
|
|
49
50
|
- LICENSE.txt
|
|
50
51
|
- README.md
|
|
51
52
|
- lib/redmineflux_icon_compat.rb
|