mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-05 05:37:50 +02:00
Initial gui support
This commit is contained in:
10
dcc/portal/templates/breadcrumbs.html
Normal file
10
dcc/portal/templates/breadcrumbs.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'index' %}">Home</a></li>
|
||||
{% for p in pages %}
|
||||
<li class="breadcrumb-item{% if forloop.last %} active {% endif %}" aria-current="page">{% if forloop.last %}{{ p.name }}{% else %}
|
||||
<a href="{% url 'portal_page' p.path %}">{{ p.name }}</a>
|
||||
{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</nav>
|
75
dcc/portal/templates/flatpage.html
Normal file
75
dcc/portal/templates/flatpage.html
Normal file
@@ -0,0 +1,75 @@
|
||||
{% load static %}
|
||||
{% load breadcrumbs %}
|
||||
{% load solo_tags %}
|
||||
{% get_solo 'portal.SiteConfiguration' as site_conf %}
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="{{ site_conf.about }}">
|
||||
<meta name="author" content="{{ site_conf.site_author }}">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-196x196.png' %}" sizes="196x196">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-128.png' %}" sizes="128x128">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-96x96.png' %}" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-32x32.png' %}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-16x16.png' %}" sizes="16x16">
|
||||
|
||||
<title>{{ site_conf.site_name }} - {{ page.name }}</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{% static "css/dist/bootstrap.min.css" %}" rel="stylesheet">
|
||||
<link href="{% static "css/fonts.css" %}" rel="stylesheet">
|
||||
<link href="{% static "css/main.css" %}" rel="stylesheet">
|
||||
{% if site_conf.common_css %}<link rel="stylesheet" href="{{ site_conf.common_css.url }}">{% endif %}
|
||||
</head>
|
||||
|
||||
<body class="bg-dark">
|
||||
<div class="container-fluid h-100 d-flex flex-column">
|
||||
<header>
|
||||
{% include 'navbar.html' %}
|
||||
<div class="row collapse bg-dark shadow-sm" id="navbarHeader">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-8 col-md-7 py-4">
|
||||
{% if site_conf.about %}<h4 class="text-white">About</h4>
|
||||
<p class="text-muted">{{ site_conf.about | safe }}</p>{% endif %}
|
||||
{% breadcrumbs page.path %}
|
||||
</div>
|
||||
<div class="col-sm-4 offset-md-1 py-4 text-right">
|
||||
{% if request.user.is_staff %}<div class="dropdown btn-group">
|
||||
<button class="btn btn-sm btn-outline-danger dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Edit
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="{% url 'admin:portal_flatpage_change' page.pk %}">Edit page</a>
|
||||
<a class="dropdown-item" href="{% url 'admin:portal_flatpage_history' page.pk %}">History</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="{% url 'admin:portal_flatpage_delete' page.pk %}">Delete</a>
|
||||
</div>
|
||||
</div>{% endif %}
|
||||
{% include 'login.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<main>
|
||||
<div class="album py-5 bg-white">
|
||||
<div class="container">
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
||||
|
||||
<!-- Bootstrap core JavaScript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="{% static "js/dist/jquery.min.js" %}"></script>
|
||||
<script src="{% static "js/dist/bootstrap.bundle.min.js" %}"></script>
|
||||
</body>
|
||||
</html>
|
17
dcc/portal/templates/footer.html
Normal file
17
dcc/portal/templates/footer.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<footer class="bg-dark text-white">
|
||||
<div class="container">
|
||||
<p class="float-right">
|
||||
<a href="#">Back to top</a>
|
||||
</p>
|
||||
<p>{% if site_conf.show_copyright %}© {% now "Y" %} {% endif %}</p>
|
||||
{% if rolling_stock and site_conf.footer_short %}
|
||||
{{ site_conf.footer_short | safe }}
|
||||
{% else %}
|
||||
{{ site_conf.footer | safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if site_conf.show_version and not map %}<div class="container">
|
||||
<p class="small text-muted">Version: {{ site_conf.version }}</p>
|
||||
</div>{% endif %}
|
||||
</footer>
|
||||
|
147
dcc/portal/templates/home.html
Normal file
147
dcc/portal/templates/home.html
Normal file
@@ -0,0 +1,147 @@
|
||||
{% load static %}
|
||||
{% load solo_tags %}
|
||||
{% get_solo 'portal.SiteConfiguration' as site_conf %}
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="{{ site_conf.about }}">
|
||||
<meta name="author" content="{{ site_conf.site_author }}">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-196x196.png' %}" sizes="196x196">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-128.png' %}" sizes="128x128">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-96x96.png' %}" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-32x32.png' %}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-16x16.png' %}" sizes="16x16">
|
||||
|
||||
<title>{{ site_conf.site_name }}</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{% static "css/dist/bootstrap.min.css" %}" rel="stylesheet">
|
||||
<link href="{% static "css/fonts.css" %}" rel="stylesheet">
|
||||
<link href="{% static "css/main.css" %}" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body class="bg-dark">
|
||||
<div class="container-fluid">
|
||||
<header>
|
||||
{% include 'navbar.html' %}
|
||||
<div class="row collapse bg-dark shadow-sm" id="navbarHeader">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-8 col-md-7 py-4">
|
||||
{% if site_conf.about %}<h4 class="text-white">About</h4>
|
||||
<div class="text-justify text-muted">{{ site_conf.about | safe }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="col-sm-4 offset-md-1 py-4 text-right">
|
||||
{% include 'login.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<main class="bg-light">
|
||||
<div class="bg-white py-5">
|
||||
<div class="container">
|
||||
{{ site_conf.homepage_content | safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a id="maps"></a>
|
||||
<div class="album py-5">
|
||||
<div class="container">
|
||||
<div class="row text-center">
|
||||
<div class="col-md-12">
|
||||
{% if tags %}<p>active filter:
|
||||
{% for t in tags %}<span class="badge" style="background-color: {{ t.color }}; color: {{ t.label_color }};">{{ t.tag }}</span>{# new line is required #}
|
||||
{% endfor %}</p>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% for r in rolling_stock %}
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-4 shadow-sm">
|
||||
<a href="{{ r.get_absolute_url }}">
|
||||
{% for t in r.thumbnail.all %}{% if t.is_thumbnail %}<img src="{{ t.image.url }}" alt="Card image cap">
|
||||
{% else %}<img class="card-img-top" src="{% static "img/empty.svg" %}">{% endif %}</a>{% endfor %}
|
||||
<div class="card-body">
|
||||
<p class="card-text"><strong>{{ r }}</strong></p>{{ r.description|safe|truncatechars_html:256 }}
|
||||
<p class="card-text">
|
||||
{% for t in r.tags.all %}<a class="badge"
|
||||
style="background-color: {{ t.color }}; color: {{ t.label_color }};" href="{# url 'tags_filtered' t.tag #}">{{ t.tag }}</a>{# new line is required #}
|
||||
{% endfor %}
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{{ r.get_absolute_url }}">View</a>
|
||||
{% if request.user.is_staff %}<a class="btn btn-sm btn-outline-danger" href="{% url 'admin:roster_rollingstock_change' r.pk %}">Edit</a>{% endif %}
|
||||
</div>
|
||||
<small class="text-muted published-info">Last update: <em>{{ r.updated_time | date:"M d, Y" }}</em></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if request.user.is_staff and not rolling_stock.has_next %}
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-4 shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-sm btn-secondary" href="{#% url 'admin:rolling_stock_add' %#}">Add a new map</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if rolling_stock.has_other_pages %}
|
||||
<nav aria-label="Page navigation example">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if rolling_stock.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="/page/{{ rolling_stock.previous_page_number }}#rolling_stock" tabindex="-1">Previous</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link">Previous</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% for i in rolling_stock.paginator.page_range %}
|
||||
{% if rolling_stock.number == i %}
|
||||
<li class="page-item active">
|
||||
<span class="page-link">{{ i }}<span class="sr-only">(current)</span></span>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item"><a class="page-link" href="/page/{{ i }}#rolling_stock">{{ i }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if rolling_stock.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="/page/{{ rolling_stock.next_page_number }}#rolling_stock" tabindex="-1">Next</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link">Next</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
||||
|
||||
<!-- Bootstrap core JavaScript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="{% static "js/dist/jquery.min.js" %}"></script>
|
||||
<script src="{% static "js/dist/bootstrap.bundle.min.js" %}"></script>
|
||||
</body>
|
||||
</html>
|
18
dcc/portal/templates/login.html
Normal file
18
dcc/portal/templates/login.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% if request.user.is_staff %}
|
||||
<div class="btn-group" role="group" aria-label="User actions">
|
||||
<button type="button" class="btn btn-sm btn-outline-light dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Welcome back, <strong>{{ request.user }}</strong>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{% url 'admin:index' %}">Admin</a>
|
||||
<a class="dropdown-item" href="{% url 'admin:portal_siteconfiguration_changelist' %}">Site configuration</a>
|
||||
<a class="dropdown-item" href="{% url 'admin:password_change' %}">Change password</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="{% url 'admin:logout' %}?next={{ request.path }}">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<a class="btn btn-sm btn-outline-light" href="{% url 'admin:login' %}?next={{ request.path }}">Log in</a>
|
||||
{% endif %}
|
||||
|
10
dcc/portal/templates/navbar.html
Normal file
10
dcc/portal/templates/navbar.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="row navbar navbar-dark">
|
||||
<div class="container d-flex justify-content-between">
|
||||
<a href="{% url 'index' %}" class="navbar-brand mr-auto">{% if site_conf.site_logo %}<img class="mr-2 d-inline-block" src="{{ site_conf.site_logo.url }}" alt="website logo" id="site-logo" />{% endif %}<strong class="align-middle">{{ site_conf.site_name }}</strong></a>
|
||||
{% if rolling_stock %}<span class="navbar-brand">{{ rolling_stock.identifier }}</span>{% endif %}
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user