Add session edit page

This commit is contained in:
2020-11-07 14:19:33 +01:00
parent 1d79676f51
commit a91266b705
8 changed files with 294 additions and 59 deletions

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<link rel="icon" type="image/png" href="/static/icon.png">
<link rel="stylesheet" href="/static/styles.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu|Ubuntu+Mono&display=swap">
<title>stl</title>
</head>
<body>
<h1 class="title">stl</h1>
<div>
<a href="/history">tillbaka</a>
<br>
<br>
<form action="/session/{{session_id}}/edit" method="post">
<input type="hidden" id="category" name="category" value="{{session.category}}">
<span>Started:</span>
<input type="text" id="started" name="started" value="{{pretty_datetime session.started}}"></input>
<br>
<span>Ended:</span>
<input type="text" id="ended" name="ended" value="{{pretty_datetime session.ended}}"></input>
<br>
<button type="submit">spara</button>
</form>
<br>
<form action="/session/{{this.session_id}}/delete" method="post">
<button type="submit">ta bort</button>
</form>
</div>
</body>
</html>

View File

@ -17,16 +17,15 @@
<ul class="striped_list">
{{#each entries}}
<li class="history_entry">
<form action="/session/{{this.session_id}}/delete" method="post">
<span class="history_entry_category">{{this.category.name}}</span>
<span> under </span>
<span class="history_entry_duration">{{pretty_seconds this.duration.secs}}</span>
<span> från </span>
<span class="history_entry_started">{{pretty_datetime this.session.started}}</span>
<span> tills </span>
<span class="history_entry_ended">{{pretty_datetime this.session.ended}}</span>
<button type="submit" class="history_entry_delete_button">✕</button>
</form>
<span class="history_entry_category">{{this.category.name}}</span>
<span>under</span>
<span class="history_entry_duration">{{pretty_seconds this.duration.secs}}</span>
<span>från</span>
<span class="history_entry_started">{{pretty_datetime this.session.started}}</span>
<span>tills</span>
<span class="history_entry_ended">{{pretty_datetime this.session.ended}}</span>
<span>---</span>
<a href="/session/{{this.session_id}}/edit" class="history_entry_edit_button">ändra</a>
</li>
{{/each}}
</ul>