Added pages to list projects and create new ones
This commit is contained in:
@ -3,5 +3,42 @@
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>This is the dashboard!</p>
|
||||
<div class="row">
|
||||
<h2>Recently updated projects:</h2>
|
||||
<table class="twelve columns">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>Last updated</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in projects %}
|
||||
<tr>
|
||||
<td>{{ p.title }}</td>
|
||||
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<h2>Recently added results:</h2>
|
||||
<table class="twelve columns">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Benchmark</td>
|
||||
<td>Hardware</td>
|
||||
<td>Average/Score</td>
|
||||
<td>Scoring type</td>
|
||||
<td>Added on</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
27
views/project/add.twig
Normal file
27
views/project/add.twig
Normal file
@ -0,0 +1,27 @@
|
||||
{% extends 'layouts/default.twig' %}
|
||||
|
||||
{% block title %}Add a Project{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<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>
|
||||
{% endblock %}
|
29
views/project/list.twig
Normal file
29
views/project/list.twig
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends 'layouts/default.twig' %}
|
||||
|
||||
{% block title %}List of Projects{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<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>
|
||||
{% for p in projects %}
|
||||
<tr>
|
||||
<td><a href="/project/{{ p.id }}">{{ p.title }}</a></td>
|
||||
<td>{{ p.createdAt | date('m/d/Y g:ia') }}</td>
|
||||
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user