Compare commits
2 commits
c25402bc98
...
7401ce154c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7401ce154c | ||
![]() |
0baa6dbe04 |
2 changed files with 18 additions and 3 deletions
|
@ -375,7 +375,7 @@ def notification_mark_read(request, pk):
|
||||||
notif = get_object_or_404(Notification, pk=pk, user=request.user)
|
notif = get_object_or_404(Notification, pk=pk, user=request.user)
|
||||||
notif.read = True
|
notif.read = True
|
||||||
notif.save(update_fields=["read"])
|
notif.save(update_fields=["read"])
|
||||||
messages.success(request, _("Notification marked as read."))
|
#messages.success(request, _("Notification marked as read."))
|
||||||
return redirect(request.META.get("HTTP_REFERER") or "risks:notifications")
|
return redirect(request.META.get("HTTP_REFERER") or "risks:notifications")
|
||||||
|
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ def notification_mark_all_read(request):
|
||||||
if request.method != "POST":
|
if request.method != "POST":
|
||||||
return HttpResponseForbidden()
|
return HttpResponseForbidden()
|
||||||
Notification.objects.filter(user=request.user, read=False).update(read=True)
|
Notification.objects.filter(user=request.user, read=False).update(read=True)
|
||||||
messages.success(request, _("All notifications marked as read."))
|
#messages.success(request, _("All notifications marked as read."))
|
||||||
return redirect("risks:notifications")
|
return redirect("risks:notifications")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,13 @@
|
||||||
<a href="{% url 'admin:risks_risk_delete' risk.pk %}" class="button is-small is-danger" title="{% trans 'Delete Risk' %}">
|
<a href="{% url 'admin:risks_risk_delete' risk.pk %}" class="button is-small is-danger" title="{% trans 'Delete Risk' %}">
|
||||||
<span class="icon"><i class="fas fa-trash"></i></span> {% trans 'Delete Risk' %}
|
<span class="icon"><i class="fas fa-trash"></i></span> {% trans 'Delete Risk' %}
|
||||||
</a>
|
</a>
|
||||||
|
{% if risk.status != 'closed' %}
|
||||||
<a href="{% url 'risks:mark_risk_reviewed' risk.pk %}"
|
<a href="{% url 'risks:mark_risk_reviewed' risk.pk %}"
|
||||||
class="button is-small is-success"
|
class="button is-small is-success"
|
||||||
title="{% trans 'Mark Risk as reviewed' %}">
|
title="{% trans 'Mark Risk as reviewed' %}">
|
||||||
<span class="icon"><i class="fas fa-check"></i></span> {% trans 'Mark Risk as reviewed' %}
|
<span class="icon"><i class="fas fa-check"></i></span> {% trans 'Mark Risk as reviewed' %}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -48,7 +50,20 @@
|
||||||
<span class="has-text-grey">{% trans "Not yet assigned" %}</span>
|
<span class="has-text-grey">{% trans "Not yet assigned" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p><strong>{% trans "Status" %}:</strong> {{ risk.get_status_display }}</p>
|
<p>
|
||||||
|
<strong>{% trans "Status" %}:</strong>
|
||||||
|
<strong class="tag
|
||||||
|
{% if risk.status == 'open' %}
|
||||||
|
is-info
|
||||||
|
{% elif risk.status == 'review_required' %}
|
||||||
|
is-warning
|
||||||
|
{% elif risk.status == 'closed' %}
|
||||||
|
is-success
|
||||||
|
{% elif risk.status == 'in_progress' %}
|
||||||
|
is-link is-light
|
||||||
|
{% endif %}
|
||||||
|
">{{ risk.get_status_display }}
|
||||||
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-half">
|
<div class="column is-half">
|
||||||
<p><strong>{% trans "Risk owner" %}:</strong> {{ risk.owner|user_display|default:"-" }}</p>
|
<p><strong>{% trans "Risk owner" %}:</strong> {{ risk.owner|user_display|default:"-" }}</p>
|
||||||
|
|
Loading…
Add table
Reference in a new issue