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 areas.models import Areas
|
||||
from tasks.models import Tasks
|
||||
from ckeditor.widgets import CKEditorWidget
|
||||
#from ckeditor.widgets import CKEditorWidget
|
||||
|
||||
|
||||
|
||||
|
||||
class StandardAddStandard(forms.ModelForm):
|
||||
|
||||
|
|
@ -13,7 +16,7 @@ class StandardAddStandard(forms.ModelForm):
|
|||
"name" : "Titel",
|
||||
"area" : "Übergeordneter Bereich",
|
||||
"task" : "Aufgabenbereich",
|
||||
"content": "Inhalt"
|
||||
"content": "Inhalt"
|
||||
}
|
||||
fields = ['name', 'area', 'task', 'content']
|
||||
'''
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
{% extends "users/base.html" %}
|
||||
{% load counter_tag %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content-section col-12">
|
||||
<h3>Standards</h3>
|
||||
|
|
@ -30,22 +32,25 @@
|
|||
<div class="tab-content" id="area_contents">
|
||||
{% for area in areas %}
|
||||
<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>
|
||||
<hr>
|
||||
<h5 class="mt-3"><a href="{% url 'standard-area' area.id %}" style="color: #000000;">Standards aus dem Bereich {{area.name}}</a></h5>
|
||||
<hr>
|
||||
{% for task in tasks %}
|
||||
|
||||
{% for task in tasks %}
|
||||
{% if task.area == area %}
|
||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; float: left">
|
||||
{% if task.area == area %}
|
||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; height: 12rem; float: left">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{task.name}}</h5>
|
||||
{% for standard in standards_of_agency %}
|
||||
{% if standard.task == task and standard.area == area %}
|
||||
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></p>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<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 %}
|
||||
{% getvar as varcounter %}
|
||||
{% if standard.task == task and standard.area == area and varcounter < 3 %}
|
||||
{% incvar %}
|
||||
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></p>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
|
|
|||
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>
|
||||
{% if res_standard|length > 0 %}
|
||||
{% 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 %}
|
||||
{% else %}
|
||||
<p>Keine Ergebnisse in Standards</p>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<h4>Bereiche</h4>
|
||||
{% if res_areas|length > 0 %}
|
||||
{% 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 %}
|
||||
{% else %}
|
||||
<p>Keine Ergebnisse in Bereichen</p>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<h4>Aufgaben</h4>
|
||||
{% if res_tasks|length > 0 %}
|
||||
{% 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 %}
|
||||
{% else %}
|
||||
<p>Keine Ergebnisse in Aufgaben</p>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<h4>Personen</h4>
|
||||
{% if res_pers|length > 0 %}
|
||||
{% 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 %}
|
||||
{% else %}
|
||||
<p>Keine Ergebnisse in Personen</p>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ urlpatterns = [
|
|||
path('support/', views.support, name="supportda"),
|
||||
path('setuserparent/', views.setuserparent, name="users-setuserparent"),
|
||||
path('sendpassmail/', views.sendpassmail, name="users-sendpassmail")
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -409,7 +409,6 @@ def GlobalSearch(request):
|
|||
else:
|
||||
return HttpResponse("Request method is not a GET")
|
||||
|
||||
|
||||
def searchStandardRouter(request):
|
||||
if request.method == 'GET':
|
||||
return redirect('/standards/standard/'+request.GET['s_id']+'/single')
|
||||
|
|
@ -443,9 +442,7 @@ def UsersAreaTaskUpdate(request, pk):
|
|||
area_ids.append(int(tempdata[1]))
|
||||
elif(tempdata[0] == 'task'):
|
||||
task_ids.append(int(tempdata[1]))
|
||||
print(area_ids)
|
||||
print(task_ids)
|
||||
|
||||
|
||||
areas = Areas.objects.filter(agency__pk=user.profile.agency.pk)
|
||||
tasks = Tasks.objects.filter(agency__pk=user.profile.agency.pk)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue