Login
4 branches 0 tags
Ben (Desktop/Arch) Improved sidebar and removed superfluous session_user cookie 0f57547 1 month ago 154 Commits
rubhub / templates / project_commits.html
<!DOCTYPE html>
<html>

  <head>
    <title>{{ owner.name }}/{{ project.name }}</title>
  </head>

  <body>
    {% include "sidebar.html" %}
    <main>
      <section>
        <div class="page-header">
          <h1 class="project-header">
            <a href="{{ owner.uri() }}">{{ owner.name }}</a> /
            <a href="{{ project.uri() }}">{{ project.name }}</a> /
            <a href="{{ project.uri_log(selected_branch, 0) }}">log {{ selected_branch }}</a>
          </h1>
        </div>

        <div class="card">
          <div class="repo-bar">
            {% if summary.branches.len() > 0 %}
            <select name="branch-name" class="branch-switcher" data-base-suffix="log" data-base-href="{{ project.uri() }}">
              {% for branch in summary.branches %}
              <option value="{{ branch }}" {% if branch==selected_branch.as_str() %}selected{% endif %}>{{ branch
                }}</option>
              {% endfor %}
            </select>
            {% else %}
            <select name="branch-name" disabled>
              <option selected>Empty Repo</option>
            </select>
            {% endif %}

            <span class="repo-branches">
              <a href="{{ project.uri_branches() }}">
                ⎇ {{ summary.branches.len() }} branch{% if summary.branches.len() != 1 %}es{% endif %}
              </a>
            </span>

            <span class="repo-tags">
              <a href="{{ project.uri_tags() }}">
                🏷 {{ summary.tags.len() }} Tag{% if summary.tags.len() != 1 %}s{% endif %}
              </a>
            </span>

            <div class="flex-gap"> </div>

            {% include "project_clone_url.html" %}
          </div>

          {% if let Some(info) = info %}
          <div class="commit-bar">
            {% if info.commits.is_empty() %}
            <p>No commits available</p>
            {% else %}
            {% for commit in info.commits %}
            <div class="commit">
              <span class="commit-author" title="{{ commit.author }}">{{ commit.author }}</span>
              <span class="commit-message" title="{{ commit.message }}">{{ commit.message }}</span>
              <a href="{{ project.uri_tree(&commit.id, "") }}" class="commit-id">{{ commit.id }}</a>
              <span class="commit-time">{{ commit.relative_time() }}</span>
            </div>
            {% endfor %}
            {% endif %}

            <nav class="pagination">
              <a href="{{ project.uri_log(selected_branch, 0) }}" class="start">⇤</a>
              {% if current_page > 0 %}
              <a href="{{ project.uri_log(selected_branch, current_page - 1) }}" class="prev">⇠</a>
              {% else %}
              <a href="{{ project.uri_log(selected_branch, 0) }}" class="prev disabled">⇠</a>
              {% endif %}

              {% for page in page_min..=page_max %}
              <a href="{{ project.uri_log(selected_branch, *page) }}" class="{% if page == current_page %}active{% endif %}">{{ page }}</a>
              {% endfor %}

              {% if current_page < page_count %}
                                   <a href="{{ project.uri_log(selected_branch, current_page + 1) }}" class="next">⇢</a>
                                   {% else %}
                                   <a href="{{ project.uri_log(selected_branch, *page_count) }}?page={{ page_count }}" class="next disabled">⇢</a>
                                   {% endif %}
                                   <a href="{{ project.uri_log(selected_branch, *page_count) }}" class="end">⇥</a>
            </nav>
          </div>
          {% endif %}
        </div>
      </section>
    </main>
  </body>

</html>