diff --git a/assets/scripts/app/models/hook.coffee b/assets/scripts/app/models/hook.coffee index f35166ac..58fff636 100644 --- a/assets/scripts/app/models/hook.coffee +++ b/assets/scripts/app/models/hook.coffee @@ -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') diff --git a/assets/scripts/app/templates/profile/tabs/hooks.hbs b/assets/scripts/app/templates/profile/tabs/hooks.hbs index dc920183..0cae8362 100644 --- a/assets/scripts/app/templates/profile/tabs/hooks.hbs +++ b/assets/scripts/app/templates/profile/tabs/hooks.hbs @@ -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 diff --git a/assets/styles/profile/hooks.sass b/assets/styles/profile/hooks.sass index 5566b966..6c003d4a 100644 --- a/assets/styles/profile/hooks.sass +++ b/assets/styles/profile/hooks.sass @@ -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