vextoly/gitman

Fork of patx/gitman.

% rebase("base.tpl", title=file_path + " at " + repo["owner_username"] + "/" + repo["name"], user=user, error=error, notice=notice)

<section class="repo-header slim">
  <div>
    % include("repo_fork_eyebrow.tpl")
    % include("repo_title.tpl", repo=repo)
    
    % include("repo_nav.tpl", repo=repo, commit_count=commit_count, issue_counts=issue_counts, pr_counts=pr_counts, star_count=star_count, is_starred=is_starred, is_owner=is_owner, can_maintain=can_maintain)
    
    <div class="breadcrumb">
      <a href="{{url_with_ref('/' + repo['owner_username'] + '/' + repo['name'] + '/src', selected_ref)}}">root</a>
      % parts = file_path.split("/")
      % running = ""
      % for index, part in enumerate(parts):
        % running = part if not running else running + "/" + part
        <span>/</span>
        % if index + 1 == len(parts):
          <span>{{part}}</span>
        % else:
          <a href="{{url_with_ref('/' + repo['owner_username'] + '/' + repo['name'] + '/src/' + quote_path(running), selected_ref)}}">{{part}}</a>
        % end
      % end
      <a href="{{url_with_ref('/' + repo['owner_username'] + '/' + repo['name'] + '/raw/' + quote_path(file_path), selected_ref)}}">[View Raw]</a>
    </div>
  </div>
</section>

<section class="panel">
  % if is_binary:
    <p class="empty">Binary file, {{size}} bytes. Use the raw view to download it.</p>
  % else:
    <div class="copyable-code" data-code-viewer>
      <div class="code-actions">
        % edit_url = "/" + repo['owner_username'] + "/" + repo['name'] + "/edit/" + quote_path(file_path)
        % if selected_ref and selected_ref['type'] == 'branch' and selected_ref.get('name'):
          % edit_url += "?ref_type=branch&ref=" + selected_ref['name']
        % end
        % if can_maintain:
          <a
            class="copy-button"
            href="{{edit_url}}"
            aria-label="Edit file"
            title="Edit file"
          >
            <svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
              <path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"/>
            </svg>
            <span class="sr-only">Edit file</span>
          </a>
        % end
        <button
          class="copy-button"
          type="button"
          aria-label="Copy file contents"
          title="Copy file contents"
          data-copy-raw-url="{{url_with_ref('/' + repo['owner_username'] + '/' + repo['name'] + '/raw/' + quote_path(file_path), selected_ref)}}"
        >
          <svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
            <path d="M10 1.5H3.5A1.5 1.5 0 0 0 2 3v8A1.5 1.5 0 0 0 3.5 12.5H5v-1H3.5A.5.5 0 0 1 3 11V3a.5.5 0 0 1 .5-.5H10z"/>
            <path d="M6.5 4A1.5 1.5 0 0 0 5 5.5v7A1.5 1.5 0 0 0 6.5 14h6A1.5 1.5 0 0 0 14 12.5v-7A1.5 1.5 0 0 0 12.5 4zm0 1h6a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5v-7a.5.5 0 0 1 .5-.5"/>
          </svg>
          <span class="sr-only">Copy file contents</span>
        </button>
      </div>
      <pre class="code"><code class="{{language_class}}">{{content}}</code></pre>
    </div>
  % end
</section>