Use @resource.any? consistentently when display data to the user.

pull/3665/head
Peter Lehwess 9 years ago
parent 16a4ad49e3
commit 9d5d3cf3f2
  1. 7
      app/views/admin/projects.html.erb
  2. 6
      app/views/auth_sources/index.html.erb
  3. 6
      app/views/custom_fields/_tab.html.erb
  4. 6
      app/views/my/blocks/_news.html.erb
  5. 19
      app/views/news/index.html.erb
  6. 6
      app/views/planning_element_type_colors/index.html.erb
  7. 7
      app/views/project_types/index.html.erb
  8. 6
      app/views/projects/index.html.erb
  9. 6
      app/views/projects/settings/_activities.html.erb
  10. 6
      app/views/projects/settings/_custom_fields.html.erb
  11. 6
      app/views/projects/settings/_types.html.erb
  12. 8
      app/views/reportings/index.html.erb
  13. 7
      app/views/statuses/index.html.erb
  14. 7
      app/views/types/index.html.erb
  15. 2
      app/views/wiki/date_index.html.erb
  16. 6
      app/views/workflows/index.html.erb

@ -61,9 +61,8 @@ See doc/COPYRIGHT.rdoc for more details.
count: Project.count, count: Project.count,
storage: number_to_human_size(Project.total_projects_size, precision: 2)) %> storage: number_to_human_size(Project.total_projects_size, precision: 2)) %>
</p> </p>
<% if @projects.empty? %>
<%= no_results_box(action_url: new_project_path, display_action: true) %> <% if @projects.any? %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -147,4 +146,6 @@ See doc/COPYRIGHT.rdoc for more details.
<%= pagination_links_full @projects %> <%= pagination_links_full @projects %>
</div> </div>
</div> </div>
<% else %>
<%= no_results_box(action_url: new_project_path, display_action: true) %>
<% end %> <% end %>

@ -37,9 +37,7 @@ See doc/COPYRIGHT.rdoc for more details.
</li> </li>
<% end %> <% end %>
<% if @auth_sources.empty? %> <% if @auth_sources.any? %>
<%= no_results_box(action_url: { action: 'new' }, display_action: true) %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -114,4 +112,6 @@ See doc/COPYRIGHT.rdoc for more details.
</div> </div>
</div> </div>
<%= pagination_links_full @auth_sources %> <%= pagination_links_full @auth_sources %>
<% else %>
<%= no_results_box(action_url: { action: 'new' }, display_action: true) %>
<% end %> <% end %>

@ -27,9 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%> ++#%>
<% if (@custom_fields_by_type[tab[:name]] || []).empty? %> <% if (@custom_fields_by_type[tab[:name]] || []).any? %>
<%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -131,4 +129,6 @@ See doc/COPYRIGHT.rdoc for more details.
<i class="button--icon icon-add"></i> <i class="button--icon icon-add"></i>
<span class="button--text"><%= l(:label_custom_field_new) %></span> <span class="button--text"><%= l(:label_custom_field_new) %></span>
<% end %> <% end %>
<% else %>
<%= no_results_box(action_url: new_custom_field_path(type: tab[:name]), display_action: true) %>
<% end %> <% end %>

@ -37,10 +37,10 @@ See doc/COPYRIGHT.rdoc for more details.
<%= content_for "#{block_name}_remove_block" %> <%= content_for "#{block_name}_remove_block" %>
<% end %> <% end %>
<% unless news %> <% if news %>
<%= no_results_box(custom_title: t('news.my_page.no_results_title_text')) %>
<% else %>
<%= render(partial: 'news/news', <%= render(partial: 'news/news',
collection: news) collection: news)
%> %>
<% else %>
<%= no_results_box(custom_title: t('news.my_page.no_results_title_text')) %>
<% end %> <% end %>

