From 37887f153c998a13435bffc07371877a52026f30 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Sat, 18 Jan 2020 16:33:35 +0100 Subject: [PATCH] Organigramm getauscht und Quick-Links-Ladebutton --- orga/templates/orga/orga_main.html | 283 +++++++++++------- orga/templates/orga/orga_main_ALT.html | 153 ++++++++++ quicklinks/__pycache__/urls.cpython-38.pyc | Bin 787 -> 860 bytes quicklinks/__pycache__/views.cpython-38.pyc | Bin 3009 -> 3937 bytes .../templates/quicklinks/ql_management.html | 18 ++ quicklinks/urls.py | 3 +- quicklinks/views.py | 23 +- users/__pycache__/views.cpython-38.pyc | Bin 15559 -> 15560 bytes users/static/users/css/custom.css | 110 +++++++ users/templates/users/base.html | 2 +- users/templates/users/profile.html | 2 +- users/templates/users/profile_update.html | 2 +- users/views.py | 2 +- 13 files changed, 487 insertions(+), 111 deletions(-) create mode 100644 orga/templates/orga/orga_main_ALT.html diff --git a/orga/templates/orga/orga_main.html b/orga/templates/orga/orga_main.html index 6120fc5..5605e4c 100644 --- a/orga/templates/orga/orga_main.html +++ b/orga/templates/orga/orga_main.html @@ -1,59 +1,207 @@ {% extends "users/base.html" %} +{% load static %} {% block content %} - - +

{{request.user.profile.agency.name}}


Organigramm

-
+
- + + + {% endblock content %} \ No newline at end of file diff --git a/orga/templates/orga/orga_main_ALT.html b/orga/templates/orga/orga_main_ALT.html new file mode 100644 index 0000000..6120fc5 --- /dev/null +++ b/orga/templates/orga/orga_main_ALT.html @@ -0,0 +1,153 @@ +{% extends "users/base.html" %} +{% block content %} + + +
+

{{request.user.profile.agency.name}}

+
+

Organigramm

