aboutsummaryrefslogtreecommitdiff
path: root/tmpl/index.tmpl
blob: 7fa81900242ed98649ac8d71e48fa30bb1abac09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{{- /*
     * vim: filetype=gotmpl
     *
     * Copyright (c) 2024 Runxi Yu
     * SPDX-License-Identifier: AGPL-3.0-or-later
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Affero General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU Affero General Public License for more details.
     *
     * You should have received a copy of the GNU Affero General Public License
     * along with this program.  If not, see <https://www.gnu.org/licenses/>.
     */ -}}
{{- define "index" -}}
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>
			Home &ndash; FBFP
		</title>
		<link rel="stylesheet" href="/static/style.css" />
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<style>
				.tp-columns {
					display: flex;
					flex-direction: row;
					@media(max-width: 50rem) {
						flex-wrap: wrap;
						gap: 0rem;
					}
					gap: 2rem;
					align-items: stretch;
				}

				.tp-columns div {
					min-width: 18em;
					/* max-width: 40rem; */
					width: 100%;
					margin-left: auto;
					margin-right: auto;
				}
		</style>
	</head>
	<body>
		<header>
			<div class="header-content">
				<div class="header-left">
					<h1><a id="site-title" href="/">FBFP</a></h1>
				</div>
				<div class="header-middle">
				</div>
				<div class="header-right">
					<p>{{- .user.Name -}}</p>
				</div>
			</div>
		</header>
		<main class="tp-columns">
			<div class="tp-columns">
				<div id="yours">
					<table class="wide">
						<tr>
							<th colspan=3>Your Works</th>
						</tr>
						<tr>
							<th class="min" scope="col">ID</th>
							<th class="min" scope="col">Flags</th>
							<th scope="col">Title</th>
						</tr>
						{{- range .works }}
						<tr>
							<th scope="row" class="min">{{ .id }}</th>
							<td class="min flags">{{- if .public -}}<abbr title="Public">P</abbr>{{- else -}}<abbr title="Private">x</abbr>{{- end -}}{{- if .active -}}<abbr title="Active">!</abbr>{{- else -}}<abbr title="Inactive">-</abbr>{{- end -}}{{- if .anonymous -}}<abbr title="Anonymous">*</abbr>{{- else -}}<abbr title="Non-anonymous">@</abbr>{{- end -}}</td>
							<td><a href="./works/{{- .id -}}">{{- .title -}}</a></td>
						</tr>
						{{ end -}}
						<tr>
							<th colspan="3">
								<div class="flex-justify">
									<a class="btn-primary btn" href="./works/new">New</a>
								</div>
							</th>
						</tr>
					</table>
				</div>
				<div id="others">
					<table class="wide">
						<tr>
							<th colspan=3>Active Works from Others</th>
						</tr>
						<tr>
							<th class="min" scope="col">ID</th>
							<th class="min" scope="col">Author</th>
							<th scope="col">Title</th>
						</tr>
						{{- /*
						{% for w in wothers %}
						<tr>
							<th scope="row" class="min">{{ w.id }}</th>
							{% if w.anonymous %}
							<td class="min anonymous">Anonymous</td>
							{% else %}
							<td class="min"><a href="{{ url_for(".user", oid=w.user.oid) }}">{{ w.user.name }}</a></td>
							{% endif %}
							<td><a href="{{ url_for(".work", id=w.id) }}">{{ w.title }}</a></td>
						</tr>
						{% endfor %}
						*/ -}}
						<tr>
							<th colspan="3">
								<div class="flex-justify">
									<a class="btn-primary btn" href="{{- /* url_for(".list_") */ -}}">List all</a>
								</div>
							</th>
						</tr>
					</table>
				</div>
			</div>
		</main>
	</body>
</html>
{{- end -}}