@ -41,14 +41,8 @@ See doc/COPYRIGHT.rdoc for more details.
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
<% if @newss.empty? %>
<% if managable %> <% if @newss.any? %>
<%= no_results_box(action_url: new_project_news_path(@project),
display_action: true) %>
<% else %>
<%= no_results_box %>
<% end %>
<% else %>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<h3><%= avatar(news.author) %><%= link_to_project(news.project) + ': ' unless news.project == @project %> <h3><%= avatar(news.author) %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
<%= link_to h(news.title), news_path(news) %> <%= link_to h(news.title), news_path(news) %>
@ -58,8 +52,17 @@ See doc/COPYRIGHT.rdoc for more details.
<%= format_text(news.summary.present? ? news.summary : truncate(news.description), :object => news) %> <%= format_text(news.summary.present? ? news.summary : truncate(news.description), :object => news) %>
</div> </div>
<% end %> <% end %>
<% else %>
<% if managable %>
<%= no_results_box(action_url: new_project_news_path(@project),
display_action: true) %>
<% else %>
<%= no_results_box %>
<% end %>
<% end %> <% end %>
<%= pagination_links_full @newss %> <%= pagination_links_full @newss %>
<%= other_formats_links do |f| %> <%= other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
<% end %> <% end %>

@ -38,9 +38,7 @@ See doc/COPYRIGHT.rdoc for more details.
</li> </li>
<% end %> <% end %>
<% if @colors.blank? %> <% if @colors.any? %>
<%= no_results_box(action_url: new_color_path, display_action: true) %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -105,4 +103,6 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="generic-table--header-background"></div> <div class="generic-table--header-background"></div>
</div> </div>
</div> </div>
<% else %>
<%= no_results_box(action_url: new_color_path, display_action: true) %>
<% end %> <% end %>

@ -38,10 +38,7 @@ See doc/COPYRIGHT.rdoc for more details.
</li> </li>
<% end %> <% end %>
<% if @project_types.any? %>
<% if @project_types.blank? %>
<%= no_results_box(action_url: new_project_type_path, display_action: true) %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -109,4 +106,6 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="generic-table--header-background"></div> <div class="generic-table--header-background"></div>
</div> </div>
</div> </div>
<% else %>
<%= no_results_box(action_url: new_project_type_path, display_action: true) %>
<% end %> <% end %>

@ -53,9 +53,7 @@ See doc/COPYRIGHT.rdoc for more details.
</div> </div>
<% end %> <% end %>
<% if @projects.empty? %> <% if @projects.any? %>
<%= no_results_box %>
<% else %>
<% if User.current.logged? %> <% if User.current.logged? %>
<p style="float:right;"> <p style="float:right;">
<span class="icon icon-star2"><%= l(:label_my_projects) %></span> <span class="icon icon-star2"><%= l(:label_my_projects) %></span>
@ -63,6 +61,8 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<%= render_project_hierarchy(@projects)%> <%= render_project_hierarchy(@projects)%>
<% else %>
<%= no_results_box %>
<% end %> <% end %>
<%= other_formats_links do |f| %> <%= other_formats_links do |f| %>

@ -26,9 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details. See doc/COPYRIGHT.rdoc for more details.
++#%> ++#%>
<% if @project.activities(true).empty? %> <% if @project.activities(true).any? %>
<%= no_results_box %>
<% else %>
<%= form_tag project_enumerations_path(@project), <%= form_tag project_enumerations_path(@project),
method: :put, method: :put,
class: "tabular" do %> class: "tabular" do %>
@ -39,4 +37,6 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<br/> <br/>
<% else %>
<%= no_results_box %>
<% end %> <% end %>

@ -26,9 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details. See doc/COPYRIGHT.rdoc for more details.
++#%> ++#%>
<% if @issue_custom_fields.empty? %> <% if @issue_custom_fields.any? %>
<%= no_results_box %>
<% else %>
<%= labelled_tabular_form_for @project, <%= labelled_tabular_form_for @project,
url: { action: 'custom_fields', id: @project }, url: { action: 'custom_fields', id: @project },
method: :put, method: :put,
@ -43,4 +41,6 @@ See doc/COPYRIGHT.rdoc for more details.
<p><%= form.button l(:button_save), class: 'button -highlight -with-icon icon-yes' %></p> <p><%= form.button l(:button_save), class: 'button -highlight -with-icon icon-yes' %></p>
<% end %> <% end %>
<% else %>
<%= no_results_box %>
<% end %> <% end %>

