Commit c9ab59ddbd15371847a0a24781b4ecf04b9d91fa
Exists in
staging
and in
4 other branches
Merge branch 'AI3220_proposals' into stable
Showing
7 changed files
with
32 additions
and
6 deletions
Show diff stats
plugins/proposals_discussion/lib/proposals_discussion_plugin/proposal.rb
plugins/proposals_discussion/lib/proposals_discussion_plugin/topic_helper.rb
1 | 1 | module ProposalsDiscussionPlugin::TopicHelper |
2 | 2 | |
3 | 3 | def topic_title(topic) |
4 | - content_tag(:div, '', :class=>'topic-color', :style => "background-color: #{topic.color};") + | |
5 | - content_tag(:h2, link_to(topic.title, topic.view_url)) | |
4 | + image_icon = topic.image ? image_tag(topic.image.public_filename(:thumb), :class => 'disable-zoom') : '' | |
5 | + | |
6 | + content_tag(:div, ( | |
7 | + content_tag(:div, '', :class=>'topic-color', :style => "background-color: #{topic.color};") + | |
8 | + content_tag(:h2, link_to(image_icon + content_tag(:span, topic.title), topic.view_url)) | |
9 | + ), :class => 'topic-title') | |
6 | 10 | end |
7 | 11 | |
8 | 12 | end | ... | ... |
plugins/proposals_discussion/public/proposals_list.js
plugins/proposals_discussion/public/style.css
... | ... | @@ -156,11 +156,14 @@ form .proposals-discussion-plugin .body textarea { |
156 | 156 | #content .topic-item h2 a, #article .article-body-proposals-discussion-plugin_topic h2 a, |
157 | 157 | #content .topic h2 a { |
158 | 158 | text-decoration: none; |
159 | - padding: 10px; | |
160 | 159 | display: inline-block; |
161 | 160 | width: 94%; |
162 | 161 | color: white; |
163 | 162 | } |
163 | +#content .topic-title h2 span { | |
164 | + padding: 10px; | |
165 | + display: inline-block; | |
166 | +} | |
164 | 167 | .topic-item .topic-content, #article .article-body-proposals-discussion-plugin_topic .topic-content { |
165 | 168 | padding: 5px 7px 5px 2px; |
166 | 169 | } |
... | ... | @@ -223,3 +226,9 @@ form .proposals-discussion-plugin .body textarea { |
223 | 226 | .proposal .actions .fb-share-button { |
224 | 227 | top: -3px; |
225 | 228 | } |
229 | + | |
230 | +.topic-title h2 img { | |
231 | + max-height: 36px; | |
232 | + vertical-align: middle; | |
233 | + padding: 4px 0 4px 4px; | |
234 | +} | ... | ... |
plugins/proposals_discussion/views/cms/proposals_discussion_plugin/_topic.html.erb
... | ... | @@ -11,3 +11,8 @@ |
11 | 11 | |
12 | 12 | <%= labelled_colorpicker_field(_('Color:'), :article, :color) %> |
13 | 13 | <span id="color_preview" class = "color_marker" style="background-color: <%= @article.color %>" ></span> |
14 | + | |
15 | +<%= f.fields_for :image_builder, @article.image do |i| %> | |
16 | + <%= file_field_or_thumbnail(_('Image:'), @article.image, i)%> | |
17 | + <%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> | |
18 | +<% end %> | ... | ... |
plugins/proposals_discussion/views/content_viewer/proposal.html.erb
... | ... | @@ -2,9 +2,10 @@ |
2 | 2 | <h5><%= @page.topic.discussion.title %> </h5> |
3 | 3 | </div> |
4 | 4 | |
5 | +<% extend ProposalsDiscussionPlugin::TopicHelper %> | |
6 | + | |
5 | 7 | <div class="topic"> |
6 | - <div class="topic-color" style="background-color: <%= @page.topic.color %>;"></div> | |
7 | - <h2><%= link_to @page.topic.title, @page.topic.view_url %></h2> | |
8 | + <%= topic_title @page.topic %> | |
8 | 9 | </div> |
9 | 10 | |
10 | 11 | <div class="title"> | ... | ... |
public/javascripts/application.js
... | ... | @@ -1037,7 +1037,7 @@ jQuery(document).ready(function(){ |
1037 | 1037 | function apply_zoom_to_images(zoom_text) { |
1038 | 1038 | jQuery(function($) { |
1039 | 1039 | $(window).load( function() { |
1040 | - $('#article .article-body img').each( function(index) { | |
1040 | + $('#article .article-body img:not(.disable-zoom)').each( function(index) { | |
1041 | 1041 | var original = original_image_dimensions($(this).attr('src')); |
1042 | 1042 | if ($(this).width() < original['width'] || $(this).height() < original['height']) { |
1043 | 1043 | $(this).wrap('<div class="zoomable-image" />'); | ... | ... |