Landing page
* started to implement a landing page * started news implementationpull/2/head
parent
f654826003
commit
7968d7d355
@ -0,0 +1,21 @@
|
|||||||
|
"""
|
||||||
|
Author: Michel Peltriaux
|
||||||
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||||
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||||
|
Created on: 05.07.21
|
||||||
|
|
||||||
|
"""
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
from konova.models import ServerMessage
|
||||||
|
|
||||||
|
|
||||||
|
class ServerMessageAdmin(admin.ModelAdmin):
|
||||||
|
list_display = [
|
||||||
|
"id",
|
||||||
|
"subject",
|
||||||
|
"publish_on",
|
||||||
|
"is_active",
|
||||||
|
]
|
||||||
|
|
||||||
|
admin.site.register(ServerMessage, ServerMessageAdmin)
|
@ -1,44 +1,38 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n %}
|
{% load i18n ksp_filters %}
|
||||||
|
|
||||||
{% block body_middle %}
|
{% block body %}
|
||||||
<h1>Kompensationsverzeichnis</h1>
|
<div id="server-messages" class="row px-3">
|
||||||
<h2>Service Portal</h2>
|
<h4 class="row">{% trans 'News' %}</h4>
|
||||||
<hr>
|
<div class="row px-3">
|
||||||
{% if user.is_anonymous %}
|
{% for msg in msgs %}
|
||||||
<a href="{% url 'simple-sso-login' %}">
|
<div class="card col-md {{msg.importance|bootstrap_cls}}">
|
||||||
<button class="button middle">
|
<div class="card-body">
|
||||||
{% trans 'Proceed with login' %}
|
<h6 class="card-title">{{msg.subject}}</h6>
|
||||||
</button>
|
<small>{% trans 'Published on' %} {{msg.publish_on}}</small>
|
||||||
|
<article class="card-text">{{msg.body|safe}}</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
<div class="card col-md {{msg.importance|bootstrap_cls}} align-items-center justify-content-center">
|
||||||
|
<a class="w-100 h-100 align-middle text-center" href="{% url 'home' %}">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">{% trans 'Older ...' %}</h5>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
</div>
|
||||||
<article>
|
</div>
|
||||||
{% trans 'Logged in as' %} <strong>{{ user.username }}</strong>
|
</div>
|
||||||
<br>
|
|
||||||
{% trans 'Last login on' %} {{ user.last_login }}
|
<hr>
|
||||||
</article>
|
|
||||||
|
<div id="quickstart" class="col-md px-3">
|
||||||
|
<h4 class="row">{% trans 'Quickstart' %}</h4>
|
||||||
|
<div class="row px-3">
|
||||||
|
<div class="col-md">{% trans 'Intervention' %}</div>
|
||||||
|
<div class="col-md">{% trans 'Compensation' %}</div>
|
||||||
|
<div class="col-md">{% trans 'Eco-account' %}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form action="{{form.action_url}}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<table>
|
|
||||||
{% comment %}
|
|
||||||
This is an alternative to using the <article></article>
|
|
||||||
<tr>
|
|
||||||
<td>{% trans 'Logged in as' %}</td>
|
|
||||||
<td><strong>{{ user.username }}</strong></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{% trans 'Last login on' %}</td>
|
|
||||||
<td><strong>{{ user.last_login }}</strong></td>
|
|
||||||
</tr>
|
|
||||||
{% endcomment %}
|
|
||||||
{% for field in form %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ field.label }}</td>
|
|
||||||
<td>{{ field }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -0,0 +1,7 @@
|
|||||||
|
"""
|
||||||
|
Author: Michel Peltriaux
|
||||||
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||||
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||||
|
Created on: 05.07.21
|
||||||
|
|
||||||
|
"""
|
@ -0,0 +1,28 @@
|
|||||||
|
"""
|
||||||
|
Author: Michel Peltriaux
|
||||||
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||||
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||||
|
Created on: 05.07.21
|
||||||
|
|
||||||
|
"""
|
||||||
|
from django import template
|
||||||
|
from konova.settings import SVI_BOOTSTRAP_CLS_MAP
|
||||||
|
|
||||||
|
# Create custom library
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter("bootstrap_cls")
|
||||||
|
def bootstrap_cls(value):
|
||||||
|
""" Returns a bootstrap html class name
|
||||||
|
|
||||||
|
Resolves ServerMessageImportance enum into a html class name
|
||||||
|
|
||||||
|
Args:
|
||||||
|
value ():
|
||||||
|
arg ():
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
"""
|
||||||
|
return SVI_BOOTSTRAP_CLS_MAP.get(value, "")
|
Binary file not shown.
Loading…
Reference in New Issue