Commit 2bb8d680857884b2fdacd0a316f7591b67e2455b
1 parent
0505a73e
Exists in
master
#community dashboard - fixes
Showing
3 changed files
with
29 additions
and
15 deletions
Show diff stats
public/javascripts/community_hub.js
... | ... | @@ -31,7 +31,7 @@ function new_mediation_comment(button, mediation) { |
31 | 31 | jQuery.post(form.attr("action"), form.serialize(), function(data) { |
32 | 32 | jQuery(".loading-mediation-comment").filter("#" + mediation).removeClass("loading-signal-processing"); |
33 | 33 | if (data.ok) { |
34 | - jQuery(".hub .form #message_body").val(''); | |
34 | + jQuery("#mediation-comment-form-" + mediation + " textarea").val(''); | |
35 | 35 | jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-done"); |
36 | 36 | setTimeout(function(){ |
37 | 37 | clearLoadingMediationCommentSignal(mediation); |
... | ... | @@ -117,7 +117,7 @@ function pin_message(post_id) { |
117 | 117 | type: 'get', |
118 | 118 | dataType: 'json', |
119 | 119 | data: { message: post_id, hub: hub_id }, |
120 | - success: function(data) { | |
120 | + success: function(data) { | |
121 | 121 | }, |
122 | 122 | error: function(ajax, stat, errorThrown) { |
123 | 123 | console.log(stat); |
... | ... | @@ -137,8 +137,6 @@ function update_mediation_comments(mediation) { |
137 | 137 | var latest_post_id = jQuery("#mediation-comment-list-" + mediation + " li.mediation-comment").last().attr('id'); |
138 | 138 | } |
139 | 139 | |
140 | - //console.log(latest_post_id); | |
141 | - | |
142 | 140 | jQuery.ajax({ |
143 | 141 | url: '/plugin/community_hub/public/newer_mediation_comment', |
144 | 142 | type: 'get', |
... | ... | @@ -146,6 +144,7 @@ function update_mediation_comments(mediation) { |
146 | 144 | success: function(data) { |
147 | 145 | if (data.trim().length > 0) { |
148 | 146 | jQuery("#mediation-comment-list-" + mediation + "").append(data); |
147 | + jQuery("#mediation-comment-total-" + mediation).html(jQuery("#mediation-comment-list-" + mediation + " li.mediation-comment").size()); | |
149 | 148 | } |
150 | 149 | }, |
151 | 150 | error: function(ajax, stat, errorThrown) { | ... | ... |
public/style.css
... | ... | @@ -153,6 +153,19 @@ clear: both; |
153 | 153 | margin-bottom: 2px; |
154 | 154 | } |
155 | 155 | |
156 | +.hub .mediation-comment-form { | |
157 | + margin-left: 70px; | |
158 | + margin-top: 10px; | |
159 | +} | |
160 | + | |
161 | +.hub input.button.with-text.icon-add.submit{ | |
162 | + display: block; | |
163 | +} | |
164 | + | |
165 | +.hub ul#mediation-posts .post { | |
166 | + padding-bottom: 10px; | |
167 | +} | |
168 | + | |
156 | 169 | /**/ |
157 | 170 | |
158 | 171 | .hub .live { |
... | ... | @@ -397,3 +410,5 @@ textarea#message_body { |
397 | 410 | .loading-signal-processing { |
398 | 411 | background-image: url(/plugins/community_hub/icons/hub-samarelo.gif); |
399 | 412 | } |
413 | + | |
414 | + | ... | ... |
views/community_hub_plugin_public/_mediation.rhtml
... | ... | @@ -6,12 +6,12 @@ |
6 | 6 | <li class="time"><%= post_time(mediation.created_at) %></li> |
7 | 7 | <li class="avatar"><%= image_tag(profile_icon(mediation.author, :minor)) %></li> |
8 | 8 | <li class="message"><span class="author"><%= mediation.author_name %>:</span> <%= mediation.body %></li> |
9 | - | |
9 | + | |
10 | 10 | <% if mediator?(hub) %> |
11 | 11 | <li class="mediation-bar"> |
12 | 12 | |
13 | 13 | <ul> |
14 | - | |
14 | + | |
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;"> |
... | ... | @@ -38,16 +38,16 @@ |
38 | 38 | <% total_mediation_comments = mediation.comments.count %> |
39 | 39 | |
40 | 40 | <span class="comment-count"> |
41 | - <%= link_to(_( "#{total_mediation_comments} Comments" ) , '#', | |
42 | - :class => 'display-comment-form', | |
43 | - :id => 'top-post-comment-button', | |
41 | + <%= link_to(_( "<span id='mediation-comment-total-#{mediation.id}'>#{total_mediation_comments}</span> Comments" ) , '#', | |
42 | + :class => 'display-comment-form', | |
43 | + :id => 'top-post-comment-button', | |
44 | 44 | :onclick => "toogle_mediation_comments(#{mediation.id}); return false;") %> |
45 | 45 | </span> |
46 | 46 | |
47 | 47 | <script type="text/javascript"> |
48 | 48 | setTimeout(function() { update_mediation_comments('<%= mediation.id %>')}, 5000); |
49 | 49 | </script> |
50 | - | |
50 | + | |
51 | 51 | <ul id="mediation-comment-list-<%=mediation.id%>" class="mediation-comment-list" style="display:none;"> |
52 | 52 | <% if mediation.accept_comments? && mediation.comments.count > 0 %> |
53 | 53 | <%= render :partial => 'community_hub_plugin_public/mediation_comment', :collection => mediation.comments %> |
... | ... | @@ -60,15 +60,15 @@ |
60 | 60 | :locals => { |
61 | 61 | :hub => hub, |
62 | 62 | :mediation => mediation, |
63 | - :comment => Comment.new, | |
63 | + :comment => Comment.new, | |
64 | 64 | :url => { |
65 | - :controller => :comment, | |
65 | + :controller => :comment, | |
66 | 66 | :action => :create |
67 | - }, | |
68 | - :display_link => true, | |
67 | + }, | |
68 | + :display_link => true, | |
69 | 69 | :cancel_triggers_hide => true |
70 | 70 | } %> |
71 | 71 | </div> |
72 | 72 | <% end %> |
73 | 73 | |
74 | -</li> | |
75 | 74 | \ No newline at end of file |
75 | +</li> | ... | ... |