travis-web/assets/scripts/app/templates/account.hbs
Piotr Sarnacki 52dea338ee Refactor handling accounts
This commit changes a way we load accounts for profile view:

* instead of using several views with profile controllers, always use
  one view to render hooks. This is achieved by redirecting to
  individual account page from main profile page (for example when going
  into /profile as a user drogus, the effective address will be
  /profile/drogus)
* instead of using observers to wait for accounts to load I just use
  promise in ProfileRoute#model which effectively ensures that accounts
  are loaded at the time we want to select an individual account
* profile controller is split into profile and account controller
2014-05-28 10:23:39 +02:00

79 lines
2.6 KiB
Handlebars

<p class="tip">
{{#if showPrivateReposHint}}
We're only showing <strong>your public repositories</strong> below.
You can find your <strong>private projects on <a href="https://travis-ci.com?utm_source=hooks">travis-ci.com</a></strong>.
{{/if}}
{{#if showPublicReposHint}}
We're only showing <strong>your private repositories</strong> below.
You can find your <strong>public projects on <a href="https://travis-ci.org?utm_source=hooks">travis-ci.org</a></strong>.
{{/if}}
</p>
<p class="tip">
Enable your projects below by flicking the switch, add a <a href="http://docs.travis-ci.com">.travis.yml</a> to your project, and push a new commit to
GitHub.
</p>
{{#if allHooks.isLoaded}}
{{#if user.isSyncing}}
<p class="message loading">
<span>Please wait while we synchronize your data from GitHub</span>
</p>
{{else}}
<p class="message">
Last synchronized from GitHub: {{formatTime user.syncedAt}}
<a class="sync_now button" {{action "sync"}}>
Sync now
</a>
</p>
<ul id="hooks">
{{#each hook in hooks}}
<li {{bind-attr class="hook.active:active"}}>
<a {{bind-attr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
{{#if hook.isSaving}}<span class="loading"></span>{{/if}}
<p class="description">{{hook.description}}</p>
<div class="controls">
{{#link-to "repo.settings" hook.repo class="repo-settings-icon tool-tip" title="Repository settings"}}{{/link-to}}
{{travis-switch action="toggle" target=hook toggleAutomatically="false"}}
</div>
</li>
{{else}}
<li>
{{#if hooksWithoutAdmin.length}}
Sorry, but we can't find any repositories you have admin access to.
{{else}}
Sorry, it seems like we couldn't find any repositories you have access to on GitHub.
{{/if}}
</li>
{{/each}}
</ul>
{{#if hooksWithoutAdmin.length}}
<div id="unadministerable-hooks">
<h3>Repositories without admin access</h3>
<p class="tip">
You only have pull or push access to the repositories below.
</p>
<ul>
{{#each hook in hooksWithoutAdmin}}
<li {{bind-attr class="hook.active:active"}}>
<a {{bind-attr 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">
<span>Loading</span>
</p>
{{/if}}