diff --git a/plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb b/plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb index ddc2f78..142b883 100644 --- a/plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb +++ b/plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb @@ -36,4 +36,11 @@ class ProposalsDiscussionPlugin::Topic < Folder @max ||= [1, proposals.maximum(:comments_count)].max end + def proposal_tags + proposals.tag_counts.inject({}) do |memo,tag| + memo[tag.name] = tag.count + memo + end + end + end diff --git a/plugins/proposals_discussion/public/style.css b/plugins/proposals_discussion/public/style.css index 4be0a65..ec01194 100644 --- a/plugins/proposals_discussion/public/style.css +++ b/plugins/proposals_discussion/public/style.css @@ -170,3 +170,18 @@ form .proposals-discussion-plugin .body textarea { position: absolute; top: -18px; } + +#content .tag_cloud a { + text-decoration: none; +} + +#content .statistics { + display: inline-block; +} +#content .tag_cloud { + float: right; + width: 300px; + box-shadow: 5px 5px 5px -2px #ddd; + background-color: rgb(248, 248, 248); + min-height: 50px; +} diff --git a/plugins/proposals_discussion/views/content_viewer/topic.html.erb b/plugins/proposals_discussion/views/content_viewer/topic.html.erb index b9c62f0..081e48c 100644 --- a/plugins/proposals_discussion/views/content_viewer/topic.html.erb +++ b/plugins/proposals_discussion/views/content_viewer/topic.html.erb @@ -15,25 +15,30 @@ <% unless list_view %>

<%= topic.discussion.title %>

-
- <%= _('Number of Proposals: ') %> - <%= topic.proposals.count %> +
+
+ <%= _('Number of Proposals: ') %> + <%= topic.proposals.count %> +
+
+ <%= _('Number of Participants: ') %> + <%= topic.proposals_authors.count %> +
+
+ <%= _('Number of Comments: ') %> + <%= topic.proposals_comments.count %> +
+
+ <%= _('Most active: ') %> + + <% topic.most_active_participants.each do |author| %> + <%= link_to profile_image(author, :icon), author.url, :title => author.name %> + <% end %> + +
-
- <%= _('Number of Participants: ') %> - <%= topic.proposals_authors.count %> -
-
- <%= _('Number of Comments: ') %> - <%= topic.proposals_comments.count %> -
-
- <%= _('Most active: ') %> - - <% topic.most_active_participants.each do |author| %> - <%= link_to profile_image(author, :icon), author.url, :title => author.name %> - <% end %> - +
+ <%= tag_cloud(topic.proposal_tags, :tag, {:action => :tag, :controller => 'search'}, :max_size => 18, :min_size => 10) %>
<% end %> -- libgit2 0.21.2