-
Notifications
You must be signed in to change notification settings - Fork 8
/
admin.html
101 lines (89 loc) · 3.92 KB
/
admin.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{.Title}}</title>
<meta name="description" content="{{.Intro}}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/app/css/normalize.css">
<link rel="stylesheet" href="/static/app/css/skeleton.css">
<link rel="stylesheet" href="/static/app/css/app.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="icon" href="/static/custom/favicon.ico" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css2?family=Inter&display=swap" rel="stylesheet">
</head>
<body>
<div class="container admin">
<section class="header">
<a href="/">
<img width="100px" src="{{.LogoURL}}">
</a>
<h3>{{.Title}}</h3>
<h5>{{.Intro}}</h5>
</section>
<hr>
<span class="error">{{.Error}}</span>
<span class="success">{{.Success}}</span>
<h5>New Link</h5>
<form action="/admin/links/new" method="POST">
<label for="url">URL*</label>
<div class="row">
<div class="eight columns">
<input class="u-full-width" placeholder="https://" type="url" name="url"
{{ with .OGPURL }} value= "{{.}}" {{ end }}
>
</div>
<div class="four columns">
<input class="u-full-width" type="submit" type="submit" name="submit" value="Fetch Data">
</div>
</div>
<label for="text">Text*</label>
<input class="u-full-width" placeholder="Description" type="text" name="text"
{{ with .OGPDesc }} value= "{{.}}" {{ end }}
><br>
<label for="image_url">Image URL</label>
<input class="u-full-width" placeholder="https://" type="url" name="image_url"
{{ with .OGPImage }} value= "{{.}}" {{ end }}
><br>
<input type="submit" type="submit" name="submit" value="Submit">
</form>
<hr>
{{ range .Links }}
<div class="stats">
<a href="/admin/links/{{.ID}}/weight?action=up">Up</a>
<a>
({{.Weight}})
</a>
<a href="/admin/links/{{.ID}}/weight?action=down">Down</a>
<div class="push"></div>
<a href="/admin/links/{{.ID}}/delete">Delete</a>
</div>
<div class="row link">
<div class="linker">
{{if .ImageURL}}
<div class="thumb">
<img class="thumbnail" src="{{.ImageURL}}">
</div>
{{end}}
<div class="data">
<span class="text">
{{ .Text }}
</span>
</div>
</div>
</div>
<div class="stats">
<div class="push"></div>
<span>Clicks: {{.Hits}}</span>
</div>
<form action="/admin/links/{{.ID}}/update" action="POST">
<input class="u-full-width" name="text" value="{{ .Text }}" type="text"><br>
<input class="u-full-width" name="url" value="{{ .URL }}" type="text"><br>
<input class="u-full-width" name="image_url" value="{{ .ImageURL }}" type="text"><br>
<input class="u-full-width" type="submit" type="submit" value="Update">
</form>
{{ end }}
</div>
</body>
</html>