Added models; started working on project routes
This commit is contained in:
25
templates/project/create.tmpl
Normal file
25
templates/project/create.tmpl
Normal file
@ -0,0 +1,25 @@
|
||||
{{ template "header" . }}
|
||||
|
||||
<div class="row">
|
||||
<h2>Add a project</h2>
|
||||
|
||||
<form class="twelve columns" action="/project/add" method="POST">
|
||||
<div class="row">
|
||||
<label for="project_title">
|
||||
Project title:
|
||||
<input id="project_title" class="u-full-width" type="text" name="project_title" placeholder="My hardware benchmarking project">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label for="project_description">
|
||||
Project description:
|
||||
<textarea id="project_description" class="twelve columns" cols="30" rows="10" name="project_description"></textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<input class="button-primary u-full-width" type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{ template "footer" . }}
|
27
templates/project/list.tmpl
Normal file
27
templates/project/list.tmpl
Normal file
@ -0,0 +1,27 @@
|
||||
{{ template "header" . }}
|
||||
|
||||
<div class="row">
|
||||
<h2>Projects</h2>
|
||||
<a href="/project/add">Add a project</a>
|
||||
|
||||
<table class="twelve columns">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>Created at</td>
|
||||
<td>Last updated</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $p := .projects }}
|
||||
<tr>
|
||||
<td><a href="/project/{{ $p.Id }}">{{ $p.Name }}</a></td>
|
||||
<td>{{ $p.CreatedAt.Format "01/02/2006 15:04am" }}</td>
|
||||
<td>{{ $p.UpdatedAt.Format "01/02/2006 15:04am" }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ template "footer" . }}
|
13
templates/project/view.tmpl
Normal file
13
templates/project/view.tmpl
Normal file
@ -0,0 +1,13 @@
|
||||
{{ template "header" . }}
|
||||
|
||||
<div class="row">
|
||||
<h2>{{ .project.Name }}</h2>
|
||||
|
||||
<p>{{ .project.Description }}</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p><a href="/project">Back</a></p>
|
||||
</div>
|
||||
|
||||
{{ template "footer" . }}
|
Reference in New Issue
Block a user