cadoles-arcad/template/layouts/profile.html.tmpl
2022-05-11 21:38:20 +02:00

85 lines
3.1 KiB
Cheetah

{{define "title"}}Profil - Arcad{{end}}
{{define "body"}}
{{template "header" .}}
<section>
<div>
{{template "flash" .}}
<form action="/login" method="POST" enctype="multipart/form-data">
<div class="field" style="margin-bottom:0">
<div class="file is-medium is-success" id="memberCard">
<label class="file-label">
<input class="file-input" type="file" name="memberCard">
<span class="file-cta">
<span class="file-icon">
<svg class="icon" width="50" height="50">
<use xlink:href="#address-card"></use>
</svg>
</span>
<span class="file-label">
Se connecter
</span>
</span>
</label>
</div>
</div>
{{ .csrfField }}
</form>
</div>
<div class="level-item">
<a href="/logout" class="button is-warning is-medium">
<svg class="icon" width="50" height="50">
<use xlink:href="#sign-out-alt"></use>
</svg>
</a>
</div>
</div>
</div>
<div class="columns">
<div class="column is-6">
<h5 class="is-size-5">Vos informations</h5>
<form class="has-margin-top-small" action="/profile" method="post">
<div class="field">
<label class="label">Pseudonyme</label>
<div class="control">
<input class="input is-medium" type="text"
name="nickname"
value="{{if .Form}}{{ .Form.Get "nickname" }}{{else}}{{ .User.Nickname }}{{end}}">
</div>
</div>
{{ .csrfField }}
<div class="buttons" style="justify-content:flex-end">
<button type="submit" class="button is-primary is-medium">
<span>Modifier</span>
<span class="icon">
<svg class="icon" width="50" height="50">
<use xlink:href="#edit"></use>
</svg>
</span>
</button>
</div>
</form>
</div>
<div class="column is-6">
<h5 class="is-size-5">Carte de membre</h5>
<article class="message is-info">
<div class="message-body">
Téléchargez et utilisez votre carte de membre afin de pouvoir vous authentifier la prochaine fois avec le même pseudonyme !
</div>
</article>
<figure class="image is-3by2 has-margin-top-small">
<a href="/profile/card" rel="Member card" download="ArcadBox-Member-{{ .User.Nickname }}">
<img src="/profile/card" />
</a>
</figure>
</div>
</section>
{{end}}
{{define "body_script"}}
<script>
const fileInput = document.querySelector('#memberCard input[type=file]');
fileInput.onchange = () => {
fileInput.form.submit();
}
</script>
{{end}}
{{template "base" .}}