Link to repo settings from a hooks page

This commit is contained in:
Piotr Sarnacki 2013-12-12 14:55:01 +01:00
parent 8482c4c286
commit 3a15b037da
3 changed files with 13 additions and 3 deletions

View File

@ -27,3 +27,13 @@ require 'travis/model'
return if @get('isSaving')
@set 'active', !@get('active')
@save()
repo: (->
# I don't want to make an ajax request for each repository showed in profile,
# especially, because most of them does not have any builds anyway. That's why
# I add an info which we have here to the store - this will allow to display
# a link to the repo and if more info is needed, it will be requested when the
# link is used
Travis.loadOrMerge(Travis.Repo, @getProperties('id', 'slug', 'name', 'ownerName'), skipIfExists: true)
Travis.Repo.find(@get('id'))
).property('id')

View File

@ -23,7 +23,7 @@
<p class="description">{{hook.description}}</p>
<div class="controls">
<a {{bindAttr href="hook.urlGithubAdmin"}} class="github-admin tool-tip" title="Github service hooks admin page"></a>
{{#link-to "repo.settings" hook.repo class="repo-settings-icon tool-tip" title="Repository settings"}}{{/link-to}}
<a {{action "toggle" hook}} class="switch">
{{#if hook.active}}
ON

View File

@ -57,14 +57,14 @@
float: left
display: block
.github-admin
.repo-settings-icon
// Overriding an earlier definition above, which is probably
// obsolete. TODO: Remove if so.
position: relative
height: 20px
width: 20px
padding-right: 0
background: inline-image('ui/github-admin.png') no-repeat 3px 4px
background: inline-image('ui/repo-settings.png') no-repeat 3px 4px
.switch
position: relative