diff --git a/lib/integrity/ui/public/spinner.gif b/lib/integrity/ui/public/spinner.gif new file mode 100644 index 00000000..9a08feb7 Binary files /dev/null and b/lib/integrity/ui/public/spinner.gif differ diff --git a/lib/integrity/ui/views/home.haml b/lib/integrity/ui/views/home.haml index fb91f0f4..f88cb1be 100644 --- a/lib/integrity/ui/views/home.haml +++ b/lib/integrity/ui/views/home.haml @@ -8,7 +8,7 @@ - else %ul#projects - @projects.each do |project| - %li{ :class => cycle("even", "odd") } + %li{ :class => cycle("even", "odd") + (project.building? ? ' building' : '') } %a{ :href => project_url(project) }&= project.name %p#new %a{ :href => "/new" } Add a new project diff --git a/lib/integrity/ui/views/integrity.sass b/lib/integrity/ui/views/integrity.sass index 493a3943..34d44195 100644 --- a/lib/integrity/ui/views/integrity.sass +++ b/lib/integrity/ui/views/integrity.sass @@ -200,12 +200,15 @@ a :border-bottom = 1px solid !rule_color &.odd :background = !content_bg - #080808 + &.building + :background transparent url(/spinner.gif) no-repeat scroll right a :font-size 2em :padding .25em :line-height 1.2 :font-weight bold :display block + #previous_builds li @@ -325,4 +328,4 @@ a :color #666 :text-align right strong - :font-weight bold \ No newline at end of file + :font-weight bold diff --git a/spec/ui_spec.rb b/spec/ui_spec.rb index 22eeb68e..7c62e17c 100644 --- a/spec/ui_spec.rb +++ b/spec/ui_spec.rb @@ -82,8 +82,8 @@ def provide_valid_credentials! describe "with available projects" do before do - @project_1 = stub("project", :name => "The 1st Project", :permalink => "the-1st-project") - @project_2 = stub("project", :name => "The 2nd Project", :permalink => "the-2nd-project") + @project_1 = stub("project", :name => "The 1st Project", :permalink => "the-1st-project", :building? => true) + @project_2 = stub("project", :name => "The 2nd Project", :permalink => "the-2nd-project", :building? => false) Project.stub!(:all).and_return([@project_1, @project_2]) end @@ -110,6 +110,11 @@ def provide_valid_credentials! end end + it 'should mark projects being built as such' do + get_it '/' + body.should have_tag('#projects li[@class~="building"]', :count => 1) + end + it "should have a link to add a new project" do get_it "/" body.should have_tag("#new a[@href=/new]", /add a new project/i)