Factor out the update button into its own small template

For code reuse, you know
This commit is contained in:
Eli Ribble 2016-08-10 16:58:55 -06:00
parent 23ca01f1b1
commit 8d0d8d72b1
3 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block main_content %} {% block main_content %}
<h1>{{ account.name }}</h1> <h1>{{ account.name }}</h1>
{% include 'update_button.html' %}
<table class="table"> <table class="table">
<tr><td>Current balance</td><td>{{ account.balance }}</td></tr> <tr><td>Current balance</td><td>{{ account.balance }}</td></tr>
<tr><td>Last updated</td><td>{{ account.last_updated }}</td></tr> <tr><td>Last updated</td><td>{{ account.last_updated }}</td></tr>

View File

@ -11,10 +11,7 @@
<td>{{ account.source.name }}</td> <td>{{ account.source.name }}</td>
<td>{{ account.last_updated }}</td> <td>{{ account.last_updated }}</td>
<td> <td>
<form method="POST" action="/update/"> {% include 'update_button.html' %}
<input type="hidden" name="account_uuid" value="{{ account.uuid }}"></input>
<input type="submit" value="Update" class="btn btn-primary"></input>
</form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -0,0 +1,4 @@
<form method="POST" action="/update/">
<input type="hidden" name="account_uuid" value="{{ account.uuid }}"></input>
<input type="submit" value="Update" class="btn btn-primary"></input>
</form>