updated pages view routes and templates to used content module
This commit is contained in:
parent
61809acf44
commit
9610d995de
@ -1,17 +1,18 @@
|
|||||||
from all_paw_care.pages import pages
|
from all_paw_care.pages import pages
|
||||||
|
from all_paw_care.content import pages as site_pages
|
||||||
|
|
||||||
from flask import render_template,url_for
|
from flask import render_template,url_for
|
||||||
|
|
||||||
@pages.route('/')
|
@pages.route('/')
|
||||||
@pages.route('/home')
|
@pages.route('/home')
|
||||||
def home():
|
def home():
|
||||||
return render_template("pages/index.html")
|
return render_template("pages/index.html", page=site_pages.home)
|
||||||
|
|
||||||
@pages.route('/faq')
|
@pages.route('/faq')
|
||||||
def faq():
|
def faq():
|
||||||
return render_template("pages/faq.html")
|
return render_template("pages/faq.html", page=site_pages.faqs)
|
||||||
|
|
||||||
@pages.route('/services')
|
@pages.route('/services')
|
||||||
def services():
|
def services():
|
||||||
return render_template("pages/services.html")
|
return render_template("pages/services.html", page=site_pages.services)
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{% extends "jinja/types/page.html" %}
|
{% extends "jinja/types/page.html" %}
|
||||||
|
|
||||||
{% set title %}FAQ{% endset %}
|
{% set title %}{{ page.get_title() }}{% endset %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row text-center mb-2">
|
<div class="row text-center mb-2">
|
||||||
@ -9,20 +9,20 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for faq in config.FAQS.items() %}
|
{% for faq in page.get_content() %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="btn btn-primary text-center" data-bs-toggle="collapse"
|
<a class="btn btn-primary text-center" data-bs-toggle="collapse"
|
||||||
href="#{{ faq[1][0] }}" role="button" aria-expanded="false"
|
href="#{{ page.get_content()[faq]['tag'] }}" role="button" aria-expanded="false"
|
||||||
aria-controls="{{ faq[1][0] }}">
|
aria-controls="{{ page.get_content()[faq]['tag'] }}">
|
||||||
<h2>{{ faq[0] }}</h2>
|
<h2>{{ faq }}</h2>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="collapse" id="{{ faq[1][0] }}">
|
<div class="collapse" id="{{ page.get_content()[faq]['tag'] }}">
|
||||||
<div class="card card-body text-center">
|
<div class="card card-body text-center">
|
||||||
{{ faq[1][1] }}
|
{{ page.get_content()[faq]['answer'] }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +1,25 @@
|
|||||||
{% extends "jinja/types/page.html" %}
|
{% extends "jinja/types/page.html" %}
|
||||||
|
|
||||||
{% set title %}About me{% endset %}
|
{% set title %}{{ page.get_title() }}{% endset %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row text-center">
|
<div class="row text-center">
|
||||||
<h1 class="text-primary display-1">
|
<h1 class="text-primary display-1">
|
||||||
About me
|
{{ page.get_title() }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for row in config.ABOUT_ME %}
|
{% for row in page.get_content() %}
|
||||||
<div class="row pb-3">
|
<div class="row pb-3">
|
||||||
<div class="col-8 text-center {{ loop.cycle('order-first','order-last') }}">
|
<div class="col-8 text-center {{ loop.cycle('order-first','order-last') }}">
|
||||||
<p class="text-secondary lead">
|
<p class="text-secondary lead">
|
||||||
{{ row[1] }}
|
{{ page.get_content()[row]['content'] }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-4 {{ loop.cycle('order-last','order-first') }}">
|
<div class="col-4 {{ loop.cycle('order-last','order-first') }}">
|
||||||
<picture>
|
<picture>
|
||||||
{% for img in row[0] %}
|
{% for img in page.get_content()[row]['images'] %}
|
||||||
{% if not loop.last %}
|
{% if not loop.last %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ img }}"
|
||||||
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
@ -29,7 +29,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<img class="img-fluid" src="{{ row[0][1] }}">
|
<img class="img-fluid" src="{{ page.get_content()[row]['images'][1] }}">
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,26 +1,29 @@
|
|||||||
{% extends "jinja/types/page.html" %}
|
{% extends "jinja/types/page.html" %}
|
||||||
|
|
||||||
{% set title %}Services{% endset %}
|
{% set title %}{{ page.get_title() }}{% endset %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row text-center pb-2">
|
<div class="row text-center pb-2">
|
||||||
<h1 class="text-primary display-1">
|
<h1 class="text-primary display-1">
|
||||||
Services & Pricing
|
{{ page.get_title() }}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<hr>
|
||||||
<h2 class="text-secondary display-2">
|
|
||||||
Primary services:
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row pt-2 pb-4">
|
{% for section in page.get_content() %}
|
||||||
{% for service in config.SERVICES.items() %}
|
<div class="row text-center">
|
||||||
|
<h2 class="text-secondary display-3">
|
||||||
|
{{ section }}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row pt-2 pb-4">
|
||||||
|
{% for service in page.get_content()[section] %}
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<picture>
|
<picture>
|
||||||
{% for img in service[1][0] %}
|
{% for img in service['images'] %}
|
||||||
{% if not loop.last %}
|
{% if not loop.last %}
|
||||||
<source srcset="{{ img }}"
|
<source srcset="{{ img }}"
|
||||||
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
||||||
@ -31,24 +34,23 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<img class="img-fluid card-img-top"
|
<img class="img-fluid card-img-top"
|
||||||
src="{{ service[1][0][1] }}">
|
src="{{ service['images'][1] }}">
|
||||||
</picture>
|
</picture>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h1 class="card-title text-center text-primary">{{ service[0] }}</h1>
|
<h1 class="card-title text-center text-primary">{{ service['title'] }}</h1>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h2 class="text-success text-center">
|
<h2 class="text-success text-center">
|
||||||
{{ service[1][1] }}
|
{{ service['price'] }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<hr class="invisible">
|
<hr class="invisible">
|
||||||
|
|
||||||
<p class="text-secondary">
|
<p class="text-secondary">
|
||||||
{{ service[1][2] }}
|
Service includes:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for included in service[1][3] %}
|
{% for included in service['included'] %}
|
||||||
<li>{{ included }}</li>
|
<li>{{ included }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@ -57,58 +59,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<h2 class="text-secondary">
|
|
||||||
Add-on services:
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row pt-2 pb-4">
|
|
||||||
{% for service in config.SERVICES.items() %}
|
|
||||||
<div class="col-4">
|
|
||||||
<div class="card">
|
|
||||||
<picture>
|
|
||||||
{% for img in service[1][0] %}
|
|
||||||
{% if not loop.last %}
|
|
||||||
<source srcset="{{ img }}"
|
|
||||||
media="(max-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
|
||||||
{% else %}
|
|
||||||
<source srcset="{{ img }}"
|
|
||||||
media="(min-width: {{ config.IMG_BREAKPOINTS[loop.index] }})" />
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<img class="img-fluid" class="card-img-top"
|
|
||||||
src="{{ service[1][0][1] }}"
|
|
||||||
alt="Woman walking dog">
|
|
||||||
</picture>
|
|
||||||
<div class="card-body">
|
|
||||||
<h1 class="card-title text-center text-primary">{{ service[0] }}</h1>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h2 class="text-success text-center">
|
|
||||||
{{ service[1][1] }}
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<hr class="invisible">
|
|
||||||
|
|
||||||
<p class="text-secondary">
|
|
||||||
{{ service[1][2] }}
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{% for included in service[1][3] %}
|
|
||||||
<li>{{ included }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endfor %}
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="btn btn-primary">
|
<div class="btn btn-primary">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user