Skip to content
Snippets Groups Projects

Draft: Resolve "Instructions can be linked to a document as remarks by the group"

10 unresolved threads
3 files
+ 84
42
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -2,52 +2,73 @@
{% extends "core/base.html" %}
{% load i18n rules %}
{% load i18n rules material_form %}
{% block browser_title %}{% blocktrans %}Instructions{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans %}Instructions{% endblocktrans %}{% endblock %}
{% block content %}
{% has_perm "alsijil.add_instruction_rule" user as can_add %}
{% if can_add %}
<a class="btn green waves-effect waves-light" href="{% url 'create_instruction' %}">
<i class="material-icons left">add</i>
{% trans "Create instruction" %}
</a>
{% endif %}
<div class="row no-margin">
<div class="col s12">
{% has_perm "alsijil.add_instruction_rule" user as can_add %}
{% if can_add %}
<a class="btn green waves-effect waves-light margin-bottom" href="{% url 'create_instruction' %}">
<i class="material-icons left">add</i>
{% trans "Create instruction" %}
</a>
{% endif %}
<form action="" method="get">
<div class="card">
<div class="card-content">
<div class="card-title">{% trans "Filter instructions" %}</div>
{% form form=filter.form %}{% endform %}
</div>
<div class="card-action-light">
<button type="submit" class="btn waves-effect waves-light green">
<i class="material-icons left">filter_alt</i>
{% trans "Filter" %}
</button>
<a href="{% url "instructions" %}" class="btn waves-effect waves-light red">
<i class="material-icons left">cancel</i>
{% trans "Reset filter" %}
</a>
</div>
</div>
</form>
</div>
</div>
<ul class="collection">
<div class="row">
{% for instruction in instruction_list %}
<li class="collection-item avatar">
<i class="material-icons materialize-circle primary-color">{{ instruction.icon|default:"rule" }}</i>
<span class="title"> {{ instruction.name }}</span>
<div class="right">
{% has_perm "alsijil.edit_instruction_rule" user as can_edit %}
{% has_perm "alsijil.delete_instruction_rule" user as can_delete %}
{% if can_edit %}
<a class="btn-flat waves-effect waves-orange orange-text"
href="{% url "edit_instruction" instruction.pk %}">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
<div class=" col s12 m12 l6 xl4">
<div class="card">
<div class="card-content">
<i class="material-icons materialize-circle primary-color-text left small">{{ instruction.icon|default:"rule" }}</i>
<span class="card-title"> {{ instruction.name }}</span>
{% has_perm "alsijil.edit_instruction_rule" user as can_edit %}
{% has_perm "alsijil.delete_instruction_rule" user as can_delete %}
{% if can_edit %}
<a class="btn-flat waves-effect waves-orange orange-text"
href="{% url "edit_instruction" instruction.pk %}">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
{% endif %}
{% if can_delete %}
<a class="btn-flat waves-effect waves-red red-text" href="{% url "delete_instruction" instruction.pk %}">
<i class="material-icons left">delete</i>
{% trans "Delete" %}
</a>
{% endif %}
</div>
<div class="card-action">
<a class="" href="{{ instruction.pdf_file.url }}" target="_blank">
{% trans "Show PDF file with instruction" %}
</a>
{% endif %}
{% if can_delete %}
<a class="btn-flat waves-effect waves-red red-text" href="{% url "delete_instruction" instruction.pk %}">
<i class="material-icons left">delete</i>
{% trans "Delete" %}
</a>
{% endif %}
<a class="btn-flat waves-effect waves-green right" href="{{ instruction.pdf_file.url }}" target="_blank">
<i class="material-icons left">picture_as_pdf</i>
{% trans "Show PDF file with instruction" %}
</a>
</div>
</div>
</li>
{% empty %}
<li class="collection-item">
{% trans "No instructions available." %}
</li>
</div>
{% endfor %}
</ul>
</div>
{% endblock %}
Loading