+
+
+
+ +
+ +{% endblock content %} \ No newline at end of file diff --git a/quicklinks/__pycache__/urls.cpython-38.pyc b/quicklinks/__pycache__/urls.cpython-38.pyc index a5a17252f0f907aedaa027f7d74a6055284eeb37..5a2f4d87d8a584cd67c7d58ba1e6052baf6c916e 100644 GIT binary patch delta 255 zcmbQtc85(nl$V!_0SI>ID8@}-W?*;>;vfS~AjbiSiw{lIcGgQ_Nny(2$z_gWW@JcZ zOkqpq$l^_5PvPigOyNx7>SYFsai_AU@H8`~a%S;PoFHw@yO5!oF+~6>DF~J1UH}mn zf{F{LGH3Cnh=6$MtWo?aqQMNBVjFK*GfGvl=A;&->sRp==IAD7C069*C#IyNruk_K zOcrA*lP%%~y6qNwVsU&~W@>p9FH}0QG^eC6XYy30EC~^y0v<*lMgc|%Mjkd1Mj0S2 I!N~U;02bytQ2+n{ delta 182 zcmcb^HknO3l$V!_0SIE)e#AO5GcY^`agYHAkmCTv#VaOiJ1eC!rm&@QWbvf1r*QN# zrf{Zk^)ds+xKr6vc$yhgIkR{s&XLyTS;)}Lm?8j`6og80FMx;(fyC2UqIgq;gBdhM zHh!{ZWcJhKo9xb1#(9f9u{gdgGqrs3Ev76H0ieA+j6942j1p`jj53T8j1qqU!{;V7 diff --git a/quicklinks/__pycache__/views.cpython-38.pyc b/quicklinks/__pycache__/views.cpython-38.pyc index 99842c2b3d760278de4a5202d0ef5a1bb8ed4ebb..f99d89de4a3b3a2d840a0e2633839408eae90ff2 100644 GIT binary patch delta 1967 zcmZ`)&2Jk;6yMohZ+0C!iJdqfB?Kp>fC;wK(om76r5}lc5DBG$R2YG^*_k>U@2>6H zb)r}aJ|q_;I7Ew72_XcB9(w4V0|yXAf`4Hzhyw@y1UT{DxDIKQc(uQsdGF2d&3kX= z`R9>8C;C22CgT$PDhHFF{+>AO8z)Z=r$25}iRzBz4wMFn1Y^TVx#?1xNJ|op)7}G# z_A-TO`)X+rBng@XNfIP6kPLyOkM@J4A0!4yG9VeCDUhT<(gTuVnx=yXQfY(^txCDf z-?)Pui8RhU%6N_({`J{7%yrJF&6yRzIPrE6)bBFCUh{kweyg7g_sFj#9p07?0DqI$ zVi_Pwh3A#^t2m01<+A0NzHc$dDVO<+AnU*sjxHed1N6e{s{lGtW4u57NqKl<5S3|w zoWh52jD&mw;E}>#z;PB~5<##DazTlf=YH(!pFvX@l6)smlB-7!fLuNmRiZRcWjuQ;qfj>eK*)HUJ1$9}uoPAYAc^TSk>?HDx~7@?cDEXQVEkheBKa_y4Q z8WN0aj0fCi>u_0lU^=bIc9(DKSeybjr8k^BRJ7sbj7W1?uu-FY z9@Virx4od#>`pXP)i+_|Nn}*TT`eWxM3_w{KuSMSpnsJ#Y!MCTSWm=O9VMNbN#~xL zH=HGq`B?yo#7Up5kz>z4s-crnG7cJ@@CC40$&H48#J}E*dg-R=LD?|@ybm`4`<;Y(k%RYqaUG>zExMyG?>5z!9Q&lyoAUO82J+{sW-Zyg~o~ delta 997 zcmZ{iy>HV{6vgBCBX(lvlTfJAHcHEf38g750@SMN22(|a$^Z?P8^1y%C#jwd0}BJ) zQFsFqGZN~bz{pUEzrkBa_6}@t&x=Y$)Wq^nH|Jg7_s+3TW`9iOcN{01qTjCZyWOyc z`I_=|*nF||C>5B2b(jh)rZVG$_Pj_+Hpr2ZBSj~rM2a0aq&TElq?Ad?2L)0Jq-02` z1jVN*w=_KcD12jDd{>T@qIjP^Bx>q2y+Ruogs1MUp-LRj>x6z3byygB9&eB~LLJpS z;1DdjBaL7xn$8{Z(pVOYTD)08Ly_RByo?${d5v(S@)^{#z#LEqDO)eiOLJu}ce8x+6SAj&Y@Jox9|FU%4fYjp4R*yF%-U5wMWOjN9~w-zK>F z$U1x_n$KTFGKIwCEIJtUBQ}2ORcdUCZ<)?2qT~qmEKlq(3bl!<4*Z{COKg~}?uB;I zyi7=(nDq`qKW1Lv?=g=3Mnfk?fPE3%cmyjH!HhUHUsDWi%UgtBE?=MwMCQ5#tqz=@ z6bozOm$kQapQ + {% if perms.users.ql_management %} + ERGO-Quicklinks laden + {% endif %}
{% endblock content %} diff --git a/quicklinks/urls.py b/quicklinks/urls.py index 777b297..6a0ffa1 100644 --- a/quicklinks/urls.py +++ b/quicklinks/urls.py @@ -2,6 +2,7 @@ from django.urls import path from django.contrib.auth import views as auth_views from django.contrib.auth.decorators import login_required, permission_required from .views import QlManagement, QlAdd, QlDeleteView, QlUpdateView +from . import views ''' Permissions definiert in models.py bei USERS und dann hier vor die View geschrieben! ''' @@ -11,5 +12,5 @@ urlpatterns = [ path('addql/', permission_required('users.ql_management')(QlAdd.as_view(template_name="quicklinks/ql_add.html")), name='ql-addql'), path('addql//delete', permission_required('users.ql_management')(QlDeleteView.as_view()), name='ql-delete'), path('addql//', permission_required('users.ql_management')(QlUpdateView.as_view()), name='ql-update'), - + path('lerg/', views.loaddefaultql, name="ql-ajaxloaddef"), ] diff --git a/quicklinks/views.py b/quicklinks/views.py index 488e018..8b6de6b 100644 --- a/quicklinks/views.py +++ b/quicklinks/views.py @@ -4,6 +4,8 @@ from django.views.generic import CreateView, ListView, UpdateView, DetailView, D from .models import QuickLinks from .forms import QlAddQlForm from django.contrib import messages +from django.shortcuts import redirect +from django.http import HttpResponse # Create your views here. class QlManagement(LoginRequiredMixin, ListView): @@ -64,4 +66,23 @@ class QlUpdateView(LoginRequiredMixin, UpdateView): def get_context_data(self, **kwargs): context = super(QlUpdateView, self).get_context_data(**kwargs) context['active_link'] = 'quicklinks' - return context \ No newline at end of file + return context + +def loaddefaultql(request): + if request.method == 'GET': + if request.GET['action'] == 'adddefql': + defaultlinks = [ + ["EASY", "https://easy.ergo.com "], + ["ERGO Ansprechpartner Navigator", "http://ansprechpartner-navigator.de/ "], + ["ERGO Lokales Marketing", "https://ergo.ergo-mein-lokales-marketing.de/marcapo_platform/WelcomePre.cms "], + ["ERGO Meine Druckstücke", "https://www.ergo-meine-druckstuecke.de/?client-check=2 "], + ["ERGO Vertriebsportal", "https://vertriebsportal.ergo.com/"], + ["myVVE", "https://www.myvve.de/"], + ["Wiki", "https://wiki.digitale-agentur.com/"] + ] + for ele in defaultlinks: + print(ele[0] + " " + ele[1]) + tempql = QuickLinks(agency=request.user.profile.agency, name=ele[0], link=ele[1]) + tempql.save() + return redirect("ql-addql") + return redirect("ql-addql") \ No newline at end of file diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index a311f2b48bda9908fe83df9186a7ffea54c5444c..4b4f1311dd5948b5c68f3d13b96e69d2f2357037 100644 GIT binary patch delta 39 tcmX?Jd7_dxl$V!_0SE*iD8zAXrM{AD|0OLap5C8xG diff --git a/users/static/users/css/custom.css b/users/static/users/css/custom.css index 31e5182..861f78c 100644 --- a/users/static/users/css/custom.css +++ b/users/static/users/css/custom.css @@ -53,3 +53,113 @@ html h1 { body{ background-color: #f8f9fc; } +/* + FOR TREE ORGA + +*/ + /*Now the CSS*/ +.profpic_orga { + max-width: 50px; +} + +* {margin: 0; padding: 0;} + +.tree ul { + padding-top: 20px; position: relative; + + transition: all 0.5s; + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; +} + +.tree li { + float: left; text-align: center; + list-style-type: none; + position: relative; + padding: 20px 5px 0 5px; + + transition: all 0.5s; + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; +} + +/*We will use ::before and ::after to draw the connectors*/ + +.tree li::before, .tree li::after{ + content: ''; + position: absolute; top: 0; right: 50%; + border-top: 2px solid #ccc; + width: 50%; height: 20px; +} +.tree li::after{ + right: auto; left: 50%; + border-left: 2px solid #ccc; +} + +/*We need to remove left-right connectors from elements without +any siblings*/ +.tree li:only-child::after, .tree li:only-child::before { + display: none; +} + +/*Remove space from the top of single children*/ +.tree li:only-child{ padding-top: 0;} + +/*Remove left connector from first child and +right connector from last child*/ +.tree li:first-child::before, .tree li:last-child::after{ + border: 0 none; +} +/*Adding back the vertical connector to the last nodes*/ +.tree li:last-child::before{ + border-right: 2px solid #ccc; + border-radius: 0 5px 0 0; + -webkit-border-radius: 0 5px 0 0; + -moz-border-radius: 0 5px 0 0; +} +.tree li:first-child::after{ + border-radius: 5px 0 0 0; + -webkit-border-radius: 5px 0 0 0; + -moz-border-radius: 5px 0 0 0; +} + +/*Time to add downward connectors from parents*/ +.tree ul ul::before{ + content: ''; + position: absolute; top: 0; left: 50%; + border-left: 2px solid #ccc; + width: 0; height: 20px; +} + +.tree li a{ + border: 1px solid #ccc; + padding: 5px 10px; + text-decoration: none; + color: #666; + font-size: 1.2em; + display: inline-block; + + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + + transition: all 0.5s; + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; +} + +/*Time for some hover effects*/ +/*We will apply the hover effect the the lineage of the element also*/ +.tree li a:hover, .tree li a:hover+ul li a { + background: #c8e4f8; color: #000; border: 1px solid #94a0b4; +} +/*Connector styles on hover*/ +.tree li a:hover+ul li::after, +.tree li a:hover+ul li::before, +.tree li a:hover+ul::before, +.tree li a:hover+ul ul::before{ + border-color: #94a0b4; +} + +/*Thats all. I hope you enjoyed it. +Thanks :)*/ \ No newline at end of file diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 0c7ef09..f81568c 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -193,7 +193,7 @@