tangled
alpha
login
or
join now
diffdown.com
/
diffdown-app
0
fork
atom
Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
0
fork
atom
overview
issues
10
pulls
pipelines
Add 'Documents Shared with You' section to dashboard
diffdown.com
2 weeks ago
c55e4563
86297b5b
+27
-5
1 changed file
expand all
collapse all
unified
split
templates
documents.html
+27
-5
templates/documents.html
reviewed
···
11
11
<a href="/docs/new" class="btn">New Document</a>
12
12
</div>
13
13
</div>
14
14
-
{{with .Content}}
15
14
<div class="repo-list" id="doc-list">
16
16
-
{{range .}}
15
15
+
{{range .Content.OwnDocs}}
17
16
<a href="/docs/{{.RKey}}" class="repo-card">
18
17
<h3>{{.Title}}</h3>
19
18
{{if .UpdatedAt}}
···
29
28
</div>
30
29
{{end}}
31
30
</div>
31
31
+
32
32
+
{{if .Content.SharedDocs}}
33
33
+
<div class="dashboard-header" style="margin-top:2rem">
34
34
+
<h2>Documents Shared with You</h2>
35
35
+
</div>
36
36
+
<div class="repo-list" id="shared-list">
37
37
+
{{range .Content.SharedDocs}}
38
38
+
<a href="/docs/{{.OwnerDID}}/{{.RKey}}" class="repo-card">
39
39
+
<h3>{{.Title}}</h3>
40
40
+
{{if .UpdatedAt}}
41
41
+
<time>Updated {{.UpdatedAt | fmtdate}}</time>
42
42
+
{{else}}
43
43
+
<time>Created {{.CreatedAt | fmtdate}}</time>
44
44
+
{{end}}
45
45
+
</a>
46
46
+
{{end}}
47
47
+
</div>
32
48
{{end}}
33
49
</div>
34
50
{{end}}
···
36
52
<script>
37
53
(function() {
38
54
function setView(v) {
39
39
-
var list = document.getElementById('doc-list');
55
55
+
var lists = [document.getElementById('doc-list'), document.getElementById('shared-list')];
40
56
var btnCards = document.getElementById('btn-cards');
41
57
var btnList = document.getElementById('btn-list');
58
58
+
lists.forEach(function(list) {
59
59
+
if (!list) return;
60
60
+
if (v === 'list') {
61
61
+
list.classList.add('list-view');
62
62
+
} else {
63
63
+
list.classList.remove('list-view');
64
64
+
}
65
65
+
});
42
66
if (v === 'list') {
43
43
-
list.classList.add('list-view');
44
67
btnList.classList.add('active');
45
68
btnCards.classList.remove('active');
46
69
} else {
47
47
-
list.classList.remove('list-view');
48
70
btnCards.classList.add('active');
49
71
btnList.classList.remove('active');
50
72
}