Skip to content

Commit

Permalink
working on tabler icons integration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 5, 2024
1 parent 0472465 commit 9313188
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 31 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,37 @@ rm -rf plugins/additional_tags
This plugin is licensed under the terms of GNU/GPL v2.
See LICENSE for details.

## Redmine Copyright

The additional_tags is a plugin extension for Redmine Project Management Software, whose Copyright follows.
Copyright (C) 2006- Jean-Philippe Lang

Redmine is a flexible project management web application written using Ruby on Rails framework.
More details can be found in the doc directory or on the official website <http://www.redmine.org>

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.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

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.

## Credits

### Code

The source code is a (almost) rewrite of

- [redmine_tags](https://github.com/ixti/redmine_tags)
- [redmineup_tags](https://www.redmine.org/plugins/redmineup_tags)

Special thanks to the original author and contributors for making this awesome hook for Redmine.

### Icons

Thanks to:

- Font Awesome Free Icons (<https://fontawesome.com/license/free>) licenced under - Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License.
Copyright (c) 2018- Fonticons, Inc.
- Tabler Icons - Free and open source icons (<https://tabler.io/icons>) licensed under MIT License.
Copyright (c) 2020- Paweł Kuna
2 changes: 1 addition & 1 deletion app/controllers/additional_tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def edit; end
def update
@tag.name = params[:tag][:name] if params[:tag]
if @tag.save
flash[:notice] = l :notice_successful_update
flash[:notice] = flash_msg :update
respond_to do |format|
format.html do
redirect_to @tag_list_path
Expand Down
20 changes: 9 additions & 11 deletions app/helpers/additional_tags_wiki_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,24 @@ def render_sidebar_tags
render_tags_list sidebar_tags, **options
end

def render_wiki_index_title(project: nil, name: nil, tag: nil, title: :label_wiki)
def render_wiki_index_title(title, project: nil, name: nil, tag: nil)
title = l title unless is_a? Symbol

if tag.present?
tag_object = ActsAsTaggableOn::Tag.new name: tag

if project
safe_join [l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' '
else
title = [link_to(l(title), wiki_index_path)]
title << Additionals::LIST_SEPARATOR
title << l(:label_wiki_index_for_tag)
title << additional_tag_link(tag_object, link: '#')
safe_join title, ' '
items = [link_to(title, wiki_index_path)]
items << safe_join([l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' ')
render_breadcrumb items
end
elsif name.present?
title = [link_to(l(title), wiki_index_path)]
title << Additionals::LIST_SEPARATOR
title << name
safe_join title, ' '
render_breadcrumb [link_to(title, wiki_index_path),
name]
else
l title
title
end
end
end
2 changes: 1 addition & 1 deletion app/views/common/_tag_summary_block.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ul.reporting-list.tag-summary
ul.dashboard-list.tag-summary
li.amount-tags
= l :label_amount_tags
' :
Expand Down
2 changes: 1 addition & 1 deletion app/views/wiki/tag_index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- if User.current.allowed_to? :edit_wiki_pages, @project
= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), remote: true, class: 'icon icon-add'

h2 = render_wiki_index_title project: @project, tag: @tag
h2 = render_wiki_index_title :label_wiki, project: @project, tag: @tag

- if @pages.empty?
p.nodata = l :label_no_data
Expand Down
2 changes: 1 addition & 1 deletion lib/additional_tags/patches/wiki_controller_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def update_tags
@page.safe_attributes = [:tag_list]
@page.tag_list = params[:wiki_page][:tag_list].to_a.reject(&:empty?)
flash[:notice] = if @page.save
l :notice_successful_update
flash_msg :update
else
t :notice_failed_to_add_tags
end
Expand Down
21 changes: 5 additions & 16 deletions test/unit/i18n_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,10 @@ def test_valid_languages
end

def test_locales_validness
lang_files_count = Rails.root.glob('plugins/additional_tags/config/locales/*.yml').size

assert_equal 13, lang_files_count
valid_languages.each do |lang|
assert set_language_if_valid(lang)
case lang.to_s
when 'en'

assert_equal 'Merge selected tags', l(:label_merge_selected_tags)
when 'bg', 'cs', 'de', 'es', 'fa', 'fr', 'it', 'ja', 'ko', 'pl', 'pt-BR', 'ru'

assert_not l(:label_merge_selected_tags) == 'Merge selected tags', lang
end
end

set_language_if_valid 'en'
assert_locales_validness plugin: 'additional_tags',
file_cnt: 13,
locales: %w[bg cs de es fa fr it ja ko pl pt-BR ru],
control_string: :label_merge_selected_tags,
control_english: 'Merge selected tags'
end
end

0 comments on commit 9313188

Please sign in to comment.