Standardanischt gleich
Link Standard zum Aufgabenbereich Zähler mit customtag bei Standards
This commit is contained in:
parent
5fddfc4b7c
commit
f9e4720b58
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,10 @@ from django.forms import ModelForm
|
||||||
from .models import Standards
|
from .models import Standards
|
||||||
from areas.models import Areas
|
from areas.models import Areas
|
||||||
from tasks.models import Tasks
|
from tasks.models import Tasks
|
||||||
from ckeditor.widgets import CKEditorWidget
|
#from ckeditor.widgets import CKEditorWidget
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class StandardAddStandard(forms.ModelForm):
|
class StandardAddStandard(forms.ModelForm):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
{% extends "users/base.html" %}
|
{% extends "users/base.html" %}
|
||||||
|
{% load counter_tag %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="content-section col-12">
|
<div class="content-section col-12">
|
||||||
<h3>Standards</h3>
|
<h3>Standards</h3>
|
||||||
|
|
@ -30,19 +32,22 @@
|
||||||
<div class="tab-content" id="area_contents">
|
<div class="tab-content" id="area_contents">
|
||||||
{% for area in areas %}
|
{% for area in areas %}
|
||||||
<div class="tab-pane fade" id="t_{{area.id}}" role="tabpanel" aria-labelledby="{{area.id}}">
|
<div class="tab-pane fade" id="t_{{area.id}}" role="tabpanel" aria-labelledby="{{area.id}}">
|
||||||
<h5 class="mt-3">Standards aus dem Bereich {{area.name}}</h5>
|
<h5 class="mt-3"><a href="{% url 'standard-area' area.id %}" style="color: #000000;">Standards aus dem Bereich {{area.name}}</a></h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
{% for task in tasks %}
|
{% for task in tasks %}
|
||||||
|
|
||||||
{% if task.area == area %}
|
{% if task.area == area %}
|
||||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; float: left">
|
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; height: 12rem; float: left">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{task.name}}</h5>
|
<h5 class="card-title"><a href="{% url 'standard-task' task.pk %}" style="color: #000000;">{{task.name}}</a></h5>
|
||||||
|
{% setvar 0 %}
|
||||||
{% for standard in standards_of_agency %}
|
{% for standard in standards_of_agency %}
|
||||||
{% if standard.task == task and standard.area == area %}
|
{% getvar as varcounter %}
|
||||||
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></p>
|
{% if standard.task == task and standard.area == area and varcounter < 3 %}
|
||||||
{% endif %}
|
{% incvar %}
|
||||||
{% endfor %}
|
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></p>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,45 @@
|
||||||
|
from django import template
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
b = 0
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def setvar(value):
|
||||||
|
global b
|
||||||
|
b = value
|
||||||
|
return ''
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getvar():
|
||||||
|
global b
|
||||||
|
return b
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def incvar():
|
||||||
|
global b
|
||||||
|
b += 1
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
'''
|
||||||
|
class Counter:
|
||||||
|
count = 0
|
||||||
|
@register.simple_tag
|
||||||
|
def increment(self):
|
||||||
|
self.count += 1
|
||||||
|
return ''
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def decrement(self):
|
||||||
|
self.count -= 1
|
||||||
|
return ''
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def double(self):
|
||||||
|
self.count *= 2
|
||||||
|
return ''
|
||||||
|
|
||||||
|
def getCounter(self):
|
||||||
|
return count
|
||||||
|
'''
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -4,7 +4,7 @@
|
||||||
<h4>Standards</h4>
|
<h4>Standards</h4>
|
||||||
{% if res_standard|length > 0 %}
|
{% if res_standard|length > 0 %}
|
||||||
{% for s in res_standard %}
|
{% for s in res_standard %}
|
||||||
<a href="{% url 'standard-single' s.pk %}"><b>{{s.name|striptags}}</b> | {{s.content|truncatechars:125|striptags}}</a><br /><br />
|
<i class="fas fa-fw fa-lightbulb"></i> <a href="{% url 'standard-single' s.pk %}"><b>{{s.name|striptags}}</b> | {{s.content|truncatechars:125|striptags}}</a><br /><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Keine Ergebnisse in Standards</p>
|
<p>Keine Ergebnisse in Standards</p>
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<h4>Bereiche</h4>
|
<h4>Bereiche</h4>
|
||||||
{% if res_areas|length > 0 %}
|
{% if res_areas|length > 0 %}
|
||||||
{% for s in res_areas %}
|
{% for s in res_areas %}
|
||||||
<a href="{% url 'standard-area' s.pk %}"><b>{{s.name|striptags}}</b></a><br /><br />
|
<i class="fas fa-fw fa-layer-group"></i> <a href="{% url 'standard-area' s.pk %}"><b>{{s.name|striptags}}</b></a><br /><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Keine Ergebnisse in Bereichen</p>
|
<p>Keine Ergebnisse in Bereichen</p>
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<h4>Aufgaben</h4>
|
<h4>Aufgaben</h4>
|
||||||
{% if res_tasks|length > 0 %}
|
{% if res_tasks|length > 0 %}
|
||||||
{% for s in res_tasks %}
|
{% for s in res_tasks %}
|
||||||
<a href="{% url 'standard-task' s.pk %}"><b>{{s.name|striptags}}</b></a><br /><br />
|
<i class="fas fa-fw fa-tasks"></i> <a href="{% url 'standard-task' s.pk %}"><b>{{s.name|striptags}}</b></a><br /><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Keine Ergebnisse in Aufgaben</p>
|
<p>Keine Ergebnisse in Aufgaben</p>
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<h4>Personen</h4>
|
<h4>Personen</h4>
|
||||||
{% if res_pers|length > 0 %}
|
{% if res_pers|length > 0 %}
|
||||||
{% for s in res_pers %}
|
{% for s in res_pers %}
|
||||||
<a href="{% url 'orga-single' s.pk %}"><b>{{s.first_name}} {{s.last_name}}</b></a><br /><br />
|
<i class="fas fa-fw fa-users"></i> <a href="{% url 'orga-single' s.pk %}"><b>{{s.first_name}} {{s.last_name}}</b></a><br /><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Keine Ergebnisse in Personen</p>
|
<p>Keine Ergebnisse in Personen</p>
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ urlpatterns = [
|
||||||
path('support/', views.support, name="supportda"),
|
path('support/', views.support, name="supportda"),
|
||||||
path('setuserparent/', views.setuserparent, name="users-setuserparent"),
|
path('setuserparent/', views.setuserparent, name="users-setuserparent"),
|
||||||
path('sendpassmail/', views.sendpassmail, name="users-sendpassmail")
|
path('sendpassmail/', views.sendpassmail, name="users-sendpassmail")
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,6 @@ def GlobalSearch(request):
|
||||||
else:
|
else:
|
||||||
return HttpResponse("Request method is not a GET")
|
return HttpResponse("Request method is not a GET")
|
||||||
|
|
||||||
|
|
||||||
def searchStandardRouter(request):
|
def searchStandardRouter(request):
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
return redirect('/standards/standard/'+request.GET['s_id']+'/single')
|
return redirect('/standards/standard/'+request.GET['s_id']+'/single')
|
||||||
|
|
@ -443,8 +442,6 @@ def UsersAreaTaskUpdate(request, pk):
|
||||||
area_ids.append(int(tempdata[1]))
|
area_ids.append(int(tempdata[1]))
|
||||||
elif(tempdata[0] == 'task'):
|
elif(tempdata[0] == 'task'):
|
||||||
task_ids.append(int(tempdata[1]))
|
task_ids.append(int(tempdata[1]))
|
||||||
print(area_ids)
|
|
||||||
print(task_ids)
|
|
||||||
|
|
||||||
areas = Areas.objects.filter(agency__pk=user.profile.agency.pk)
|
areas = Areas.objects.filter(agency__pk=user.profile.agency.pk)
|
||||||
tasks = Tasks.objects.filter(agency__pk=user.profile.agency.pk)
|
tasks = Tasks.objects.filter(agency__pk=user.profile.agency.pk)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue