Some work on the tasks CRUD

This commit is contained in:
simon
2018-02-21 21:52:41 -05:00
parent 165844e4ca
commit 1602f47b4e
8 changed files with 171 additions and 24 deletions

View File

@@ -16,7 +16,7 @@
<div class="form-group">
<input type="text" class="form-control" placeholder="Absolute path" name="path">
</div>
<button type="submit" class="btn btn-primary">Add Directory</button>
<button type="submit" class="btn btn-success">Add Directory</button>
</form>
</div>
@@ -26,7 +26,8 @@
<div class="panel-heading">An excellent list</div>
<div class="panel-body">
<table class="info-table">
<table class="info-table table-hover table-striped">
<thead>
<tr>
<th>Display Name</th>
<th>Path</th>
@@ -34,16 +35,19 @@
<th>Last indexed</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for dir in directories %}
<tr>
<td>{{ directories[dir].name }}</td>
<td><pre style="width: 80%">{{ directories[dir].path }}</pre></td>
<td><i class="far {{ "fa-check-square" if directories[dir].enabled else "fa-square" }}"></i></td>
<td>2018-02-21</td>
<td><a href="directory/{{ dir }}">Manage</a> </td>
<td><a href="directory/{{ dir }}" class="btn btn-primary">Manage</a> </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -34,21 +34,25 @@
<div class="panel panel-default">
<div class="panel-heading">An excellent option list</div>
<div class="panel-body">
<table class="info-table">
<table class="info-table table-striped table-hover">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for option in directory.options %}
<tr>
<td>{{ option.key }}</td>
<td>{{ option.value }}</td>
<td><a href="/directory/{{ directory.id }}/del_opt/{{ option.id }}" >Remove</a></td>
<td><a class="btn btn-danger" href="/directory/{{ directory.id }}/del_opt/{{ option.id }}" >Remove</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<hr>
@@ -67,7 +71,7 @@
</div>
<button type="submit" class="btn btn-primary">Add option</button>
<button type="submit" class="btn btn-success">Add option</button>
</form>
</div>

View File

@@ -35,9 +35,9 @@
padding: 4px;
}
.info-table tr:nth-child(even) {
background-color: #fafafa;
}
{# .info-table tr:nth-child(even) {#}
{# background-color: #fafafa;#}
{# }#}
{# todo: box-shadow 0 1px 10px 1px #1AC8DE#}
</style>

View File

@@ -1,10 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends "layout.html" %}
</body>
</html>
{% block title %}An excellent title{% endblock title %}
{% block body %}
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">An excellent form</div>
<div class="panel-body">
<form class="form-inline" action="/task/add">
<label for="type">Create </label>
<select class="form-control" id="type" name="type" >
<option value="1">Indexing</option>
<option value="2">Thumbnail Generation</option>
</select>
<label for="directory">task for</label>
<select class="form-control" id="directory" name="directory" >
{% for dir_id in directories %}
<option value="{{ dir_id }}">{{ directories[dir_id].name }}</option>
{% endfor %}
</select>
<input type="submit" class="form-control btn btn-success" value="Add">
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">An excellent panel</div>
<div class="panel-body">
<table class="info-table">
<tr>
<th>Task type</th>
<th>Directory</th>
<th>Completed</th>
</tr>
{% for task in tasks %}
<tr>
<td>{{ task.type }}</td>
<td>{{ directories[task.dir_id].name }}</td>
<td>{{ task.completed }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
{% endblock body %}