Commit 932e72c4841d656f1239b9173e80a1943ae350e9
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'stable' of gitlab.com:participa/noosfero into stable
Showing
11 changed files
with
43 additions
and
11 deletions
Show diff stats
app/models/article.rb
@@ -2,7 +2,7 @@ require 'hpricot' | @@ -2,7 +2,7 @@ require 'hpricot' | ||
2 | 2 | ||
3 | class Article < ActiveRecord::Base | 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 | acts_as_having_image | 7 | acts_as_having_image |
8 | 8 |
app/views/cms/_raw_html_article.html.erb
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> | 3 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> |
4 | 4 | ||
5 | +<%= render :partial => 'text_fields' %> | ||
5 | <%= render :partial => 'general_fields' %> | 6 | <%= render :partial => 'general_fields' %> |
6 | <%= render :partial => 'translatable' %> | 7 | <%= render :partial => 'translatable' %> |
7 | <%= render :partial => 'shared/lead_and_body' %> | 8 | <%= render :partial => 'shared/lead_and_body' %> |
app/views/cms/_textile_article.html.erb
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | 4 | ||
5 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72', :maxlength => 150)) %> | 5 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '72', :maxlength => 150)) %> |
6 | 6 | ||
7 | +<%= render :partial => 'text_fields' %> | ||
7 | <%= render :partial => 'general_fields' %> | 8 | <%= render :partial => 'general_fields' %> |
8 | <%= render :partial => 'translatable' %> | 9 | <%= render :partial => 'translatable' %> |
9 | <%= render :partial => 'shared/lead_and_body' %> | 10 | <%= render :partial => 'shared/lead_and_body' %> |
app/views/cms/_tiny_mce_article.html.erb
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | <div> | 5 | <div> |
6 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> | 6 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> |
7 | 7 | ||
8 | + <%= render :partial => 'text_fields' %> | ||
8 | <%= render :partial => 'general_fields' %> | 9 | <%= render :partial => 'general_fields' %> |
9 | <%= render :partial => 'translatable' %> | 10 | <%= render :partial => 'translatable' %> |
10 | <%= render :partial => 'shared/lead_and_body', :locals => {:tiny_mce => true} %> | 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 < Folder | @@ -58,6 +58,6 @@ class CommunityHubPlugin::Hub < Folder | ||
58 | end | 58 | end |
59 | 59 | ||
60 | def mediator?(user) | 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 | end | 62 | end |
63 | end | 63 | end |
plugins/community_hub/lib/community_hub_plugin/hub_helper.rb
1 | module CommunityHubPlugin::HubHelper | 1 | module CommunityHubPlugin::HubHelper |
2 | 2 | ||
3 | def mediator?(hub) | 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 | end | 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 | end | 9 | end |
10 | 10 | ||
11 | def pinned_message?(hub, message_id) | 11 | def pinned_message?(hub, message_id) |
plugins/community_hub/views/cms/community_hub_plugin/_hub.html.erb
1 | <div class='hub'> | 1 | <div class='hub'> |
2 | + | ||
2 | <h1><%= _("HUB Settings:") %></h1> | 3 | <h1><%= _("HUB Settings:") %></h1> |
4 | + | ||
3 | <%= required_fields_message %> | 5 | <%= required_fields_message %> |
6 | + | ||
4 | <div> | 7 | <div> |
5 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> | 8 | <%= required labelled_form_field(_('Title'), text_field(:article, 'name', :size => '64', :maxlength => 150)) %> |
6 | </div> | 9 | </div> |
10 | + | ||
7 | <div> | 11 | <div> |
8 | <%= required labelled_form_field(_('Description'), text_area(:article, 'body', :style => 'width: 99%;')) %> | 12 | <%= required labelled_form_field(_('Description'), text_area(:article, 'body', :style => 'width: 99%;')) %> |
9 | </div> | 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 | <br /> | 19 | <br /> |
20 | + | ||
11 | <div> | 21 | <div> |
12 | <h2><%= _('Twitter Settings:') %></h2> | 22 | <h2><%= _('Twitter Settings:') %></h2> |
13 | </div> | 23 | </div> |
plugins/community_hub/views/community_hub_plugin_public/_mediation.html.erb
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | <% if mediation.source != 'twitter' && mediation.source != 'facebook' %> | 24 | <% if mediation.source != 'twitter' && mediation.source != 'facebook' %> |
25 | 25 | ||
26 | <li class="promote"> | 26 | <li class="promote"> |
27 | - <% if !promoted?(hub, mediation.created_by.id) %> | 27 | + <% if !promoted?(hub, mediation.created_by) %> |
28 | <a id="<%= mediation.id %>" href="#" onclick="promote_user(<%= mediation.id %>,<%= mediation.created_by.id %>); return false;"> | 28 | <a id="<%= mediation.id %>" href="#" onclick="promote_user(<%= mediation.id %>,<%= mediation.created_by.id %>); return false;"> |
29 | <img class="not-promoted" src="/plugins/community_hub/icons/hub-not-promote-icon.png" title="<%= _("User not promoted") %>" /> | 29 | <img class="not-promoted" src="/plugins/community_hub/icons/hub-not-promote-icon.png" title="<%= _("User not promoted") %>" /> |
30 | </a> | 30 | </a> |
plugins/community_hub/views/community_hub_plugin_public/_mediation_comment_form.html.erb
@@ -8,5 +8,5 @@ | @@ -8,5 +8,5 @@ | ||
8 | <%= f.text_area(:body, | 8 | <%= f.text_area(:body, |
9 | :rows => 4, | 9 | :rows => 4, |
10 | :placeholder => _('Type your comment here')) %> | 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 | <% end %> | 12 | <% end %> |
plugins/video/public/style.css
@@ -2,14 +2,15 @@ | @@ -2,14 +2,15 @@ | ||
2 | position: relative; | 2 | position: relative; |
3 | display: inline-block; | 3 | display: inline-block; |
4 | width: 95px; | 4 | width: 95px; |
5 | - height: 85px; | 5 | + height: 115px; |
6 | margin: 1em; | 6 | margin: 1em; |
7 | border: solid #F0F0F0 1px; | 7 | border: solid #F0F0F0 1px; |
8 | vertical-align: top; | 8 | vertical-align: top; |
9 | - text-align: center; | 9 | + text-align: left; |
10 | overflow: hidden; | 10 | overflow: hidden; |
11 | padding-top: 7px; | 11 | padding-top: 7px; |
12 | margin-botton: 10px; | 12 | margin-botton: 10px; |
13 | + text-overflow: ellipsis; | ||
13 | } | 14 | } |
14 | 15 | ||
15 | .video-gallery-top-box{ | 16 | .video-gallery-top-box{ |
@@ -23,3 +24,19 @@ | @@ -23,3 +24,19 @@ | ||
23 | font-size: 1em; | 24 | font-size: 1em; |
24 | text-color: white; | 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 | \ No newline at end of file | 43 | \ No newline at end of file |
plugins/video/views/shared/video_list.html.erb
1 | <div> | 1 | <div> |
2 | <% contents.each do |content| %> | 2 | <% contents.each do |content| %> |
3 | - <%#= py content %> | ||
4 | <% if content.display_to?(user) %> | 3 | <% if content.display_to?(user) %> |
5 | <div class="video-gallery-thumbnail"> | 4 | <div class="video-gallery-thumbnail"> |
6 | <div class="video-gallery-top-box"> | 5 | <div class="video-gallery-top-box"> |
@@ -9,7 +8,10 @@ | @@ -9,7 +8,10 @@ | ||
9 | <% end %> | 8 | <% end %> |
10 | </div> | 9 | </div> |
11 | <div class="video-gallery-botton-box"> | 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 | </div> | 15 | </div> |
14 | </div> | 16 | </div> |
15 | <% end %> | 17 | <% end %> |