From 574f269d54f6ff9fc316720e4cdbe0f169170304 Mon Sep 17 00:00:00 2001 From: lukemelia Date: Tue, 6 Nov 2007 04:37:04 +0000 Subject: [PATCH] Hide default context field in new project form when no contexts exist. Fixes #544. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@632 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/projects/index.rhtml | 2 ++ tracks/app/views/stats/_totals.rhtml | 2 +- tracks/app/views/stats/index.rhtml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tracks/app/views/projects/index.rhtml b/tracks/app/views/projects/index.rhtml index feceae36..6ab77f89 100644 --- a/tracks/app/views/projects/index.rhtml +++ b/tracks/app/views/projects/index.rhtml @@ -25,10 +25,12 @@
<%= text_area 'project', 'description', "cols" => 30, "rows" => 4, "tabindex" => 2 %>
+ <% unless @contexts.empty? -%>
<%= text_field_tag("project[default_context_name]", @project.default_context.name, :tabindex => 3) %> <%= render :partial => 'default_context_autocomplete' %>
+ <% end -%>
diff --git a/tracks/app/views/stats/_totals.rhtml b/tracks/app/views/stats/_totals.rhtml index 806342c6..2edbbb88 100755 --- a/tracks/app/views/stats/_totals.rhtml +++ b/tracks/app/views/stats/_totals.rhtml @@ -7,7 +7,7 @@ Of those <%= @contexts.count(:conditions => ["hide = ?", false])%> are visible contexts and <%= @contexts.count(:conditions => ["hide = ?", true]) %> are hidden contexts -<% unless @actions.count == 0 -%> +<% unless @actions.empty? -%>

You have <%= @actions.count(:conditions => "completed_at IS NULL") %> uncompleted actions of which <%= @actions.count(:conditions => "completed_at IS NULL AND NOT show_from IS NULL") %> are deferred actions.

diff --git a/tracks/app/views/stats/index.rhtml b/tracks/app/views/stats/index.rhtml index e7168fa8..ef76c9cf 100755 --- a/tracks/app/views/stats/index.rhtml +++ b/tracks/app/views/stats/index.rhtml @@ -3,7 +3,7 @@ <%= render :partial => 'totals' -%> -<% unless @actions.count == 0 -%> +<% unless @actions.empty? -%>

Actions