Commit 79998632dc46a0c6e29508aaeff06b08caf5a51e

Authored by Francisco Marcelo de Araújo Lima Júnior
1 parent 8703a837
Exists in master

#community dashboard - fixes

controllers/public/community_hub_plugin_public_controller.rb
... ... @@ -165,9 +165,8 @@ class CommunityHubPluginPublicController < PublicController
165 165 def pin_message
166 166 message = Comment.find(params[:message])
167 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 170 mediation.save
172 171  
173 172 if mediation && mediation.save
... ... @@ -195,11 +194,11 @@ class CommunityHubPluginPublicController < PublicController
195 194 end
196 195  
197 196  
198   - def make_mediation_from_message(community, hub, message)
  197 + def make_mediation_from_message(hub, message)
199 198 begin
200 199 mediation = Article.new
201 200  
202   - mediation.profile = community
  201 + mediation.profile = hub.profile
203 202 mediation.parent = hub
204 203 mediation.name = mediation_timestamp
205 204 mediation.body = message.body
... ... @@ -217,7 +216,6 @@ class CommunityHubPluginPublicController < PublicController
217 216 mediation.published = true
218 217 mediation.license_id = ""
219 218 mediation.category_ids = []
220   - #mediation.save
221 219 rescue
222 220 mediation = nil
223 221 end
... ...
public/javascripts/community_hub.js
... ... @@ -87,7 +87,7 @@ function pin_message(post_id) {
87 87 url: '/plugin/community_hub/public/pin_message',
88 88 type: 'get',
89 89 dataType: 'json',
90   - data: { id: post_id, hub: hub_id },
  90 + data: { message: post_id, hub: hub_id },
91 91 success: function(data) {
92 92 },
93 93 error: function(ajax, stat, errorThrown) {
... ...
public/style.css
... ... @@ -108,18 +108,22 @@
108 108 text-indent: -10000px;
109 109 }
110 110  
111   -.hub .promote {
  111 +/*
  112 +.hub .promoted {
112 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 118 opacity: 0.5;
117 119 filter: alpha(opacity=50);
118 120 }
119 121  
  122 +/*
120 123 .hub .pin {
121 124 background: url("images/hub-pin-icon.png") no-repeat center center #fff;
122 125 }
  126 +*/
123 127  
124 128 .hub .pin .not-pinned {
125 129 opacity: 0.5;
... ... @@ -138,8 +142,8 @@
138 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 339 border-radius: 5px;
336 340 font-weight: bold;
337 341 margin-bottom: -5px;
338   -}
339 342 \ No newline at end of file
  343 +}
  344 +
... ...
views/community_hub_plugin_public/_mediation.rhtml
... ... @@ -15,16 +15,16 @@
15 15 <li class="promote">
16 16 <% if !promoted?(hub, mediation.author.id) %>
17 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 19 </a>
20 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 22 <% end %>
23 23 </li>
24 24  
25 25 <% if pinned_mediation?(hub, mediation.id) %>
26 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 28 </li>
29 29 <% end %>
30 30  
... ...
views/community_hub_plugin_public/_post.rhtml
... ... @@ -5,9 +5,9 @@
5 5 <li class="time"><%= post_time(post.created_at) %></li>
6 6 <li class="avatar">
7 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 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 11 <% else %>
12 12 <%= image_tag(profile_icon(post.author, :minor)) %>
13 13 <% end %>
... ... @@ -19,15 +19,22 @@
19 19  
20 20 <ul>
21 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 30 </li>
24 31 <li class="pin">
25 32 <% if !pinned_message?(hub, post.id) %>
26 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 35 </a>
29 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 38 <% end %>
32 39 </li>
33 40 </ul>
... ...