<p class="tip">
  {{{t profiles.show.message.your_repos}}}
</p>

{{#if allHooks.isLoaded}}
  {{#if user.isSyncing}}
    <p class="message loading">
      <span>Please wait while we sync 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 {{bindAttr class="hook.active:active"}}>
          <a {{bindAttr 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">
            <a {{bindAttr href="hook.urlGithubAdmin"}} class="github-admin tool-tip" title="Github service hooks admin page"></a>
            <a {{action "toggle" hook}} class="switch">
              {{#if hook.active}}
                ON
              {{else}}
                OFF
              {{/if}}
            </a>
          </div>
        </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">
    <span>Loading</span>
  </p>
{{/if}}


