diff options
| author | Elizabeth <elizabeth@simponic.xyz> | 2024-04-09 18:39:14 -0400 |
|---|---|---|
| committer | simponic <simponic@hatecomputers.club> | 2024-04-09 18:39:14 -0400 |
| commit | 1d75bf7489527925217bd5611ba7910c0ffe077c (patch) | |
| tree | 3b6e6056912648a88e1e42c1e42ed7e58e2d4701 /templates | |
| parent | ee49015cc90e6c136ad94243fffc9241b9506a36 (diff) | |
| download | hatecomputers.club-1d75bf7489527925217bd5611ba7910c0ffe077c.tar.gz hatecomputers.club-1d75bf7489527925217bd5611ba7910c0ffe077c.zip | |
profiles (#7)
Reviewed-on: https://git.hatecomputers.club/hatecomputers/hatecomputers.club/pulls/7
Co-authored-by: Elizabeth <elizabeth@simponic.xyz>
Co-committed-by: Elizabeth <elizabeth@simponic.xyz>
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/api_keys.html | 7 | ||||
| -rw-r--r-- | templates/base.html | 15 | ||||
| -rw-r--r-- | templates/dns.html | 14 | ||||
| -rw-r--r-- | templates/guestbook.html | 9 | ||||
| -rw-r--r-- | templates/home.html | 18 | ||||
| -rw-r--r-- | templates/profile.html | 24 |
6 files changed, 56 insertions, 31 deletions
diff --git a/templates/api_keys.html b/templates/api_keys.html index cd4d274..018fda3 100644 --- a/templates/api_keys.html +++ b/templates/api_keys.html @@ -28,12 +28,5 @@ <h2>generate key.</h2> <hr> <input type="submit" value="generate." /> - {{ if .FormError }} - {{ if (len .FormError.Errors) }} - {{ range $error := .FormError.Errors }} - <div class="error">{{ $error }}</div> - {{ end }} - {{ end }} - {{ end }} </form> {{ end }} diff --git a/templates/base.html b/templates/base.html index 9f5a903..89d6dd2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -37,7 +37,9 @@ <span> | </span> <a href="/keys">api keys.</a> <span> | </span> - <a href="/logout">logout, {{ .User.DisplayName }}.</a> + <a href="/profile">{{ .User.DisplayName }}.</a> + <span> | </span> + <a href="/logout">logout.</a> {{ else }} <a href="/login">login.</a> @@ -46,6 +48,17 @@ <hr> <div id="content"> + {{ if and .Success (gt (len .Success.Messages) 0) }} + {{ range $message := .Success.Messages }} + <div class="info success">{{ $message }}</div> + {{ end }} + {{ end }} + {{ if and .Error (gt (len .Error.Messages) 0) }} + {{ range $error := .Error.Messages }} + <div class="info error">{{ $error }}</div> + {{ end }} + {{ end }} + {{ template "content" . }} </div> diff --git a/templates/dns.html b/templates/dns.html index d16ed89..2f3f0a7 100644 --- a/templates/dns.html +++ b/templates/dns.html @@ -76,18 +76,6 @@ {{ end }} /> </label> - - - <input type="submit" value="Add" /> - - {{ if .FormError }} - {{ if (len .FormError.Errors) }} - {{ range $error := .FormError.Errors }} - <div class="error">{{ $error }}</div> - {{ end }} - {{ end }} - {{ end }} + <input type="submit" value="add." /> </form> - - {{ end }} diff --git a/templates/guestbook.html b/templates/guestbook.html index 85727c7..d1f4417 100644 --- a/templates/guestbook.html +++ b/templates/guestbook.html @@ -21,18 +21,9 @@ <div class="h-captcha" data-sitekey="{{ .HcaptchaArgs.SiteKey }}" - data-theme="dark" ></div> <br> <button type="submit" class="btn btn-primary">sign.</button> - <br> - {{ if .FormError }} - {{ if (len .FormError.Errors) }} - {{ range $error := .FormError.Errors }} - <div class="error">{{ $error }}</div> - {{ end }} - {{ end }} - {{ end }} </form> <hr> diff --git a/templates/home.html b/templates/home.html index 1c03377..76bbc6a 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,3 +1,19 @@ {{ define "content" }} - <p class="blinky">under construction!</p> +<h2 class="blinky">hello there!</h2> +<p>current peeps in the club :D</p> +<div class="club-members"> + {{ range $user := .Users }} + <div class="club-member"> + <div class="avatar"> + <div style="background-image: url('{{ $user.Avatar }}')"></div> + </div> + <div class="about"> + <div>name: {{ $user.Username }}</div> + <div>pronouns: {{ $user.Pronouns }}</div> + <div><a href="{{ $user.Website }}">{{ $user.Website }}</a></div> + <div class="club-bio">{{ $user.Bio }}</div> + </div> + </div> + {{ end }} +</div> {{ end }} diff --git a/templates/profile.html b/templates/profile.html new file mode 100644 index 0000000..a6e1b68 --- /dev/null +++ b/templates/profile.html @@ -0,0 +1,24 @@ +{{ define "content" }} + +<h1>hey {{ .Profile.DisplayName }}</h1> +<br> +<form action="/profile" method="POST" class="form" enctype="multipart/form-data"> + <label for="file" class="file-upload">avatar.</label> + <input type="file" name="avatar"> + + <label for="location">location.</label> + <input type="text" name="location" value="{{ .Profile.Location }}"> + + <label for="website">website.</label> + <input type="text" name="website" value="{{ .Profile.Website }}"> + + <label for="pronouns">pronouns.</label> + <input type="text" name="pronouns" value="{{ .Profile.Pronouns }}"> + + <label for="bio">bio.</label> + <textarea name="bio">{{ .Profile.Bio }}</textarea> + + <input type="submit" value="update"> +</form> + +{{ end }} |
