Show download log link in the cog menu

This commit is contained in:
Piotr Sarnacki 2013-01-16 12:59:15 +01:00
parent 13d752a77b
commit a8b5460eed
5 changed files with 26 additions and 7 deletions

View File

@ -68,6 +68,7 @@ Travis.Store = DS.Store.extend
{ id: id, clientId: clientId }
receive: (event, data) ->
console.log event
return if event == 'worker:added' || event == 'worker:removed'
[name, type] = event.split(':')

View File

@ -17,7 +17,6 @@
{{/if}}
<a href='#' class="to-top" {{action toTop target="view"}}>To top</a>
<a class="download-log" {{bindAttr href="view.plainTextLogUrl"}}>Download log</a>
{{else}}
<div id="log" class="loading">
<span>Loading</span>

View File

@ -29,6 +29,11 @@
<a href="#" name="regenerate-key" class="open-popup" {{action regenerateKeyPopup target="view"}}>Regenerate Key</a>
</li>
{{/if}}
{{#if view.showDownloadLog}}
<li>
<a class="download-log" {{bindAttr href="view.plainTextLogUrl"}}>Download log</a>
</li>
{{/if}}
</ul>
</div>

View File

@ -140,6 +140,20 @@
@get('isJobTab') && @get('job.isFinished') && @get('hasPermission')
).property('isJobTab', 'job.isFinished', 'hasPermissions')
showDownloadLog: (->
@get('logId')
).property('logId')
logId: (->
@get('job.log.id') ||
(@get('build.jobs.length') == 1 && @get('build.jobs.firstObject.log.id'))
).property('job.log.id', 'build.jobs.firstObject.log.id', 'build.jobs.length')
plainTextLogUrl: (->
if id = @get('logId')
Travis.Urls.plainTextLog(id)
).property('logId')
canCancelBuild: (->
# @get('isBuildTab') && @get('build.canCancel') && @get('hasPermission')
false

View File

@ -111,12 +111,12 @@ pre#log
float: left
margin-top: 0
color: #999
.to-top, .download-log
.to-top
float: right
margin-right: 2px
color: #999
.to-top
background: inline-image('ui/to-top.png') no-repeat right 6px
padding-right: 16px
.download-log
margin-right: 10px
color: #999
background: inline-image('ui/to-top.png') no-repeat right 6px