Author | Jakob Wakeling <[email protected]> |
Date | 2024-01-08 09:23:49 |
Commit | 71b7f193d76588ec5966a027b798ef8824c857fd |
Parent | 594ec417f426c15db7124a13480e9792dacd0205 |
Add missing <html> tag in HTML templates
Diffstat
M | README.md | | | 2 | ++ |
M | res/admin/cron.html | | | 60 | +++++++++++++++++++++++++++++++----------------------------- |
M | res/admin/repo_edit.html | | | 190 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/admin/repos.html | | | 62 | ++++++++++++++++++++++++++++++++------------------------------ |
M | res/admin/status.html | | | 66 | ++++++++++++++++++++++++++++++++++-------------------------------- |
M | res/admin/user_create.html | | | 52 | +++++++++++++++++++++++++++------------------------- |
M | res/admin/user_edit.html | | | 56 | +++++++++++++++++++++++++++++--------------------------- |
M | res/admin/users.html | | | 58 | ++++++++++++++++++++++++++++++---------------------------- |
M | res/error.html | | | 22 | ++++++++++++---------- |
M | res/index.html | | | 102 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/repo/commit.html | | | 76 | +++++++++++++++++++++++++++++++++++++++------------------------------------- |
M | res/repo/create.html | | | 128 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/repo/edit.html | | | 190 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/repo/file.html | | | 44 | +++++++++++++++++++++++--------------------- |
M | res/repo/log.html | | | 94 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/repo/refs.html | | | 110 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/repo/tree.html | | | 82 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/user/edit.html | | | 90 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | res/user/login.html | | | 70 | ++++++++++++++++++++++++++++++++++++---------------------------------- |
M | res/user/sessions.html | | | 58 | ++++++++++++++++++++++++++++++---------------------------- |
M | src/main.go | | | 4 | ++-- |
21 files changed, 828 insertions, 788 deletions
diff --git a/README.md b/README.md index 9954bd5..0510319 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A simple and lightweight Git web server. +Note that at present, compatibility between updates is not guaranteed. + ## Features - Git Smart HTTP protocol (v2 only) diff --git a/res/admin/cron.html b/res/admin/cron.html index a14243d..ad97916 100644 --- a/res/admin/cron.html +++ b/res/admin/cron.html @@ -1,30 +1,32 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <table class="highlight-row"> - <thead> - <tr> - <td><b>ID</b></td> - <td><b>Repository</b></td> - <td><b>Schedule</b></td> - <td><b>Next</b></td> - <td><b>Last</b></td> - </tr> - </thead> - <tbody> - {{range .Jobs}} - <tr> - <td>{{.Id}}</td> - <td><a href="/{{.Repo}}">{{.Repo}}</a></td> - <td>{{.Schedule}}</td> - <td>{{.Next}}</td> - <td>{{.Last}}</td> - </tr> - {{end}} - </tbody> - </table><hr> - <span>Schedule format is month, day, weekday, hour, minute, second, where an asterisk represents "any".</span> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>ID</b></td> + <td><b>Repository</b></td> + <td><b>Schedule</b></td> + <td><b>Next</b></td> + <td><b>Last</b></td> + </tr> + </thead> + <tbody> + {{range .Jobs}} + <tr> + <td>{{.Id}}</td> + <td><a href="/{{.Repo}}">{{.Repo}}</a></td> + <td>{{.Schedule}}</td> + <td>{{.Next}}</td> + <td>{{.Last}}</td> + </tr> + {{end}} + </tbody> + </table><hr> + <span>Schedule format is month, day, weekday, hour, minute, second, where an asterisk represents "any".</span> + </main> + </body> +</html> diff --git a/res/admin/repo_edit.html b/res/admin/repo_edit.html index e5b9364..610c1da 100644 --- a/res/admin/repo_edit.html +++ b/res/admin/repo_edit.html @@ -1,96 +1,98 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <h1>{{.Title}}</h1><hr> - <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="edit"> - <table> - <tr> - <td style="text-align: right;"><span>ID</span></td> - <td><span>{{.Edit.Id}}</span></td> - </tr> - <tr> - <td style="text-align: right;"><span>Owner</span></td> - <td><span>{{.Edit.Owner}}</span></td> - </tr> - <tr> - <td style="text-align: right;"><label for="reponame">Name</label></td> - <td><input type="text" name="reponame" value="{{.Edit.Name}}" spellcheck="false"></td> - </tr> - <tr> - <td style="text-align:right; vertical-align:top;"><label for="description">Description</label></td> - <td><textarea name="description" spellcheck="false">{{.Edit.Description}}</textarea></td> - </tr> - <tr> - <td style="text-align: right;"><label for="branch">Default Branch</label></td> - <td><input type="text" name="branch" value="{{.Edit.DefaultBranch}}" placeholder="master"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="visibility">Visibility:</label></td> - <td> - <select name="visibility"> - <option value="public">Public</option> - <option value="private" {{if .Edit.IsPrivate}}selected{{end}}>Private</option> - </select> - </td> - </tr> - <tr> - <td style="text-align: right;"><label for="upstream">Upstream</label></td> - <td><input type="text" name="upstream" value="{{.Edit.Upstream}}" spellcheck="false"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="mirror">Mirror</label></td> - <td> - <input type="checkbox" name="mirror" value="mirror" {{if .Edit.IsMirror}}checked{{end}}> - <span id="mirror-warn">Enabling mirror will replace any existing repository data</span> - </td> - </tr> - <tr> - <td></td> - <td> - <input type="submit" value="Update"> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <h1>{{.Title}}</h1><hr> + <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="edit"> + <table> + <tr> + <td style="text-align: right;"><span>ID</span></td> + <td><span>{{.Edit.Id}}</span></td> + </tr> + <tr> + <td style="text-align: right;"><span>Owner</span></td> + <td><span>{{.Edit.Owner}}</span></td> + </tr> + <tr> + <td style="text-align: right;"><label for="reponame">Name</label></td> + <td><input type="text" name="reponame" value="{{.Edit.Name}}" spellcheck="false"></td> + </tr> + <tr> + <td style="text-align:right; vertical-align:top;"><label for="description">Description</label></td> + <td><textarea name="description" spellcheck="false">{{.Edit.Description}}</textarea></td> + </tr> + <tr> + <td style="text-align: right;"><label for="branch">Default Branch</label></td> + <td><input type="text" name="branch" value="{{.Edit.DefaultBranch}}" placeholder="master"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="visibility">Visibility:</label></td> + <td> + <select name="visibility"> + <option value="public">Public</option> + <option value="private" {{if .Edit.IsPrivate}}selected{{end}}>Private</option> + </select> + </td> + </tr> + <tr> + <td style="text-align: right;"><label for="upstream">Upstream</label></td> + <td><input type="text" name="upstream" value="{{.Edit.Upstream}}" spellcheck="false"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="mirror">Mirror</label></td> + <td> + <input type="checkbox" name="mirror" value="mirror" {{if .Edit.IsMirror}}checked{{end}}> + <span id="mirror-warn">Enabling mirror will replace any existing repository data</span> + </td> + </tr> + <tr> + <td></td> + <td> + <input type="submit" value="Update"> + <a href="/admin/repos" style="color: inherit;">Cancel</a> + </td> + </tr> + <tr> + <td></td> + <td><span style="color: #AA0000">{{.Edit.Message}}</span></td> + </tr> + </table> + </form> + <br><h2>Transfer Ownership</h2><hr> + <span>- You will lose access to this repository if it is not public.</span><br><br> + <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="transfer"> + <table> + <tr><td><label for="owner">New Owner</label></td></tr> + <tr><td><input type="text" name="owner" value="{{.Transfer.Owner}}" spellcheck="false"></td></tr> + <tr><td> + <input type="submit" value="Transfer"> <a href="/admin/repos" style="color: inherit;">Cancel</a> - </td> - </tr> - <tr> - <td></td> - <td><span style="color: #AA0000">{{.Edit.Message}}</span></td> - </tr> - </table> - </form> - <br><h2>Transfer Ownership</h2><hr> - <span>- You will lose access to this repository if it is not public.</span><br><br> - <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="transfer"> - <table> - <tr><td><label for="owner">New Owner</label></td></tr> - <tr><td><input type="text" name="owner" value="{{.Transfer.Owner}}" spellcheck="false"></td></tr> - <tr><td> - <input type="submit" value="Transfer"> - <a href="/admin/repos" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td style="color: #AA0000">{{.Transfer.Message}}</td></tr> - </table> - </form> - <br><h2>Delete Repository</h2><hr> - <span>- This operation <b>CANNOT</b> be undone.</span><br> - <span>- This operation will permanently delete the {{.Name}} repository and all associated data.</span><br><br> - <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="delete"> - <table> - <tr><td><label for="reponame">To confirm, type "{{.Name}}" in the box below</label></td></tr> - <tr><td><input type="text" name="reponame" spellcheck="false"></td></tr> - <tr><td> - <input type="submit" value="Delete"> - <a href="/admin/repos" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td style="color: #AA0000">{{.Delete.Message}}</td></tr> - </table> - </form> - </main> -</body> + </td></tr> + <tr><td style="color: #AA0000">{{.Transfer.Message}}</td></tr> + </table> + </form> + <br><h2>Delete Repository</h2><hr> + <span>- This operation <b>CANNOT</b> be undone.</span><br> + <span>- This operation will permanently delete the {{.Name}} repository and all associated data.</span><br><br> + <form action="/admin/repo/edit?repo={{.Edit.Id}}" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="delete"> + <table> + <tr><td><label for="reponame">To confirm, type "{{.Name}}" in the box below</label></td></tr> + <tr><td><input type="text" name="reponame" spellcheck="false"></td></tr> + <tr><td> + <input type="submit" value="Delete"> + <a href="/admin/repos" style="color: inherit;">Cancel</a> + </td></tr> + <tr><td style="color: #AA0000">{{.Delete.Message}}</td></tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/admin/repos.html b/res/admin/repos.html index 9f7b42a..a3657ca 100644 --- a/res/admin/repos.html +++ b/res/admin/repos.html @@ -1,31 +1,33 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <table class="highlight-row"> - <thead> - <tr> - <td><b>ID</b></td> - <td><b>Owner</b></td> - <td><b>Name</b></td> - <td><b>Visibility</b></td> - <td><b>Size</b></td> - <td></td> - </tr> - </thead> - <tbody> - {{range .Repos}} - <tr> - <td>{{.Id}}</td> - <td><a href="/?u={{.Owner}}">{{.Owner}}</a></td> - <td><a href="/{{.Name}}">{{.Name}}</a></td> - <td>{{.Visibility}}</td> - <td>{{.Size}}</td> - <td><a href="/admin/repo/edit?repo={{.Id}}">edit</a></td> - </tr> - {{end}} - </tbody> - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>ID</b></td> + <td><b>Owner</b></td> + <td><b>Name</b></td> + <td><b>Visibility</b></td> + <td><b>Size</b></td> + <td></td> + </tr> + </thead> + <tbody> + {{range .Repos}} + <tr> + <td>{{.Id}}</td> + <td><a href="/?u={{.Owner}}">{{.Owner}}</a></td> + <td><a href="/{{.Name}}">{{.Name}}</a></td> + <td>{{.Visibility}}</td> + <td>{{.Size}}</td> + <td><a href="/admin/repo/edit?repo={{.Id}}">edit</a></td> + </tr> + {{end}} + </tbody> + </table> + </main> + </body> +</html> diff --git a/res/admin/status.html b/res/admin/status.html index 5917200..7238303 100644 --- a/res/admin/status.html +++ b/res/admin/status.html @@ -1,33 +1,35 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <table> - <tr> - <td style="text-align: right;"><b>Version</b></td> - <td>{{.Version}}</td> - </tr> - <tr> - <td style="text-align: right;"><b>Uptime</b></td> - <td>{{.Uptime}}</td> - </tr> - <tr> - <td style="text-align: right;"><b>Goroutines</b></td> - <td>{{.Goroutines}}</td> - </tr> - <tr> - <td style="text-align: right;"><b>Memory</b></td> - <td>{{.Memory}}</td> - </tr> - <tr> - <td style="text-align: right;"><b>Stack Usage</b></td> - <td>{{.Stack}}</td> - </tr> - <tr> - <td style="text-align: right;"><b>Heap Usage</b></td> - <td>{{.Heap}}</td> - </tr> - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <table> + <tr> + <td style="text-align: right;"><b>Version</b></td> + <td>{{.Version}}</td> + </tr> + <tr> + <td style="text-align: right;"><b>Uptime</b></td> + <td>{{.Uptime}}</td> + </tr> + <tr> + <td style="text-align: right;"><b>Goroutines</b></td> + <td>{{.Goroutines}}</td> + </tr> + <tr> + <td style="text-align: right;"><b>Memory</b></td> + <td>{{.Memory}}</td> + </tr> + <tr> + <td style="text-align: right;"><b>Stack Usage</b></td> + <td>{{.Stack}}</td> + </tr> + <tr> + <td style="text-align: right;"><b>Heap Usage</b></td> + <td>{{.Heap}}</td> + </tr> + </table> + </main> + </body> +</html> diff --git a/res/admin/user_create.html b/res/admin/user_create.html index 10274eb..abdab43 100644 --- a/res/admin/user_create.html +++ b/res/admin/user_create.html @@ -1,26 +1,28 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <h1>{{.Title}}</h1><hr> - <form action="/admin/user/create" method="post"> - {{.CsrfField}} - <table> - <tr><td><label for="username">Username</label></td></tr> - <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> - <tr><td><label for="fullname">Full Name</label></td></tr> - <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> - <tr><td><label for="password">Password</label></td></tr> - <tr><td><input type="password" name="password"></td></tr> - <tr><td><label for="admin">Admin</label></td></tr> - <tr><td><input type="checkbox" name="admin" value="true" {{if .Form.IsAdmin}}checked{{end}}></td></tr> - <tr><td> - <input type="submit" name="submit" value="Create"> - <a href="/admin/users" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td><span style="color: #AA0000">{{.Message}}</span></td></tr> - </table> - </form> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <h1>{{.Title}}</h1><hr> + <form action="/admin/user/create" method="post"> + {{.CsrfField}} + <table> + <tr><td><label for="username">Username</label></td></tr> + <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> + <tr><td><label for="fullname">Full Name</label></td></tr> + <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> + <tr><td><label for="password">Password</label></td></tr> + <tr><td><input type="password" name="password"></td></tr> + <tr><td><label for="admin">Admin</label></td></tr> + <tr><td><input type="checkbox" name="admin" value="true" {{if .Form.IsAdmin}}checked{{end}}></td></tr> + <tr><td> + <input type="submit" name="submit" value="Create"> + <a href="/admin/users" style="color: inherit;">Cancel</a> + </td></tr> + <tr><td><span style="color: #AA0000">{{.Message}}</span></td></tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/admin/user_edit.html b/res/admin/user_edit.html index 5ea5aa3..3f83036 100644 --- a/res/admin/user_edit.html +++ b/res/admin/user_edit.html @@ -1,28 +1,30 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <h1>{{.Title}}</h1><hr> - <form action="/admin/user/edit?user={{.Form.Id}}" method="post"> - {{.CsrfField}} - <table> - <tr><td><label for="id">ID</label></td></tr> - <tr><td><span>{{.Form.Id}}</span></td></tr> - <tr><td><label for="username">Username</label></td></tr> - <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> - <tr><td><label for="fullname">Full Name</label></td></tr> - <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> - <tr><td><label for="password">Password</label></td></tr> - <tr><td><input type="password" name="password" placeholder="unchanged"></td></tr> - <tr><td><label for="admin">Admin</label></td></tr> - <tr><td><input type="checkbox" name="admin" value="true" {{if .Form.IsAdmin}}checked{{end}}></td></tr> - <tr><td> - <input type="submit" name="submit" value="Update"> - <a href="/admin/users" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td><span style="color: #AA0000">{{.Message}}</span></td></tr> - </table> - </form> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <h1>{{.Title}}</h1><hr> + <form action="/admin/user/edit?user={{.Form.Id}}" method="post"> + {{.CsrfField}} + <table> + <tr><td><label for="id">ID</label></td></tr> + <tr><td><span>{{.Form.Id}}</span></td></tr> + <tr><td><label for="username">Username</label></td></tr> + <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> + <tr><td><label for="fullname">Full Name</label></td></tr> + <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> + <tr><td><label for="password">Password</label></td></tr> + <tr><td><input type="password" name="password" placeholder="unchanged"></td></tr> + <tr><td><label for="admin">Admin</label></td></tr> + <tr><td><input type="checkbox" name="admin" value="true" {{if .Form.IsAdmin}}checked{{end}}></td></tr> + <tr><td> + <input type="submit" name="submit" value="Update"> + <a href="/admin/users" style="color: inherit;">Cancel</a> + </td></tr> + <tr><td><span style="color: #AA0000">{{.Message}}</span></td></tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/admin/users.html b/res/admin/users.html index 5e5ff62..08207a5 100644 --- a/res/admin/users.html +++ b/res/admin/users.html @@ -1,29 +1,31 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "admin/header" .}}</header><hr> - <main> - <table class="highlight-row"> - <thead> - <tr> - <td><b>ID</b></td> - <td><b>Name</b></td> - <td><b>Full Name</b></td> - <td><b>Admin</b></td> - <td></td> - </tr> - </thead> - <tbody> - {{range .Users}} - <tr> - <td>{{.Id}}</td> - <td><a href="/?u={{.Name}}">{{.Name}}</a></td> - <td>{{.FullName}}</td> - <td>{{.IsAdmin}}</td> - <td><a href="/admin/user/edit?user={{.Id}}">edit</a></td> - </tr> - {{end}} - </tbody> - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "admin/header" .}}</header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>ID</b></td> + <td><b>Name</b></td> + <td><b>Full Name</b></td> + <td><b>Admin</b></td> + <td></td> + </tr> + </thead> + <tbody> + {{range .Users}} + <tr> + <td>{{.Id}}</td> + <td><a href="/?u={{.Name}}">{{.Name}}</a></td> + <td>{{.FullName}}</td> + <td>{{.IsAdmin}}</td> + <td><a href="/admin/user/edit?user={{.Id}}">edit</a></td> + </tr> + {{end}} + </tbody> + </table> + </main> + </body> +</html> diff --git a/res/error.html b/res/error.html index 79fa76b..4555a42 100644 --- a/res/error.html +++ b/res/error.html @@ -1,11 +1,13 @@ <!DOCTYPE html> -<head lang="en-GB"> - <meta charset="UTF-8"> - <title>{{.Status}}</title> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" type="text/css" href="/static/style.css"> - <link rel="icon" type="image/png" href="/static/favicon.png"> -</head> -<body> - <b>{{.Status}}</b> -</body> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <title>{{.Status}}</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="/static/style.css"> + <link rel="icon" type="image/png" href="/static/favicon.png"> + </head> + <body> + <b>{{.Status}}</b> + </body> +</html> diff --git a/res/index.html b/res/index.html index df35113..e2c80a0 100644 --- a/res/index.html +++ b/res/index.html @@ -1,55 +1,57 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header> - <table> - <tr> - <td rowspan="2"> - <a href="/"><img style="max-height: 24px;" src="/static/favicon.png"></a> - </td> - <td><h1>{{.Title}}</h1></td> - </tr> - <tr> - <td> - <a href="/">Repositories</a> - {{if .Auth}} - | <a href="/repo/create">Create</a> - | <a href="/user/sessions">User</a> - {{end}} - {{if .Admin}} - | <a href="/admin">Admin</a> - {{end}} - {{if .Auth}} - | <a href="/user/logout">Logout</a>{{if .Username}} ({{.Username}}){{end}} - {{else}} - | <a href="/user/login">Login</a> - {{end}} - </td> - </tr> - </table> - </header><hr> - <main> - <table class="highlight-row"> - <thead> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header> + <table> <tr> - <td><b>Name</b></td> - <td><b>Description</b></td> - <td><b>Owner</b></td> - <td><b>Visibility</b></td> - <td><b>Last Commit</b></td> + <td rowspan="2"> + <a href="/"><img style="max-height: 24px;" src="/static/favicon.png"></a> + </td> + <td><h1>{{.Title}}</h1></td> </tr> - </thead> - <tbody> - {{range .Repos}} <tr> - <td><a href="/{{.Name}}/">{{.Name}}</a></td> - <td>{{.Description}}</td> - <td><a href="/?u={{.Owner}}">{{.Owner}}</a></td> - <td>{{.Visibility}}</td> - <td>{{.LastCommit}}</td> + <td> + <a href="/">Repositories</a> + {{if .Auth}} + | <a href="/repo/create">Create</a> + | <a href="/user/sessions">User</a> + {{end}} + {{if .Admin}} + | <a href="/admin">Admin</a> + {{end}} + {{if .Auth}} + | <a href="/user/logout">Logout</a>{{if .Username}} ({{.Username}}){{end}} + {{else}} + | <a href="/user/login">Login</a> + {{end}} + </td> </tr> - {{end}} - </tbody> - </table> - </main> -</body> + </table> + </header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>Name</b></td> + <td><b>Description</b></td> + <td><b>Owner</b></td> + <td><b>Visibility</b></td> + <td><b>Last Commit</b></td> + </tr> + </thead> + <tbody> + {{range .Repos}} + <tr> + <td><a href="/{{.Name}}/">{{.Name}}</a></td> + <td>{{.Description}}</td> + <td><a href="/?u={{.Owner}}">{{.Owner}}</a></td> + <td>{{.Visibility}}</td> + <td>{{.LastCommit}}</td> + </tr> + {{end}} + </tbody> + </table> + </main> + </body> +</html> diff --git a/res/repo/commit.html b/res/repo/commit.html index c3bcbde..c5b6117 100644 --- a/res/repo/commit.html +++ b/res/repo/commit.html @@ -1,38 +1,40 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "repo/header" .}}</header><hr> - <main> - <table> - <tr><td>Author</td><td>{{.Author}}</td></tr> - <tr><td>Date</td><td>{{.Date}}</td></tr> - <tr><td>Commit</td><td><a href="/{{.Name}}/commit/{{.Commit}}">{{.Commit}}</a></td></tr> - {{range $i, $h := .Parents}} - <tr><td>Parent</td><td><a href="/{{$.Name}}/commit/{{$h}}">{{$h}}</a></td></tr> - {{end}} - </table> - <p>{{.MessageSubject}}</p> - <p>{{.MessageBody}}</p> - <h2>Diffstat</h2> - <table> - {{range .Stats}} - <tr> - <td>{{.Status}}</td> - <td><a href="/{{$.Name}}/file/{{.Path}}">{{.Name}}</a></td> - <td>|</td> - {{if .IsBinary}} - <td colspan="2">binary</td> - {{else}} - <td>{{.Num}}</td> - <td> - <span style="color: #008800;">{{.Plusses}}</span><!-- - --><span style="color: #AA0000;">{{.Minuses}}</span> - </td> - {{end}} - </tr> - {{end}} - </table> - <p>{{.Summary}}</p> - <pre style="tab-size: 4;">{{.Diff}}</pre> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "repo/header" .}}</header><hr> + <main> + <table> + <tr><td>Author</td><td>{{.Author}}</td></tr> + <tr><td>Date</td><td>{{.Date}}</td></tr> + <tr><td>Commit</td><td><a href="/{{.Name}}/commit/{{.Commit}}">{{.Commit}}</a></td></tr> + {{range $i, $h := .Parents}} + <tr><td>Parent</td><td><a href="/{{$.Name}}/commit/{{$h}}">{{$h}}</a></td></tr> + {{end}} + </table> + <p>{{.MessageSubject}}</p> + <p>{{.MessageBody}}</p> + <h2>Diffstat</h2> + <table> + {{range .Stats}} + <tr> + <td>{{.Status}}</td> + <td><a href="/{{$.Name}}/file/{{.Path}}">{{.Name}}</a></td> + <td>|</td> + {{if .IsBinary}} + <td colspan="2">binary</td> + {{else}} + <td>{{.Num}}</td> + <td> + <span style="color: #008800;">{{.Plusses}}</span><!-- + --><span style="color: #AA0000;">{{.Minuses}}</span> + </td> + {{end}} + </tr> + {{end}} + </table> + <p>{{.Summary}}</p> + <pre style="tab-size: 4;">{{.Diff}}</pre> + </main> + </body> +</html> diff --git a/res/repo/create.html b/res/repo/create.html index 21af36f..b06dada 100644 --- a/res/repo/create.html +++ b/res/repo/create.html @@ -1,68 +1,70 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header> - <table> - <tr> - <td rowspan="2"><a href="/"><img src="/static/favicon.png" style="max-height: 24px"></a></td> - <td><h1>{{.Title}}</h1></td> - </tr> - <tr><td></td></tr> - </table> - </header> - <main> - <form action="/repo/create" method="post"> - {{.CsrfField}} +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header> <table> <tr> - <td style="text-align: right;"><label for="reponame">Name</label></td> - <td><input type="text" name="reponame"></td> - </tr> - <tr> - <td style="text-align: right; vertical-align: top;"><label for="description">Description</label></td> - <td><textarea name="description"></textarea></td> - </tr> - <tr> - <td style="text-align: right;"><label for="branch">Default Branch</label></td> - <td><input type="text" name="branch" placeholder="master"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="visibility">Visibility</label></td> - <td> - <select name="visibility"> - <option value="public">Public</option> - <option value="private" {{if .IsPrivate}}selected{{end}}>Private</option> - </select> - </td> - </tr> - <tr> - <td style="text-align: right;"><label for="url">URL</label></td> - <td><input type="text" name="url"></td> - </tr> - <!-- <tr> - <td style="text-align: right;"><label for="username">Username</label></td> - <td><input type="text" name="username"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="password">Password</label></td> - <td><input type="password" name="password"></td> - </tr> --> - <tr> - <td style="text-align: right;"><label for="mirror">Mirror</label></td> - <td><input type="checkbox" name="mirror" value="mirror" {{if .IsMirror}}checked{{end}}></td> - </tr> - <tr> - <td></td> - <td> - <input type="submit" value="Create"> - <a href="/" style="color: inherit;">Cancel</a> - </td> - </tr> - <tr> - <td></td> - <td style="color: #AA0000">{{.Message}}</td> + <td rowspan="2"><a href="/"><img src="/static/favicon.png" style="max-height: 24px"></a></td> + <td><h1>{{.Title}}</h1></td> </tr> + <tr><td></td></tr> </table> - </form> - </main> -</body> + </header> + <main> + <form action="/repo/create" method="post"> + {{.CsrfField}} + <table> + <tr> + <td style="text-align: right;"><label for="reponame">Name</label></td> + <td><input type="text" name="reponame"></td> + </tr> + <tr> + <td style="text-align: right; vertical-align: top;"><label for="description">Description</label></td> + <td><textarea name="description"></textarea></td> + </tr> + <tr> + <td style="text-align: right;"><label for="branch">Default Branch</label></td> + <td><input type="text" name="branch" placeholder="master"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="visibility">Visibility</label></td> + <td> + <select name="visibility"> + <option value="public">Public</option> + <option value="private" {{if .IsPrivate}}selected{{end}}>Private</option> + </select> + </td> + </tr> + <tr> + <td style="text-align: right;"><label for="url">URL</label></td> + <td><input type="text" name="url"></td> + </tr> + <!-- <tr> + <td style="text-align: right;"><label for="username">Username</label></td> + <td><input type="text" name="username"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="password">Password</label></td> + <td><input type="password" name="password"></td> + </tr> --> + <tr> + <td style="text-align: right;"><label for="mirror">Mirror</label></td> + <td><input type="checkbox" name="mirror" value="mirror" {{if .IsMirror}}checked{{end}}></td> + </tr> + <tr> + <td></td> + <td> + <input type="submit" value="Create"> + <a href="/" style="color: inherit;">Cancel</a> + </td> + </tr> + <tr> + <td></td> + <td style="color: #AA0000">{{.Message}}</td> + </tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/repo/edit.html b/res/repo/edit.html index b09ea4d..a8537c9 100644 --- a/res/repo/edit.html +++ b/res/repo/edit.html @@ -1,96 +1,98 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "repo/header" .}}</header><hr> - <main> - <h1>{{.Title}}</h1><hr> - <form action="/{{.Name}}/edit" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="edit"> - <table> - <tr> - <td style="text-align: right;"><span>ID</span></td> - <td><span>{{.Edit.Id}}</span></td> - </tr> - <tr> - <td style="text-align: right;"><span>Owner</span></td> - <td><span>{{.Edit.Owner}}</span></td> - </tr> - <tr> - <td style="text-align: right;"><label for="reponame">Name</label></td> - <td><input type="text" name="reponame" value="{{.Edit.Name}}" spellcheck="false"></td> - </tr> - <tr> - <td style="text-align:right; vertical-align:top;"><label for="description">Description</label></td> - <td><textarea name="description" spellcheck="false">{{.Edit.Description}}</textarea></td> - </tr> - <tr> - <td style="text-align: right;"><label for="branch">Default Branch</label></td> - <td><input type="text" name="branch" value="{{.Edit.DefaultBranch}}" placeholder="master"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="visibility">Visibility</label></td> - <td> - <select name="visibility"> - <option value="public">Public</option> - <option value="private" {{if .Edit.IsPrivate}}selected{{end}}>Private</option> - </select> - </td> - </tr> - <tr> - <td style="text-align: right;"><label for="upstream">Upstream</label></td> - <td><input type="text" name="upstream" value="{{.Edit.Upstream}}" spellcheck="false"></td> - </tr> - <tr> - <td style="text-align: right;"><label for="mirror">Mirror</label></td> - <td> - <input type="checkbox" name="mirror" value="mirror" {{if .Edit.IsMirror}}checked{{end}}> - <span id="mirror-warn">Enabling mirror will replace any existing repository data</span> - </td> - </tr> - <tr> - <td></td> - <td> - <input type="submit" value="Update"> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "repo/header" .}}</header><hr> + <main> + <h1>{{.Title}}</h1><hr> + <form action="/{{.Name}}/edit" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="edit"> + <table> + <tr> + <td style="text-align: right;"><span>ID</span></td> + <td><span>{{.Edit.Id}}</span></td> + </tr> + <tr> + <td style="text-align: right;"><span>Owner</span></td> + <td><span>{{.Edit.Owner}}</span></td> + </tr> + <tr> + <td style="text-align: right;"><label for="reponame">Name</label></td> + <td><input type="text" name="reponame" value="{{.Edit.Name}}" spellcheck="false"></td> + </tr> + <tr> + <td style="text-align:right; vertical-align:top;"><label for="description">Description</label></td> + <td><textarea name="description" spellcheck="false">{{.Edit.Description}}</textarea></td> + </tr> + <tr> + <td style="text-align: right;"><label for="branch">Default Branch</label></td> + <td><input type="text" name="branch" value="{{.Edit.DefaultBranch}}" placeholder="master"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="visibility">Visibility</label></td> + <td> + <select name="visibility"> + <option value="public">Public</option> + <option value="private" {{if .Edit.IsPrivate}}selected{{end}}>Private</option> + </select> + </td> + </tr> + <tr> + <td style="text-align: right;"><label for="upstream">Upstream</label></td> + <td><input type="text" name="upstream" value="{{.Edit.Upstream}}" spellcheck="false"></td> + </tr> + <tr> + <td style="text-align: right;"><label for="mirror">Mirror</label></td> + <td> + <input type="checkbox" name="mirror" value="mirror" {{if .Edit.IsMirror}}checked{{end}}> + <span id="mirror-warn">Enabling mirror will replace any existing repository data</span> + </td> + </tr> + <tr> + <td></td> + <td> + <input type="submit" value="Update"> + <a href="/{{.Name}}" style="color: inherit;">Cancel</a> + </td> + </tr> + <tr> + <td></td> + <td style="color: #AA0000">{{.Edit.Message}}</td> + </tr> + </table> + </form> + <br><h2>Transfer Ownership</h2><hr> + <span>- You will lose access to this repository if it is not public.</span><br><br> + <form action="/{{.Name}}/edit" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="transfer"> + <table> + <tr><td><label for="owner">New Owner</label></td></tr> + <tr><td><input type="text" name="owner" value="{{.Transfer.Owner}}" spellcheck="false"></td></tr> + <tr><td> + <input type="submit" value="Transfer"> <a href="/{{.Name}}" style="color: inherit;">Cancel</a> - </td> - </tr> - <tr> - <td></td> - <td style="color: #AA0000">{{.Edit.Message}}</td> - </tr> - </table> - </form> - <br><h2>Transfer Ownership</h2><hr> - <span>- You will lose access to this repository if it is not public.</span><br><br> - <form action="/{{.Name}}/edit" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="transfer"> - <table> - <tr><td><label for="owner">New Owner</label></td></tr> - <tr><td><input type="text" name="owner" value="{{.Transfer.Owner}}" spellcheck="false"></td></tr> - <tr><td> - <input type="submit" value="Transfer"> - <a href="/{{.Name}}" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td style="color: #AA0000">{{.Transfer.Message}}</td></tr> - </table> - </form> - <br><h2>Delete Repository</h2><hr> - <span>- This operation <b>CANNOT</b> be undone.</span><br> - <span>- This operation will permanently delete the {{.Name}} repository and all associated data.</span><br><br> - <form action="/{{.Name}}/edit" method="post"> - {{.CsrfField}} - <input type="hidden" name="action" value="delete"> - <table> - <tr><td><label for="reponame">To confirm, type "{{.Name}}" in the box below</label></td></tr> - <tr><td><input type="text" name="reponame" spellcheck="false"></td></tr> - <tr><td> - <input type="submit" value="Delete"> - <a href="/{{.Name}}" style="color: inherit;">Cancel</a> - </td></tr> - <tr><td style="color: #AA0000">{{.Delete.Message}}</td></tr> - </table> - </form> - </main> -</body> + </td></tr> + <tr><td style="color: #AA0000">{{.Transfer.Message}}</td></tr> + </table> + </form> + <br><h2>Delete Repository</h2><hr> + <span>- This operation <b>CANNOT</b> be undone.</span><br> + <span>- This operation will permanently delete the {{.Name}} repository and all associated data.</span><br><br> + <form action="/{{.Name}}/edit" method="post"> + {{.CsrfField}} + <input type="hidden" name="action" value="delete"> + <table> + <tr><td><label for="reponame">To confirm, type "{{.Name}}" in the box below</label></td></tr> + <tr><td><input type="text" name="reponame" spellcheck="false"></td></tr> + <tr><td> + <input type="submit" value="Delete"> + <a href="/{{.Name}}" style="color: inherit;">Cancel</a> + </td></tr> + <tr><td style="color: #AA0000">{{.Delete.Message}}</td></tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/repo/file.html b/res/repo/file.html index 716f6b7..5009c56 100644 --- a/res/repo/file.html +++ b/res/repo/file.html @@ -1,22 +1,24 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}{{.BodyCss}}</head> -<body> - <header> - {{template "repo/header" .}}<hr> - {{.HtmlPath}} ({{.LineC}}, {{.Size}}) {{.Mode}} <a href="/{{.Name}}/download/{{.Path}}">download</a> - </header><hr> - <main> - <table> - {{if .Lines}} - <tr> - <td class="lnum" style="text-align: right;"> - <pre>{{range $i, $l := .Lines}}<a id="{{$i}}" href="#{{$i}}">{{$i}}</a>{{end}}</pre> - </td> - <td class="line">{{.HtmlBody}}</td> - </tr> - {{else}} - <tr><td>Binary file</td></tr> - {{end}} - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}{{.BodyCss}}</head> + <body> + <header> + {{template "repo/header" .}}<hr> + {{.HtmlPath}} ({{.LineC}}, {{.Size}}) {{.Mode}} <a href="/{{.Name}}/download/{{.Path}}">download</a> + </header><hr> + <main> + <table> + {{if .Lines}} + <tr> + <td class="lnum" style="text-align: right;"> + <pre>{{range $i, $l := .Lines}}<a id="{{$i}}" href="#{{$i}}">{{$i}}</a>{{end}}</pre> + </td> + <td class="line">{{.HtmlBody}}</td> + </tr> + {{else}} + <tr><td>Binary file</td></tr> + {{end}} + </table> + </main> + </body> +</html> diff --git a/res/repo/log.html b/res/repo/log.html index e5331f0..779c398 100644 --- a/res/repo/log.html +++ b/res/repo/log.html @@ -1,50 +1,52 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "repo/header" .}}</header><hr> - <main> - <table class="highlight-row"> - <thead> - <tr> - <td><b>Date</b></td> - <td><b>Message</b></td> - <td><b>Author</b></td> - <td><b>Files</b></td> - <td><b>+</b></td> - <td><b>-</b></td> - </tr> - </thead> - <tbody> - {{if .Commits}} - {{range .Commits}} - <tr> - <td>{{.Date}}</a></td> - <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> - <td>{{.Author}}</td> - <td style="text-align: right;">{{.Files}}</td> - <td style="text-align: right; color: #008800;">{{.Additions}}</td> - <td style="text-align: right; color: #AA0000;">{{.Deletions}}</td> - </tr> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "repo/header" .}}</header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>Date</b></td> + <td><b>Message</b></td> + <td><b>Author</b></td> + <td><b>Files</b></td> + <td><b>+</b></td> + <td><b>-</b></td> + </tr> + </thead> + <tbody> + {{if .Commits}} + {{range .Commits}} + <tr> + <td>{{.Date}}</a></td> + <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> + <td>{{.Author}}</td> + <td style="text-align: right;">{{.Files}}</td> + <td style="text-align: right; color: #008800;">{{.Additions}}</td> + <td style="text-align: right; color: #AA0000;">{{.Deletions}}</td> + </tr> + {{end}} + {{else}} + <tr><td colspan="6">No commits</td></tr> {{end}} + </tbody> + </table> + <footer> + {{if gt .PrevOffset 0}} + <a href="/{{$.Name}}/log?o={{.PrevOffset}}">[prev]</a> + {{else if eq .PrevOffset 0}} + <a href="/{{$.Name}}/log">[prev]</a> {{else}} - <tr><td colspan="6">No commits</td></tr> + <span>[prev]</span> {{end}} - </tbody> - </table> - <footer> - {{if gt .PrevOffset 0}} - <a href="/{{$.Name}}/log?o={{.PrevOffset}}">[prev]</a> - {{else if eq .PrevOffset 0}} - <a href="/{{$.Name}}/log">[prev]</a> - {{else}} - <span>[prev]</span> - {{end}} - <span>{{.Page}}</span> - {{if gt .NextOffset 0}} - <a href="/{{$.Name}}/log?o={{.NextOffset}}">[next]</a> - {{else}} - <span>[next]</span> - {{end}} - </footer> - </main> -</body> + <span>{{.Page}}</span> + {{if gt .NextOffset 0}} + <a href="/{{$.Name}}/log?o={{.NextOffset}}">[next]</a> + {{else}} + <span>[next]</span> + {{end}} + </footer> + </main> + </body> +</html> diff --git a/res/repo/refs.html b/res/repo/refs.html index 00f20cd..43d841a 100644 --- a/res/repo/refs.html +++ b/res/repo/refs.html @@ -1,55 +1,57 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "repo/header" .}}</header><hr> - <main> - <h2>Branches</h2> - <table class="highlight-row"> - <thead> - <tr> - <td><b>Name</b></td> - <td><b>Message</b></td> - <td><b>Author</b></td> - <td><b>Last Commit</b></td> - <td><b>Commits</b></td> - </tr> - </thead> - <tbody> - {{range .Branches}} - <tr> - <td>{{.Name}}</td> - <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> - <td>{{.Author}}</td> - <td>{{.LastCommit}}</td> - <td>{{.Commits}}</td> - </tr> - {{else}} - <tr><td colspan="4">No branches</td></tr> - {{end}} - </tbody> - </table> - <br><h2>Tags</h2> - <table class="highlight-row"> - <thead> - <tr> - <td><b>Name</b></td> - <td><b>Message</b></td> - <td><b>Author</b></td> - <td><b>Last Commit</b></td> - </tr> - </thead> - <tbody> - {{range .Tags}} - <tr> - <td>{{.Name}}</td> - <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> - <td>{{.Author}}</td> - <td>{{.LastCommit}}</td> - </tr> - {{else}} - <tr><td colspan="4">No tags</td></tr> - {{end}} - </tbody> - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "repo/header" .}}</header><hr> + <main> + <h2>Branches</h2> + <table class="highlight-row"> + <thead> + <tr> + <td><b>Name</b></td> + <td><b>Message</b></td> + <td><b>Author</b></td> + <td><b>Last Commit</b></td> + <td><b>Commits</b></td> + </tr> + </thead> + <tbody> + {{range .Branches}} + <tr> + <td>{{.Name}}</td> + <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> + <td>{{.Author}}</td> + <td>{{.LastCommit}}</td> + <td>{{.Commits}}</td> + </tr> + {{else}} + <tr><td colspan="4">No branches</td></tr> + {{end}} + </tbody> + </table> + <br><h2>Tags</h2> + <table class="highlight-row"> + <thead> + <tr> + <td><b>Name</b></td> + <td><b>Message</b></td> + <td><b>Author</b></td> + <td><b>Last Commit</b></td> + </tr> + </thead> + <tbody> + {{range .Tags}} + <tr> + <td>{{.Name}}</td> + <td><a href="/{{$.Name}}/commit/{{.Hash}}">{{.Message}}</a></td> + <td>{{.Author}}</td> + <td>{{.LastCommit}}</td> + </tr> + {{else}} + <tr><td colspan="4">No tags</td></tr> + {{end}} + </tbody> + </table> + </main> + </body> +</html> diff --git a/res/repo/tree.html b/res/repo/tree.html index 09ec06d..809fc4a 100644 --- a/res/repo/tree.html +++ b/res/repo/tree.html @@ -1,43 +1,45 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header> - {{template "repo/header" .}}<hr> - {{.HtmlPath}} ({{.Size}}) <a href="/{{.Name}}/download/{{.Path}}">download</a> - </header><hr> - <main> - <table class="highlight-row"> - <thead> - <tr> - <td><b>Mode</b></td> - <td><b>Name</b></td> - <td><b>Size</b></td> - <td></td> - </tr> - </thead> - <tbody> - {{if .Files}} - {{range .Files}} - <tr> - <td>{{.Mode}}</td> - <td><a href="/{{$.Name}}/{{.Path}}">{{.Name}}</a></td> - <td align="right" {{if .B}}style="padding-right: calc(2ch + 0.4em);"{{end}}>{{.Size}}</td> - <td> - {{if .RawPath}} - <a href="/{{$.Name}}/log/{{.RawPath}}">log</a> - {{if .IsFile}} - blame - <a href="/{{$.Name}}/raw/{{.RawPath}}">raw</a> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header> + {{template "repo/header" .}}<hr> + {{.HtmlPath}} ({{.Size}}) <a href="/{{.Name}}/download/{{.Path}}">download</a> + </header><hr> + <main> + <table class="highlight-row"> + <thead> + <tr> + <td><b>Mode</b></td> + <td><b>Name</b></td> + <td><b>Size</b></td> + <td></td> + </tr> + </thead> + <tbody> + {{if .Files}} + {{range .Files}} + <tr> + <td>{{.Mode}}</td> + <td><a href="/{{$.Name}}/{{.Path}}">{{.Name}}</a></td> + <td align="right" {{if .B}}style="padding-right: calc(2ch + 0.4em);"{{end}}>{{.Size}}</td> + <td> + {{if .RawPath}} + <a href="/{{$.Name}}/log/{{.RawPath}}">log</a> + {{if .IsFile}} + blame + <a href="/{{$.Name}}/raw/{{.RawPath}}">raw</a> + {{end}} + <a href="/{{$.Name}}/download/{{.RawPath}}">download</a> {{end}} - <a href="/{{$.Name}}/download/{{.RawPath}}">download</a> - {{end}} - </td> - </tr> + </td> + </tr> + {{end}} + {{else}} + <tr><td colspan="4">No files</td></tr> {{end}} - {{else}} - <tr><td colspan="4">No files</td></tr> - {{end}} - </tbody> - </table> - </main> -</body> + </tbody> + </table> + </main> + </body> +</html> diff --git a/res/user/edit.html b/res/user/edit.html index 5317316..69759ec 100644 --- a/res/user/edit.html +++ b/res/user/edit.html @@ -1,47 +1,49 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "user/header" .}}</header><hr> - <main> - <h1>{{.Title}}</h1><hr> - <form action="/user/edit" method="post"> - {{.CsrfField}} +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "user/header" .}}</header><hr> + <main> + <h1>{{.Title}}</h1><hr> + <form action="/user/edit" method="post"> + {{.CsrfField}} + <table> + <tr><td><label for="username">Username</label></td></tr> + <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> + <tr><td><label for="fullname">Full Name</label></td></tr> + <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> + <tr> + <td> + <input type="submit" name="submit" value="Update"> + <!-- <a href="/" style="color: inherit;">Cancel</a> --> + <span style="color: #AA0000">{{.MessageA}}</span> + </td> + </tr> + <!-- <tr><td style="color: #AA0000">{{.MessageA}}</td></tr> --> + </table> + </form><hr> + <form action="/user/edit" method="post"> + {{.CsrfField}} + <table> + <tr><td><label for="password">Current Password</label></td></tr> + <tr><td><input type="password" name="password"></td></tr> + <tr><td><label for="new_password">New Password</label></td></tr> + <tr><td><input type="password" name="new_password"></td></tr> + <tr><td><label for="confirm_password">Confirm New Password</label></td></tr> + <tr><td><input type="password" name="confirm_password"></td></tr> + <tr> + <td> + <input type="submit" name="submit" value="Update Password"> + <!-- <a href="/" style="color: inherit;">Cancel</a> --> + <span style="color: #AA0000">{{.MessageB}}</span> + </td> + </tr> + <!-- <tr><td style="color: #AA0000">{{.MessageB}}</td></tr> --> + </table> + </form><hr> <table> - <tr><td><label for="username">Username</label></td></tr> - <tr><td><input type="text" name="username" value="{{.Form.Name}}" spellcheck="false"></td></tr> - <tr><td><label for="fullname">Full Name</label></td></tr> - <tr><td><input type="text" name="fullname" value="{{.Form.FullName}}" spellcheck="false"></td></tr> - <tr> - <td> - <input type="submit" name="submit" value="Update"> - <!-- <a href="/" style="color: inherit;">Cancel</a> --> - <span style="color: #AA0000">{{.MessageA}}</span> - </td> - </tr> - <!-- <tr><td style="color: #AA0000">{{.MessageA}}</td></tr> --> + <tr><td style="text-align: right;"><span>ID:</span></td><td><span>{{.Form.Id}}</span></td></tr> </table> - </form><hr> - <form action="/user/edit" method="post"> - {{.CsrfField}} - <table> - <tr><td><label for="password">Current Password</label></td></tr> - <tr><td><input type="password" name="password"></td></tr> - <tr><td><label for="new_password">New Password</label></td></tr> - <tr><td><input type="password" name="new_password"></td></tr> - <tr><td><label for="confirm_password">Confirm New Password</label></td></tr> - <tr><td><input type="password" name="confirm_password"></td></tr> - <tr> - <td> - <input type="submit" name="submit" value="Update Password"> - <!-- <a href="/" style="color: inherit;">Cancel</a> --> - <span style="color: #AA0000">{{.MessageB}}</span> - </td> - </tr> - <!-- <tr><td style="color: #AA0000">{{.MessageB}}</td></tr> --> - </table> - </form><hr> - <table> - <tr><td style="text-align: right;"><span>ID:</span></td><td><span>{{.Form.Id}}</span></td></tr> - </table> - </main> -</body> + </main> + </body> +</html> diff --git a/res/user/login.html b/res/user/login.html index 6bbc819..027b996 100644 --- a/res/user/login.html +++ b/res/user/login.html @@ -1,39 +1,41 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header> - <table> - <tr> - <td rowspan="2"><a href="/"><img src="/static/favicon.png" style="max-height: 24px"></a></td> - <td><h1>{{.Title}}</h1></td> - </tr> - <tr><td></td></tr> - </table> - </header> - <main> - <form action="/user/login" method="post"> - {{.CsrfField}} +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header> <table> <tr> - <td style="text-align: right;"><label for="username">Username</label></td> - <td><input type="text" name="username" value="{{.Name}}" {{if not .FocusPw}}autofocus{{end}}></td> - </tr> - <tr> - <td style="text-align: right;"><label for="password">Password</label></td> - <td><input type="password" name="password" {{if .FocusPw}}autofocus{{end}}></td> - </tr> - <tr> - <td></td> - <td> - <input type="submit" value="Login"> - <a href="/" style="color: inherit;">Cancel</a> - </td> - </tr> - <tr> - <td></td> - <td style="color: #AA0000">{{.Message}}</td> + <td rowspan="2"><a href="/"><img src="/static/favicon.png" style="max-height: 24px"></a></td> + <td><h1>{{.Title}}</h1></td> </tr> + <tr><td></td></tr> </table> - </form> - </main> -</body> + </header> + <main> + <form action="/user/login" method="post"> + {{.CsrfField}} + <table> + <tr> + <td style="text-align: right;"><label for="username">Username</label></td> + <td><input type="text" name="username" value="{{.Name}}" {{if not .FocusPw}}autofocus{{end}}></td> + </tr> + <tr> + <td style="text-align: right;"><label for="password">Password</label></td> + <td><input type="password" name="password" {{if .FocusPw}}autofocus{{end}}></td> + </tr> + <tr> + <td></td> + <td> + <input type="submit" value="Login"> + <a href="/" style="color: inherit;">Cancel</a> + </td> + </tr> + <tr> + <td></td> + <td style="color: #AA0000">{{.Message}}</td> + </tr> + </table> + </form> + </main> + </body> +</html> diff --git a/res/user/sessions.html b/res/user/sessions.html index 7dfa729..3719b42 100644 --- a/res/user/sessions.html +++ b/res/user/sessions.html @@ -1,29 +1,31 @@ <!DOCTYPE html> -<head lang="en-GB">{{template "base/head" .}}</head> -<body> - <header>{{template "user/header" .}}</header><hr> - <main> - <table> - <thead> - <tr> - <td><b>IP</b></td> - <td><b>Seen</b></td> - <td><b>Expiry</b></td> - <td></td> - <td></td> - </tr> - </thead> - <tbody> - {{range .Sessions}} - <tr> - <td>{{.Ip}}</a></td> - <td>{{.Seen}}</td> - <td>{{.Expiry}}</td> - <td><a href="/user/sessions?revoke={{.Index}}">revoke</a></td> - <td>{{.Current}}</td> - </tr> - {{end}} - </tbody> - </table> - </main> -</body> +<html lang="en"> + <head>{{template "base/head" .}}</head> + <body> + <header>{{template "user/header" .}}</header><hr> + <main> + <table> + <thead> + <tr> + <td><b>IP</b></td> + <td><b>Seen</b></td> + <td><b>Expiry</b></td> + <td></td> + <td></td> + </tr> + </thead> + <tbody> + {{range .Sessions}} + <tr> + <td>{{.Ip}}</a></td> + <td>{{.Seen}}</td> + <td>{{.Expiry}}</td> + <td><a href="/user/sessions?revoke={{.Index}}">revoke</a></td> + <td>{{.Current}}</td> + </tr> + {{end}} + </tbody> + </table> + </main> + </body> +</html> diff --git a/src/main.go b/src/main.go index 229ec0b..8ac6ce1 100644 --- a/src/main.go +++ b/src/main.go @@ -88,12 +88,12 @@ func main() { h.Use(func(h http.Handler) http.Handler { return http.TimeoutHandler(h, 90*time.Second, - `<!DOCTYPE html><head lang="en-GB"> + `<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"><title>503 Service Unavailable</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="/static/style.css"> <link rel="icon" type="image/png" href="/static/favicon.png"> - </head><body><b>503 Service Unavailable</b></body>`) + </head><body><b>503 Service Unavailable</b></body></html>`) }) protect = csrf.Protect(