digitaleagenturnc/standards/templates/standards/standards_single.html

283 lines
11 KiB
HTML

{% extends "users/base.html" %}
{% load counter_tag %}
{% block content %}
<div class="content-section col-12">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'standards' %}">Standards</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="{% url 'standard-area' standard.area.pk %}">{{standard.area.name}}</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="{% url 'standard-task' standard.task.pk %}">{{standard.task.name}}</a></li>
</ol>
</nav>
<h2>{{standard.name}}
<span style="float: right">
{% if standard.created_standard_by == user or perms.users.standardmanager %}
<a style="float: right" class="btn btn-secondary btn-sm ml-2" href="{% url 'standard-delete' standard.pk %}"><small><i class="fas fa-trash"></i></small></a>
<a style="float: right" class="btn btn-secondary btn-sm " href="{% url 'standard-add' standard.pk %}"><small><i class="fas fa-pen"></i></small></a>
{% endif %}
</span>
</h2>
<hr>
<div class="row col">
{% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 %}
<div class="card col-9" style="min-height: 500px">
{% else %}
<div class="card col-12" style="min-height: 500px">
{% endif %}
<div class="card-body">
<h5 class="card-title"></h5>
<p class="card-text">
{{standard.media}}
{{standard.content|safe}}
</p>
</div>
</div>
<!-- PERSONEN -->
{% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 or standard.addedcontacts.all|length > 0 or standard.addedpasswords.all|length > 0 or standard.addedquicklinks.all|length > 0 %}
<div class="col-3">
{% if standard.freefield_title|length > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">{{standard.freefield_title}}</h5>
<p class="card-text">
{{standard.freefield_content}}
</p>
</div>
</div>
{% endif %}
{% if standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Personen</h5>
<p class="card-text">
{% if standard.executor.count > 0 %}
Ausführende<br />
{% for u in standard.executor.all %}
<a href="{% url 'orga-single' u.pk%}"> {{u.first_name}} {{u.last_name}}</a>{% if forloop.counter < standard.executor.count%}&nbsp;|&nbsp;{% endif %}
{% endfor %}
<br />
{% endif %}
{% if standard.representative.count > 0 %}
Vertreter<br />
{% for u in standard.representative.all %}
<a href="{% url 'orga-single' u.pk%}"> {{u.first_name}} {{u.last_name}}</a>{% if forloop.counter < standard.representative.count%}&nbsp;|&nbsp;{% endif %}
{% endfor %}
<br />
{% endif %}
{% if standard.authority.count > 0 %}
Verantwortliche<br />
{% for u in standard.authority.all %}
<a href="{% url 'orga-single' u.pk%}"> {{u.first_name}} {{u.last_name}}</a>{% if forloop.counter < standard.authority.count%}&nbsp;|&nbsp;{% endif %}
{% endfor %}
<br />
{% endif %}
</p>
</div>
</div>
{% endif %}
<!-- FILES -->
{% if standard.addedfiles.all|length > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Dateien</h5>
<p class="card-text">
{% for files in standard.addedfiles.all %}
<a href="{% url 'cloud-td' files.pk %}" target="_blank">{{files.name|truncatechars:30}}</a><br />
{% endfor %}
</p>
</div>
</div>
{% endif %}
<!-- Quicklinks -->
{% if standard.addedquicklinks.all|length > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Quicklinks</h5>
<p class="card-text">
{% for ql in standard.addedquicklinks.all %}
<a href="{{ ql.link }}" target="_blank">{{ ql.link|truncatechars:30 }}</a><br />
{% endfor %}
</p>
</div>
</div>
{% endif %}
<!-- Contacts -->
{% if standard.addedcontacts.all|length > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Kontakte</h5>
<p class="card-text">
{% for agc in standard.addedcontacts.all %}
<a href="#/" onclick="javascript:$('#infos_{{agc.pk}}').modal('toggle');">{{agc.company}}</a><br />
{% endfor %}
</p>
</div>
</div>
{% endif %}
<!-- Passwords -->
{% if standard.addedpasswords.all|length > 0 %}
<div class="card col-14 ml-1 mb-2" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Passwörter</h5>
<p class="card-text">
{% for s in standard.addedpasswords.all %}
<a onclick="javascript:$('#infos_searchres_pass_{{s.pk}}').modal('toggle');" href="#\">{{s.name}}</a><br />
{% endfor %}
</p>
</div>
</div>
{% endif %}
<!-- STANDARDS -->
{% if standard.linked_standards.all|length > 0 %}
<div class="card col-14 ml-1" style="min-width: 110%">
<div class="card-body">
<h5 class="card-title">Verwandte Standards</h5>
<p class="card-text">
{% for standard in standard.linked_standards.all %}
{% setbool False %}
{% for ag in standard.visibleby.all %}
{% if request.user|has_group:ag.group.name %}
{% setbool True %}
{% endif %}
{% endfor %}
{% if standard.visibleby.all|length == 0 %}
{% setbool True %}
{% endif %}
{% getbool as groupchecker %}
{% if groupchecker %}
<a href="{% url 'standard-single' standard.pk %}">{{standard.name|truncatechars:30}}</a><br />
{% else %}
<i class="fas fa-lock"></i>&nbsp;{{standard.name|truncatechars:30}}</p>
{% endif %}
{% endfor %}
</p>
</div>
</div>
{% endif %}
</div>
{% endif %}
</div>
<div class="mt-2">
<small>
Erstellt durch <a href="{% url 'orga-single' standard.created_standard_by.pk %}">{{standard.created_standard_by.first_name}} {{standard.created_standard_by.last_name}}</a> am {{standard.created_standard_date}} | Zuletzt bearbeitet von <a href="{% url 'orga-single' standard.last_modified_by.pk %}">{{ standard.last_modified_by.first_name}} {{ standard.last_modified_by.last_name}}</a> am {{ standard.last_modified_on}}
</small>
</div>
</div>
{% for pass in standard.addedpasswords.all %}
<div class="modal fade " id="infos_searchres_pass_{{pass.pk}}" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">{{pass.name}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{% setbool False %}
{% for passgrous in pass.visibleby.all %}
{% if user|has_group:passgrous.group.name %}
{% setbool True %}
{% endif %}
{% endfor %}
{% if pass.visibleby.all|length == 0 %}
{% setbool True %}
{% endif %}
{% getbool as groupchecker %}
{% if groupchecker %}
Name: <b>{{pass.name }}</b><br />
Benutzername: <b/>{{pass.agpass_username }}</b><br />
Passwort: <b/>{{pass.agpass_username }}</b><br />
{% else %}
Sie dürfen keine Informationen dieses Passwords einsehen.
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Schließen</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% for agc in standard.addedcontacts.all %}
<div class="modal fade " id="infos_{{agc.pk}}" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
<div class="modal-dialog " role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">{{agc.company}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{% if agc.personname|length > 0 %}
Ansprechpartner: {{agc.personname}}<br/>
{% endif %}
{% if agc.mail|length > 0 %}
E-Mailadresse: <a href="mailto:{{agc.mail}}">{{agc.mail}}</a><br />
{% endif %}
{% if agc.phone1|length > 0 %}
Telefon 1: <a href="tel::{{agc.phone1}}">{{agc.phone1}}</a><br />
{% endif %}
{% if agc.phone2|length > 0 %}
Telefon 1: <a href="tel::{{agc.phone2}}">{{agc.phone2}}</a><br />
{% endif %}
{% if agc.street|length > 0 %}
Adresse: {{agc.street}} {{agc.plz}} {{agc.city}} <br />
{% endif %}
{% if agc.desc|length > 0 %}
Anmerkungen: {{agc.desc}}<br />
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Schließen</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% endblock content %}