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