From 00baa0ccc5971b3e579345748dafc59c4b6a9907 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 3 Jun 2021 22:43:10 +0530 Subject: Added Templates * Contact Us form * Base Index * Flash error template --- app/templates/contact.html | 37 +++++++++++++++++++++++++++++++++++++ app/templates/flash_messages.html | 7 +++++++ app/templates/index.html | 13 +++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 app/templates/contact.html create mode 100644 app/templates/flash_messages.html create mode 100644 app/templates/index.html diff --git a/app/templates/contact.html b/app/templates/contact.html new file mode 100644 index 0000000..c07032a --- /dev/null +++ b/app/templates/contact.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% block title %}Contact Us{% endblock %} +{% block head %} + {{ super() }} +{% endblock %} +{% block content %} +
+

Contact Us

+

You can use this form to send us a message.

+
+ {% include 'flash_messages.html' %} + {{ form.csrf_token }} +
+ {{ form.name.label }} {{ form.name(class="form-control") }} +
+
+ {{ form.email.label }} {{ form.email(class="form-control") }} +
+
+ {{ form.subject.label }} {{ form.subject(class="form-control") }} +
+
+ {{form.body.label}} {{form.body(class="form-control")}} +
+
+ +
+
+
+{% if form.name.errors %} + +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/app/templates/flash_messages.html b/app/templates/flash_messages.html new file mode 100644 index 0000000..b524c24 --- /dev/null +++ b/app/templates/flash_messages.html @@ -0,0 +1,7 @@ +{% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
{{ message }}
+ {% endfor %} + {% endif %} +{% endwith %} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..d66ca86 --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block title %}Home{% endblock %} +{% block head %} + {{ super() }} +{% endblock %} +{% block content %} +
+

Index

+

+ Welcome to my awesome homepage. +

+
+{% endblock %} \ No newline at end of file -- cgit v1.2.3