mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-21 16:36:08 +01:00
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:
parent
704d39add1
commit
8e719d9e9a
8 changed files with 17 additions and 4 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
setup :fixtures => :all
|
||||
open :controller => 'login', :action => 'logout'
|
||||
open :controller => 'login'
|
||||
assert_title 'exact:TRACKS::Login'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
setup :fixtures => :all
|
||||
open :controller => 'login', :action => 'logout'
|
||||
open :controller => 'login'
|
||||
assert_title 'exact:TRACKS::Login'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue