Commit bfc655ab0467101fa80337e78d6b28dcfb36222a

Authored by Evandro Jr
2 parents 7e613b9f bf73d4ea

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

Showing 33 changed files with 123 additions and 35 deletions   Show diff stats
app/controllers/application_controller.rb
@@ -9,6 +9,11 @@ class ApplicationController < ActionController::Base @@ -9,6 +9,11 @@ class ApplicationController < ActionController::Base
9 before_filter :allow_cross_domain_access 9 before_filter :allow_cross_domain_access
10 before_filter :login_required, :if => :private_environment? 10 before_filter :login_required, :if => :private_environment?
11 before_filter :verify_members_whitelist, :if => [:private_environment?, :user] 11 before_filter :verify_members_whitelist, :if => [:private_environment?, :user]
  12 + before_filter :log_user
  13 +
  14 + def log_user
  15 + Rails.logger.info "Logged in: #{user.identifier}" if user
  16 + end
12 17
13 def verify_members_whitelist 18 def verify_members_whitelist
14 render_access_denied unless user.is_admin? || environment.in_whitelist?(user) 19 render_access_denied unless user.is_admin? || environment.in_whitelist?(user)
app/controllers/box_organizer_controller.rb
@@ -84,9 +84,9 @@ class BoxOrganizerController < ApplicationController @@ -84,9 +84,9 @@ class BoxOrganizerController < ApplicationController
84 if request.xhr? and params[:query] 84 if request.xhr? and params[:query]
85 search = params[:query] 85 search = params[:query]
86 path_list = if boxes_holder.is_a?(Environment) && boxes_holder.enabled?('use_portal_community') && boxes_holder.portal_community 86 path_list = if boxes_holder.is_a?(Environment) && boxes_holder.enabled?('use_portal_community') && boxes_holder.portal_community
87 - boxes_holder.portal_community.articles.find(:all, :conditions=>"name ILIKE '%#{search}%' or path ILIKE '%#{search}%'", :limit=>20).map { |content| "/{portal}/"+content.path } 87 + boxes_holder.portal_community.articles.find(:all, :conditions=>"articles.name ILIKE '%#{search}%' or articles.path ILIKE '%#{search}%'", :limit=>20).map { |content| "/{portal}/"+content.path }
88 elsif boxes_holder.is_a?(Profile) 88 elsif boxes_holder.is_a?(Profile)
89 - boxes_holder.articles.find(:all, :conditions=>"name ILIKE '%#{search}%' or path ILIKE '%#{search}%'", :limit=>20).map { |content| "/{profile}/"+content.path } 89 + boxes_holder.articles.find(:all, :conditions=>"articles.name ILIKE '%#{search}%' or articles.path ILIKE '%#{search}%'", :limit=>20).map { |content| "/{profile}/"+content.path }
90 else 90 else
91 [] 91 []
92 end 92 end
app/controllers/public/account_controller.rb
@@ -359,11 +359,11 @@ class AccountController < ApplicationController @@ -359,11 +359,11 @@ class AccountController < ApplicationController
359 end 359 end
360 360
361 def get_signup_start_time 361 def get_signup_start_time
362 - Rails.cache.read params[:signup_time_key] 362 + Rails.cache.read params[:signup_time_key] if params[:signup_time_key].present?
363 end 363 end
364 364
365 def clear_signup_start_time 365 def clear_signup_start_time
366 - Rails.cache.delete params[:signup_time_key] if params[:signup_time_key] 366 + Rails.cache.delete params[:signup_time_key] if params[:signup_time_key].present?
367 end 367 end
368 368
369 def may_be_a_bot 369 def may_be_a_bot
app/controllers/public/profile_controller.rb
@@ -65,13 +65,13 @@ class ProfileController < PublicController @@ -65,13 +65,13 @@ class ProfileController < PublicController
65 65
66 def friends 66 def friends
67 if is_cache_expired?(profile.friends_cache_key(params)) 67 if is_cache_expired?(profile.friends_cache_key(params))
68 - @friends = profile.friends.includes(relations_to_include).paginate(:per_page => per_page, :page => params[:npage]) 68 + @friends = profile.friends.includes(relations_to_include).paginate(:per_page => per_page, :page => params[:npage], :total_entries => profile.friends.count)
69 end 69 end
70 end 70 end
71 71
72 def members 72 def members
73 if is_cache_expired?(profile.members_cache_key(params)) 73 if is_cache_expired?(profile.members_cache_key(params))
74 - @members = profile.members_by_name.includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage]) 74 + @members = profile.members_by_name.includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage], :total_entries => profile.members.count)
75 end 75 end
76 end 76 end
77 77
app/helpers/application_helper.rb
@@ -907,13 +907,15 @@ module ApplicationHelper @@ -907,13 +907,15 @@ module ApplicationHelper
907 end 907 end
908 908
909 def page_title 909 def page_title
910 - (@page ? @page.title + ' - ' : '') +  
911 - (@topic ? @topic.title + ' - ' : '') +  
912 - (@section ? @section.title + ' - ' : '') +  
913 - (@toc ? _('Online Manual') + ' - ' : '') +  
914 - (controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') +  
915 - (profile ? profile.short_name : environment.name) +  
916 - (@category ? " - #{@category.full_name}" : '') 910 + CGI.escapeHTML(
  911 + (@page ? @page.title + ' - ' : '') +
  912 + (@topic ? @topic.title + ' - ' : '') +
  913 + (@section ? @section.title + ' - ' : '') +
  914 + (@toc ? _('Online Manual') + ' - ' : '') +
  915 + (controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') +
  916 + (profile ? profile.short_name : environment.name) +
  917 + (@category ? " - #{@category.full_name}" : '')
  918 + )
917 end 919 end
918 920
919 # DEPRECATED. Do not use this. 921 # DEPRECATED. Do not use this.
@@ -1285,11 +1287,13 @@ module ApplicationHelper @@ -1285,11 +1287,13 @@ module ApplicationHelper
1285 end 1287 end
1286 1288
1287 def delete_article_message(article) 1289 def delete_article_message(article)
1288 - if article.folder?  
1289 - _("Are you sure that you want to remove the folder \"%s\"? Note that all the items inside it will also be removed!") % article.name  
1290 - else  
1291 - _("Are you sure that you want to remove the item \"%s\"?") % article.name  
1292 - end 1290 + CGI.escapeHTML(
  1291 + if article.folder?
  1292 + _("Are you sure that you want to remove the folder \"%s\"? Note that all the items inside it will also be removed!") % article.name
  1293 + else
  1294 + _("Are you sure that you want to remove the item \"%s\"?") % article.name
  1295 + end
  1296 + )
1293 end 1297 end
1294 1298
1295 def expirable_link_to(expired, content, url, options = {}) 1299 def expirable_link_to(expired, content, url, options = {})
app/helpers/layout_helper.rb
@@ -93,7 +93,7 @@ module LayoutHelper @@ -93,7 +93,7 @@ module LayoutHelper
93 end 93 end
94 94
95 def meta_description_tag(article=nil) 95 def meta_description_tag(article=nil)
96 - article ? truncate(strip_tags(article.body.to_s), :length => 200) : environment.name 96 + article ? CGI.escapeHTML(truncate(strip_tags(article.body.to_s), :length => 200)) : environment.name
97 end 97 end
98 end 98 end
99 99
app/models/block.rb
@@ -230,7 +230,7 @@ class Block < ActiveRecord::Base @@ -230,7 +230,7 @@ class Block < ActiveRecord::Base
230 duplicated_block.created_at = nil 230 duplicated_block.created_at = nil
231 duplicated_block.updated_at = nil 231 duplicated_block.updated_at = nil
232 duplicated_block.save! 232 duplicated_block.save!
233 - duplicated_block.insert_at(self.position + 1) 233 + duplicated_block.insert_at((self.position || 0) + 1)
234 duplicated_block 234 duplicated_block
235 end 235 end
236 236
app/models/profile.rb
@@ -135,7 +135,7 @@ class Profile < ActiveRecord::Base @@ -135,7 +135,7 @@ class Profile < ActiveRecord::Base
135 end 135 end
136 136
137 def members_by_name 137 def members_by_name
138 - members.order(:name) 138 + members.order('profiles.name')
139 end 139 end
140 140
141 class << self 141 class << self
app/models/user.rb
@@ -363,6 +363,7 @@ class User &lt; ActiveRecord::Base @@ -363,6 +363,7 @@ class User &lt; ActiveRecord::Base
363 end 363 end
364 364
365 def delay_activation_check 365 def delay_activation_check
  366 + return if person.is_template?
366 Delayed::Job.enqueue(UserActivationJob.new(self.id), {:priority => 0, :run_at => 72.hours.from_now}) 367 Delayed::Job.enqueue(UserActivationJob.new(self.id), {:priority => 0, :run_at => 72.hours.from_now})
367 end 368 end
368 end 369 end
app/views/content_viewer/view_page.html.erb
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 72
73 <div class="comments" id="comments_list"> 73 <div class="comments" id="comments_list">
74 74
75 - <% if @page.accept_comments? || @comments_count > 0 %> 75 + <% if @page.accept_comments? || (@comments_count.present? && @comments_count > 0) %>
76 <h3 <%= 'class="no-comments-yet"' if @comments_count == 0 %>> 76 <h3 <%= 'class="no-comments-yet"' if @comments_count == 0 %>>
77 <%= display_number_of_comments(@comments_count) %> 77 <%= display_number_of_comments(@comments_count) %>
78 </h3> 78 </h3>
app/views/layouts/application-ng.html.erb
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <meta property="og:url" content="<%= @page ? url_for(@page.url) : @environment.top_url %>"> 17 <meta property="og:url" content="<%= @page ? url_for(@page.url) : @environment.top_url %>">
18 <meta property="og:title" content="<%= h page_title %>"> 18 <meta property="og:title" content="<%= h page_title %>">
19 <meta property="og:site_name" content="<%= profile ? profile.name : @environment.name %>"> 19 <meta property="og:site_name" content="<%= profile ? profile.name : @environment.name %>">
20 - <meta property="og:description" content="<%= @page ? truncate(strip_tags(@page.body.to_s), :length => 200) : @environment.name %>"> 20 + <meta property="og:description" content="<%= meta_description_tag(@page) %>">
21 21
22 <!-- site root --> 22 <!-- site root -->
23 <meta property="noosfero:root" content="<%= Noosfero.root %>"/> 23 <meta property="noosfero:root" content="<%= Noosfero.root %>"/>
app/views/profile/_profile_activities_list.html.erb
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <% activities.each do |a| %> 2 <% activities.each do |a| %>
3 <% activity = a.klass.constantize.find(a.id) %> 3 <% activity = a.klass.constantize.find(a.id) %>
4 <% if activity.kind_of?(ActionTracker::Record) %> 4 <% if activity.kind_of?(ActionTracker::Record) %>
  5 + <% next unless activity.target %>
5 <%= render :partial => 'profile_activity', :locals => { :activity => activity, :tab_action => 'wall' } if activity.visible? %> 6 <%= render :partial => 'profile_activity', :locals => { :activity => activity, :tab_action => 'wall' } if activity.visible? %>
6 <% else %> 7 <% else %>
7 <%= render :partial => 'profile_scraps', :locals => { :activity => activity, :scrap => activity } %> 8 <%= render :partial => 'profile_scraps', :locals => { :activity => activity, :scrap => activity } %>
lib/tasks/ci.rake
@@ -35,7 +35,7 @@ namespace :ci do @@ -35,7 +35,7 @@ namespace :ci do
35 35
36 sh 'testrb', '-Itest', *tests unless tests.empty? 36 sh 'testrb', '-Itest', *tests unless tests.empty?
37 sh 'cucumber', *features unless features.empty? 37 sh 'cucumber', *features unless features.empty?
38 - sh 'cucumber', '-p', 'selenium', *features unless features.empty? 38 + sh 'xvfb-run', 'cucumber', '-p', 'selenium', *features unless features.empty?
39 39
40 changed_plugins.each do |plugin| 40 changed_plugins.each do |plugin|
41 task = "test:noosfero_plugins:#{plugin}" 41 task = "test:noosfero_plugins:#{plugin}"
lib/user_activation_job.rb
1 class UserActivationJob < Struct.new(:user_id) 1 class UserActivationJob < Struct.new(:user_id)
2 def perform 2 def perform
3 user = User.find(user_id) 3 user = User.find(user_id)
4 - user.destroy unless user.activated? 4 + user.destroy unless user.activated? || user.person.is_template?
5 end 5 end
6 end 6 end
plugins/comment_paragraph/lib/ext/article.rb
@@ -8,7 +8,7 @@ class Article @@ -8,7 +8,7 @@ class Article
8 8
9 def body_change_with_comments 9 def body_change_with_comments
10 if body && body_changed? && !self.comments.empty? 10 if body && body_changed? && !self.comments.empty?
11 - paragraphs_with_comments = self.comments.where("'paragraph_id' IS NOT NULL") 11 + paragraphs_with_comments = self.comments.where("paragraph_id IS NOT NULL")
12 errors[:base] << (N_('You are unable to change the body of the article when paragraphs are commented')) unless (paragraphs_with_comments).empty? 12 errors[:base] << (N_('You are unable to change the body of the article when paragraphs are commented')) unless (paragraphs_with_comments).empty?
13 end 13 end
14 end 14 end
plugins/community_track/lib/community_track_plugin.rb
@@ -13,8 +13,7 @@ class CommunityTrackPlugin &lt; Noosfero::Plugin @@ -13,8 +13,7 @@ class CommunityTrackPlugin &lt; Noosfero::Plugin
13 end 13 end
14 14
15 def content_types 15 def content_types
16 - return [] if !context.kind_of?(CmsController)  
17 - if context.respond_to?(:params) && context.params 16 + if context.kind_of?(CmsController) && context.respond_to?(:params) && context.params
18 types = [] 17 types = []
19 parent_id = context.params[:parent_id] 18 parent_id = context.params[:parent_id]
20 types << CommunityTrackPlugin::Track if context.profile.community? && !parent_id 19 types << CommunityTrackPlugin::Track if context.profile.community? && !parent_id
plugins/community_track/test/unit/community_track_plugin_test.rb
@@ -7,6 +7,7 @@ class CommunityTrackPluginTest &lt; ActiveSupport::TestCase @@ -7,6 +7,7 @@ class CommunityTrackPluginTest &lt; ActiveSupport::TestCase
7 @profile = fast_create(Community) 7 @profile = fast_create(Community)
8 @params = {} 8 @params = {}
9 @context = mock 9 @context = mock
  10 + @context.stubs(:kind_of?).returns(CmsController)
10 @context.stubs(:profile).returns(@profile) 11 @context.stubs(:profile).returns(@profile)
11 @context.stubs(:params).returns(@params) 12 @context.stubs(:params).returns(@params)
12 @plugin.stubs(:context).returns(@context) 13 @plugin.stubs(:context).returns(@context)
plugins/oauth_client/public/style.css
@@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
10 .oauth-login .provider a img { 10 .oauth-login .provider a img {
11 max-width: 40px; 11 max-width: 40px;
12 } 12 }
  13 +.oauth-login .provider a:hover {
  14 + opacity: 0.7;
  15 +}
13 .oauth-login .provider .developer { 16 .oauth-login .provider .developer {
14 display: none; 17 display: none;
15 } 18 }
plugins/oauth_client/views/oauth_client_plugin_admin/index.html.erb
@@ -19,3 +19,6 @@ @@ -19,3 +19,6 @@
19 </tr> 19 </tr>
20 <% end %> 20 <% end %>
21 </table> 21 </table>
  22 +<div class="actions">
  23 + <%= button(:back, _('Go back'), {:controller => 'plugins', :action => 'index'}) %>
  24 +</div>
plugins/oauth_provider/controllers/oauth_provider_authorizations_controller.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class OauthProviderAuthorizationsController < Doorkeeper::AuthorizationsController
  2 +
  3 + no_design_blocks
  4 + layout :get_layout
  5 +
  6 + def index
  7 + end
  8 +
  9 +end
plugins/oauth_provider/lib/oauth_provider_plugin.rb
@@ -8,6 +8,10 @@ class OauthProviderPlugin &lt; Noosfero::Plugin @@ -8,6 +8,10 @@ class OauthProviderPlugin &lt; Noosfero::Plugin
8 _("Oauth Provider.") 8 _("Oauth Provider.")
9 end 9 end
10 10
  11 + def stylesheet?
  12 + true
  13 + end
  14 +
11 Doorkeeper.configure do 15 Doorkeeper.configure do
12 orm :active_record 16 orm :active_record
13 17
@@ -36,7 +40,8 @@ class OauthProviderPlugin &lt; Noosfero::Plugin @@ -36,7 +40,8 @@ class OauthProviderPlugin &lt; Noosfero::Plugin
36 use_doorkeeper do 40 use_doorkeeper do
37 controllers ({ 41 controllers ({
38 :applications => 'oauth_provider_applications', 42 :applications => 'oauth_provider_applications',
39 - :authorized_applications => 'oauth_provider_authorized_applications' 43 + :authorized_applications => 'oauth_provider_authorized_applications',
  44 + :authorizations => 'oauth_provider_authorizations'
40 }) 45 })
41 end 46 end
42 end 47 end
plugins/oauth_provider/public/style.css 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +.oauth-provider-authorize .actions form {
  2 + display: inline-block;
  3 +}
  4 +.oauth-provider-authorize .h4 {
  5 + font-size: 14px;
  6 + color: rgb(36, 36, 36)
  7 +}
  8 +.oauth-provider-authorize #oauth-permissions {
  9 + color: rgb(92, 92, 92);
  10 +}
  11 +.oauth-provider .actions {
  12 + margin-top: 10px;
  13 +}
plugins/oauth_provider/views/doorkeeper/applications/index.html.erb
  1 +<div class="oauth-provider">
1 <div class="page-header"> 2 <div class="page-header">
2 <h3><%= link_to _('Oauh Provider'), '/admin/plugin/oauth_provider' %></h3> 3 <h3><%= link_to _('Oauh Provider'), '/admin/plugin/oauth_provider' %></h3>
3 </div> 4 </div>
@@ -24,3 +25,7 @@ @@ -24,3 +25,7 @@
24 <% end %> 25 <% end %>
25 </tbody> 26 </tbody>
26 </table> 27 </table>
  28 +<div class="actions">
  29 + <%= button(:back, _('Go back'), {:controller => 'oauth_provider_plugin_admin', :action => 'index'}) %>
  30 +</div>
  31 +</div>
plugins/oauth_provider/views/doorkeeper/authorizations/new.html.erb
  1 +<div class="oauth-provider-authorize">
  2 +
1 <header class="page-header" role="banner"> 3 <header class="page-header" role="banner">
2 <h1><%= _('Authorize required') %></h1> 4 <h1><%= _('Authorize required') %></h1>
3 </header> 5 </header>
@@ -26,7 +28,7 @@ @@ -26,7 +28,7 @@
26 <%= hidden_field_tag :state, @pre_auth.state %> 28 <%= hidden_field_tag :state, @pre_auth.state %>
27 <%= hidden_field_tag :response_type, @pre_auth.response_type %> 29 <%= hidden_field_tag :response_type, @pre_auth.response_type %>
28 <%= hidden_field_tag :scope, @pre_auth.scope %> 30 <%= hidden_field_tag :scope, @pre_auth.scope %>
29 - <%= submit_tag _("Authorize"), class: "btn btn-success btn-lg btn-block" %> 31 + <%= submit_button :ok, _("Authorize") %>
30 <% end %> 32 <% end %>
31 <%= form_tag oauth_authorization_path, method: :delete do %> 33 <%= form_tag oauth_authorization_path, method: :delete do %>
32 <%= hidden_field_tag :client_id, @pre_auth.client.uid %> 34 <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
@@ -34,7 +36,8 @@ @@ -34,7 +36,8 @@
34 <%= hidden_field_tag :state, @pre_auth.state %> 36 <%= hidden_field_tag :state, @pre_auth.state %>
35 <%= hidden_field_tag :response_type, @pre_auth.response_type %> 37 <%= hidden_field_tag :response_type, @pre_auth.response_type %>
36 <%= hidden_field_tag :scope, @pre_auth.scope %> 38 <%= hidden_field_tag :scope, @pre_auth.scope %>
37 - <%= submit_tag _("Deny"), class: "btn btn-danger btn-lg btn-block" %> 39 + <%= submit_button :cancel, _("Deny") %>
38 <% end %> 40 <% end %>
39 </div> 41 </div>
40 </main> 42 </main>
  43 +</div>
plugins/oauth_provider/views/doorkeeper/authorized_applications/index.html.erb
  1 +<div class="oauth-provider">
1 <header class="page-header"> 2 <header class="page-header">
2 <h1>Your authorized applications</h1> 3 <h1>Your authorized applications</h1>
3 </header> 4 </header>
@@ -23,3 +24,8 @@ @@ -23,3 +24,8 @@
23 </tbody> 24 </tbody>
24 </table> 25 </table>
25 </main> 26 </main>
  27 +
  28 +<div class="actions">
  29 + <%= button(:back, _('Go back'), :back) %>
  30 +</div>
  31 +</div>
plugins/oauth_provider/views/oauth_provider_plugin_admin/index.html.erb
@@ -8,4 +8,7 @@ @@ -8,4 +8,7 @@
8 <%= link_to _('Authorized Applications'), oauth_authorized_applications_path %> 8 <%= link_to _('Authorized Applications'), oauth_authorized_applications_path %>
9 </div> 9 </div>
10 10
  11 + <div class="actions">
  12 + <%= button(:back, _('Go back'), {:controller => 'plugins', :action => 'index'}) %>
  13 + </div>
11 </div> 14 </div>
plugins/people_block/controllers/people_block_plugin_profile_controller.rb
@@ -6,12 +6,13 @@ class PeopleBlockPluginProfileController &lt; ProfileController @@ -6,12 +6,13 @@ class PeopleBlockPluginProfileController &lt; ProfileController
6 if is_cache_expired?(profile.members_cache_key(params)) 6 if is_cache_expired?(profile.members_cache_key(params))
7 unless params[:role_key].blank? 7 unless params[:role_key].blank?
8 role = Role.find_by_key_and_environment_id(params[:role_key], profile.environment) 8 role = Role.find_by_key_and_environment_id(params[:role_key], profile.environment)
9 - @members = profile.members.with_role(role.id).includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage]) 9 + @members = profile.members.with_role(role.id)
10 @members_title = role.name 10 @members_title = role.name
11 else 11 else
12 - @members = profile.members.includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage]) 12 + @members = profile.members
13 @members_title = 'members' 13 @members_title = 'members'
14 end 14 end
  15 + @members = @members.includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage], :total_entries => @members.count)
