Skip to content

Commit

Permalink
Merge remote-tracking branch 'mhfs/output_rollback'
Browse files Browse the repository at this point in the history
  • Loading branch information
sr committed Feb 5, 2012
2 parents 49ab1f4 + 0147511 commit ab6a092
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 49 deletions.
2 changes: 1 addition & 1 deletion lib/janky/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def authorize_repo(repo)
get "/:build_id/output" do |build_id|
@build = Build.find(build_id)
authorize_repo(@build.repo)
mustache :console
mustache :console, :layout => false
end

get "/:repo_name" do |repo_name|
Expand Down
18 changes: 3 additions & 15 deletions lib/janky/templates/console.mustache
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
<ul class="builds">
<li class="{{ status }}">
<span class="status"></span>
<p class="right sha1"><a title="{{commit_message}}" href="{{commit_url}}">{{commit_short_sha}}</a></p>
<h2>
<a href="{{repo_path}}">{{ repo_name }}</a>
<span>/</span>
<a href="{{branch_path}}">{{ branch_name }}</a>
</h2>
<p>
<span class="right">{{commit_author}}</span>
{{{ last_built_text }}}
</p>
</li>
</ul>
<p>
<a href="{{ repo_path }}">{{ repo_name }}</a>/<a href="{{ branch_path }}">{{ branch_name }}</a>/<a href="{{ commit_url }}">{{ commit_short_sha }}</a>
</p>
<pre>{{ output }}</pre>
16 changes: 0 additions & 16 deletions lib/janky/views/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,10 @@ def branch_path
"#{repo_path}/#{branch_name}"
end

def status
css_status_for(@build)
end

def commit_message
@build.commit_message
end

def commit_url
@build.commit_url
end

def commit_author
@build.commit_author
end

def last_built_text
last_built_text_for(@build)
end

def commit_short_sha
@build.sha1
end
Expand Down
18 changes: 18 additions & 0 deletions lib/janky/views/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ def jobs
}
end
end

def css_status_for(build)
if build.green?
"good"
elsif build.building?
"building"
else
"janky"
end
end

def last_built_text_for(build)
if build.building?
"Build started <span class='relatize'>#{build.started_at}</span>…"
elsif build.completed?
"Built in <span>#{build.duration}</span> seconds"
end
end
end
end
end
17 changes: 0 additions & 17 deletions lib/janky/views/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,6 @@ def root
@request.env['SCRIPT_NAME']
end

def css_status_for(build)
if build.green?
"good"
elsif build.building?
"building"
else
"janky"
end
end

def last_built_text_for(build)
if build.building?
"Build started <span class='relatize'>#{build.started_at}</span>…"
elsif build.completed?
"Built in <span>#{build.duration}</span> seconds"
end
end
end
end
end

0 comments on commit ab6a092

Please sign in to comment.