Show all accounts and hooks in profile
Previously we showed only accounts and repositories, to which you have admin access. To improve usability, it's better to show all accounts and all repositories, but explain why part of the repositories are not manageable.
This commit is contained in:
parent
357aa3a563
commit
c7516b458e
|
@ -1,6 +1,8 @@
|
|||
Travis.AccountIndexController = Em.Controller.extend
|
||||
needs: ['profile', 'currentUser']
|
||||
hooksBinding: 'controllers.profile.hooks'
|
||||
allHooksBinding: 'controllers.profile.allHooks'
|
||||
unAdminisetableHooksBinding: 'controllers.profile.unAdminisetableHooks'
|
||||
userBinding: 'controllers.currentUser'
|
||||
|
||||
sync: ->
|
||||
|
|
|
@ -35,7 +35,15 @@ Travis.ProfileController = Travis.Controller.extend
|
|||
@reloadHooks()
|
||||
|
||||
reloadHooks: ->
|
||||
@set('hooks', Travis.Hook.find(owner_name: @get('params.login') || @get('user.login')))
|
||||
@set('allHooks', Travis.Hook.find(all: true, owner_name: @get('params.login') || @get('user.login')))
|
||||
|
||||
hooks: (->
|
||||
@get('allHooks').filter (hook) -> hook.get('admin')
|
||||
).property('allHooks.length', 'allHooks')
|
||||
|
||||
unAdminisetableHooks: (->
|
||||
@get('allHooks').filter (hook) -> !hook.get('admin')
|
||||
).property('allHooks.length', 'allHooks')
|
||||
|
||||
viewUser: ->
|
||||
@connectTab('user')
|
||||
|
|
|
@ -5,6 +5,7 @@ require 'travis/model'
|
|||
ownerName: DS.attr('string')
|
||||
description: DS.attr('string')
|
||||
active: DS.attr('boolean')
|
||||
admin: DS.attr('boolean')
|
||||
|
||||
account: (->
|
||||
@get('slug').split('/')[0]
|
||||
|
|
|
@ -328,7 +328,7 @@ Travis.ProfileRoute = Ember.Route.extend
|
|||
|
||||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('profile')
|
||||
@container.lookup('controller:accounts').set('content', Travis.Account.find())
|
||||
@container.lookup('controller:accounts').set('content', Travis.Account.find(all: true))
|
||||
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'profile')
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{{t profiles.show.message.your_repos}}}
|
||||
</p>
|
||||
|
||||
{{#if hooks.isLoaded}}
|
||||
{{#if allHooks.isLoaded}}
|
||||
{{#if user.isSyncing}}
|
||||
<p class="message loading">
|
||||
<span>Please wait while we sync from GitHub</span>
|
||||
|
@ -35,10 +35,33 @@
|
|||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
{{#if unAdminisetableHooks.length}}
|
||||
You do not have any repositories, which you can manage
|
||||
{{else}}
|
||||
You do not seem to have any repositories that we could sync.
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
{{#if unAdminisetableHooks.length}}
|
||||
<div id="unadministerable-hooks">
|
||||
<h3>Repositories without admin access</h3>
|
||||
|
||||
<p class="tip">
|
||||
These are the repositories, which we synced, but you do not seem to have admin access for them.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
{{#each hook in unAdminisetableHooks}}
|
||||
<li {{bindAttr class="hook.active:active"}}>
|
||||
<a {{bindAttr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
|
||||
<p class="description">{{hook.description}}</p>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p class="message loading">
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
@import "_mixins/all"
|
||||
|
||||
#hooks
|
||||
#profile
|
||||
#unadministerable-hooks
|
||||
margin-top: 15px
|
||||
h3
|
||||
font-size: $font-size-big
|
||||
.tip
|
||||
margin-top: 5px
|
||||
|
||||
#hooks, #unadministerable-hooks
|
||||
// @include list-base
|
||||
margin-top: 10px
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user