diff --git a/app/views/spam/index.rhtml b/app/views/spam/index.rhtml index 38431a4..36af68e 100644 --- a/app/views/spam/index.rhtml +++ b/app/views/spam/index.rhtml @@ -2,26 +2,27 @@

<%= _('Manage SPAM') %>

+<% no_tabs = @comment_spam.blank? && @task_spam.blank? %> + +<%= _('There are no spams to review.') if no_tabs %> + <% button_bar do %> <%= button :back, _('Back to control panel'), :controller => :profile_editor %> <% end %> <%# FIXME should not need to replicate the article structure like this to be able to use the same formatting as the comments listing %> -<% if @task_spam.length > 0 %> - <% tabs = [] %> - <% tabs << {:title => _('Comment Spam'), :id => 'comment-spam', - :content => (render :partial => 'comment_spam')} %> - <% tabs << {:title => _('Task Spam'), :id => 'task-spam', - :content => (render :partial => 'task_spam') } %> - <%= render_tabs(tabs) %> -<% else %> - <%= render :partial => 'comment_spam' %> -<% end %> - +<% tabs = [] %> +<% tabs << {:title => _('Comment Spam'), :id => 'comment-spam', + :content => (render :partial => 'comment_spam')} if @comment_spam.present? %> +<% tabs << {:title => _('Task Spam'), :id => 'task-spam', + :content => (render :partial => 'task_spam') } if @task_spam.present? %> +<%= render_tabs(tabs) %> -<% button_bar do %> - <%= button :back, _('Back to control panel'), :controller => :profile_editor %> +<% unless no_tabs %> + <% button_bar do %> + <%= button :back, _('Back to control panel'), :controller => :profile_editor %> + <% end %> <% end %> <%= javascript_include_tag 'spam' %> -- libgit2 0.21.2