diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 0000000..af401e5 --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,6 @@ +# Spanish strings go here for Rails i18n +es: + label_ok: "Aceptar" + label_dismiss: "Descartar" + label_news: "Noticias" + label_message: "Mensajes" \ No newline at end of file diff --git a/init.rb b/init.rb index 6d5481d..a4656a0 100644 --- a/init.rb +++ b/init.rb @@ -1,11 +1,16 @@ require 'redmine' -require 'sticky_messages_application_hooks' Redmine::Plugin.register :redmine_sticky_messages do name 'Redmine Sticky Messages plugin' author 'Jong-Ha Ahn' description 'This is a plugin for Redmine' - version '1.0.1' + version '1.0.2' url 'http://github.com/jongha/redmine_sticky_messages' author_url 'http://www.mrlatte.net' -end + + require File.expand_path('lib/sticky_messages_application/hooks', __dir__) + + if Rails.configuration.respond_to?(:autoloader) && Rails.configuration.autoloader == :zeitwerk + Rails.autoloaders.each { |loader| loader.ignore(File.expand_path('lib/sticky_messages_application', __dir__)) } + end +end \ No newline at end of file diff --git a/lib/sticky_messages_application/hooks.rb b/lib/sticky_messages_application/hooks.rb new file mode 100644 index 0000000..3eeb3e8 --- /dev/null +++ b/lib/sticky_messages_application/hooks.rb @@ -0,0 +1,13 @@ +module StickyMessagesHeaderHooks + class Hooks < Redmine::Hook::ViewListener + def view_layouts_base_html_head(context = {}) + o = stylesheet_link_tag('sticky_messages', :plugin => 'redmine_sticky_messages') + o << stylesheet_link_tag('buttons', :plugin => 'redmine_sticky_messages') + o << javascript_include_tag('sticky_messages', :plugin => 'redmine_sticky_messages') + o << javascript_include_tag('jquery.noty.packaged.min.js', :plugin => 'redmine_sticky_messages') + return o + end + + render_on :view_layouts_base_body_bottom, :partial => 'messages/after_top_menu' + end +end \ No newline at end of file diff --git a/lib/sticky_messages_application_hooks.rb b/lib/sticky_messages_application_hooks.rb deleted file mode 100644 index b9c8469..0000000 --- a/lib/sticky_messages_application_hooks.rb +++ /dev/null @@ -1,14 +0,0 @@ -class StickyMessagesHeaderHooks < Redmine::Hook::ViewListener - - def view_layouts_base_html_head(context = {}) - o = stylesheet_link_tag('sticky_messages', :plugin => 'redmine_sticky_messages') - o << stylesheet_link_tag('buttons', :plugin => 'redmine_sticky_messages') - o << javascript_include_tag('sticky_messages', :plugin => 'redmine_sticky_messages') - o << javascript_include_tag('jquery.noty.packaged.min.js', :plugin => 'redmine_sticky_messages') - return o - end -end - -class StickyMessageTopMenuHooks < Redmine::Hook::ViewListener - render_on :view_layouts_base_body_bottom, :partial => 'messages/after_top_menu' -end \ No newline at end of file