Commit 6d387ddca7ba17f036d6cb26370ba258819789dd
1 parent
ab168f0f
Exists in
staging
and in
4 other branches
proposals_discussion: added color to topics
Showing
5 changed files
with
53 additions
and
4 deletions
Show diff stats
plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb
| ... | ... | @@ -6,6 +6,10 @@ class ProposalsDiscussionPlugin::Topic < Folder |
| 6 | 6 | has_many :proposals_comments, :class_name => 'Comment', :through => :children, :source => :comments |
| 7 | 7 | has_many :proposals_authors, :class_name => 'Person', :through => :children, :source => :created_by |
| 8 | 8 | |
| 9 | + settings_items :color, :type => :string | |
| 10 | + | |
| 11 | + attr_accessible :color | |
| 12 | + | |
| 9 | 13 | def self.short_description |
| 10 | 14 | _("Discussion topic") |
| 11 | 15 | end | ... | ... |
plugins/proposals_discussion/public/style.css
| ... | ... | @@ -9,10 +9,10 @@ |
| 9 | 9 | background: rgb(236, 236, 236); |
| 10 | 10 | width: 100%; |
| 11 | 11 | min-width: 272px; |
| 12 | - display: table; | |
| 13 | 12 | vertical-align: top; |
| 14 | 13 | margin: 12px 13px 12px 0; |
| 15 | 14 | box-shadow: 5px 5px 5px -2px #ddd; |
| 15 | + height: 100px; | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | .article-body-proposals-discussion-plugin_discussion .actions, |
| ... | ... | @@ -25,6 +25,8 @@ |
| 25 | 25 | border-right: 1px solid; |
| 26 | 26 | border-color: rgb(201, 201, 201); |
| 27 | 27 | padding: 5px; |
| 28 | + vertical-align: middle; | |
| 29 | + height: 100%; | |
| 28 | 30 | } |
| 29 | 31 | .proposal .topic { |
| 30 | 32 | border-right: 0; |
| ... | ... | @@ -46,7 +48,7 @@ |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | #article .proposal a:visited, #article .proposal a { |
| 49 | - color: rgb(94, 94, 94); | |
| 51 | + color: rgb(70, 70, 70); | |
| 50 | 52 | text-decoration: none; |
| 51 | 53 | width: 100%; |
| 52 | 54 | display: inline-block; |
| ... | ... | @@ -59,6 +61,8 @@ |
| 59 | 61 | .proposal .content { |
| 60 | 62 | width: 68%; |
| 61 | 63 | color: rgb(83, 83, 83); |
| 64 | + vertical-align: top; | |
| 65 | + height: 90px; | |
| 62 | 66 | } |
| 63 | 67 | |
| 64 | 68 | .proposal .abstract { |
| ... | ... | @@ -76,3 +80,32 @@ form .proposals-discussion-plugin .abstract textarea { |
| 76 | 80 | form .proposals-discussion-plugin .body textarea { |
| 77 | 81 | height: 400px; |
| 78 | 82 | } |
| 83 | + | |
| 84 | +.topic-color { | |
| 85 | + width: 9px; | |
| 86 | + float: left; | |
| 87 | + height: 100%; | |
| 88 | +} | |
| 89 | + | |
| 90 | +.topics .topic { | |
| 91 | + background-color: rgb(233, 233, 233); | |
| 92 | + margin: 5px 0; | |
| 93 | + height: 25px; | |
| 94 | +} | |
| 95 | + | |
| 96 | +#article .proposal .topic a { | |
| 97 | + font-weight: bold; | |
| 98 | + color: #888a85; | |
| 99 | + width: 100%; | |
| 100 | + height: 100%; | |
| 101 | +} | |
| 102 | + | |
| 103 | +#article .topics .topic a { | |
| 104 | + text-decoration: none; | |
| 105 | + display: inline-block; | |
| 106 | + width: 95%; | |
| 107 | + height: 100%; | |
| 108 | + padding-left: 5px; | |
| 109 | + font-weight: bold; | |
| 110 | + font-size: 14px; | |
| 111 | +} | ... | ... |
plugins/proposals_discussion/views/cms/proposals_discussion_plugin/_topic.html.erb
0 → 100644
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +<%= required_fields_message %> | |
| 2 | + | |
| 3 | +<%= required f.text_field('name', :size => '64', :maxlength => 150) %> | |
| 4 | +<%= render :partial => 'general_fields' %> | |
| 5 | + | |
| 6 | +<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 3, :cols => 64)) %> | |
| 7 | + | |
| 8 | +<!-- FIXME: Use the colorpicker component from AI2915 --> | |
| 9 | +<%= labelled_form_field(_('Color:'), text_field(:article, :color)) %> | ... | ... |
plugins/proposals_discussion/views/content_viewer/_proposal_card.html.erb
plugins/proposals_discussion/views/content_viewer/discussion.html.erb
| ... | ... | @@ -13,9 +13,11 @@ |
| 13 | 13 | <div class="topics"> |
| 14 | 14 | <h3><%= _('Discussion Topics') %></h3> |
| 15 | 15 | <% @page.topics.includes(:profile).each do |topic| %> |
| 16 | - <div class="topic"><%= link_to topic.title, topic.view_url %></div> | |
| 16 | + <div class="topic"> | |
| 17 | + <div class="topic-color" style="background-color: <%= topic.color %>;"></div> | |
| 18 | + <%= link_to topic.title, topic.view_url %> | |
| 19 | + </div> | |
| 17 | 20 | <% end %> |
| 18 | - <div class="clear"></div> | |
| 19 | 21 | </div> |
| 20 | 22 | |
| 21 | 23 | <div class="actions"> | ... | ... |