Initial commit
This commit is contained in:
19
cmd/server/templates/blocks/base.html.tmpl
Normal file
19
cmd/server/templates/blocks/base.html.tmpl
Normal file
@ -0,0 +1,19 @@
|
||||
{{define "base"}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{block "title" . -}}{{- end}}</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css">
|
||||
<link rel="stylesheet" href="/css/common.css">
|
||||
{{- block "head_style" . -}}{{end}}
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
|
||||
{{- block "head_script" . -}}{{end}}
|
||||
</head>
|
||||
<body>
|
||||
{{- block "body" . -}}{{- end -}}
|
||||
{{- block "body_script" . -}}{{end}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
23
cmd/server/templates/blocks/flash.html.tmpl
Normal file
23
cmd/server/templates/blocks/flash.html.tmpl
Normal file
@ -0,0 +1,23 @@
|
||||
{{define "flash"}}
|
||||
<div class="flash has-margin-top-small">
|
||||
{{- range .Flashes -}}
|
||||
{{- if eq .Type "error" -}}
|
||||
{{template "flash_message" map "Title" "Erreur" "MessageClass" "is-danger" "Message" .Message }}
|
||||
{{- else if eq .Type "warn" -}}
|
||||
{{template "flash_message" map "Title" "Attention" "MessageClass" "is-warning" "Message" .Message }}
|
||||
{{- else if eq .Type "success" -}}
|
||||
{{template "flash_message" map "Title" "Succès" "MessageClass" "is-success" "Message" .Message }}
|
||||
{{- else -}}
|
||||
{{template "flash_message" map "Title" "Information" "MessageClass" "is-info" "Message" .Message }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{define "flash_message" -}}
|
||||
<div class="message {{.MessageClass}}">
|
||||
<div class="message-body">
|
||||
<span class="has-text-weight-bold">{{.Title}}</span> {{.Message}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end}}
|
41
cmd/server/templates/layouts/login.html.tmpl
Normal file
41
cmd/server/templates/layouts/login.html.tmpl
Normal file
@ -0,0 +1,41 @@
|
||||
{{define "title"}}LDAP Profile - Authentification{{end}}
|
||||
{{define "head_style"}}
|
||||
<link rel="stylesheet" href="/css/login.css" />
|
||||
{{end}}
|
||||
{{define "body"}}
|
||||
<section class="hero is-fullheight login">
|
||||
<div class="hero-body">
|
||||
<div class="container">
|
||||
<div class="column is-4 is-offset-4">
|
||||
{{template "flash" .}}
|
||||
<div class="has-text-centered has-margin-top-small">
|
||||
<div class="box">
|
||||
<figure class="avatar">
|
||||
<img src="/img/logo.svg" width="128" height="128">
|
||||
</figure>
|
||||
<form method="POST">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input class="input is-normal"
|
||||
name="username" type="text"
|
||||
value="{{ .Username }}"
|
||||
placeholder="Votre identifiant" autofocus="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input class="input is-normal"
|
||||
name="password" type="password"
|
||||
placeholder="Votre mot de passe">
|
||||
</div>
|
||||
</div>
|
||||
<button class="button is-block is-info is-normal is-fullwidth">S'identifier</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
{{template "base" .}}
|
46
cmd/server/templates/layouts/profile.html.tmpl
Normal file
46
cmd/server/templates/layouts/profile.html.tmpl
Normal file
@ -0,0 +1,46 @@
|
||||
{{define "title"}}LDAP Profile - Votre profil{{end}}
|
||||
{{define "head_style"}}
|
||||
<link rel="stylesheet" href="/css/profile.css" />
|
||||
{{end}}
|
||||
{{define "body"}}
|
||||
<section class="is-fullheight profile">
|
||||
<div class="container">
|
||||
<div class="column is-8 is-offset-2">
|
||||
{{template "flash" .}}
|
||||
<div class="has-text-right">
|
||||
<a href="/logout" class="button is-warning">Se déconnecter</a>
|
||||
</div>
|
||||
<div class="has-margin-top-small">
|
||||
<div class="box">
|
||||
<h2 class="title is-2">Votre profil</h2>
|
||||
<form method="POST">
|
||||
{{range .EntryAttributes}}
|
||||
<label class="label">{{ .Name }}</label>
|
||||
{{ $name := .Name }}
|
||||
{{range .Values}}
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" type="text" value="{{ . }}" name="{{ $name }}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-danger">
|
||||
-
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="has-text-right">
|
||||
<button data-attribute-name="{{ $name }}" class="button is-primary">+</button>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="has-text-right has-margin-top-small">
|
||||
<button class="button is-medium is-success">Enregistrer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
{{template "base" .}}
|
Reference in New Issue
Block a user