Commit d019e81f authored by felix.herrmann's avatar felix.herrmann
Browse files

fix(UIUX): redesign of access request notification

parent 0c2418e5
......@@ -7,15 +7,21 @@
{% include 'ddusers/_user-image.html' with user_uuid=comment.owner.uuid user_photo=comment.owner.photo %}
</div>
<div class="col-md-11">
<span class="badge badge-{{ comment.get_notification_type_display|slugify }}">{{ comment.get_notification_type_display }}</span> <span class="comment-name"> {{ comment.owner.get_academic_name }} {% if comment.recipient %}{% trans 'to' %} {{ comment.recipient.get_academic_name }}{% endif %}</span> <span class="comment-naturaltime">{{ comment.date_added | naturaltime }}</span>
<p><span class="badge badge-{{ comment.get_notification_type_display|slugify }}">{{ comment.get_notification_type_display }}</span> <span class="comment-name"> <a href="{% url 'ddusers:detail' comment.owner.uuid %}">{{ comment.owner.get_academic_name }}</a> {% if comment.recipient %}{% trans 'to' %} <a href="{% url 'ddusers:detail' comment.recipient.uuid %}">{{ comment.recipient.get_academic_name }}</a> {% endif %}</span> <span class="comment-naturaltime">{{ comment.date_added | naturaltime }}</span></p>
<div class="comment-text" id="comment-text-{{ comment.uuid }}">
{{ comment.text|linebreaks }}
{% if comment.get_notification_type_display == "access request" %}
<div class="comment-name">
{% trans 'Access request for' %} <a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object }}</a>
</div>
{% endif %}
<div class="comment-text" id="comment-text-{{ comment.uuid }}">
{% if comment.get_notification_type_display == "access request" %}
<a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object }}</a>
<div class="smallskip">
<div class="row">
<div class="col-md-10">
{{ comment.text|linebreaks }}
</div>
<div class="col-md-2">
{% if comment.content_object|user_has_restricted_access:comment.owner %}
<button class="btn btn-secondary" disabled>{% trans 'Access granted' %}</button>
{% elif comment.content_object|user_has_admin_right:request.user %}
......@@ -26,8 +32,12 @@
<input type="hidden" value="acc" name="perm">
<button type="button" class="btn btn-primary" ic-post-to="{% url 'dddatasets:prep_edit_access_user' comment.content_object.uuid %}" ic-target="#ds-content" ic-include="">{% trans 'Grant access' %}</button>
</form>
</div>
{% endif %}
</div>
</div>
{% else %}
{{ comment.text|linebreaks }}
{% endif %}
</div>
......@@ -36,6 +46,12 @@
{% trans "Created at" %}: {{ comment.date_added|date:"d M, h:i A (Y)" }}{% if comment.date_edited|date:"d M Y h i s" != comment.date_added|date:"d M Y h i s" %}, {% trans "edited at" %}: {{ comment.date_edited|date:"d M, h:i A (Y)" }}{% endif %}
</span>
{% if comment.get_notification_type_display == "access request" %}
<div class="smallskip">
</div>
{% endif %}
{% comment %}
No deleting or editing of notification (operates like email)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment