Fix layout n stuff

This commit is contained in:
Götz 2019-04-12 21:45:18 +02:00
parent cae2f3a2be
commit 2f037fe9ea
13 changed files with 131 additions and 15 deletions

View File

@ -35,9 +35,9 @@ class UserGroupListForm(forms.Form):
class AddLDAPGroupForm(forms.Form):
name = forms.CharField(label='Name', max_length=400)
name = forms.CharField(label='Gruppenname', max_length=400)
# TODO show only allowed user
members = forms.ModelMultipleChoiceField(label='Mitglieder', widget=forms.CheckboxSelectMultiple,
members = forms.ModelMultipleChoiceField(label='Nutzer hinzufügen', widget=forms.CheckboxSelectMultiple,
queryset=LdapUser.objects.all(), )

View File

@ -84,6 +84,7 @@ class LdapUser(Model):
query = Q(username=users.pop())
for user in users:
query = query | Q(username=user)
LdapUser.base_dn = LdapUser.ROOT_DN
return LdapUser.objects.filter(query)
@staticmethod

View File

@ -17,6 +17,7 @@ from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import user_passes_test
from .views import about
login_forbidden = user_passes_test(lambda u: u.is_anonymous(), '/')
@ -24,6 +25,7 @@ urlpatterns = [
path('', include('account_manager.urls')),
path('admin/', admin.site.urls),
path('accounts/login/', auth_views.LoginView.as_view(redirect_authenticated_user=True), name='login'),
path('about/', about, name='about'),
path('accounts/password_reset/',
auth_views.PasswordResetView.as_view(html_email_template_name='registration/password_reset_email.html'),
name='password_reset'),

9
core/views.py Normal file
View File

@ -0,0 +1,9 @@
import logging
from django.shortcuts import render
logger = logging.getLogger(__name__)
def about(request):
return render(request, 'about.jinja2', {})

View File

@ -71,8 +71,15 @@
}
/*SIDEBAR*/
.sidebar-bottom {
position: fixed;
width: 15rem;
bottom: 0;
}
.sidebar-wrapper {
min-height: 100vh;
min-height: calc(100vh - 56px);
margin-left: -15rem;
-webkit-transition: margin .25s ease-out;
-moz-transition: margin .25s ease-out;
@ -82,6 +89,7 @@
.sidebar-wrapper .sidebar-heading {
padding: 0.875rem 1.25rem;
margin-bottom: 0;
font-size: 1.2rem;
}
@ -171,6 +179,10 @@
opacity: 0;
}
.table th, .table td {
padding: 0.5rem;
}
/* ------------------------------------------------------------------------------------------------------------------ */
/* -- Realm delete -- */
/* ------------------------------------------------------------------------------------------------------------------ */

68
static/images/lama.svg Normal file
View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<path style="fill:#F6D76F;" d="M369.437,474.854V512h33.391v-37.146c-5.472-17.394-9.924-27.411-16.696-48.559
C378.435,447.443,375.096,460.8,369.437,474.854z"/>
<path style="fill:#FBB071;" d="M318.33,278.261c0,0,25.6,143.583,34.411,181.462c3.942,6.545,9.754,11.834,16.696,15.132
c5.061,2.404,10.72,3.754,16.696,3.754s11.635-1.349,16.696-3.754c13.161-6.253,22.261-19.663,22.261-35.202V274.22
C381.774,277.148,358.4,277.148,318.33,278.261z"/>
<path style="fill:#F6D76F;" d="M109.172,474.854V512h33.391v-37.146c-6.772-10.715-11.224-18.507-19.015-32.976
C117.983,455.235,113.53,466.365,109.172,474.854z"/>
<path style="fill:#FAE8AC;" d="M175.954,474.854V512h33.391v-37.146c-6.772-8.489-10.111-16.281-17.902-28.524
C185.878,458.574,183.652,466.365,175.954,474.854z"/>
<path style="fill:#F6D76F;" d="M159.259,459.723c3.942,6.545,9.754,11.834,16.696,15.132c5.061,2.404,10.72,3.754,16.696,3.754
c5.976,0,11.635-1.349,16.696-3.754c13.161-6.253,22.261-19.663,22.261-35.202v-72.971l-102.493-28.316
C129.113,338.365,151.374,429.635,159.259,459.723z"/>
<path style="fill:#FBB071;" d="M391.698,0c-12.243,0-22.261,10.017-22.261,22.261v3.268l21.241,21.219L391.698,0z"/>
<path style="fill:#FF835D;" d="M86.911,286.546c-18.364,0-33.391,15.027-33.391,33.391v43.195h73.367L86.911,286.546z"/>
<g>
<path style="fill:#FBB071;" d="M302.654,474.854V512h33.391v-37.146c-6.585-9.602-11.037-17.394-16.696-28.524
C311.652,457.461,309.426,465.252,302.654,474.854z"/>
<path style="fill:#FBB071;" d="M233.39,208.629l-68.563,0.011c-43.031-0.007-77.914,34.876-77.914,77.906v153.106
c0,15.539,9.1,28.949,22.261,35.202c5.061,2.404,10.72,3.754,16.696,3.754s11.635-1.349,16.696-3.754
c6.942-3.298,12.753-8.587,16.696-15.132c3.532-5.862,5.565-12.728,5.565-20.07v-72.971h115.57l67.988-86.194l-67.989-71.858
H233.39z"/>
</g>
<g>
<path style="fill:#FF835D;" d="M425.089,47.79V25.529h-66.783c-3.903,0-7.648,0.677-11.13,1.908V0
c-12.243,0-22.261,10.017-22.261,22.261v160.69c0,14.158-12.622,25.678-26.78,25.678h-17.742v231.023
c0,15.539,9.1,28.949,22.261,35.202c5.061,2.404,10.72,3.754,16.696,3.754c5.976,0,11.635-1.349,16.696-3.754
c6.942-3.298,12.753-8.587,16.696-15.132c3.532-5.862,5.565-12.728,5.565-20.07V362.75c38.28-11.479,66.783-46.817,66.783-88.529
V47.79z"/>
<rect x="131.428" y="299.898" style="fill:#FF835D;" width="33.391" height="33.391"/>
<rect x="198.211" y="266.507" style="fill:#FF835D;" width="33.391" height="33.391"/>
</g>
<path style="fill:#F6D76F;" d="M380.567,47.79v55.012c0,0,18.778,0,26.713,0c6.781,0,12.983-2.438,17.809-6.47
c2.568-2.145,4.753-4.735,6.413-7.664l26.978-7.486V47.79C458.48,47.79,380.567,47.79,380.567,47.79z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

16
templates/about.jinja2 Normal file
View File

@ -0,0 +1,16 @@
{% extends 'base.jinja2' %}
{% block content %}
<div class="col-12 ">
<div class="row justify-content-center justify-content-sm-center">
<div class="col-12 col-sm-8 col-md-7 col-lg-6 col-xl-5 bg-white text-dark text-center p-3 mt-5">
<p>Diese App wurde mit viel <i style="color: #DC143C;" class="fas fa-spin fa-heart"></i> von Micheal Götz entwickelt.</p>
<br>
<h2>Icons</h2>
Das App-Icon wurde von Freepik von <a href="https://www.flaticon.com">www.flaticon.com</a> erstellt.
<p>Alle anderen Icons stammen von <a href="https://fontawesome.com"> www.fontawesome.com</a> <i class="fab fa-font-awesome"></i>.</p>
<a href="{{ url('realm-home') }}">Zurück zur Startseite</a>
</div>
</div>
</div>
{% endblock %}

View File

@ -29,7 +29,7 @@
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="{{ url('realm-home') }}">
{# TODO: Icon#}
<img src="/docs/4.0/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top"
<img src="{{ static('images/lama.svg') }}" width="30" height="30" class="d-inline-block align-top"
alt="">
LAMa
</a>

View File

@ -12,8 +12,10 @@
{% endfor %}
</div>
{% else %}
<a href="{{ url('realm-home') }}" class="list-group-item list-group-item-action bg-light">
<i class="fas fa-list"></i> Bereichsübersicht</a>
<div class="list-group-flush border-top">
<a href="{{ url('realm-home') }}" class="list-group-item list-group-item-action bg-light">
<i class="fas fa-list"></i> Bereichsübersicht</a>
</div>
{% if realm %}
<h2 class="sidebar-heading">Bereich {{ realm.name }}</h2>
<div class="list-group list-group-flush">
@ -30,11 +32,16 @@
{% endif %}
{% endif %}
{% if request.user.is_superuser %}
<div class="list-group-item bg-light"></div>
<a href="{{ url('realm-add') }}"
class="list-group-item list-group-item-action bg-light"><i class="fas fa-plus-square"></i>
Bereich hinufügen</a>
<div class="list-group-flush border-top">
<div class="list-group-item bg-light border-0"></div>
<a href="{{ url('realm-add') }}"
class="list-group-item list-group-item-action bg-light"><i class="fas fa-plus-square"></i>
Bereich hinufügen</a>
</div>
{% endif %}
<div class="sidebar-bottom list-group-flush border-top">
<a href="{{ url('about') }}" class="list-group-item list-group-item-action bg-light">Über</a>
</div>
</div>
<div class="page-content-wrapper">

View File

@ -2,6 +2,7 @@
{% import 'macros/form_macros.jinja2' as mform %}
{% block detail_content %}
<h2>Gruppe anlegen</h2>
{% if extra_error %}
<div class="alert alert-warning">{{ extra_error }}</div>
{% endif %}

View File

@ -8,7 +8,7 @@
<ul class="list-group list-group-flush w-100 mb-3">
<li class="list-group-item">Ldap Domain: {{ group.dn }}</li>
</ul>
<h2>Mitglieder</h2>
<h3>Mitglieder</h3>
{{ mutils.get_user_table(realm, users) }}
<div class="d-flex mt-3">
<a href="{{ url('realm-group-update', args = [realm.id, group.dn]) }}" class="btn btn-primary mr-auto p-2">

View File

@ -70,8 +70,8 @@
<th scope="col">Mailadresse</th>
<th scope="col">Admingruppe</th>
<th scope="col">Defaultgruppe</th>
<th scope="col">Nutzer anzahl</th>
<th scope="col">Gruppen anzahl</th>
<th scope="col">Nutzeranzahl</th>
<th scope="col">Gruppenanzahl</th>
</tr>
</thead>
<tbody>

View File

@ -32,10 +32,10 @@
</ul>
<div class="card-footer d-flex bg-white">
<a href="{{ url('user-update', args = [user.dn, realm.id]) }}"
class="btn btn-primary mr-auto p-2"><i class="fas fa-user-edit"></i> Nutzer
class="btn btn-primary mr-auto p-2"><i class="fas fa-user-edit"></i> Profil
bearbeiten</a>
<a href="{{ url('user-delete-confirm', args = [user.dn, realm.id]) }}"
class="btn btn-danger p-2"><i class="fas fa-trash"></i> Nutzer löschen</a>
class="btn btn-danger p-2"><i class="fas fa-trash"></i> Profil löschen</a>
</div>
</div>
</div>