This makes it so that we can add new accounts and show the accounts that we already have. We don't do anything with them yet, but that's okay it was interesting figuring out how to get them set up at all. I'm currently storing the passwords as unencrypted, which I intend to change, but it's going to take some time to research exactly how to encrypt them so that the data is not retrievable by a bad actor with access to the database.
42 lines
1.6 KiB
HTML
42 lines
1.6 KiB
HTML
{% extends 'layout.html' %}
|
|
{% block main_content %}
|
|
<h1>Accounts</h1>
|
|
{% if accounts %}
|
|
<table class="table">
|
|
<tr><th>Name</th><th>Type</th><th>Institution</th></tr>
|
|
{% for account in accounts %}
|
|
<tr>
|
|
<td>{{ account.name }}</td>
|
|
<td>{{ account.type }}</td>
|
|
<td>{{ account.institution }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% else %}
|
|
<p>You don't have any accounts yet. Let's create some</p>
|
|
{% endif %}
|
|
<h1>Add new account</h1>
|
|
<form method="POST" action="/account/">
|
|
<div class="form-group">
|
|
<label for="name">Name</label>
|
|
<input id="name" type="text" name="name" class="form-control" placeholder="My OFX account"></input>
|
|
<label for="institution">Institution</label>
|
|
<input id="institution" type="text" name="institution" class="form-control" list="institutions"></input>
|
|
<label for="userid">User ID</label>
|
|
<input id="userid" type="text" name="userid" class="form-control" placeholder="123456"></input>
|
|
<label for="password">Password</label>
|
|
<input id="password" type="password" name="password" class="form-control" placeholder="1234"></input>
|
|
<label for="type">Account Type</label>
|
|
<select id="account_type" value="checking" name="account_type" class="form-control">
|
|
<option value="checking">Checking</option>
|
|
<option value="checking">Savings</option>
|
|
</select>
|
|
<input class="btn btn-primary form-control" type="submit" value="Create Account"></input>
|
|
<datalist id="institutions">
|
|
{% for source in sources %}
|
|
<option value="{{ source.name }}">{{ source.name }}</option>
|
|
{% endfor %}
|
|
</datalist>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|