Commit 89e4ec8046bcae35c465b35b77e45ce1c186b89b

Authored by Victor Costa
1 parent e4ca041c

proposals_discussion: added image icon in topics

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/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 %>
... ...