From 66bdeedfb78c9417cc1bf723652c9588d4ce22ff Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Tue, 14 Jun 2016 12:50:06 -0300 Subject: [PATCH] Ticket #85: Put the interests block under the plugin scope --- plugins/person_tags/lib/person_tags_block.rb | 29 ----------------------------- plugins/person_tags/lib/person_tags_plugin.rb | 2 +- plugins/person_tags/lib/person_tags_plugin/interests_block.rb | 29 +++++++++++++++++++++++++++++ plugins/person_tags/views/blocks/interests.html.erb | 14 ++++++++++++++ plugins/person_tags/views/blocks/person_tags.html.erb | 14 -------------- 5 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 plugins/person_tags/lib/person_tags_block.rb create mode 100644 plugins/person_tags/lib/person_tags_plugin/interests_block.rb create mode 100644 plugins/person_tags/views/blocks/interests.html.erb delete mode 100644 plugins/person_tags/views/blocks/person_tags.html.erb diff --git a/plugins/person_tags/lib/person_tags_block.rb b/plugins/person_tags/lib/person_tags_block.rb deleted file mode 100644 index 57ba39e..0000000 --- a/plugins/person_tags/lib/person_tags_block.rb +++ /dev/null @@ -1,29 +0,0 @@ -class PersonTagsBlock < Block - def view_title - self.default_title - end - - def tags - owner.tag_list - end - - def extra_option - {} - end - - def self.description - _('Fields of Interest') - end - - def help - _('Things that this person is interested in') - end - - def default_title - _('Fields of Interest') - end - - def self.expire_on - { profile: [:profile] } - end -end diff --git a/plugins/person_tags/lib/person_tags_plugin.rb b/plugins/person_tags/lib/person_tags_plugin.rb index 9512080..a3f8210 100644 --- a/plugins/person_tags/lib/person_tags_plugin.rb +++ b/plugins/person_tags/lib/person_tags_plugin.rb @@ -22,7 +22,7 @@ class PersonTagsPlugin < Noosfero::Plugin def self.extra_blocks { - PersonTagsBlock => { type: Person } + PersonTagsPlugin::InterestsBlock => { type: Person } } end diff --git a/plugins/person_tags/lib/person_tags_plugin/interests_block.rb b/plugins/person_tags/lib/person_tags_plugin/interests_block.rb new file mode 100644 index 0000000..53fe87c --- /dev/null +++ b/plugins/person_tags/lib/person_tags_plugin/interests_block.rb @@ -0,0 +1,29 @@ +class PersonTagsPlugin::InterestsBlock < Block + def view_title + self.default_title + end + + def tags + owner.tag_list + end + + def extra_option + {} + end + + def self.description + _('Fields of Interest') + end + + def help + _('Things that this person is interested in') + end + + def default_title + _('Fields of Interest') + end + + def self.expire_on + { profile: [:profile] } + end +end diff --git a/plugins/person_tags/views/blocks/interests.html.erb b/plugins/person_tags/views/blocks/interests.html.erb new file mode 100644 index 0000000..64956bb --- /dev/null +++ b/plugins/person_tags/views/blocks/interests.html.erb @@ -0,0 +1,14 @@ +<%= block_title(block.view_title, block.subtitle) %> + +
+ <% unless block.tags.size == 0 %> + + <% else %> +
<%= c_('None') %>
+ <% end %> +
+
diff --git a/plugins/person_tags/views/blocks/person_tags.html.erb b/plugins/person_tags/views/blocks/person_tags.html.erb deleted file mode 100644 index 64956bb..0000000 --- a/plugins/person_tags/views/blocks/person_tags.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= block_title(block.view_title, block.subtitle) %> - -
- <% unless block.tags.size == 0 %> - - <% else %> -
<%= c_('None') %>
- <% end %> -
-
-- libgit2 0.21.2