Added models; started working on project routes

This commit is contained in:
2023-11-27 23:41:48 -05:00
parent 49925c6d8f
commit 19670e9abd
8 changed files with 131 additions and 2 deletions

View 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" . }}

View 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" . }}

View 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" . }}