diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-03 22:43:10 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-03 22:43:10 +0530 |
commit | 00baa0ccc5971b3e579345748dafc59c4b6a9907 (patch) | |
tree | 7710c6769fa9dce79bcb38752772a1497ec11538 | |
parent | f8a9c42b1011f5137a9f7a61566e7e5f1df60b1a (diff) |
Added Templates
* Contact Us form
* Base Index
* Flash error template
-rw-r--r-- | app/templates/contact.html | 37 | ||||
-rw-r--r-- | app/templates/flash_messages.html | 7 | ||||
-rw-r--r-- | app/templates/index.html | 13 |
3 files changed, 57 insertions, 0 deletions
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 %} + <div class="container"> + <h1 class="display-2">Contact Us</h1> + <p>You can use this form to send us a message.</p> + <form method="POST" action="/ContactUs"> + {% include 'flash_messages.html' %} + {{ form.csrf_token }} + <div class="form-group"> + {{ form.name.label }} {{ form.name(class="form-control") }} + </div> + <div class="form-group"> + {{ form.email.label }} {{ form.email(class="form-control") }} + </div> + <div class="form-group"> + {{ form.subject.label }} {{ form.subject(class="form-control") }} + </div> + <div class="form-group"> + {{form.body.label}} {{form.body(class="form-control")}} + </div> + <div class="form-group"> + <input class="btn btn-primary" type="submit" value="Submit"> + </div> + </form> +</div> +{% if form.name.errors %} + <ul class="errors"> + {% for error in form.name %} + <li>{{ error }}</li> + {% endfor %} + </ul> +{% 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 %} + <div class="alert alert-{{ category }}">{{ message }}</div> + {% 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 %} +<div class="container"> + <h1>Index</h1> + <p> + Welcome to my awesome homepage. + </p> +</div> +{% endblock %}
\ No newline at end of file |