summaryrefslogtreecommitdiff
path: root/app/templates/modules
diff options
context:
space:
mode:
Diffstat (limited to 'app/templates/modules')
-rw-r--r--app/templates/modules/add-item.html19
-rw-r--r--app/templates/modules/invoices.html80
-rw-r--r--app/templates/modules/login.html16
-rw-r--r--app/templates/modules/register.html16
-rw-r--r--app/templates/modules/settings.html45
5 files changed, 176 insertions, 0 deletions
diff --git a/app/templates/modules/add-item.html b/app/templates/modules/add-item.html
new file mode 100644
index 0000000..4eaee3d
--- /dev/null
+++ b/app/templates/modules/add-item.html
@@ -0,0 +1,19 @@
+{# -*- mode: web; -*- #}
+
+{% extends "base.html" %}
+
+
+{% block title %}Add {{ table }} item{% endblock %}
+{% block content %}
+
+<form action="{{ request.path }}" method="POST">
+ <fieldset>
+ <legend>Add a new item to our {{ table }} table.</legend>
+ {% for field in form %}
+ {{ field.label() }}<br/>
+ {{ field() }}<br/>
+ {% endfor %}
+ </fieldset>
+</form>
+
+{% endblock %}
diff --git a/app/templates/modules/invoices.html b/app/templates/modules/invoices.html
new file mode 100644
index 0000000..9e8f765
--- /dev/null
+++ b/app/templates/modules/invoices.html
@@ -0,0 +1,80 @@
+{# -*- mode: web; -*- #}
+
+{% extends "base.html" %}
+{% block title %}
+Invoices
+{% endblock %}
+
+{% block actions %}
+<li><a href="{{ url_for('common.add_item', module='invoices', table='Invoice') }}" class="button">Add invoice</a></li>
+<li></li>
+{% endblock %}
+
+{% block content %}
+<i>Track your invoices and create new ones here.</i><br/>
+
+{# Pagination Links #}
+{# gotten from https://betterprogramming.pub/simple-flask-pagination-example-4190b12c2e2e #}
+<center>
+ {# Loop through the number of pages to display a link for each #}
+ {% for page_num in invoices.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %}
+ {% if page_num %}
+ {# Check for the active page and set the link to "Active" #}
+ {% if invoices.page == page_num %}
+ <a href="{{ url_for('invoices.view', page=page_num) }}"
+ class="button">
+ {{ page_num }}
+ </a>
+ {% else %}
+ <a href="{{ url_for('invoices.view', page=page_num) }}"
+ class="button button-light">
+ {{ page_num }}
+ </a>
+ {% endif %}
+ {% else %}
+ ...
+ {% endif %}
+ {% endfor %}
+</center>
+<table>
+ <thead>
+ <tr>
+ <th></th>
+ <th>ID</th>
+ <th>Created</th>
+ <th>Alternative Invoice ID</th>
+ <th>Customer Name</th>
+ <th>Customer Reference</th>
+ <th>Date Billed</th>
+ <th>Date Due</th>
+ <th>Amount (Net €)</th>
+ <th>Amount (Gross €)</th>
+ <th>Tax Amount (€)</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for invoice in invoices.items %}
+ <tr {% if invoice.archive == True %} style="color: dimgray" {% endif %}>
+ <td>
+ <form method="post" action="{{ url_for('common.edit_item', module='invoices', pk=invoice.primary_key, table='Invoice') }}">
+ <button>archive</button>
+ </form>
+ <form method="get" action="{{ url_for('invoices.preview', pk=invoice.primary_key) }}">
+ <button>preview</button>
+ </form>
+ </td>
+ <td>{{ invoice.primary_key }}</td>
+ <td>{{ invoice.date_time_created }}</td>
+ <td>{{ invoice.invoice_id_alt }}</td>
+ <td>{{ invoice.customer.name }}</td>
+ <td>{{ invoice.customer_reference }}</td>
+ <td>{{ invoice.date_billed }}</td>
+ <td>{{ invoice.date_due }}</td>
+ <td>{{ invoice.amount_net }}</td>
+ <td>{{ invoice.amount_gross }}</td>
+ <td>{{ invoice.amount_tax }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock %}
diff --git a/app/templates/modules/login.html b/app/templates/modules/login.html
new file mode 100644
index 0000000..e66e6a4
--- /dev/null
+++ b/app/templates/modules/login.html
@@ -0,0 +1,16 @@
+{# -*- mode: web; -*- #}
+
+{% extends "base.html" %}
+
+{# the login form #}
+{% block content %}
+<form action="{{ url_for('auth.login') }}" method="POST">
+ <fieldset>
+ <legend>Login</legend>
+ {% for field in form %}
+ {{ field.label() }}
+ {{ field() }}<br/>
+ {% endfor %}
+ </fieldset>
+</form>
+{% endblock %}
diff --git a/app/templates/modules/register.html b/app/templates/modules/register.html
new file mode 100644
index 0000000..76fc1e2
--- /dev/null
+++ b/app/templates/modules/register.html
@@ -0,0 +1,16 @@
+{# -*- mode: web; -*- #}
+
+{% extends "base.html" %}
+
+{# the register form #}
+{% block content %}
+<form action="{{ url_for('auth.register') }}" method="POST">
+ <fieldset>
+ <legend>Register</legend>
+ {% for field in form %}
+ {{ field.label() }}
+ {{ field() }}<br/>
+ {% endfor %}
+ </fieldset>
+</form>
+{% endblock %}
diff --git a/app/templates/modules/settings.html b/app/templates/modules/settings.html
new file mode 100644
index 0000000..392ab47
--- /dev/null
+++ b/app/templates/modules/settings.html
@@ -0,0 +1,45 @@
+{# -*- mode: web; -*- #}
+
+{% extends "base.html" %}
+
+{% block title %}
+Settings for user {{ current_user.username }}
+{% endblock %}
+
+{% block content %}
+
+<p>Welcome, {{ current_user.name_first }} {{ current_user.name_last }}!</p>
+
+<h2>User profile</h2>
+
+<form method="post" action="{{ url_for('common.edit_item', module='settings', pk=current_user.primary_key, table='User' ) }}">
+ <button>edit</button>
+</form>
+
+<table>
+ <thead>
+ <tr>
+ <th>Field</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Username</td>
+ <td>{{ current_user.username }}</td>
+ </tr>
+ <tr>
+ <td>First Name</td>
+ <td>{{ current_user.name_first }}</td>
+ </tr>
+ <tr>
+ <td>Last Name</td>
+ <td>{{ current_user.name_last }}</td>
+ </tr>
+ <tr>
+ <td> Last Updated</td>
+ <td>{{ current_user.date_time_updated }}</td>
+ </tr>
+ </tbody>
+</table>
+{% endblock %}
Copyright 2019--2024 Marius PETER