Commit 264989f3 authored by Yann Caumartin's avatar Yann Caumartin
Browse files

Adds crud for camp

parent d8bfd8df
......@@ -9,6 +9,9 @@
<h2>View of camp #{{ camp._id }}</h2>
<hr>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-resource-modal">
Add new resource
</button>
<div class="list-group">
<div class="list-group-item list-group-item-action align-items-start list-group-item-flex">
......@@ -40,6 +43,16 @@
<h5 class="mb-1">{{ camp.location.alt }}</h5>
</div>
</div>
{% for resource in resources %}
<div class="list-group-item list-group-item-action align-items-start list-group-item-flex">
<div class="list-group-item-tools">
<a href="/resources/{{ resource._id }}" title="Look resource"><i class="fas fa-eye"></i></a>
<a href="resources/{{ resource._id }}/edit" title="Edit resource"><i class="fas fa-pencil-alt"></i></a>
<a href="resources/{{ resource._id }}/consume" title="Consume resource"><i class="fas fa-pencil-alt"></i></a>
<a href="resources/{{ resource._id }}/delete" title="Delete resource"><i class="fas fa-pencil-alt"></i></a>
<a href="resources/{{ resource._id }}/transfer" title="Transfer resource"><i class="fas fa-pencil-alt"></i></a>
</div>
{% endfor %}
</div>
{% for log in logs %}
log.value
......
<div class="modal fade" id="add-resource-modal" tabindex="-1" role="dialog" aria-labelledby="add-resource-modal-label" aria-hidden="true">
<div class="modal-dialog" role="document">
<form action="" method="POST">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Add new resource</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="input-type">Type</label>
<input type="text" class="form-control" id="input-type" name="type" aria-describedby="quantityHelp" placeholder="Enter type">
</div>
<div class="form-group">
<label for="input-quantity">quantity</label>
<input type="quantity" class="form-control" id="input-quantity" name="quantity" aria-describedby="quantityHelp" placeholder="Enter quantity">
</div>
<div class="form-group">
<label for="input-unit">unit</label>
<input type="unit" class="form-control" id="input-unit" name="unit" aria-describedby="unitHelp" placeholder="Enter unit">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add resource</button>
</div>
</div>
</form>
</div>
</div>
......@@ -11,7 +11,7 @@
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-user-log-modal">
Add new log
</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-user-resource-modal">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-resource-modal">
Add new resource
</button>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment