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 a5a1725..5a2f4d8 100644 Binary files a/quicklinks/__pycache__/urls.cpython-38.pyc and b/quicklinks/__pycache__/urls.cpython-38.pyc differ diff --git a/quicklinks/__pycache__/views.cpython-38.pyc b/quicklinks/__pycache__/views.cpython-38.pyc index 99842c2..f99d89d 100644 Binary files a/quicklinks/__pycache__/views.cpython-38.pyc and b/quicklinks/__pycache__/views.cpython-38.pyc differ diff --git a/quicklinks/templates/quicklinks/ql_management.html b/quicklinks/templates/quicklinks/ql_management.html index b17c267..9437c1f 100644 --- a/quicklinks/templates/quicklinks/ql_management.html +++ b/quicklinks/templates/quicklinks/ql_management.html @@ -56,6 +56,9 @@ {% endfor %} + {% 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 a311f2b..4b4f131 100644 Binary files a/users/__pycache__/views.cpython-38.pyc and b/users/__pycache__/views.cpython-38.pyc differ 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 @@