get app ready for heroku

This commit is contained in:
2017-02-07 22:26:44 -05:00
parent ae5250e688
commit 537795bf16
36 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
{% extends "../boilerplate.html" %}
{% block main %}
<div>
{% include "./item.html" %}
<div class="approve">
{% if I.details %}
<div class="details">
<span>Details:</span><br>
{{ I.details }}</div>
{% endif %}
<div class="status">Status: <span>{{ I.statusText }}</span></div>
<div class="actions">
{% if approve %}
<a href="/items/{{ I.pk }}/approve" class="btn">Approve</a>
<a href="/items/{{ I.pk }}/reject" class="btn">Reject</a>
{% endif %}
<a href="/items/{{ I.pk }}/delete" class="btn">Delete</a>
<a href="/items/{{ I.pk }}/edit" class="btn">Edit</a>
<a href="/items" class="btn">Back</a>
</div>
<a href="{{ I.image.url }}"><img src="{{ I.image.thumbnail.url }}"></a>
</div>
</div>
{% endblock %}

66
templates/items/edit.html Normal file
View File

@@ -0,0 +1,66 @@
{% extends "../boilerplate.html" %}
{% block title %}Edit Reimbursement{% endblock %}
{% block main %}
<div>
<a href="/items" class="btn pull-right">Back</a>
<h1>Edit Reimbursements</h1>
<hr>
<form action="/items/{{ I.pk }}/edit" method="post">
{% csrf_token %}
<div>
<label for="desc">Item</label>
<input id="desc" type="text" name="desc" placeholder="What you bought"
value="{{ I.desc }}">
</div>
<div>
<label for="event">Event</label>
<input id="event" type="text" name="event" placeholder="When we need it"
value="{{ I.event }}">
</div>
<div>
<label for="committee">Committee or Budget</label>
<select name="committee" id="committee">
{% for C in committees %}
{% if I.committee == C %}
<option selected>{{ C.name }}</option>
{% else %}
<option>{{ C.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div>
<label for="cost">Cost</label>
<input id="cost" type="text" name="cost" placeholder="15.00"
value="{{ I.cost }}">
</div>
<div>
<label for="date">Date Purchased</label>
<input id="date" type="date" name="date" placeholder="mm/dd/yyyy"
value="{{ I.date_purchased }}">
</div>
<div class="clear">
<div>
<label for="details">Details</label>
<textarea id="details" name="details" rows="4" class="clear">{{ I.details }}</textarea>
</div>
</div>
<div class="clear">
<div>
<input type="submit">
</div>
</div>
</form>
</div>
{% endblock %}

38
templates/items/item.html Normal file
View File

@@ -0,0 +1,38 @@
<div class="item">
<div class="committee">
{{ I.comName }}
</div>
{% if I.approved %}
<div class="cost approved">
{% elif I.processed %}
<div class="cost processed">
{% elif I.rejected %}
<div class="cost rejected">
{% else %}
<div class="cost newItem">
{% endif %}
${{ I.cost|floatformat:"2" }}
</div>
<a href="/items/{{ I.pk }}">
<div class="details-row">
<b>{{ I.event }}:</b>
{{ I.desc }}
<em>by</em>
{{ I.created_by.first_name }} {{ I.created_by.last_name }}
<em>on</em> {{ I.date_purchased }}
<em>(filed {{ I.date_filed }})</em>
</div>
</a>
<div class="status">
{% if I.approved or I.processed %}
Approved By:
{% for u in I.approved_by.all %}
{{ u.first_name }} {{ u.last_name }}
{% endfor %}
{% elif I.rejected %}
Reimbursement Declined
{% else %}
Needs Approval
{% endif %}
</div>
</div>

45
templates/items/list.html Normal file
View File

@@ -0,0 +1,45 @@
{% extends "../boilerplate.html" %}
{% block main %}
{% if error %}
<div>
<span class="error">{{ error }}</span>
</div>
{% endif %}
{% if preapproved %}
{% with items=preapproved pagination_key="C" name="Pre-Approved" %}
{% include "./section.html" %}
{% endwith %}
{% endif %}
{% if newitems %}
{% with items=newitems pagination_key="N" name="New Items" %}
{% include "./section.html" %}
{% endwith %}
{% endif %}
{% if processed %}
{% with items=processed pagination_key="P" name="Approved" %}
{% include "./section.html" %}
{% endwith %}
{% endif %}
{% if rejected %}
{% with items=rejected pagination_key="R" name="Rejected" %}
{% include "./section.html" %}
{% endwith %}
{% endif %}
{% with items=mine pagination_key="M" name="My Reimbursements" %}
{% include "./section.html" %}
{% endwith %}
{% endblock %}
{% block bottom %}
<a href="/items/new" title="Submit new item" class="btn-floating">
<span>+</span>
</a>
{% endblock %}

68
templates/items/new.html Normal file
View File

@@ -0,0 +1,68 @@
{% extends "../boilerplate.html" %}
{% block title %}New Reimbursement{% endblock %}
{% block main %}
<div>
<h1>Add New Reimbursements</h1>
<hr>
<div class="rcol">
Make sure all information is accurate, you submit an itemized receipt, and
you select the correct committee.
</div>
<form action="/items/new" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div>
<label for="desc">Item</label>
<input id="desc" type="text" name="desc" placeholder="What you bought">
</div>
<div>
<label for="event">Event</label>
<input id="event" type="text" name="event" placeholder="When we need it">
</div>
<div>
<label for="committee">Committee or Budget</label>
<select name="committee" id="committee">
<option disabled selected>Select a committee</option>
{% for C in committees %}
<option>{{ C.name }}</option>
{% endfor %}
</select>
</div>
<div>
<label for="cost">Cost</label>
<input id="cost" type="text" name="cost" placeholder="15.00">
</div>
<div>
<label for="date">Date Purchased</label>
<input id="date" type="date" name="date" placeholder="mm/dd/yyyy">
</div>
<div class="clear">
<div>
<label for="details">Details</label>
<textarea id="details" name="details" rows="4" class="clear"></textarea>
</div>
</div>
<div>
<label for="image">Receipt</label>
<input type="file" name="image" id="image" accept="image/*">
</div>
<div class="clear">
<div>
<input type="submit">
</div>
</div>
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,22 @@
<section>{{ name }}</section>
<div class="items">
{% for I in items %}
{% include "./item.html" %}
{% empty %}
<div class="empty">No Reimbursements</div>
{% endfor %}
{% if items.has_next %}
<a class="page" href="?{{ pagination_key }}={{ items.next_page_number }}">
Older &rarr;
</a>
{% else %}
<a class="page empty" href="#">Older &rarr;</a>
{% endif %}
{% if items.has_previous %}
<a class="page" href="?{{ pagination_key }}={{ items.previous_page_number }}">
&larr; Newer
</a>
{% else %}
<a class="page empty" href="#">&larr; Newer</a>
{% endif %}
</div>