{% if tokens.is_empty() %}<pclass="empty small pad">No tokens yet.</p>{% else %}
22
<ulclass="rows token-rows">
23
{% for t in tokens %}
24
<li>
25
<divclass="token-main">
26
<divclass="token-name"><strong>{{ t.name }}</strong>{% if t.agent %} <spanclass="pill agent-pill"title="What is done with this token is told to you">agent</span>{% endif %}</div>
27
<divclass="token-scopes">{% for sc in t.scopes.split(',') %}<codeclass="chip">{{ sc }}</code>{% endfor %}{% if !t.repos.is_empty() %} <spanclass="small mute">only {{ t.repos }}</span>{% endif %}</div>
28
<divclass="small mute">created <timetitle="{{ t.created_ms|when_i }}">{{ t.created_ms|ago_i }}</time> · last used {% if let Some(u) = t.last_used_ms %}<timetitle="{{ u|when_i }}">{{ u|ago_i }}</time>{% else %}never{% endif %} · {% if let Some(x) = t.expires_ms %}expires {{ x|when_i }}{% if t.renew_ms.is_some() %} (renewed on use){% endif %}{% else %}never expires{% endif %}</div>
29
</div>
30
<divclass="token-actions">
31
<formclass="inline"method="post"action="/settings/tokens/{{ t.id }}/agent"><inputtype="hidden"name="_csrf"value="{{ shell.csrf }}"><buttonclass="small"title="{% if t.agent %}Stop telling me what is done with it{% else %}An agent uses this token: tell me what it does{% endif %}">{% if t.agent %}Not an agent{% else %}Mark as agent{% endif %}</button></form>
{% for (name, what) in scopes %}<label><inputtype="checkbox"name="scopes"value="{{ name }}"{% if *name == "repo:read" || *name == "repo:write" %} checked{% endif %}><code>{{ name }}</code><spanclass="small mute">{{ what }}</span></label>{% endfor %}
47
</div>
48
<labelfor="repos">Only these repositories (comma-separated owner/name; empty for all)</label><inputtype="text"id="repos"name="repos">
49
<labelfor="expires_days">Expires after (days; empty for never)</label><inputtype="number"id="expires_days"name="expires_days"min="1">
50
<labelclass="choice token-agent"><inputtype="checkbox"name="agent"value="1"> An agent uses this token: tell me what it does</label>
51
<pclass="small mute token-hint">Proposals it opens, comments it makes and the rest reach your inbox and email like anyone else's would.</p>