blob: d48aaebd29f0fcf6cae44f949876d42301cabdb5 [file] [log] [blame]
DTabidzeb00a1db2024-01-12 18:30:14 +04001<!DOCTYPE html>
Davit Tabidzef99bc4f2024-01-17 22:37:32 +04002<html lang="en" data-theme="light">
DTabidzeb00a1db2024-01-12 18:30:14 +04003<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>URL Shortener</title>
Davit Tabidzef99bc4f2024-01-17 22:37:32 +04007 <link rel="stylesheet" href="/static/pico.min.css">
8 <script type="application/javascript" src="/static/main.js"></script>
DTabidzeb00a1db2024-01-12 18:30:14 +04009</head>
Davit Tabidzef99bc4f2024-01-17 22:37:32 +040010<body class="container">
DTabidzeb00a1db2024-01-12 18:30:14 +040011 <h1>URL Shortener</h1>
DTabidzeb00a1db2024-01-12 18:30:14 +040012 <form action="/" method="post">
13 <label for="address">Address:</label>
14 <input type="text" id="address" name="address" required>
DTabidzeb00a1db2024-01-12 18:30:14 +040015 <label for="custom">Custom Name (optional):</label>
16 <input type="text" id="custom" name="custom">
DTabidzeb00a1db2024-01-12 18:30:14 +040017 <button type="submit">Shorten URL</button>
18 </form>
DTabidzeb00a1db2024-01-12 18:30:14 +040019 <h2>Named Addresses:</h2>
20 <table>
21 <tr>
22 <th>Name</th>
23 <th>Address</th>
DTabidzeb00a1db2024-01-12 18:30:14 +040024 <th>Active</th>
25 </tr>
DTabidze71353b52024-01-17 16:02:55 +040026 {{- range .NamedAddresses -}}
DTabidzeb00a1db2024-01-12 18:30:14 +040027 <tr>
28 <td><a href="{{ .Name }}" target="_blank">{{ .Name }}</a></td>
29 <td>{{ .Address }}</td>
DTabidze71353b52024-01-17 16:02:55 +040030 <td>
31 <input type="checkbox" role="switch" {{ if .Active }}checked{{ end }} onclick="toggle('{{ .Name }}', {{ not .Active }});">
32 </td>
DTabidzeb00a1db2024-01-12 18:30:14 +040033 </tr>
DTabidze71353b52024-01-17 16:02:55 +040034 {{- end -}}
DTabidzeb00a1db2024-01-12 18:30:14 +040035 </table>
36</body>
DTabidzeb00a1db2024-01-12 18:30:14 +040037</html>