Change summary on job page, fix more tests.

This brings both pages on par, though the duplication isn't ideal.
This commit is contained in:
Mathias Meyer 2014-05-08 16:31:33 +02:00
parent 1373308475
commit e1bd111224
4 changed files with 57 additions and 50 deletions

View File

@ -31,15 +31,15 @@
<div class="footer"> <div class="footer">
<div class="author"> <div class="author">
{{#if commit.authorName}} {{#if commit.authorName}}
<img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.authorName}} authored <div><img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.authorName}} authored</div>
{{/if}} {{/if}}
{{#if commit.committerName}} {{#if commit.committerName}}
<img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.committerName}} committed <div><img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.committerName}} committed</div>
{{/if}} {{/if}}
</div> </div>
<div class="commit"> <div class="commit-changes">
<div class=""><a class="github commit" {{bind-attr href="controller.urlGithubCommit"}}>Commit {{formatSha commit.sha}}</a></div><img src="/images/icons/github.png" height="15"/> <div class=""><a class="commit" {{bind-attr href="controller.urlGithubCommit"}}>Commit {{formatSha commit.sha}}</a></div><img src="/images/icons/github.png" height="15"/>
{{#if build.pullRequest}} {{#if build.pullRequest}}
<div><a class="compare" {{bind-attr href="build.commit.compareUrl"}} >#{{build.pullRequestNumber}}: {{build.pullRequestTitle}}</a></div> <div><a class="compare" {{bind-attr href="build.commit.compareUrl"}} >#{{build.pullRequestNumber}}: {{build.pullRequestTitle}}</a></div>
{{else}} {{else}}

View File

@ -1,53 +1,56 @@
{{#if job.isLoaded}} {{#if job.isLoaded}}
<div {{bind-attr class="view.color"}}> <div {{bind-attr class="view.color"}}>
<dl id="summary"> <div id="new-summary">
<div class="left"> <div class="right">
<dt>Job</dt> <div class="build-status">
<dd class="number"> {{#link-to "job" repo job}}#{{job.number}} {{job.state}}{{/link-to}}
<span class="status"></span> </div>
{{#if job.id}}
{{#if job.repo.slug}} <div class="runtime">
{{#link-to "job" repo job}}{{job.number}}{{/link-to}} ran for {{formatDuration job.duration}}
{{/if}} </div>
{{/if}}
</dd> <div class="finished">
<dt>State</dt> {{formatTime job.finishedAt}}
<dd class="state">{{capitalize job.state}}</dd> </div>
<dt class="finished_at_label">Finished</dt> </div>
<dd class="finished_at timeago" {{bind-attr title="job.formattedFinishedAt"}}>{{formatTime job.finishedAt}}</dd>
<dt>Duration</dt> <div class="branch" {{bind-attr title="job.commit.branch"}}>
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration job.duration}}</dd> {{job.commit.branch}}
</div>
-
<div class="subject">
{{formatMessage job.commit.subject repoBinding=job.repo}}
</div> </div>
{{#with job}} <pre class="body">
<div class="right"> {{formatMessage job.commit.body repoBinding=job.repo pre=true}}
<dt>Commit</dt> </pre>
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
{{#if build.pullRequest}} <div class="footer">
<dt></dt> <div class="author">
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{build.pullRequestNumber}} {{build.pullRequestTitle}}</a></dd>
{{else}}
{{#if commit.compareUrl}}
<dt>Compare</dt>
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
{{/if}}
{{/if}}
{{#if commit.authorName}} {{#if commit.authorName}}
<dt>Author</dt> <img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.authorName}} authored
<dd class="author">{{commit.authorName}}</dd>
{{/if}} {{/if}}
{{#if commit.committerName}} {{#if commit.committerName}}
<dt>Committer</dt> <img src="https://travis-ci.org/images/mailer/mascot-avatar-40px.png"/>{{commit.committerName}} committed
<dd class="committer">{{commit.committerName}}</dd>
{{/if}} {{/if}}
</div> </div>
{{/with}}
<dt>Message</dt> <div class="commit-changes">
<dd class="message"> <div><a class="commit" {{bind-attr href="controller.urlGithubCommit"}}>Commit {{formatSha job.commit.sha}}</a></div><img src="/images/icons/github.png" height="15"/>
{{formatMessage job.commit.subject repoBinding=job.repo}} {{#if job.build.pullRequest}}
<pre>{{formatMessage job.commit.body repoBinding=job.repo pre=true}}</pre> <div><a class="compare" {{bind-attr href="job.commit.compareUrl"}} >#{{job.build.pullRequestNumber}}: {{job.build.pullRequestTitle}}</a></div>
</dd> {{else}}
</dl> {{#if job.commit.compareUrl}}
<div><a class="compare" {{bind-attr href="job.commit.compareUrl"}}>Compare {{shortCompareShas
job.commit.compareUrl}}</a></div>
{{/if}}
{{/if}}
<img src="/images/icons/github.png" height="15"/>
</div>
</div>
</div>
{{view Travis.AnnotationsView annotationsBinding="view.annotations"}} {{view Travis.AnnotationsView annotationsBinding="view.annotations"}}

View File

@ -23,19 +23,19 @@
element = $('#new-summary .runtime') element = $('#new-summary .runtime')
equal(element.text().trim(), "ran for #{data.duration}") equal(element.text().trim(), "ran for #{data.duration}")
element = $('#new-summary .commit a.commit') element = $('#new-summary .commit-changes a.commit')
equal(element.attr('href'), "https://github.com/#{data.repo}/commit/#{data.commit}") equal(element.attr('href'), "https://github.com/#{data.repo}/commit/#{data.commit}")
element = $('#new-summary .commit a.commit') element = $('#new-summary .commit-changes a.commit')
equal(element.text(), "Commit #{data.commit}") equal(element.text(), "Commit #{data.commit}")
element = $('#new-summary .branch') element = $('#new-summary .branch')
equal(element.text().trim(), data.branch) equal(element.text().trim(), data.branch)
element = $('#new-summary .commit a.compare') element = $('#new-summary .commit-changes a.compare')
equal(element.attr('href'), "https://github.com/compare/#{data.compare}") equal(element.attr('href'), "https://github.com/compare/#{data.compare}")
element = $('#new-summary .commit a.compare') element = $('#new-summary .commit-changes a.compare')
equal(element.text(), "Compare #{data.compare}") equal(element.text(), "Compare #{data.compare}")
element = $('#new-summary .subject') element = $('#new-summary .subject')

View File

@ -87,7 +87,7 @@
a a
text-decoration: underline text-decoration: underline
.commit .commit-changes
text-align: right text-align: right
width: inherit width: inherit
margin-top: 0px margin-top: 0px
@ -108,6 +108,10 @@
.author .author
float: left float: left
div
display: inline
clear: none
img img
height: 15px height: 15px
width: 15px width: 15px