Renamed views directory to templates.
This commit is contained in:
parent
d0caa8119e
commit
299774c0c7
12 changed files with 1 additions and 1 deletions
3
templates/pages/about.gohtml
Normal file
3
templates/pages/about.gohtml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{{define "content"}}
|
||||
<p>{{.Data}}</p>
|
||||
{{end}}
|
||||
18
templates/pages/contact.gohtml
Normal file
18
templates/pages/contact.gohtml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{{define "content"}}
|
||||
<form method="post">
|
||||
<div class="field">
|
||||
<label class="label">Message</label>
|
||||
<div class="control">
|
||||
<textarea class="textarea" placeholder="Textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "csrf" .}}
|
||||
</form>
|
||||
{{end}}
|
||||
11
templates/pages/error.gohtml
Normal file
11
templates/pages/error.gohtml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{{define "content"}}
|
||||
{{if gt .StatusCode 500}}
|
||||
<p>Please try again. Request ID: {{.RequestID}}</p>
|
||||
{{else if or (eq .StatusCode 403) (eq .StatusCode 401)}}
|
||||
<p>You are not authorized to view the requested page.</p>
|
||||
{{else if eq .StatusCode 404}}
|
||||
<p>Click {{link (call .Reverse "home") "here" .Path}} to return home</p>
|
||||
{{else}}
|
||||
<p>Something went wrong</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
4
templates/pages/home.gohtml
Normal file
4
templates/pages/home.gohtml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{{define "content"}}
|
||||
Hello homepage {{upper "data"}}: {{ .Data }}
|
||||
<p><img src="{{file "gopher.png"}}" alt="Gopher"/></p>
|
||||
{{end}}
|
||||
26
templates/pages/login.gohtml
Normal file
26
templates/pages/login.gohtml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{{define "content"}}
|
||||
<form method="post">
|
||||
<div class="field">
|
||||
<label for="login" class="label">Username</label>
|
||||
<div class="control">
|
||||
<input id="login" type="text" name="username" class="input" value="{{.Data.Username}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="password" class="label">Password</label>
|
||||
<div class="control">
|
||||
<input id="password" type="password" name="password" placeholder="*******" class="input" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<p class="control">
|
||||
<button class="button is-primary">Log in</button>
|
||||
</p>
|
||||
<p class="control">
|
||||
<a href="{{call .Reverse "home"}}" class="button is-light">Cancel</a>
|
||||
</p>
|
||||
</div>
|
||||
{{template "csrf" .}}
|
||||
</form>
|
||||
<div class="content is-small"><a href="{{call .Reverse "register"}}">Create an account</a></div>
|
||||
{{end}}
|
||||
25
templates/pages/register.gohtml
Normal file
25
templates/pages/register.gohtml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{{define "content"}}
|
||||
<form method="post">
|
||||
<div class="field">
|
||||
<label for="username" class="label">Username</label>
|
||||
<div class="control">
|
||||
<input type="text" id="username" name="username" class="input" value="{{.Data.Username}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="password" class="label">Password</label>
|
||||
<div class="control">
|
||||
<input type="password" id="password" name="password" placeholder="*******" class="input" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-grouped">
|
||||
<p class="control">
|
||||
<button class="button is-primary">Register</button>
|
||||
</p>
|
||||
<p class="control">
|
||||
<a href="{{call .Reverse "home"}}" class="button is-light">Cancel</a>
|
||||
</p>
|
||||
</div>
|
||||
{{template "csrf" .}}
|
||||
</form>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue