Skip to main content

max / makenotwork

1.2 KB · 30 lines History Blame Raw
1 {# Notes on the object a page is showing. Expects `notes: Vec<CommitNote>`.
2 Shared by the commit page (notes on the commit) and the file view (notes on
3 the blob), so the two cannot drift. #}
4 {% if !notes.is_empty() %}
5 <div class="git-notes" id="notes">
6 {% for note in notes %}
7 <div class="git-note">
8 <div class="git-note-header">
9 <span class="git-note-namespace">{{ note.namespace }}</span>
10 {% if note.read_only %}
11 {# Says where it came from, so a note nobody on the repo wrote does
12 not read as one of theirs they have forgotten. #}
13 <span class="git-note-owned">written by makenot.work</span>
14 {% endif %}
15 {% if let Some(a) = note.attribution %}
16 <span class="git-note-attribution">
17 {% if a.exact %}
18 {{ a.by }} &middot; {{ a.when }}
19 {% else %}
20 edited since {{ a.short_commit }} &middot; {{ a.when }}
21 {% endif %}
22 </span>
23 {% endif %}
24 </div>
25 <div class="git-note-body git-readme-body">{{ note.html|safe }}</div>
26 </div>
27 {% endfor %}
28 </div>
29 {% endif %}
30