clean up urls
This commit is contained in:
parent
c894e81409
commit
badf832bd8
|
@ -1,47 +1,27 @@
|
|||
@Travis.Urls =
|
||||
repository: (slug) ->
|
||||
"#!/#{slug}" if slug
|
||||
"#!/#{slug}"
|
||||
|
||||
builds: (slug) ->
|
||||
"#!/#{slug}/builds" if slug
|
||||
"#!/#{slug}/builds"
|
||||
|
||||
build: (slug, id) ->
|
||||
"#!/#{slug}/builds/#{id}" if slug && id
|
||||
"#!/#{slug}/builds/#{id}"
|
||||
|
||||
job: (slug, id) ->
|
||||
"#!/#{slug}/jobs/#{id}" if slug && id
|
||||
"#!/#{slug}/jobs/#{id}"
|
||||
|
||||
Repository:
|
||||
urlGithub: (->
|
||||
"http://github.com/#{@getPath('repository.slug')}"
|
||||
).property('repository.slug'),
|
||||
githubCommit: (slug, sha) ->
|
||||
"http://github.com/#{slug}/commit/#{sha}"
|
||||
|
||||
urlGithubWatchers: (->
|
||||
"http://github.com/#{@get('slug')}/watchers"
|
||||
).property('slug'),
|
||||
githubRepository: (slug) ->
|
||||
"http://github.com/#{slug}"
|
||||
|
||||
urlGithubNetwork: (->
|
||||
"http://github.com/#{@get('slug')}/network"
|
||||
).property('slug'),
|
||||
githubWatchers: (slug) ->
|
||||
"http://github.com/#{slug}/watchers"
|
||||
|
||||
urlGithubAdmin: (->
|
||||
"http://github.com/#{@get('slug')}/admin/hooks#travis_minibucket"
|
||||
).property('slug')
|
||||
|
||||
statusImage: (->
|
||||
"#{@get('slug')}.png"
|
||||
).property('slug')
|
||||
|
||||
Commit:
|
||||
urlGithubCommit: (->
|
||||
"http://github.com/#{@getPath('repository.slug')}/commit/#{@getPath('commit.sha')}"
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
urlAuthor: (->
|
||||
"mailto:#{@getPath('commit.authorEmail')}"
|
||||
).property('commit.authorEmail')
|
||||
|
||||
urlCommitter: (->
|
||||
"mailto:#{@getPath('commit.committerEmail')}"
|
||||
).property('commit.committerEmail')
|
||||
githubNetwork: (slug) ->
|
||||
"http://github.com/#{slug}/network"
|
||||
|
||||
email: (email) ->
|
||||
"mailto:#{email}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{#with controller.builds}}
|
||||
{{#with view.builds}}
|
||||
<table id="builds" class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -21,8 +21,6 @@
|
|||
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
||||
</tr>
|
||||
{{/view}}
|
||||
{{else}}
|
||||
Loading ...
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
{{#with view.build}}
|
||||
{{#unless isLoaded}}
|
||||
{{#with view}}
|
||||
{{#unless build.isLoaded}}
|
||||
Loading ...
|
||||
{{else}}
|
||||
<div id="build" {{bindAttr class="view.color"}}>
|
||||
<div id="build" {{bindAttr class="color"}}>
|
||||
<dl id="summary">
|
||||
<div class="left">
|
||||
<dt>{{t builds.name}}</dt>
|
||||
<dd class="number"><a {{bindAttr href="controller.view.urlBuild"}}>{{number}}</a></dd>
|
||||
<dd class="number"><a {{bindAttr href="urlBuild"}}>{{build.number}}</a></dd>
|
||||
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime build.finished_at}}</dd>
|
||||
<dt>{{t builds.duration}}</dt>
|
||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration build.duration}}</dd>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<dt>{{t builds.commit}}</dt>
|
||||
<dd class="commit"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||
<dd class="commit"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit build.commit}}</a></dd>
|
||||
{{#if commit.compareUrl}}
|
||||
<dt>{{t builds.compare}}</dt>
|
||||
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom build.commit.compareUrl}}</a></dd>
|
||||
{{/if}}
|
||||
{{#if commit.authorName}}
|
||||
<dt>{{t builds.author}}</dt>
|
||||
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{commit.authorName}}</a></dd>
|
||||
<dd class="author"><a {{bindAttr href="urlAuthor"}}>{{build.commit.authorName}}</a></dd>
|
||||
{{/if}}
|
||||
{{#if commit.committerName}}
|
||||
<dt>{{t builds.committer}}</dt>
|
||||
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{commit.committerName}}</a></dd>
|
||||
<dd class="committer"><a {{bindAttr href="urlCommitter"}}>{{build.commit.committerName}}</a></dd>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<dt>{{t builds.message}}</dt>
|
||||
<dd class="message">{{{formatMessage commit.message}}}</dd>
|
||||
<dd class="message">{{{formatMessage build.commit.message}}}</dd>
|
||||
|
||||
{{#unless isMatrix}}
|
||||
<dt>{{t builds.config}}</dt>
|
||||
<dd class="config">{{formatConfig config}}</dd>
|
||||
<dd class="config">{{formatConfig build.config}}</dd>
|
||||
{{/unless}}
|
||||
</dl>
|
||||
|
||||
{{#if isMatrix}}
|
||||
{{view Travis.Views.JobsView jobsBinding="view.requiredJobs" required="true"}}
|
||||
{{view Travis.Views.JobsView jobsBinding="view.allowedFailureJobs"}}
|
||||
{{#if build.isMatrix}}
|
||||
{{view Travis.Views.JobsView jobsBinding="requiredJobs" required="true"}}
|
||||
{{view Travis.Views.JobsView jobsBinding="allowedFailureJobs"}}
|
||||
{{else}}
|
||||
{{view Travis.Views.LogView contextBinding="jobs.firstObject"}}
|
||||
{{view Travis.Views.LogView contextBinding="build.jobs.firstObject"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#with controller.build}}
|
||||
{{#if jobs.length}}
|
||||
{{#with view.jobs}}
|
||||
{{#if length}}
|
||||
{{#if view.required}}
|
||||
<table id="jobs" class="list">
|
||||
<caption>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<pre id="log">{{{formatLog log.body}}}</pre>
|
||||
{{#with job}}
|
||||
<pre id="log">{{{formatLog log.body}}}</pre>
|
||||
|
||||
{{#if sponsor.name}}
|
||||
<p class="sponsor">
|
||||
{{t builds.messages.sponsored_by}}
|
||||
<a {{bindAttr href="sponsor.url"}}>{{sponsor.name}}</a>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{#if sponsor.name}}
|
||||
<p class="sponsor">
|
||||
{{t builds.messages.sponsored_by}}
|
||||
<a {{bindAttr href="sponsor.url"}}>{{sponsor.name}}</a>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{{#with view.job}}
|
||||
{{#if isLoaded}}
|
||||
{{#with view}}
|
||||
{{#if job.isLoaded}}
|
||||
<div {{bindAttr class="view.color"}}>
|
||||
<dl id="summary">
|
||||
<div class="left">
|
||||
<dt>Job</dt>
|
||||
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></dd>
|
||||
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{job.number}}</a></dd>
|
||||
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</dd>
|
||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime job.finished_at}}</dd>
|
||||
<dt>{{t jobs.duration}}</dt>
|
||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</dd>
|
||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration job.duration}}</dd>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
|
@ -31,7 +31,7 @@
|
|||
<dt>{{t jobs.message}}</dt>
|
||||
<dd class="commit-message">{{formatMessage commit.message}}</dd>
|
||||
<dt>{{t jobs.config}}</dt>
|
||||
<dd class="config">{{formatConfig config}}</dd>
|
||||
<dd class="config">{{formatConfig job.config}}</dd>
|
||||
</dl>
|
||||
|
||||
{{view Travis.Views.LogView}}
|
||||
|
|
|
@ -12,8 +12,7 @@ require 'ext/ember/namespace'
|
|||
|
||||
toggleSidebar: ->
|
||||
$('body').toggleClass('maximized')
|
||||
# TODO gotta force redraw here :/
|
||||
element = $('<span></span>')
|
||||
element = $('<span></span>') # TODO gotta force redraw here :/
|
||||
$('#repository').append(element)
|
||||
Em.run.later (-> element.remove()), 10
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
@Travis.Views.reopen
|
||||
BuildsView: Em.View.extend
|
||||
templateName: 'builds/list'
|
||||
buildsBinding: 'controller'
|
||||
|
||||
BuildsItemView: Em.View.extend
|
||||
buildBinding: 'context'
|
||||
repositoryBinding: 'controller.repository'
|
||||
buildBinding: 'context'
|
||||
commitBinding: 'build.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('context.result'))
|
||||
|
@ -14,11 +16,16 @@
|
|||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
||||
).property('repository.slug', 'build.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
BuildView: Em.View.extend
|
||||
templateName: 'builds/show'
|
||||
|
||||
buildBinding: 'controller.build'
|
||||
repositoryBinding: 'controller.repository'
|
||||
buildBinding: 'controller.build'
|
||||
commitBinding: 'build.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('build.result'))
|
||||
|
@ -28,6 +35,18 @@
|
|||
Travis.Urls.build(@getPath('repository.slug'), @getPath('build.id'))
|
||||
).property('repository.slug', 'build.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
urlAuthor: (->
|
||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
||||
).property('commit.authorEmail')
|
||||
|
||||
urlCommitter: (->
|
||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
||||
).property('commit.committerEmail')
|
||||
|
||||
requiredJobs: (->
|
||||
jobs = @getPath('build.jobs')
|
||||
jobs.filter((job) -> job.get('allow_failure') != true) if jobs
|
||||
|
@ -37,5 +56,3 @@
|
|||
jobs = @getPath('build.jobs')
|
||||
jobs.filter((job) -> job.get('allow_failure')) if jobs
|
||||
).property('build.jobs')
|
||||
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
$.facebox(div: '#allow_failure_help')
|
||||
|
||||
JobsItemView: Em.View.extend
|
||||
jobBinding: 'context'
|
||||
repositoryBinding: 'context.repository'
|
||||
jobBinding: 'context'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
||||
|
@ -20,17 +20,30 @@
|
|||
JobView: Em.View.extend
|
||||
templateName: 'jobs/show'
|
||||
|
||||
jobBinding: 'controller.job'
|
||||
repositoryBinding: 'controller.repository'
|
||||
jobBinding: 'controller.job'
|
||||
commitBinding: 'job.commit'
|
||||
|
||||
color: (->
|
||||
Travis.Helpers.colorForResult(@getPath('job.result'))
|
||||
).property('job.result')
|
||||
|
||||
urlJob: (->
|
||||
Travis.Urls.job(@getPath('repository.slug'), @get('job.id'))
|
||||
Travis.Urls.job(@getPath('repository.slug'), @getPath('job.id'))
|
||||
).property('repository.slug', 'job.id')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@getPath('repository.slug'), @getPath('commit.sha'))
|
||||
).property('repository.slug', 'commit.sha')
|
||||
|
||||
urlAuthor: (->
|
||||
Travis.Urls.email(@getPath('commit.authorEmail'))
|
||||
).property('commit.authorEmail')
|
||||
|
||||
urlCommitter: (->
|
||||
Travis.Urls.email(@getPath('commit.committerEmail'))
|
||||
).property('commit.committerEmail')
|
||||
|
||||
LogView: Em.View.extend
|
||||
templateName: 'jobs/log'
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
UserView: Em.View.extend
|
||||
templateName: 'profile/show'
|
||||
|
||||
userBinding: 'controller.user'
|
||||
# userBinding: 'controller.user'
|
||||
|
||||
gravatarUrl: (->
|
||||
"http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=48&d=mm"
|
||||
).property('user.gravatar')
|
||||
# gravatarUrl: (->
|
||||
# "http://www.gravatar.com/avatar/#{@getPath('user.gravatar')}?s=48&d=mm"
|
||||
# ).property('user.gravatar')
|
||||
|
||||
HooksView: Em.View.extend
|
||||
templateName: 'profile/hooks'
|
||||
|
|
|
@ -29,3 +29,14 @@
|
|||
templateName: 'repositories/show'
|
||||
repositoryBinding: 'controller.repository'
|
||||
|
||||
urlGithub: (->
|
||||
Travis.Urls.githubRepository(@getPath('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
||||
urlGithubWatchers: (->
|
||||
Travis.Urls.githubWatchers(@getPath('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
||||
urlGithubNetwork: (->
|
||||
Travis.Urls.githubNetwork(@getPath('repository.slug'))
|
||||
).property('repository.slug'),
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user