15 end 16 end
16 render "profile/members" 17 render "profile/members"
17 end 18 end
plugins/proposals_discussion/lib/proposals_discussion_plugin/discussion.rb
@@ -35,4 +35,8 @@ class ProposalsDiscussionPlugin::Discussion &lt; Folder @@ -35,4 +35,8 @@ class ProposalsDiscussionPlugin::Discussion &lt; Folder
35 ProposalsDiscussionPlugin::Proposal.from_discussion(self) 35 ProposalsDiscussionPlugin::Proposal.from_discussion(self)
36 end 36 end
37 37
  38 + def accept_comments?
  39 + accept_comments
  40 + end
  41 +
38 end 42 end
plugins/proposals_discussion/lib/proposals_discussion_plugin/topic.rb
@@ -67,4 +67,8 @@ class ProposalsDiscussionPlugin::Topic &lt; Folder @@ -67,4 +67,8 @@ class ProposalsDiscussionPlugin::Topic &lt; Folder
67 end 67 end
68 alias_method_chain :cache_key, :person 68 alias_method_chain :cache_key, :person
69 69
  70 + def accept_comments?
  71 + accept_comments
  72 + end
  73 +
70 end 74 end
public/designs/themes/base/footer.html.erb
1 <div id="footer-links"> 1 <div id="footer-links">
2 - <a id="link-to-doc" class='icon-help'><%= link_to _('Manual'), '/doc' %></a> 2 + <%= link_to _('Manual'), '/doc', id: "link-to-doc", class: 'icon-help' %>
3 </div><!-- end id="footer-links" --> 3 </div><!-- end id="footer-links" -->
4 <div id="copyright"> 4 <div id="copyright">
5 <p><%= _('This social network uses <a href="http://noosfero.org/">Noosfero</a>, developed by %s and licensed under the <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a> version 3 or any later version.') % link_to('Colivre', 'http://colivre.coop.br/') %></p> 5 <p><%= _('This social network uses <a href="http://noosfero.org/">Noosfero</a>, developed by %s and licensed under the <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a> version 3 or any later version.') % link_to('Colivre', 'http://colivre.coop.br/') %></p>
public/stylesheets/application.css
@@ -2007,7 +2007,7 @@ a.button.disabled, input.disabled { @@ -2007,7 +2007,7 @@ a.button.disabled, input.disabled {
2007 } 2007 }
2008 #content .comment-header .comment-actions-reply { 2008 #content .comment-header .comment-actions-reply {
2009 float: right; 2009 float: right;
2010 - background-image: url(../designs/icons/tango/Tango/16x16/actions/go-jump.png); 2010 + background-image: url(/designs/icons/tango/Tango/16x16/actions/go-jump.png);
2011 height: 12px; 2011 height: 12px;
2012 } 2012 }
2013 #content .comment-header ul { 2013 #content .comment-header ul {
test/unit/user_activation_job_test.rb
@@ -29,6 +29,17 @@ class NotifyActivityToProfilesJobTest &lt; ActiveSupport::TestCase @@ -29,6 +29,17 @@ class NotifyActivityToProfilesJobTest &lt; ActiveSupport::TestCase
29 end 29 end
30 end 30 end
31 31
  32 + should 'not destroy user if not activated but is template' do
  33 + user = new_user :login => 'test3'
  34 + user.person.is_template = true
  35 + user.person.save
  36 + job = UserActivationJob.new(user.id)
  37 + assert_no_difference 'User.count' do
  38 + job.perform
  39 + process_delayed_job_queue
  40 + end
  41 + end
  42 +
32 protected 43 protected
33 def new_user(options = {}) 44 def new_user(options = {})
34 user = User.new({ :login => 'quire', :email => 'quire@example.com', :password => 'quire', :password_confirmation => 'quire' }.merge(options)) 45 user = User.new({ :login => 'quire', :email => 'quire@example.com', :password => 'quire', :password_confirmation => 'quire' }.merge(options))
test/unit/user_test.rb
@@ -525,6 +525,13 @@ class UserTest &lt; ActiveSupport::TestCase @@ -525,6 +525,13 @@ class UserTest &lt; ActiveSupport::TestCase
525 assert_match /UserActivationJob/, Delayed::Job.last.handler 525 assert_match /UserActivationJob/, Delayed::Job.last.handler
526 end 526 end
527 527
  528 + should 'not create job to check activation to template users' do
  529 + Person.any_instance.stubs(:is_template?).returns(true)
  530 +
  531 + user = new_user
  532 + assert_equal 0, Delayed::Job.by_handler("--- !ruby/struct:UserActivationJob\nuser_id: #{user.id}\n").count
  533 + end
  534 +
528 should 'deactivate an user' do 535 should 'deactivate an user' do
529 user = new_user 536 user = new_user
530 user.activate 537 user.activate