Introduce support for Flatpages

Markdown support only
This commit is contained in:
2022-08-07 18:43:58 +02:00
parent f56accb4ff
commit 46477c4576
17 changed files with 194 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
{% load static %}
{% load solo_tags %}
{% load markdown %}
{% load show_menu %}
{% get_solo 'portal.SiteConfiguration' as site_conf %}
<!doctype html>
@@ -71,6 +72,7 @@
<li class="nav-item">
<a class="nav-link" href="{% url 'scales' %}">Scales</a>
</li>
{% show_menu %}
</ul>
{% include 'includes/search.html' %}
</div>
@@ -84,7 +86,7 @@
</div>
</div>
</section>
<div class="album py-5 bg-light">
<div class="album py-4 bg-light">
<div class="container">
<a id="rolling-stock"></a>
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">

View File

@@ -57,7 +57,7 @@
{% block pagination %}
{% if company.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if company.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'company_pagination' page=company.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>

View File

@@ -103,7 +103,7 @@
{% block pagination %}
{% if rolling_stock.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if rolling_stock.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'consist_pagination' uuid=consist.uuid page=rolling_stock.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>

View File

@@ -70,7 +70,7 @@
{% block pagination %}
{% if consist.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if consist.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'consists_pagination' page=consist.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>

View File

@@ -0,0 +1,19 @@
{% extends 'base.html' %}
{% load markdown %}
{% block header %}
<h1 class="fw-light">{{ flatpage.name }}</h1>
<small class="text-muted">Updated {{ flatpage.updated_time | date:"M d, Y H:i" }}</small>
{% endblock %}
{% block extra_content %}
<section class="py-4 text-start container">
<div class="row">
<div class="mx-auto">
<div>{{ flatpage.content | markdown | safe }} </div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:portal_flatpage_change' flatpage.pk %}">Edit</a>{% endif %}
</div>
</div>
</div>
</section>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% if menu %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
More ...
</a>
{% for m in menu %}
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="{{ m.get_absolute_url }}">{{ m.name }}</a></li>
</ul>
{% endfor %}
</li>
{% endif %}

View File

@@ -9,7 +9,7 @@
{% block pagination %}
{% if rolling_stock.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if rolling_stock.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'index_pagination' page=rolling_stock.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>

View File

@@ -47,7 +47,7 @@
{% block pagination %}
{% if scale.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if scale.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'scale_pagination' page=scale.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>

View File

@@ -7,7 +7,7 @@
{% block pagination %}
{% if rolling_stock.has_other_pages %}
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center mt-4">
<ul class="pagination justify-content-center mt-4 mb-0">
{% if rolling_stock.has_previous %}
<li class="page-item">
<a class="page-link" href="{% url 'filtered_pagination' _filter=filter search=search page=rolling_stock.previous_page_number %}#rolling-stock" tabindex="-1">Previous</a>