@ -27,9 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%> ++#%>
<% if Type.all.empty? %> <% if Type.all.any? %>
<%= no_results_box %>
<% else %>
<%= form_for @project, <%= form_for @project,
:url => { :action => 'types', :id => @project }, :url => { :action => 'types', :id => @project },
:method => :patch, :method => :patch,
@ -40,4 +38,6 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<br/> <br/>
<% else %>
<%= no_results_box %>
<% end %> <% end %>

@ -39,10 +39,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<% end %> <% end %>
<% if @reportings.blank? %> <% if @reportings.any? %>
<%= no_results_box(action_url: new_project_reporting_path(@project),
display_action: authorize_for(:reportings, :new)) %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -133,4 +130,7 @@ See doc/COPYRIGHT.rdoc for more details.
<div class="generic-table--header-background"></div> <div class="generic-table--header-background"></div>
</div> </div>
</div> </div>
<% else %>
<%= no_results_box(action_url: new_project_reporting_path(@project),
display_action: authorize_for(:reportings, :new)) %>
<% end %> <% end %>

@ -44,9 +44,8 @@ See doc/COPYRIGHT.rdoc for more details.
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
<% if @statuses.empty? %>
<%= no_results_box(action_url: new_status_path, display_action: true) %> <% if @statuses.any? %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -133,4 +132,6 @@ See doc/COPYRIGHT.rdoc for more details.
</div> </div>
</div> </div>
<%= pagination_links_full @statuses %> <%= pagination_links_full @statuses %>
<% else %>
<%= no_results_box(action_url: new_status_path, display_action: true) %>
<% end %> <% end %>

@ -36,9 +36,8 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
<% if @types.empty? %>
<%= no_results_box(action_url: new_type_path, display_action: true)%> <% if @types.any? %>
<% else %>
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
<table interactive-table role="grid" class="generic-table"> <table interactive-table role="grid" class="generic-table">
@ -139,4 +138,6 @@ See doc/COPYRIGHT.rdoc for more details.
</div> </div>
</div> </div>
<%= pagination_links_full @types %> <%= pagination_links_full @types %>
<% else %>
<%= no_results_box(action_url: new_type_path, display_action: true)%>
<% end %> <% end %>

@ -46,7 +46,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% content_for :sidebar do %> <% content_for :sidebar do %>
<%= render :partial => 'sidebar' %> <%= render :partial => 'sidebar' %>
<% end %> <% end %>
<% unless @pages.empty? %> <% if @pages.any? %>
<%= other_formats_links do |f| %> <%= other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => '/activities', :action => 'index', :show_wiki_edits => 1, :key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:controller => '/activities', :action => 'index', :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %> <%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>

@ -28,9 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%> ++#%>
<%= render partial: 'action_menu', locals: { title: l(:label_workflow_plural) } %> <%= render partial: 'action_menu', locals: { title: l(:label_workflow_plural) } %>
<% html_title l(:label_administration), l(:label_workflow_plural) -%> <% html_title l(:label_administration), l(:label_workflow_plural) -%>
<% if @workflow_counts.empty? %> <% if @workflow_counts.any? %>
<%= no_results_box %>
<% else %>
<div class="autoscroll"> <div class="autoscroll">
<div class="generic-table--container"> <div class="generic-table--container">
<div class="generic-table--results-container"> <div class="generic-table--results-container">
@ -75,4 +73,6 @@ See doc/COPYRIGHT.rdoc for more details.
</div> </div>
</div> </div>
</div> </div>
<% else %>
<%= no_results_box %>
<% end %> <% end %>

Loading…
Cancel
Save