Commit 932e72c4841d656f1239b9173e80a1943ae350e9

Authored by Victor Costa
2 parents c146c295 d5aaf22c

Merge branch 'stable' of gitlab.com:participa/noosfero into stable

app/models/article.rb
... ... @@ -2,7 +2,7 @@ require 'hpricot'
2 2  
3 3 class Article < ActiveRecord::Base
4 4  
5   - attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions, :external_link, :image_builder
  5 + attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions, :external_link, :image_builder, :published_at
6 6  
7 7 acts_as_having_image
8 8  
... ...
app/views/cms/_raw_html_article.html.erb
... ... @@ -2,6 +2,7 @@
2 2  
3 3 <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>
4 4  
  5 +<%= render :partial => 'text_fields' %>
5 6 <%= render :partial => 'general_fields' %>
6 7 <%= render :partial => 'translatable' %>
7 8 <%= render :partial => 'shared/lead_and_body' %>
... ...
app/views/cms/_textile_article.html.erb
... ... @@ -4,6 +4,7 @@
4 4  
5 5 <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72', :maxlength => 150)) %>
6 6  
  7 +<%= render :partial => 'text_fields' %>
7 8 <%= render :partial => 'general_fields' %>
8 9 <%= render :partial => 'translatable' %>
9 10 <%= render :partial => 'shared/lead_and_body' %>
... ...
app/views/cms/_tiny_mce_article.html.erb
... ... @@ -5,6 +5,7 @@
5 5 <div>
6 6 <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>
7 7  
  8 + <%= render :partial => 'text_fields' %>
8 9 <%= render :partial => 'general_fields' %>
9 10 <%= render :partial => 'translatable' %>
10 11 <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %>
... ...
plugins/community_hub/lib/community_hub_plugin/hub.rb
... ... @@ -58,6 +58,6 @@ class CommunityHubPlugin::Hub &lt; Folder
58 58 end
59 59  
60 60 def mediator?(user)
61   - self.author.id == user.id || self.mediators.include?(user.id) ? true : false
  61 + self.allow_edit?(user) || self.mediators.include?(user.id)
62 62 end
63 63 end
... ...
plugins/community_hub/lib/community_hub_plugin/hub_helper.rb
1 1 module CommunityHubPlugin::HubHelper
2 2  
3 3 def mediator?(hub)
4   - logged_in? && (hub.author.id == user.id || hub.mediators.include?(user.id)) ? true : false
  4 + logged_in? && (user && hub.allow_edit?(user) || hub.mediators.include?(user.id))
5 5 end
6 6  
7   - def promoted?(hub, user_id)
8   - logged_in? && (hub.author.id == user_id || hub.mediators.include?(user_id)) ? true : false
  7 + def promoted?(hub, person)
  8 + logged_in? && (hub.allow_edit?(person) || hub.mediators.include?(person.id))
9 9 end
10 10  
11 11 def pinned_message?(hub, message_id)
... ...
plugins/community_hub/views/cms/community_hub_plugin/_hub.html.erb
1 1 <div class='hub'>
  2 +
2 3 <h1><%= _("HUB Settings:") %></h1>
  4 +
3 5 <%= required_fields_message %>
  6 +
4 7 <div>
5 8 <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %>
6 9 </div>
  10 +
7 11 <div>
8 12 <%= required labelled_form_field(_('Description'), text_area(:article, 'body', :style => 'width: 99%;')) %>
9 13 </div>
  14 +
  15 + <%= fields_for 'article[image_builder]', @article.image do |i| %>
  16 + <%= file_field_or_thumbnail(_('Image:'), @article.image, i) %>
  17 + <% end %>
  18 +
10 19 <br />
  20 +
11 21 <div>
12 22 <h2><%= _('Twitter Settings:') %></h2>
13 23 </div>
... ...
plugins/community_hub/views/community_hub_plugin_public/_mediation.html.erb
... ... @@ -24,7 +24,7 @@
24 24 <% if mediation.source != 'twitter' && mediation.source != 'facebook' %>
25 25  
26 26 <li class="promote">
27   - <% if !promoted?(hub, mediation.created_by.id) %>
  27 + <% if !promoted?(hub, mediation.created_by) %>
28 28 <a id="<%= mediation.id %>" href="#" onclick="promote_user(<%= mediation.id %>,<%= mediation.created_by.id %>); return false;">
29 29 <img class="not-promoted" src="/plugins/community_hub/icons/hub-not-promote-icon.png" title="<%= _("User not promoted") %>" />
30 30 </a>
... ...
plugins/community_hub/views/community_hub_plugin_public/_mediation_comment_form.html.erb
... ... @@ -8,5 +8,5 @@
8 8 <%= f.text_area(:body,
9 9 :rows => 4,
10 10 :placeholder => _('Type your comment here')) %>
11   - <%= submit_button('add', _('Post'), :onclick => "new_mediation_comment(this,#{mediation.id}); return false;") %>
  11 + <%= submit_button('add', _('Send'), :onclick => "new_mediation_comment(this,#{mediation.id}); return false;") %>
12 12 <% end %>
... ...
plugins/video/public/style.css
... ... @@ -2,14 +2,15 @@
2 2 position: relative;
3 3 display: inline-block;
4 4 width: 95px;
5   - height: 85px;
  5 + height: 115px;
6 6 margin: 1em;
7 7 border: solid #F0F0F0 1px;
8 8 vertical-align: top;
9   - text-align: center;
  9 + text-align: left;
10 10 overflow: hidden;
11 11 padding-top: 7px;
12 12 margin-botton: 10px;
  13 + text-overflow: ellipsis;
13 14 }
14 15  
15 16 .video-gallery-top-box{
... ... @@ -23,3 +24,19 @@
23 24 font-size: 1em;
24 25 text-color: white;
25 26 }
  27 +
  28 +.video-title{
  29 + width: 100%;
  30 + overflow: hidden;
  31 + text-overflow: ellipsis;
  32 +}
  33 +
  34 +.video-author{
  35 + display: none;
  36 + overflow: hidden;
  37 + text-overflow: ellipsis;
  38 +}
  39 +
  40 +.video-gallery-thumbnail:hover div{
  41 + display: inline-block;
  42 +}
26 43 \ No newline at end of file
... ...
plugins/video/views/shared/video_list.html.erb
1 1 <div>
2 2 <% contents.each do |content| %>
3   - <%#= py content %>
4 3 <% if content.display_to?(user) %>
5 4 <div class="video-gallery-thumbnail">
6 5 <div class="video-gallery-top-box">
... ... @@ -9,7 +8,10 @@
9 8 <% end %>
10 9 </div>
11 10 <div class="video-gallery-botton-box">
12   - <font size="1em"><%= content.title %></font>
  11 + <div class="video-author">
  12 + <%= _("by") %> <%= content.author_name %> <%= _("updated at") %> <%= time_ago_as_sentence(content.updated_at) %>
  13 + </div>
  14 + <div class="video-title"><%= content.title %></div>
13 15 </div>
14 16 </div>
15 17 <% end %>
... ...