Added message to contexts page when no contexts exist. Fixes #476.

Also tweaked a couple of selenium login tests to make them work properly if run alone.
 


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@488 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-03-28 05:08:55 +00:00
parent 704d39add1
commit 8e719d9e9a
8 changed files with 17 additions and 4 deletions

View file

@ -11,7 +11,7 @@ class ContextsController < ApplicationController
def index
respond_to do |format|
format.html { @page_title = "TRACKS::List Contexts"; render }
format.html &render_contexts_html
format.xml { render :xml => @contexts.to_xml( :except => :user_id ) }
format.rss &render_contexts_rss_feed
format.atom &render_contexts_atom_feed
@ -98,6 +98,14 @@ class ContextsController < ApplicationController
protected
def render_contexts_html
lambda do
@page_title = "TRACKS::List Contexts"
@no_contexts = @contexts.empty?
render
end
end
def render_contexts_rss_feed
lambda do
render_rss_feed_for @contexts, :feed => Context.feed_options(@user),

View file

@ -136,6 +136,7 @@ class ProjectsController < ApplicationController
@active_projects = @projects.select{ |p| p.active? }
@hidden_projects = @projects.select{ |p| p.hidden? }
@completed_projects = @projects.select{ |p| p.completed? }
@no_projects = @projects.empty?
@projects.cache_note_counts
@new_project = @user.projects.build
render

View file

@ -1,4 +1,5 @@
if @saved
page.hide 'contexts-empty-nd'
page.insert_html :bottom, "list-contexts", :partial => 'context_listing', :locals => { :context_listing => @context }
page.sortable "list-contexts", get_listing_sortable_options
page.call "Form.reset", "context-form"

View file

@ -1,5 +1,8 @@
<div id="display_box">
<div id="list-contexts">
<div id="contexts-empty-nd" style="display:<%= @no_contexts ? 'block' : 'none'%>;">
<div class="message"><p>Currently there are no contexts</p></div>
</div>
<%= render :partial => 'context_listing', :collection => @contexts %>
</div>
</div>

View file

@ -1,5 +1,3 @@
<% @no_projects = @active_projects.empty? && @hidden_projects.empty? && @completed_projects.empty? %>
<div id="display_box">
<div id="projects-empty-nd" style="display:<%= @no_projects ? 'block' : 'none'%>;">
<div class="message"><p>Currently there are no projects</p></div>

View file

@ -525,7 +525,7 @@ div.buttons, div.buttons a, div.buttons a:hover {
background-color: transparent;
}
div#list-active-projects, div#list-hidden-projects, div#list-completed-projects, div#list-contexts {
div#list-active-projects, div#list-hidden-projects, div#list-completed-projects, div#list-contexts, div#projects-empty-nd {
border: 1px solid #999;
}

View file

@ -1,3 +1,4 @@
setup :fixtures => :all
open :controller => 'login', :action => 'logout'
open :controller => 'login'
assert_title 'exact:TRACKS::Login'

View file

@ -1,3 +1,4 @@
setup :fixtures => :all
open :controller => 'login', :action => 'logout'
open :controller => 'login'
assert_title 'exact:TRACKS::Login'