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' %}
|
||||
{% load i18n %}
|
||||
{% load i18n ksp_filters %}
|
||||
|
||||
{% block body_middle %}
|
||||
<h1>Kompensationsverzeichnis</h1>
|
||||
<h2>Service Portal</h2>
|
||||
<hr>
|
||||
{% if user.is_anonymous %}
|
||||
<a href="{% url 'simple-sso-login' %}">
|
||||
<button class="button middle">
|
||||
{% trans 'Proceed with login' %}
|
||||
</button>
|
||||
{% block body %}
|
||||
<div id="server-messages" class="row px-3">
|
||||
<h4 class="row">{% trans 'News' %}</h4>
|
||||
<div class="row px-3">
|
||||
{% for msg in msgs %}
|
||||
<div class="card col-md {{msg.importance|bootstrap_cls}}">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">{{msg.subject}}</h6>
|
||||
<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>
|
||||
{% else %}
|
||||
<article>
|
||||
{% trans 'Logged in as' %} <strong>{{ user.username }}</strong>
|
||||
<br>
|
||||
{% trans 'Last login on' %} {{ user.last_login }}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<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 %}
|
@ -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