Add delete buttons to history page
This commit is contained in:
@ -17,13 +17,16 @@
|
||||
<ul class="striped_list">
|
||||
{{#each entries}}
|
||||
<li class="history_entry">
|
||||
<span class="history_entry_category">{{this.category.name}}</span>
|
||||
<span> for </span>
|
||||
<span class="history_entry_duration">{{pretty_seconds this.duration.secs}}</span>
|
||||
<span> from </span>
|
||||
<span class="history_entry_started">{{pretty_datetime this.session.started}}</span>
|
||||
<span> to </span>
|
||||
<span class="history_entry_ended">{{pretty_datetime this.session.ended}}</span>
|
||||
<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>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
@ -20,10 +20,10 @@
|
||||
// Get the corresponding route to activate/inactivate the category
|
||||
let url;
|
||||
if(active) {
|
||||
url = "/set_category/" + id + "/inactive";
|
||||
url = "/category/" + id + "/end_session";
|
||||
cl.remove(toggled_class);
|
||||
} else {
|
||||
url = "/set_category/" + id + "/active";
|
||||
url = "/category/" + id + "/start_session";
|
||||
cl.add(toggled_class);
|
||||
}
|
||||
|
||||
@ -42,10 +42,6 @@
|
||||
<body>
|
||||
<h1 class="title">stl</h1>
|
||||
|
||||
{{#each categories}}
|
||||
<form action="/toggle_category/{{this.0}}" method="post" id="{{this.0}}"></form>
|
||||
{{/each}}
|
||||
|
||||
<ul class="striped_list">
|
||||
{{#each categories}}
|
||||
<li class="category_entry">
|
||||
|
||||
Reference in New Issue
Block a user