Dynamischer Steckbrief fertig
This commit is contained in:
parent
dcd8613ee4
commit
119a6b3425
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{% for formfield in agencyform %}
|
{% for formfield in agencyform %}
|
||||||
{% if forloop.counter|divisibleby:5 %}
|
{% if forloop.counter|divisibleby:6 %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{formfield|as_crispy_field}}
|
{{formfield|as_crispy_field}}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -14,33 +14,31 @@ import os
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
############################################## DEV #####################################
|
||||||
############################################## PROD #####################################
|
BASE_URL = "https://dev01.digitale-agentur.com/"
|
||||||
BASE_URL = "https://digitale-agentur.com/"
|
|
||||||
CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D"
|
CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D"
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
# MAIL PROD
|
# MAIL DEV
|
||||||
EMAIL_HOST = 'smtp.strato.de'
|
EMAIL_HOST = 'smtp.strato.de'
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
EMAIL_USE_TLS = True
|
EMAIL_USE_TLS = True
|
||||||
EMAIL_HOST_USER = "support@digitale-agentur.com"
|
EMAIL_HOST_USER = "support@dev01.digitale-agentur.com"
|
||||||
EMAIL_HOST_PASSWORD = "aPx9m3!7x3m@8o!t"
|
EMAIL_HOST_PASSWORD = "support@dev01.digitale-agentur.com"
|
||||||
DEFAULT_FROM_EMAIL = "support@digitale-agentur.com"
|
DEFAULT_FROM_EMAIL = "support@dev01.digitale-agentur.com"
|
||||||
|
|
||||||
# PROD
|
# DEV
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME' : 'digitaleagentur',
|
'NAME' : 'digitaleagentur_dev01',
|
||||||
'USER' : 'digitaleagentur',
|
'USER' : 'digitaleagentur_dev01',
|
||||||
'PASSWORD' : 'H9hzbzyBqtUCnZlIwL1qSrzh',
|
'PASSWORD' : 't3TvtGAOkFHYXdJlUMIu9u3U',
|
||||||
'PORT' : 3306
|
'PORT' : 3306
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
############################################## DEV #####################################
|
||||||
############################################## PROD #####################################
|
|
||||||
|
|
||||||
|
|
||||||
# Nach zehn Stunden läuft der Cookie ab!
|
# Nach zehn Stunden läuft der Cookie ab!
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -6,13 +6,13 @@
|
||||||
<link href="{% static 'users/css/jsLists.css' %}" rel="stylesheet">
|
<link href="{% static 'users/css/jsLists.css' %}" rel="stylesheet">
|
||||||
|
|
||||||
<div class="content-section">
|
<div class="content-section">
|
||||||
<h3>Bereiche und Aufgaben von {{user_first_name}} {{user_last_name}}<span style="float: right">
|
<h3>Bereiche und Tätigkeiten von {{user_first_name}} {{user_last_name}}<span style="float: right">
|
||||||
{% if user|usergperm:"usermanager" %}
|
{% if user|usergperm:"usermanager" %}
|
||||||
<button type="button" id="activatechangingorder" style="float: right" class="btn btn-secondary btn-sm" onclick="javascript:activateChangeTaskOrder()" data-toggle="tooltip" data-placement="top" title="Reihenfolge der Tätigkeiten anpassen"><small><i class="fas fa-pen"></i></small></button>
|
<button type="button" id="activatechangingorder" style="float: right" class="btn btn-secondary btn-sm" onclick="javascript:activateChangeTaskOrder()" data-toggle="tooltip" data-placement="top" title="Reihenfolge der Tätigkeiten anpassen"><small><i class="fas fa-pen"></i></small></button>
|
||||||
<button type="button" id="changingorder" style="float: right; display: none" class="btn btn-primary btn-sm" onclick="javascript:activateChangeTaskOrder()" data-toggle="tooltip" data-placement="top" title="Reihenfolge der Tätigkeiten anpassen"><small><i class="fas fa-check"></i></small></button>
|
<button type="button" id="changingorder" style="float: right; display: none" class="btn btn-primary btn-sm" onclick="javascript:activateChangeTaskOrder()" data-toggle="tooltip" data-placement="top" title="Reihenfolge der Tätigkeiten anpassen"><small><i class="fas fa-check"></i></small></button>
|
||||||
|
|
||||||
<span style="float: right;">
|
<span style="float: right;">
|
||||||
{% if request.user.profile.agency.dynamicprofile == False %}
|
{% if request.user.profile.agency.dynamicprofile %}
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-primary dropdown-toggle btn-sm mr-1" type="button" id="changeViewDynamic" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-primary dropdown-toggle btn-sm mr-1" type="button" id="changeViewDynamic" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Ansicht wechseln
|
Ansicht wechseln
|
||||||
|
|
@ -65,6 +65,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
<h4 class="ml-4">{{ user_first_name }} {{ user_last_name }}
|
||||||
|
|
||||||
|
{% if request.user.profile.agency.dynamicprofile %}
|
||||||
|
|
||||||
|
als <span id="view_info_0">Verantwortlicher</span>
|
||||||
|
<span id="view_info_1" style="display: none;">Ausführender</span>
|
||||||
|
<span id="view_info_2" style="display: none;">Vertreter</span>
|
||||||
|
{% endif %}
|
||||||
|
</h4>
|
||||||
<table class="table" id="orgasingle">
|
<table class="table" id="orgasingle">
|
||||||
<thead>
|
<thead>
|
||||||
<tr >
|
<tr >
|
||||||
|
|
@ -78,34 +87,31 @@
|
||||||
{% for area in areas %}
|
{% for area in areas %}
|
||||||
<td class="text-center" style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 0.3)">
|
<td class="text-center" style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 0.3)">
|
||||||
<div class="areaCollapseContent" id="sortarea_{{area.pk}}">
|
<div class="areaCollapseContent" id="sortarea_{{area.pk}}">
|
||||||
{% if request.user.profile.agency.dynamicprofile == False %}
|
{% if request.user.profile.agency.dynamicprofile %}
|
||||||
|
|
||||||
{% for ex in executor %}
|
{% for task in tasks %}
|
||||||
{% if ex.area == area %}
|
{% isUserInAuth task area request.user as checkIsUserAuth %}
|
||||||
<div style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_0" id="ele_{{ex.task.pk}}">
|
{% if task.area.pk == area.pk and task.visible and checkIsUserAuth %}
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' ex.task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{ex.task.name}}</a></h6></span>
|
<div style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_0" id="ele_{{task.pk}}">
|
||||||
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% for auth in authority %}
|
{% isUserInEx task area request.user as checkIsUserEx %}
|
||||||
{% if auth.area == area %}
|
{% if task.area.pk == area.pk and task.visible and checkIsUserEx %}
|
||||||
<div style=" background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_1 " id="ele_{{auth.task.pk}}">
|
<div style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_1" id="ele_{{task.pk}}">
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' auth.task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{auth.task.name}}</a></h6></span>
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% for rep in representative %}
|
{% isUserInRep task area request.user as checkIsUserRep %}
|
||||||
{% if rep.area == area %}
|
{% if task.area.pk == area.pk and task.visible and checkIsUserRep %}
|
||||||
<div style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_2 " id="ele_{{rep.task.pk}}">
|
<div style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 1)" class="mb-2 pt-3 pb-1 view_2" id="ele_{{task.pk}}">
|
||||||
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' rep.task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{rep.task.name}}</a></h6></span>
|
<span ><h6 ><a style=" color: #FFFFFF;"href="{% url 'standard-task' task.pk %}"><span class="arrows_area_{{area.pk}} ml-4" style="display:none; float: left;"><i class="fas fa-sort"></i></span>{{task.name}}</a></h6></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% for prio in prios %}
|
{% for prio in prios %}
|
||||||
|
|
@ -197,19 +203,29 @@ $( document ).ready(function() {
|
||||||
$( "#sortarea_" + sortablearea_ids[i]).sortable("disable");
|
$( "#sortarea_" + sortablearea_ids[i]).sortable("disable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//AUTH
|
||||||
$(document).find(".view_0").hide();
|
$(document).find(".view_0").hide();
|
||||||
|
//EX
|
||||||
$(document).find(".view_1").hide();
|
$(document).find(".view_1").hide();
|
||||||
|
//REP
|
||||||
$(document).find(".view_2").hide();
|
$(document).find(".view_2").hide();
|
||||||
|
|
||||||
$(document).find(".view_2").show();
|
$(document).find(".view_0").show();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function changeView(newview){
|
function changeView(newview){
|
||||||
|
|
||||||
$(document).find(".view_0").hide();
|
$(document).find(".view_0").hide();
|
||||||
$(document).find(".view_1").hide();
|
$(document).find(".view_1").hide();
|
||||||
$(document).find(".view_2").hide();
|
$(document).find(".view_2").hide();
|
||||||
$(document).find(".view_" + newview).show();
|
$(document).find(".view_" + newview).show();
|
||||||
|
|
||||||
|
$(document).find("#view_info_0").hide();
|
||||||
|
$(document).find("#view_info_1").hide();
|
||||||
|
$(document).find("#view_info_2").hide();
|
||||||
|
$(document).find("#view_info_" + newview).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,20 @@ def singleorga(request, pk):
|
||||||
if(user.profile.agency.pk==request.user.profile.agency.pk):
|
if(user.profile.agency.pk==request.user.profile.agency.pk):
|
||||||
prios = Prio.objects.filter(user__pk=pk).order_by('prio')
|
prios = Prio.objects.filter(user__pk=pk).order_by('prio')
|
||||||
areas = list(Areas.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('areaorder'))
|
areas = list(Areas.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('areaorder'))
|
||||||
|
alltasks = Tasks.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('name')
|
||||||
|
|
||||||
|
'''
|
||||||
|
Hier werden die Tasks entsprechend ihrer Prio gespeichert, anschließend werden noch die übrigen Tasks übertragen, die noch keinen Prio-Eintrag haben. Diese haben 0 und landen dementsprechend hinten.
|
||||||
|
'''
|
||||||
|
|
||||||
|
tasks = []
|
||||||
|
for p in prios:
|
||||||
|
tasks.append(p.task)
|
||||||
|
|
||||||
|
for at in alltasks:
|
||||||
|
if at not in tasks:
|
||||||
|
tasks.append(at)
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
for area in areas:
|
for area in areas:
|
||||||
areas[i].hex = areas[i].color
|
areas[i].hex = areas[i].color
|
||||||
|
|
@ -69,22 +83,6 @@ def singleorga(request, pk):
|
||||||
except:
|
except:
|
||||||
userfuncname = "Nicht vergeben"
|
userfuncname = "Nicht vergeben"
|
||||||
|
|
||||||
st = Standards.objects.filter(agency=request.user.profile.agency)
|
|
||||||
|
|
||||||
representative = []
|
|
||||||
executor = []
|
|
||||||
authority = []
|
|
||||||
|
|
||||||
for s in st:
|
|
||||||
if request.user in s.representative.all():
|
|
||||||
representative.append(s)
|
|
||||||
|
|
||||||
if request.user in s.executor.all():
|
|
||||||
executor.append(s)
|
|
||||||
|
|
||||||
if request.user in s.authority.all():
|
|
||||||
authority.append(s)
|
|
||||||
|
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'active_link' : 'orga',
|
'active_link' : 'orga',
|
||||||
|
|
@ -98,9 +96,10 @@ def singleorga(request, pk):
|
||||||
'imageurl' : user.profile.get_photo_url,
|
'imageurl' : user.profile.get_photo_url,
|
||||||
'compfunc' : user.profile.compfunc,
|
'compfunc' : user.profile.compfunc,
|
||||||
'phoneland' : user.profile.phoneland,
|
'phoneland' : user.profile.phoneland,
|
||||||
'representative' : representative,
|
'tasks' : tasks,
|
||||||
'executor' : executor,
|
#'representative' : representative,
|
||||||
'authority' : authority,
|
#'executor' : executor,
|
||||||
|
#'authority' : authority,
|
||||||
'phonemobile' : user.profile.phonemobile
|
'phonemobile' : user.profile.phonemobile
|
||||||
}
|
}
|
||||||
print(context)
|
print(context)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -215,3 +215,47 @@ def getifuserdidcomment(standard, user):
|
||||||
didcomment = True
|
didcomment = True
|
||||||
|
|
||||||
return didcomment
|
return didcomment
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def isUserInAuth(task, area, user):
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
|
||||||
|
found = False
|
||||||
|
|
||||||
|
for st in st_auth:
|
||||||
|
if user in st.authority.all():
|
||||||
|
found = True
|
||||||
|
print("AUTH FOUND")
|
||||||
|
break
|
||||||
|
|
||||||
|
return found
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def isUserInEx(task, area, user):
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
|
||||||
|
found = False
|
||||||
|
|
||||||
|
for st in st_auth:
|
||||||
|
if user in st.executor.all():
|
||||||
|
found = True
|
||||||
|
print("EX FOUND")
|
||||||
|
break
|
||||||
|
|
||||||
|
return found
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def isUserInRep(task, area, user):
|
||||||
|
st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area)
|
||||||
|
|
||||||
|
found = False
|
||||||
|
|
||||||
|
for st in st_auth:
|
||||||
|
if user in st.representative.all():
|
||||||
|
found = True
|
||||||
|
print("REP FOUND")
|
||||||
|
break
|
||||||
|
|
||||||
|
return found
|
||||||
|
|
@ -78,9 +78,10 @@ class AgencyUpdateForm(forms.ModelForm):
|
||||||
"city" : "Stadt",
|
"city" : "Stadt",
|
||||||
"agency_email" : "E-Mail",
|
"agency_email" : "E-Mail",
|
||||||
"phone" : "Telefon",
|
"phone" : "Telefon",
|
||||||
|
"dynamicprofile" : "Dynamischer Steckbrief",
|
||||||
"agencypic" : "Agenturbild"
|
"agencypic" : "Agenturbild"
|
||||||
}
|
}
|
||||||
fields = ['name','inhaber','agency_email', 'phone', 'street', 'plz', 'city', 'agencypic', 'x', 'y', 'width', 'height', 'rotation']
|
fields = ['name','inhaber','agency_email', 'phone', 'street', 'plz', 'city', 'dynamicprofile', 'agencypic', 'x', 'y', 'width', 'height', 'rotation']
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
photo = super(AgencyUpdateForm, self).save()
|
photo = super(AgencyUpdateForm, self).save()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue