OXYGENHUB
# f8cf54e99879 oxygenhub / templates / dashboard.html
4.3 KiB · HTML · last changed feat(web): the dashboard in cards, like the repository page (closes #155) 22 days ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}Dashboard{% endblock %}
3
{% block content %}
4
<div class="head">
5
  <h1>Dashboard <small>signed in as {% if let Some(u) = shell.user %}{{ u }}{% endif %}</small></h1>
6
</div>
7
<div class="side-layout rev dash">
8
  <div>
9
    <section class="card-box">
10
    <div class="card-head"><h2>Waiting for your review</h2><span class="count-chip">{{ reviews.len() }}</span></div>
11
    {% if reviews.is_empty() %}
12
    <p class="empty small">Nothing waits on you. Proposals by others in your repositories land here until you review them.</p>
13
    {% else %}
14
    <ul class="rows">
15
    {% for p in reviews %}
16
      <li>
17
        <div>
18
          <a class="name" href="/{{ p.owner }}/{{ p.name }}/proposal/{{ p.number }}"><span class="mute">{{ p.owner }}/{{ p.name }} #{{ p.number }}</span> <strong>{{ p.title }}</strong></a>
19
          {% if p.conflicted %}<span class="tag bad">conflicts</span>{% endif %}
20
          <p class="small">by {{ p.author }}</p>
21
        </div>
22
        <div class="right small">updated <time title="{{ p.updated_ms|when_i }}">{{ p.updated_ms|ago_i }}</time></div>
23
      </li>
24
    {% endfor %}
25
    </ul>
26
    {% endif %}
27
    </section>
28
29
    {% if !authored.is_empty() %}
30
    <section class="card-box">
31
    <div class="card-head"><h2>Your proposals</h2><span class="count-chip">{{ authored.len() }}</span></div>
32
    <ul class="rows">
33
    {% for p in authored %}
34
      <li>
35
        <div>
36
          <a class="name" href="/{{ p.owner }}/{{ p.name }}/proposal/{{ p.number }}"><span class="mute">{{ p.owner }}/{{ p.name }} #{{ p.number }}</span> <strong>{{ p.title }}</strong></a>
37
          {% if p.state == "draft" %}<span class="tag">draft</span>{% endif %}
38
          {% if p.conflicted %}<span class="tag bad">conflicts</span>{% endif %}
39
        </div>
40
        <div class="right small">updated <time title="{{ p.updated_ms|when_i }}">{{ p.updated_ms|ago_i }}</time></div>
41
      </li>
42
    {% endfor %}
43
    </ul>
44
    </section>
45
    {% endif %}
46
47
    {% if !assigned.is_empty() %}
48
    <section class="card-box">
49
    <div class="card-head"><h2>Issues assigned to you</h2><span class="count-chip">{{ assigned.len() }}</span></div>
50
    <ul class="rows">
51
    {% for i in assigned %}
52
      <li>
53
        <div><a class="name" href="/{{ i.owner }}/{{ i.name }}/issue/{{ i.number }}"><span class="mute">{{ i.owner }}/{{ i.name }} #{{ i.number }}</span> <strong>{{ i.title }}</strong></a></div>
54
        <div class="right small">updated <time title="{{ i.updated_ms|when_i }}">{{ i.updated_ms|ago_i }}</time></div>
55
      </li>
56
    {% endfor %}
57
    </ul>
58
    </section>
59
    {% endif %}
60
61
    <section class="card-box">
62
    <div class="card-head"><h2>Recent activity</h2></div>
63
    {% if feed.is_empty() %}
64
    <p class="empty small">No activity yet. Push to a repository and it shows here.</p>
65
    {% else %}
66
    <ul class="feed">
67
    {% for a in feed %}
68
      <li>
69
        <span class="who">{% if a.actor.is_empty() %}the hub{% else %}<img class="avatar xs" src="/avatar/{{ a.actor }}" alt=""> <a href="/{{ a.actor }}">{{ a.actor }}</a>{% endif %}</span>
70
        {% if a.kind == "push" %}pushed <span class="lbl lbl-bm">{{ a.event }}</span> to
71
        {% else if a.kind == "release" %}published <a href="{{ a.url() }}">{{ a.title }}</a> in
72
        {% else %}{{ a.event }} {{ a.kind }} <a href="{{ a.url() }}">#{{ a.number }} {{ a.title }}</a> in
73
        {% endif %}
74
        <a href="/{{ a.owner }}/{{ a.name }}">{{ a.owner }}/{{ a.name }}</a>
75
        <time class="mute small" title="{{ a.at_ms|when_i }}">{{ a.at_ms|ago_i }}</time>
76
      </li>
77
    {% endfor %}
78
    </ul>
79
    {% endif %}
80
    </section>
81
  </div>
82
  <aside class="side cards">
83
    <section class="side-card"><h3>Your repositories <span class="count-chip">{{ mine.len() }}</span><a class="more" href="/new">+ New</a></h3><div class="body">
84
    {% if mine.is_empty() %}
85
    <p class="small mute">None yet. <a href="/new">Create one</a>, or <a href="/explore">explore</a>.</p>
86
    {% else %}
87
    <ul class="plain repo-list">
88
    {% for r in mine %}
89
      <li><a href="/{{ r.owner }}/{{ r.name }}" title="{{ r.owner }}/{{ r.name }}"><span class="mute">{{ r.owner }} /</span> {{ r.name }}</a>{% if r.visibility != "public" %}<span class="tag">{{ r.visibility }}</span>{% endif %}</li>
90
    {% endfor %}
91
    </ul>
92
    {% endif %}
93
    </div></section>
94
  </aside>
95
</div>
96
{% endblock %}