~edwargix/git.sr.ht

62451100655a5a7a7175fe62d193842ebe92c780 — Drew DeVault 6 years ago 8ebcbd6
More small stylistic changes
3 files changed, 27 insertions(+), 22 deletions(-)

M gitsrht/blueprints/public.py
M gitsrht/templates/index.html
M gitsrht/templates/user.html
M gitsrht/blueprints/public.py => gitsrht/blueprints/public.py +4 -4
@@ 112,18 112,18 @@ def user_index(username):
                Repository.description.ilike("%" + search + "%")))
    repos = repos.order_by(Repository.updated.desc())
    total_repos = repos.count()
    total_pages = repos.count() // 5 + 1
    if total_repos % 5 == 0:
    total_pages = repos.count() // 10 + 1
    if total_repos % 10 == 0:
        total_pages -= 1
    if page:
        try:
            page = int(page) - 1
            repos = repos.offset(page * 5)
            repos = repos.offset(page * 10)
        except:
            page = None
    else:
        page = 0
    repos = repos.limit(5).all()
    repos = repos.limit(10).all()
    r = requests.get(meta_uri + "/api/user/profile", headers={
        "Authorization": "token " + user.oauth_token
    }) # TODO: cache

M gitsrht/templates/index.html => gitsrht/templates/index.html +3 -1
@@ 24,9 24,11 @@
            <a href="/~{{current_user.username}}/{{repo.name}}">
              ~{{current_user.username}}/{{repo.name}}
            </a>
            {% if repo.visibility.value != 'public' %}
            <small class="pull-right">
              {{ repo.updated | date }}
              {{ repo.visibility.value }}
            </small>
            {% endif %}
          </h4>
          {% if repo.description %}
          <p>{{ repo.description }}</p>

M gitsrht/templates/user.html => gitsrht/templates/user.html +20 -17
@@ 54,24 54,27 @@
          class="form-control"
          value="{{ search if search else "" }}" />
      </form>
      {% for repo in repos %}
        <h4>
          <a href="/~{{user.username}}/{{repo.name}}">
            ~{{user.username}}/{{repo.name}}
          </a>
          {% if repo.visibility.value != 'public' %}
          <small class="text-muted">
            <em>{{ repo.visibility.value }}</em>
          </small>
      <div class="event-list">
        {% for repo in repos %}
        <div class="event">
          <h4>
            <a href="/~{{user.username}}/{{repo.name}}">
              ~{{user.username}}/{{repo.name}}
            </a>
            {% if repo.visibility.value != 'public' %}
            <small class="pull-right">
              {{ repo.visibility.value }}
            </small>
            {% endif %}
          </h4>
          {% if repo.description %}
          <p>{{ repo.description }}</p>
          {% endif %}
        </h4>
        {% if repo.description %}
        <p>{{ repo.description }}</p>
        {% endif %}
        <p>
          <em class="text-muted">Last updated {{ repo.updated | date }}</em>
        </p>
      {% endfor %}
          <p>
          </p>
        </div>
        {% endfor %}
      </div>
      {% endif %}
      {% if total_pages > 1 %}
      <div class="row">