From 1dad22d3e45d6506c8624e3a7111240fcc4ab786 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 15 May 2022 13:16:37 +0200 Subject: Templates. --- app/templates/modules/add-invoice.html | 48 ++++++++++ app/templates/modules/add-item.html | 19 ++++ app/templates/modules/customers.html | 18 +++- app/templates/modules/edit-item.html | 19 ++++ app/templates/modules/ferti.html | 99 ++++++++++++++++++++ app/templates/modules/invoice-preview.html | 108 ++++++++++++++++++++++ app/templates/modules/invoices.html | 96 +++++++++++++------ app/templates/modules/logger.html | 142 ----------------------------- app/templates/modules/login.html | 16 ++++ app/templates/modules/orders.html | 8 +- app/templates/modules/products.html | 18 ++-- app/templates/modules/register.html | 16 ++++ app/templates/modules/settings.html | 57 ++++++++++++ 13 files changed, 476 insertions(+), 188 deletions(-) create mode 100644 app/templates/modules/add-invoice.html create mode 100644 app/templates/modules/add-item.html create mode 100644 app/templates/modules/edit-item.html create mode 100644 app/templates/modules/ferti.html create mode 100644 app/templates/modules/invoice-preview.html delete mode 100644 app/templates/modules/logger.html create mode 100644 app/templates/modules/login.html create mode 100644 app/templates/modules/register.html create mode 100644 app/templates/modules/settings.html (limited to 'app/templates/modules') diff --git a/app/templates/modules/add-invoice.html b/app/templates/modules/add-invoice.html new file mode 100644 index 0000000..92748be --- /dev/null +++ b/app/templates/modules/add-invoice.html @@ -0,0 +1,48 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} + + +{% block title %}Add a new invoice{% endblock %} +{% block content %} + +{% if message %} +{# the form was submitted and message exists #} +

{{ item }}

+{# links #} +

Submit another {{ item }}

+

Return to the index

+ +{% else %} +{# the form is displayed when template opens via GET not POST #} + +{# show flash - based on WTForms validators see +https://pythonprogramming.net/flash-flask-tutorial/ +get_flashed_messages() exists here because of flash() in the route +function #} + +{% with errors = get_flashed_messages() %} {% if errors %} +{% for err in errors %} + +{% endfor %} +{% endif %} +{% endwith %} +{# end of flash #} + + +{# the form #} +
+
+ Add a new {{ item }} to our database. + {% for field in form %} + {{ field.label() }} + {{ field() }}
+ {% endfor %} +
+
+ +{% endif %} +{% endblock %} diff --git a/app/templates/modules/add-item.html b/app/templates/modules/add-item.html new file mode 100644 index 0000000..356ce9f --- /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 %} + +
+
+ Add a new item to our {{ table }} table. + {% for field in form %} + {{ field.label() }} + {{ field() }}
+ {% endfor %} +
+
+ +{% endblock %} diff --git a/app/templates/modules/customers.html b/app/templates/modules/customers.html index c693097..64ed4c2 100644 --- a/app/templates/modules/customers.html +++ b/app/templates/modules/customers.html @@ -5,15 +5,17 @@ Customers {% endblock %} +{% block actions %} +
  • Add customer
  • +{% endblock %} + {% block content %} -
    - Add customer -
    + @@ -23,7 +25,15 @@ Customers {% for customer in customers %} - + + {% if customer.website %} {% else %} diff --git a/app/templates/modules/edit-item.html b/app/templates/modules/edit-item.html new file mode 100644 index 0000000..194aa77 --- /dev/null +++ b/app/templates/modules/edit-item.html @@ -0,0 +1,19 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} + + +{% block title %}Edit {{ table }} item{% endblock %} +{% block content %} + + +
    + Edit item #{{ pk }} in our {{ table }} table. + {% for field in form %} + {{ field.label() }} + {{ field() }}
    + {% endfor %} +
    + + +{% endblock %} diff --git a/app/templates/modules/ferti.html b/app/templates/modules/ferti.html new file mode 100644 index 0000000..549059b --- /dev/null +++ b/app/templates/modules/ferti.html @@ -0,0 +1,99 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} + +{% block title %} +Logger +{% endblock %} + +{% block actions %} +
  • Add log
  • +
  • Add target
  • +{% endblock %} + +{% block content %} + +Track operating logs. + +
    ID Name City Phone
    +
    + +
    +
    + +
    +
    {{ customer.primary_key }}{{ customer.name }}
    + + + + + + + + + + + + + + + + + + + + + + + + + {% if target %} + + + + + + + + + + + + + + + + + + + + + + + {% endif %} + {% for log in logs %} + + + + + + + + + + + + + + + + + + + + + + + {% endfor %} + +
    ActionsIDUpdatedNNO3PKCaMgSNaClFeZnBMnCuMoSiNNH4
    {{ target.primary_key }}{{ target.date_time_updated }}{{ target.nno3 }}{{ target.p }}{{ target.k }}{{ target.ca }}{{ target.mg }}{{ target.s }}{{ target.na }}{{ target.cl }}{{ target.fe }}{{ target.zn }}{{ target.b }}{{ target.mn }}{{ target.cu }}{{ target.mo }}{{ target.si }}{{ target.nnh4 }}
    + + +
    + +
    +
    {{ log.primary_key }}{{ log.date_time_updated }}{{ log.nno3 }}{{ log.p }}{{ log.k }}{{ log.ca }}{{ log.mg }}{{ log.s }}{{ log.na }}{{ log.cl }}{{ log.fe }}{{ log.zn }}{{ log.b }}{{ log.mn }}{{ log.cu }}{{ log.mo }}{{ log.si }}{{ log.nnh4 }}
    +{% endblock %} diff --git a/app/templates/modules/invoice-preview.html b/app/templates/modules/invoice-preview.html new file mode 100644 index 0000000..f86f9a2 --- /dev/null +++ b/app/templates/modules/invoice-preview.html @@ -0,0 +1,108 @@ +{# -*- mode: web; -*- #} + + + + + + + + Invoice preview for {{ invoice.customer.name }} + + + + + + +
    +
    + +
    +

    FAPG

    +
    Route de Versonnex
    +
    (602) 519-0450
    +
    company@example.com
    +
    + +
    +
    +
    +
    +
    INVOICE TO:
    +

    {{ invoice.customer.name }}

    +
    {{ invoice.customer.address }}
    + {% if invoice.customer.email %} + + {% endif %} +
    +
    +

    INVOICE {{ invoice.invoice_id_alt }}

    +
    Date of Invoice: {{ invoice.date_billed }}
    +
    Due Date: {{ invoice.date_due }}
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #DESCRIPTIONUNIT PRICEQUANTITYTOTAL
    01

    Website Design

    Creating a recognizable design solution based on the company's existing visual identity
    $40.0030$1,200.00
    02

    Website Development

    Developing a Content Management System-based Website
    $40.0080$3,200.00
    03

    Search Engines Optimization

    Optimize the site for search engines (SEO)
    $40.0020$800.00
    SUBTOTAL$5,200.00
    TAX 25%$1,300.00
    GRAND TOTAL$6,500.00
    +
    Thank you!
    +
    +
    NOTICE:
    +
    A finance charge of 1.5% will be made on unpaid balances after 30 days.
    +
    +
    +
    + Invoice was created on a computer and is valid without the signature and seal. +
    + +
    + + diff --git a/app/templates/modules/invoices.html b/app/templates/modules/invoices.html index 76fe267..55a4b87 100644 --- a/app/templates/modules/invoices.html +++ b/app/templates/modules/invoices.html @@ -1,44 +1,80 @@ -{# -*- mode: jinja2; -*- #} +{# -*- mode: web; -*- #} {% extends "base.html" %} {% block title %} - Products +Invoices {% endblock %} -{% block content %} +{% block actions %} +
  • Add invoice
  • +
  • +{% endblock %} -
    - New invoice -
    +{% block content %} +Track your invoices and create new ones here.
    - Track your invoices and create new ones here. - - +
    +{% for page_num in invoices.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %} +{% if page_num %} + +{% if invoices.page == page_num %} + + {{ page_num }} + +{% else %} + + {{ page_num }} + +{% endif %} +{% else %} +... +{% endif %} +{% endfor %} +
    +
    - - - - - - - + + + + + + + + + + + + + - {% for invoice in invoices %} + {% for invoice in invoices.items %} - - - - - - {% if product.date_time_updated %} - - {% else %} - - {% endif %} - + + + + + + + + + + + - {% endfor %} + {% endfor %} -
    ActionsNamePrice (net)Price (gross)Updated
    ActionsIDCreatedAlternative Invoice IDCustomer NameCustomer ReferenceDate BilledDate DueAmount (Net €)Amount (Gross €)Tax Amount (€)
    {{ product.name }}{{ product.price_net }}{{ product.price_gross }}{{ product.date_time_updated }}{{ product.date_time_created }} +
    + +
    +
    + +
    +
    + +
    +
    {{ invoice.primary_key }}{{ invoice.date_time_created }}{{ invoice.invoice_id_alt }}{{ invoice.customer.name }}{{ invoice.customer_reference }}{{ invoice.date_billed }}{{ invoice.date_due }}{{ invoice.amount_net }}{{ invoice.amount_gross }}{{ invoice.amount_tax }}
    + {% endblock %} diff --git a/app/templates/modules/logger.html b/app/templates/modules/logger.html deleted file mode 100644 index f3321e9..0000000 --- a/app/templates/modules/logger.html +++ /dev/null @@ -1,142 +0,0 @@ -{# -*- mode: web; -*- #} - -{% extends "base.html" %} - -{% block title %} -Logger -{% endblock %} - -{% block content %} - - -
    - Add log -
    - -Track operating logs. - -

    Most recent target

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ActionsIDTypeUpdatedNNO3PKCaMgSNaClFeZnBMnCuMoSiNNH4
    - - -
    - -
    -
    {{ target.primary_key }}Target{{ target.date_time_updated }}{{ target.nno3 }}{{ target.p }}{{ target.k }}{{ target.ca }}{{ target.mg }}{{ target.s }}{{ target.na }}{{ target.cl }}{{ target.fe }}{{ target.zn }}{{ target.b }}{{ target.mn }}{{ target.cu }}{{ target.mo }}{{ target.si }}{{ target.nnh4 }}
    - -

    Logs

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for log in logs %} - - - - - {% if log.target == "True" %} - - {% else %} - - {% endif %} - - - - - - - - - - - - - - - - - - - {% endfor %} - -
    ActionsIDTypeUpdatedNNO3PKCaMgSNaClFeZnBMnCuMoSiNNH4
    - - -
    - -
    -
    {{ log.primary_key }}TargetLog{{ log.date_time_updated }}{{ log.nno3 }}{{ log.p }}{{ log.k }}{{ log.ca }}{{ log.mg }}{{ log.s }}{{ log.na }}{{ log.cl }}{{ log.fe }}{{ log.zn }}{{ log.b }}{{ log.mn }}{{ log.cu }}{{ log.mo }}{{ log.si }}{{ log.nnh4 }}
    -{% 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 %} +
    +
    + Login + {% for field in form %} + {{ field.label() }} + {{ field() }}
    + {% endfor %} +
    +
    +{% endblock %} diff --git a/app/templates/modules/orders.html b/app/templates/modules/orders.html index bf94d3d..fd0c13b 100644 --- a/app/templates/modules/orders.html +++ b/app/templates/modules/orders.html @@ -5,13 +5,13 @@ Orders {% endblock %} +{% block actions %} +Add order +{% endblock %} + {% block content %} Track your orders and their payment status here. -

    - Add order -

    - diff --git a/app/templates/modules/products.html b/app/templates/modules/products.html index 97b692a..fda1afd 100644 --- a/app/templates/modules/products.html +++ b/app/templates/modules/products.html @@ -5,12 +5,11 @@ Products {% endblock %} -{% block content %} - +{% block actions %} +
  • Add product
  • +{% endblock %} -
    - Add product -
    +{% block content %} Track products you sell here. @@ -18,6 +17,7 @@ Products + @@ -28,13 +28,15 @@ Products {% for product in products %} + + + + 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 %} + +
    + Register + {% for field in form %} + {{ field.label() }} + {{ field() }}
    + {% endfor %} +
    + +{% endblock %} diff --git a/app/templates/modules/settings.html b/app/templates/modules/settings.html new file mode 100644 index 0000000..0b8f0c0 --- /dev/null +++ b/app/templates/modules/settings.html @@ -0,0 +1,57 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} + +{% block title %} +Settings for user {{ current_user.username }} +{% endblock %} + +{% block content %} + +

    Welcome, {{ current_user.username }}!

    + +

    User profile

    + + + + + +
    ActionsID Name Price (net) Price (gross)
    - -
    -
    +
    {{ product.primary_key }} {{ product.name }} {{ product.price_net }} {{ product.price_gross }}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Username{{ current_user.username }}
    First Name{{ current_user.name_first }}
    Last Name{{ current_user.name_last }}
    E-mail{{ current_user.email }}
    Phone (mobile){{ current_user.phone_mobile }}
    Phone (alt){{ current_user.phone_alternative }}
    Last Updated{{ current_user.date_time_updated }}
    +{% endblock %} -- cgit v1.2.3