Commit 44487be7b50c4c58c7ad100afbefcd8536095b41

Authored by Antonio Terceiro
1 parent 13d70601

Adding "unblock" button also in Disabled enterprise message

(ActionItem1402)
app/views/content_viewer/view_page.rhtml
@@ -76,11 +76,7 @@ @@ -76,11 +76,7 @@
76 </div> 76 </div>
77 <% end %> 77 <% end %>
78 78
79 -<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>  
80 - <div id='profile-disabled'>  
81 - <%= environment.message_for_disabled_enterprise %>  
82 - </div>  
83 -<% end %> 79 +<%= render :partial => 'shared/disabled_enterprise' %>
84 80
85 <% cache(@page.cache_key(params, user)) do %> 81 <% cache(@page.cache_key(params, user)) do %>
86 <div class="<%="article-body article-body-" + @page.css_class_name %>"> 82 <div class="<%="article-body article-body-" + @page.css_class_name %>">
app/views/profile/index.rhtml
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 - </div>  
5 -<% end %> 1 +<%= render :partial => 'shared/disabled_enterprise' %>
6 2
7 <h1><%= profile.name %></h1> 3 <h1><%= profile.name %></h1>
8 4
app/views/shared/_disabled_enterprise.rhtml 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  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.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 %>