Commit 4711e596e98627c47a9aaf8718a33ed91d059e5c

Authored by Rodrigo Souto
2 parents 0c8b097a 16d460f9

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

app/views/content_viewer/view_page.rhtml
@@ -40,8 +40,6 @@ @@ -40,8 +40,6 @@
40 </div> 40 </div>
41 <% end %> 41 <% end %>
42 42
43 -<%= render :partial => 'shared/disabled_enterprise' %>  
44 -  
45 <% if NOOSFERO_CONF['addthis_enabled'] %> 43 <% if NOOSFERO_CONF['addthis_enabled'] %>
46 <%= render :partial => 'addthis' %> 44 <%= render :partial => 'addthis' %>
47 <% end %> 45 <% end %>
app/views/profile/index.rhtml
1 -<%= render :partial => 'shared/disabled_enterprise' %>  
2 -  
3 <h1><%= h profile.name %></h1> 1 <h1><%= h profile.name %></h1>
4 2
5 <% if @action %> 3 <% if @action %>
app/views/shared/_disabled_enterprise.rhtml
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>  
2 - <div id='profile-disabled'>  
3 - <%= environment.message_for_disabled_enterprise %>  
4 - <% if profile.blocked? && user && user.is_admin?(profile.environment) %>  
5 - <div class='unlock-button'>  
6 - <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %>  
7 - </div>  
8 - <% end %>  
9 - </div>  
10 -<% end %>  
db/migrate/20140501171906_index_filtered_fields_on_task.rb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +class IndexFilteredFieldsOnTask < ActiveRecord::Migration
  2 + def self.up
  3 + add_index :tasks, :requestor_id
  4 + add_index :tasks, :target_id
  5 + add_index :tasks, :target_type
  6 + add_index :tasks, [:target_id, :target_type]
  7 + add_index :tasks, :status
  8 + end
  9 +
  10 + def self.down
  11 + remove_index :tasks, :requestor_id
  12 + remove_index :tasks, :target_id
  13 + remove_index :tasks, :target_type
  14 + remove_index :tasks, [:target_id, :target_type]
  15 + remove_index :tasks, :status
  16 + end
  17 +end
public/stylesheets/application.css
@@ -1814,29 +1814,29 @@ a.button.disabled, input.disabled { @@ -1814,29 +1814,29 @@ a.button.disabled, input.disabled {
1814 } 1814 }
1815 1815
1816 #add-block-dialog { 1816 #add-block-dialog {
1817 - display: inline-block;  
1818 padding: 0px 5px 0px 20px; 1817 padding: 0px 5px 0px 20px;
  1818 + max-width: 600px;
1819 } 1819 }
1820 1820
1821 #add-block-dialog .block-types { 1821 #add-block-dialog .block-types {
1822 - column-count: 2;  
1823 - -ms-column-count: 2;  
1824 - -moz-column-count: 2;  
1825 - -webkit-column-count: 2;  
1826 } 1822 }
1827 1823
1828 #add-block-dialog .block-types input{ 1824 #add-block-dialog .block-types input{
1829 vertical-align: middle; 1825 vertical-align: middle;
  1826 + display: inline-block;
1830 } 1827 }
1831 1828
1832 #add-block-dialog .block-types label{ 1829 #add-block-dialog .block-types label{
1833 - display: inline-block;  
1834 vertical-align: middle; 1830 vertical-align: middle;
1835 - width: 140px; 1831 + display: inline-block;
  1832 + width: 85%;
  1833 + padding-top: 4px;
1836 } 1834 }
1837 1835
1838 #add-block-dialog .block-type{ 1836 #add-block-dialog .block-type{
1839 - margin: 3px 0; 1837 + margin: 3px 0px;
  1838 + display: inline-block;
  1839 + width: 49%;
1840 } 1840 }
1841 1841
1842 /* ==> blocks/tags-block.css <<= */ 1842 /* ==> blocks/tags-block.css <<= */
test/functional/profile_controller_test.rb
@@ -230,30 +230,6 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -230,30 +230,6 @@ class ProfileControllerTest &lt; ActionController::TestCase
230 assert_no_match /Add friend/, @response.body 230 assert_no_match /Add friend/, @response.body
231 end 231 end
232 232
233 - should 'show message for disabled enterprise' do  
234 - login_as(@profile.identifier)  
235 - ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false)  
236 - get :index, :profile => ent.identifier  
237 - assert_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => /#{Environment.default.message_for_disabled_enterprise}/  
238 - end  
239 -  
240 - should 'not show message for disabled enterprise to non-enterprises' do  
241 - login_as(@profile.identifier)  
242 - @profile.enabled = false; @profile.save!  
243 - get :index, :profile => @profile.identifier  
244 - assert_no_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise  
245 - end  
246 -  
247 - should 'not show message for disabled enterprise if there is a block for it' do  
248 - login_as(@profile.identifier)  
249 - ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false)  
250 - ent.boxes << Box.new  
251 - ent.boxes[0].blocks << DisabledEnterpriseMessageBlock.new  
252 - ent.save  
253 - get :index, :profile => ent.identifier  
254 - assert_no_tag :tag => 'div', :attributes => {:class => 'blocks'}, :descendant => { :tag => 'div', :attributes => { :id => 'profile-disabled' }}  
255 - end  
256 -  
257 should 'display "Products" link for enterprise' do 233 should 'display "Products" link for enterprise' do
258 ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) 234 ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false)
259 235
@@ -1189,7 +1165,7 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -1189,7 +1165,7 @@ class ProfileControllerTest &lt; ActionController::TestCase
1189 20.times {comment = fast_create(Comment, :source_id => article, :title => 'a comment', :body => 'lalala', :created_at => Time.now)} 1165 20.times {comment = fast_create(Comment, :source_id => article, :title => 'a comment', :body => 'lalala', :created_at => Time.now)}
1190 article.reload 1166 article.reload
1191 get :index, :profile => profile.identifier 1167 get :index, :profile => profile.identifier
1192 - assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments'}, :children => {:count => 0 } 1168 + assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments'}, :children => {:count => 0 }
1193 end 1169 end
1194 1170
1195 should "view more comments paginated" do 1171 should "view more comments paginated" do
@@ -1215,7 +1191,7 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -1215,7 +1191,7 @@ class ProfileControllerTest &lt; ActionController::TestCase
1215 20.times {fast_create(Scrap, :sender_id => profile.id, :receiver_id => profile.id, :scrap_id => scrap.id)} 1191 20.times {fast_create(Scrap, :sender_id => profile.id, :receiver_id => profile.id, :scrap_id => scrap.id)}
1216 profile.reload 1192 profile.reload
1217 get :index, :profile => profile.identifier 1193 get :index, :profile => profile.identifier
1218 - assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments scrap-replies'}, :children => {:count => 0 } 1194 + assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments scrap-replies'}, :children => {:count => 0 }
1219 end 1195 end
1220 1196
1221 should "view more replies paginated" do 1197 should "view more replies paginated" do