From 51c9fed15381421c4b7e8ba95af60b5204483d50 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 5 Jun 2022 14:20:40 +0200 Subject: First commit :baby: --- app/templates/base.html | 50 +++++++++++++++++++++ app/templates/home.html | 90 +++++++++++++++++++++++++++++++++++++ app/templates/modules/add-item.html | 19 ++++++++ app/templates/modules/invoices.html | 80 +++++++++++++++++++++++++++++++++ app/templates/modules/login.html | 16 +++++++ app/templates/modules/register.html | 16 +++++++ app/templates/modules/settings.html | 45 +++++++++++++++++++ 7 files changed, 316 insertions(+) create mode 100644 app/templates/base.html create mode 100644 app/templates/home.html create mode 100644 app/templates/modules/add-item.html create mode 100644 app/templates/modules/invoices.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') diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..7a63ddf --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,50 @@ +{# -*- mode: web; -*- #} + + + + + + + + mdl + + + + + + + +
+ {% block content %}{% endblock %} +
+ {# Flashed messages added last, so that they appear on top of the content. #} + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+ +
+ {% endif %} + {% endwith %} + + + diff --git a/app/templates/home.html b/app/templates/home.html new file mode 100644 index 0000000..e4e690f --- /dev/null +++ b/app/templates/home.html @@ -0,0 +1,90 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} + +{% block title %} +{% if current_user.is_authenticated %} +Welcome, {{ user.name_first }} {{ user.name_last }}! +{% else %} +Welcome to mdl, the music downloader +{% endif %} +{% endblock %} + +{% block actions %} +{#
  • Download database
  • #} +{% endblock %} + +{% block content %} +{% if current_user.is_authenticated %} +
    +
    +

    New

    +
    +
    + Download audio from a URL to the server. + {% with form = form_download_remote %} + {{ form.csrf_token }} + {{ form.url.label() }} + {{ form.url() }} + {{ form.download_remote() }} + {% endwith %} +
    +
    +
    + {% if pending_files %} +
    +

    Pending

    + {% for file in pending_files %} +
    +
    + {{ file }} +
    +
    + {% endfor %} +
    + {% endif %} + {% if downloaded_files %} +
    +

    Finished

    + {% for file in downloaded_files %} +
    +
    + {{ file }} + {% with form = form_manage_remote %} + {{ form.csrf_token }} + {{ form.file_name(value=file) }} + {{ form.download_local() }} + {{ form.remove_remote() }} + {% endwith %} +
    +
    + {% endfor %} +
    + {% endif %} +
    +

    Download history

    + + + + + + + + + + + {% for file in download_history %} + + + + + + + {% endfor %} + +
    IDTitleDownloadedUser
    {{ file.primary_key }}{{ file.title }}{{ file.date_time_downloaded }}{{ file.user.username }}
    +{% else %} +

    You need to be logged in before using this web app.

    +{% endif %} + +{% endblock %} 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 %} + +
    +
    + Add a new item to our {{ table }} table. + {% for field in form %} + {{ field.label() }}
    + {{ field() }}
    + {% endfor %} +
    +
    + +{% 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 %} +
  • Add invoice
  • +
  • +{% endblock %} + +{% block content %} +Track your invoices and create new ones here.
    + +{# Pagination Links #} +{# gotten from https://betterprogramming.pub/simple-flask-pagination-example-4190b12c2e2e #} +
    + {# 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 %} + + {{ page_num }} + + {% else %} + + {{ page_num }} + + {% endif %} + {% else %} + ... + {% endif %} + {% endfor %} +
    + + + + + + + + + + + + + + + + + + {% for invoice in invoices.items %} + + + + + + + + + + + + + + {% endfor %} + +
    IDCreatedAlternative Invoice IDCustomer NameCustomer ReferenceDate BilledDate DueAmount (Net €)Amount (Gross €)Tax Amount (€)
    +
    + +
    +
    + +
    +
    {{ 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/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/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..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 %} + +

    Welcome, {{ current_user.name_first }} {{ current_user.name_last }}!

    + +

    User profile

    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldValue
    Username{{ current_user.username }}
    First Name{{ current_user.name_first }}
    Last Name{{ current_user.name_last }}
    Last Updated{{ current_user.date_time_updated }}
    +{% endblock %} -- cgit v1.2.3