Commit b513985fd902392a1df010cc3f518e7b28b75ab0

Authored by Francisco Marcelo de Araújo Lima Júnior
1 parent 9d2306f2

#community dashboard - fixes

plugins/community_hub/controllers/public/community_hub_plugin_public_controller.rb
@@ -165,9 +165,8 @@ class CommunityHubPluginPublicController < PublicController @@ -165,9 +165,8 @@ class CommunityHubPluginPublicController < PublicController
165 def pin_message 165 def pin_message
166 message = Comment.find(params[:message]) 166 message = Comment.find(params[:message])
167 hub = Article.find(params[:hub]) 167 hub = Article.find(params[:hub])
168 - community = Profile.find(params[:community])  
169 168
170 - mediation = make_mediation_from_message(community, hub, message) 169 + mediation = make_mediation_from_message(hub, message)
171 mediation.save 170 mediation.save
172 171
173 if mediation && mediation.save 172 if mediation && mediation.save
@@ -195,11 +194,11 @@ class CommunityHubPluginPublicController < PublicController @@ -195,11 +194,11 @@ class CommunityHubPluginPublicController < PublicController
195 end 194 end
196 195
197 196
198 - def make_mediation_from_message(community, hub, message) 197 + def make_mediation_from_message(hub, message)
199 begin 198 begin
200 mediation = Article.new 199 mediation = Article.new
201 200
202 - mediation.profile = community 201 + mediation.profile = hub.profile
203 mediation.parent = hub 202 mediation.parent = hub
204 mediation.name = mediation_timestamp 203 mediation.name = mediation_timestamp
205 mediation.body = message.body 204 mediation.body = message.body
@@ -217,7 +216,6 @@ class CommunityHubPluginPublicController < PublicController @@ -217,7 +216,6 @@ class CommunityHubPluginPublicController < PublicController
217 mediation.published = true 216 mediation.published = true
218 mediation.license_id = "" 217 mediation.license_id = ""
219 mediation.category_ids = [] 218 mediation.category_ids = []
220 - #mediation.save  
221 rescue 219 rescue
222 mediation = nil 220 mediation = nil
223 end 221 end
plugins/community_hub/public/javascripts/community_hub.js
@@ -87,7 +87,7 @@ function pin_message(post_id) { @@ -87,7 +87,7 @@ function pin_message(post_id) {
87 url: '/plugin/community_hub/public/pin_message', 87 url: '/plugin/community_hub/public/pin_message',
88 type: 'get', 88 type: 'get',
89 dataType: 'json', 89 dataType: 'json',
90 - data: { id: post_id, hub: hub_id }, 90 + data: { message: post_id, hub: hub_id },
91 success: function(data) { 91 success: function(data) {
92 }, 92 },
93 error: function(ajax, stat, errorThrown) { 93 error: function(ajax, stat, errorThrown) {
plugins/community_hub/public/style.css
@@ -108,18 +108,22 @@ @@ -108,18 +108,22 @@
108 text-indent: -10000px; 108 text-indent: -10000px;
109 } 109 }
110 110
111 -.hub .promote { 111 +/*
  112 +.hub .promoted {
112 background: url("images/hub-promote-icon.png") no-repeat center center #fff; 113 background: url("images/hub-promote-icon.png") no-repeat center center #fff;
113 -} 114 +}*/
114 115
115 -.hub .promote .not-promoted { 116 +.hub .not-promoted {
  117 + /*background: url("images/hub-not-promote-icon.png") no-repeat center center #fff;*/
116 opacity: 0.5; 118 opacity: 0.5;
117 filter: alpha(opacity=50); 119 filter: alpha(opacity=50);
118 } 120 }
119 121
  122 +/*
120 .hub .pin { 123 .hub .pin {
121 background: url("images/hub-pin-icon.png") no-repeat center center #fff; 124 background: url("images/hub-pin-icon.png") no-repeat center center #fff;
122 } 125 }
  126 +*/
123 127
124 .hub .pin .not-pinned { 128 .hub .pin .not-pinned {
125 opacity: 0.5; 129 opacity: 0.5;
@@ -138,8 +142,8 @@ @@ -138,8 +142,8 @@
138 margin-bottom: 10px; 142 margin-bottom: 10px;
139 } 143 }
140 144
141 -.hub ul.mediation-comment-list li{  
142 - padding-left: 10px; 145 +.hub ul.mediation-comment-list li {
  146 + margin-bottom: 2px;
143 } 147 }
144 148
145 /**/ 149 /**/
@@ -335,4 +339,5 @@ textarea#message_body { @@ -335,4 +339,5 @@ textarea#message_body {
335 border-radius: 5px; 339 border-radius: 5px;
336 font-weight: bold; 340 font-weight: bold;
337 margin-bottom: -5px; 341 margin-bottom: -5px;
338 -}  
339 \ No newline at end of file 342 \ No newline at end of file
  343 +}
  344 +
plugins/community_hub/views/community_hub_plugin_public/_mediation.rhtml
@@ -15,16 +15,16 @@ @@ -15,16 +15,16 @@
15 <li class="promote"> 15 <li class="promote">
16 <% if !promoted?(hub, mediation.author.id) %> 16 <% if !promoted?(hub, mediation.author.id) %>
17 <a id="<%= mediation.id %>" href="#" onclick="promote_user(<%= mediation.author.id %>); return false;"> 17 <a id="<%= mediation.id %>" href="#" onclick="promote_user(<%= mediation.author.id %>); return false;">
18 - <img class="promoted" src="/designs/icons/default/outras/16x16/actions/spread.png" /> 18 + <img class="promoted" src="/designs/themes/default/images/hub-promote-icon.png" />
19 </a> 19 </a>
20 <% else %> 20 <% else %>
21 - <img class="not-promoted" src="/designs/icons/default/outras/16x16/actions/spread.png" /> 21 + <img class="not-promoted" src="/designs/themes/default/images/hub-not-promote-icon.png" />
22 <% end %> 22 <% end %>
23 </li> 23 </li>
24 24
25 <% if pinned_mediation?(hub, mediation.id) %> 25 <% if pinned_mediation?(hub, mediation.id) %>
26 <li class="pin"> 26 <li class="pin">
27 - <img class="pinned" src="/designs/icons/default/outras/16x16/apps/tags.gif" /> 27 + <img class="pinned" src="/designs/themes/default/images/hub-not-pinned-icon.png" />
28 </li> 28 </li>
29 <% end %> 29 <% end %>
30 30
plugins/community_hub/views/community_hub_plugin_public/_post.rhtml
@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 <li class="time"><%= post_time(post.created_at) %></li> 5 <li class="time"><%= post_time(post.created_at) %></li>
6 <li class="avatar"> 6 <li class="avatar">
7 <% if post.title == 'hub-message-twitter' %> 7 <% if post.title == 'hub-message-twitter' %>
8 - <%= image_tag('/designs/themes/default/images/logo_twitter_bird_blue_50x50.png', :alt => "Twitter") %> 8 + <%= image_tag('/designs/themes/default/images/logo_twitter_bird_white_50x50.png', :alt => "Twitter") %>
9 <% elsif post.title == 'hub-message-facebook' %> 9 <% elsif post.title == 'hub-message-facebook' %>
10 - <%= image_tag('/designs/themes/default/images/logo-facebook-50x50.png', :alt => "Facebook") %> 10 + <%= image_tag('/designs/themes/default/images/logo_facebook_50x50.png', :alt => "Facebook") %>
11 <% else %> 11 <% else %>
12 <%= image_tag(profile_icon(post.author, :minor)) %> 12 <%= image_tag(profile_icon(post.author, :minor)) %>
13 <% end %> 13 <% end %>
@@ -19,15 +19,22 @@ @@ -19,15 +19,22 @@
19 19
20 <ul> 20 <ul>
21 <li class="promote"> 21 <li class="promote">
22 - <img class="<%= !promoted?(hub, post.author.id) ? "promoted" : "not-promoted" %>" src="/designs/icons/default/outras/16x16/actions/spread.png" /> 22 + <% if promoted?(hub, post.author.id) == 'promoted' %>
  23 + <a id="<%= post.id %>" href="#" onclick="pin_message(<%= post.id %>); return false;">
  24 + <img class="promoted" src="/designs/themes/default/images/hub-promote-icon.png" />
  25 + </a>
  26 + <% else %>
  27 + <img class="not-promoted" src="/designs/themes/default/images/hub-not-promote-icon.png" />
  28 + <% end %>
  29 +
23 </li> 30 </li>
24 <li class="pin"> 31 <li class="pin">
25 <% if !pinned_message?(hub, post.id) %> 32 <% if !pinned_message?(hub, post.id) %>
26 <a id="<%= post.id %>" href="#" onclick="pin_message(<%= post.id %>); return false;"> 33 <a id="<%= post.id %>" href="#" onclick="pin_message(<%= post.id %>); return false;">
27 - <img class="pinned" src="/designs/icons/default/outras/16x16/apps/tags.gif" /> 34 + <img class="not-pinned" src="/designs/themes/default/images/hub-pinned-icon.png" />
28 </a> 35 </a>
29 <% else %> 36 <% else %>
30 - <img class="not-pinned" src="/designs/icons/default/outras/16x16/apps/tags.gif" /> 37 + <img class="pinned" src="/designs/themes/default/images/hub-not-pinned-icon.png" />
31 <% end %> 38 <% end %>
32 </li> 39 </li>
33 </ul> 40 </ul>