Skip to content

Commit 96a1802

Browse files
authored
Merge pull request #69 from farend/change-icons-to-svg
Change icons to svg
2 parents 8e46dd5 + d1df8f9 commit 96a1802

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- redmine-repository: 'redmica/redmica'
15-
redmine-version: 'stable-3.0'
16-
ruby-version: '3.3'
1714
- redmine-repository: 'redmica/redmica'
1815
redmine-version: 'master'
1916
ruby-version: '3.3'

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# redmine_message_customize
22

33
This is a plugin for Redmine.
4-
This plugin changes the translation of the wording on the screen defined in "config/locales/*.yml" in the admin view.
4+
This plugin changes the translation of the wording on the screen defined in "config/locales/*.yml" in the admin view.
5+
It is available for Redmine 6.0 or later.
56

67
## Install
78

89
```
910
$ cd /your/path/redmine
1011
$ git clone https://github.com/farend/redmine_message_customize.git plugins/redmine_message_customize
11-
$ # When Redmine 4.1 or lower versions
12-
$ cp plugins/redmine_message_customize/35_change_load_order_locales.rb config/initializers/35_change_load_order_locales.rb
1312
$ # redmine restart
1413
```
1514

16-
:warning: To customize messages for other plugins in **Redmine 4.1 or lower versions**, redmine_message_customize/35_change_load_order_locales.rb It is necessary to copy the file to redmine/config/initializers.
17-
If redmine/config/initializers/35_change_load_order_locales.rb is missing, only non-plugin messages can be customized.
18-
1915
## Usage
2016

2117
* 1: Open setting page

app/helpers/custom_message_settings_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ def normal_mode_input_fields(setting, lang)
1717
content += content_tag(:p) do
1818
content_tag(:label, k) +
1919
text_field_tag("settings[custom_messages][#{k}]", v.to_s) +
20-
link_to_function('', '$(this).closest("p").remove();', class: 'icon icon-del clear-key-link')
20+
link_to_function(sprite_icon('del'), '$(this).closest("p").remove()', class: 'icon clear-key-link')
2121
end
2222
end
2323
content
2424
end
2525

2626
def open_default_messages_window_link(lang)
27-
link_to l(:label_default_messages),
27+
link_to sprite_icon('file', l(:label_default_messages)),
2828
default_messages_custom_message_settings_path(lang: lang),
29-
class: 'icon icon-file text-plain',
29+
class: 'icon text-plain',
3030
onclick: "window.open(this.href,'redmine_message_customize_plugin-default_messages', 'height=800, width=500');return false;",
3131
id: 'default-messages-link'
3232
end
33-
end
33+
end

app/views/custom_message_settings/_messages.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div>
22
<%= select_tag 'select-key', available_message_options(@setting, lang), id: 'key-selector' %>
3-
<span class='icon icon-help'><%= l(:text_description_of_search_box) %></span>
3+
<span class='icon'><%= sprite_icon('help', l(:text_description_of_search_box)) %></span>
44
</div>
55
<br>
66
<div class='tabular'>
@@ -43,10 +43,10 @@ function AddMessageInputField(key, val){
4343
name: 'settings[custom_messages][' + key + ']'
4444
}).appendTo($('#edit-custom-messages .tabular p:first'));
4545
$('<a>').attr({
46-
class: 'icon icon-del clear-key-link',
46+
class: 'icon clear-key-link',
4747
href: '#',
48-
onclick: '$(this).closest("p").remove();; return false;'
49-
}).appendTo($('#edit-custom-messages .tabular p:first'));
48+
onclick: '$(this).closest("p").remove(); return false;'
49+
}).html('<%= sprite_icon('del') %>').appendTo($('#edit-custom-messages .tabular p:first'));
5050
$('#key-selector').val('').change();
5151
$('#key-selector option[value="' + key + '"]').prop("disabled", true).change();
5252
setSelect2();

app/views/custom_message_settings/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<% end %>
99

1010
<div class='message-customize-menu contextual'>
11-
<%= link_to (@setting.enabled? ? l(:label_disable_customize) : l(:label_enable_customize)), toggle_enabled_custom_message_settings_path, method: :post, class: 'icon icon-settings' %> /
11+
<%= link_to sprite_icon('settings', (@setting.enabled? ? l(:label_disable_customize) : l(:label_enable_customize))), toggle_enabled_custom_message_settings_path, method: :post, class: 'icon' %> /
1212
<%= open_default_messages_window_link(@lang) %>
1313
</div>
1414

init.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
author_url 'https://github.com/farend'
1414
settings default: { custom_messages: {} }
1515
menu :admin_menu, :custom_messages, { controller: 'custom_message_settings', action: 'edit' },
16-
caption: :label_custom_messages, html: { class: 'icon icon-edit' }
17-
requires_redmine version_or_higher: '3.2'
16+
caption: :label_custom_messages, html: { class: 'icon' }, icon: 'edit'
17+
requires_redmine version_or_higher: '6.0'
1818
end
1919

2020
Rails.application.config.i18n.load_path += Dir.glob(File.join(p.directory, 'config', 'locales', 'custom_messages', '*.rb'))

0 commit comments

Comments
 (0)