Skip to content
Browse files

Showing all tasks when no recent tasks exist

  • Loading branch information...
1 parent 05ba190 commit c84302ffe31e6ea36f18bf33210136b42c5c64d5 @joelmoss committed
View
4 .gitignore
@@ -15,4 +15,6 @@
/tmp
config/database.yml
-.powenv
+.powenv
+
+vendor/repos
View
5 Gemfile.lock
@@ -50,6 +50,7 @@ GEM
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capistrano_colors (0.5.5)
+ chronic (0.6.7)
coffee-rails (3.2.1)
coffee-script (>= 2.2.0)
railties (~> 3.2.0.beta)
@@ -243,6 +244,9 @@ GEM
webmock (1.7.10)
addressable (~> 2.2, > 2.2.5)
crack (>= 0.1.7)
+ whenever (0.7.2)
+ activesupport (>= 2.3.4)
+ chronic (~> 0.6.3)
yajl-ruby (1.1.0)
PLATFORMS
@@ -289,4 +293,5 @@ DEPENDENCIES
uglifier (>= 1.0.3)
vcr (~> 2.0.0.rc)
webmock
+ whenever
yajl-ruby
View
4 app/views/projects/show/_tasks.html.erb
@@ -1,6 +1,6 @@
<div class="tab-pane" id="tasks">
- <%- if @recent_tasks -%>
+ <%- unless @recent_tasks.empty? -%>
<div class="page-header">
<h6>Most recent</h6>
@@ -20,7 +20,7 @@
<%- end -%>
- <div id="other_tasks" class="<%= 'hide' if @recent_tasks %>">
+ <div id="other_tasks" class="<%= 'hide' unless @recent_tasks.empty? %>">
<%- resource.public_tasks.each do |task| -%>
<%- unless resource.jobs.where(:task => task.fully_qualified_name).first -%>
<%= render :partial => "task", :locals => { :task => task, :hidden => false } %>
View
9 db/migrate/20120213093204_add_token_to_users.rb
@@ -0,0 +1,9 @@
+class AddTokenToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :token, :string
+
+ User.find_each do |u|
+ u.update_attribute :token, SecureRandom.hex(32)
+ end
+ end
+end
View
2 lib/strano/repo.rb
@@ -18,7 +18,7 @@ def initialize(url)
# Returns the newly clone Strano::Repo object.
def self.clone(url)
repo = new(url)
- repo.git.fs_mkdir('..')
+ repo.git.fs_mkdir('..') if !repo.git.fs_exist?('..')
repo.git.clone({:timeout => false}, url, repo.path)
repo
end
View
1 vendor/repos

0 comments on commit c84302f

Please sign in to comment.
Something went wrong with that request. Please try again.