{% extends "base.html" %} {% block title %}Notifications — {{ service_name }}{% endblock %} {% block content %}

Notifications

{% if notifications | length == 0 %}

You do not have any notifications.

{% else %} {% for notification in notifications %} {% endfor %}
Date Message {% if num_unread_notifications > 0 %}
{{ mark_all_notifications_as_read_form.hidden_tag() }}
{% endif %}
{{ delete_all_notifications_form.hidden_tag() }}
{{ notification.utc_datetime.strftime('%Y-%m-%d') }} {% if notification.type == NotificationType.ASSIGNED_AS_RESPONSIBLE_USER %} {{ get_user(notification.data['assigner_id']).name }} assigned you as responsible user for object #{{ notification.data['object_id'] }}. {% if 'confirmation_url' in notification.data and not object_location_assignment_is_confirmed(notification.data['object_location_assignment_id']) %}Confirm{% endif %} {% elif notification.type == NotificationType.OTHER %} {{ notification.data['message'] }} {% elif notification.type == NotificationType.INVITED_TO_GROUP %} {% set group = get_group(notification.data['group_id']) %} {% if group is not none %} {{ get_user(notification.data['inviter_id']).name }} has invited you to the group "{{ get_group(notification.data['group_id']).name }}": {% if is_group_member(current_user.id, notification.data['group_id']) %} You are already a member of this group. {% elif notification.data['expiration_utc_datetime'] is none or datetime.datetime.strptime(notification.data['expiration_utc_datetime'], '%Y-%m-%d %H:%M:%S') > datetime.datetime.utcnow() %} Join Group {% else %} The invitation has expired at {{ notification.data['expiration_utc_datetime'] }}. {% endif %} {% else %} {{ get_user(notification.data['inviter_id']).name }} has invited you to a group, but it has been deleted already. {% endif %} {% elif notification.type == NotificationType.INVITED_TO_PROJECT %} {% set project = get_project(notification.data['project_id']) %} {% if project is not none %} {{ get_user(notification.data['inviter_id']).name }} has invited you to the project "{{ get_project(notification.data['project_id']).name }}": {% if is_project_member(current_user.id, notification.data['project_id']) %} You are already a member of this project. {% elif notification.data['expiration_utc_datetime'] is none or datetime.datetime.strptime(notification.data['expiration_utc_datetime'], '%Y-%m-%d %H:%M:%S') > datetime.datetime.utcnow() %} Join Project {% else %} The invitation has expired at {{ notification.data['expiration_utc_datetime'] }}. {% endif %} {% else %} {{ get_user(notification.data['inviter_id']).name }} has invited you to a project, but it has been deleted already. {% endif %} {% elif notification.type == NotificationType.ANNOUNCEMENT %} {% if 'html' in notification.data and notification.data['html'] %} {{ notification.data['html'] | safe }} {% else %}

{{ notification.data['message'] }}

{% endif %} {% elif notification.type == NotificationType.RECEIVED_OBJECT_PERMISSIONS_REQUEST %} {% set current_permissions = get_user_object_permissions(user_id=notification.data['requester_id'], object_id=notification.data['object_id']) %} {% if Permissions.READ in current_permissions %} {{ get_user(notification.data['requester_id']).name }} has requested read permissions for object #{{ notification.data['object_id'] }}, but has been granted {{ current_permissions.name.lower() }} permissions already. {% elif current_user.is_readonly %} {{ get_user(notification.data['requester_id']).name }} has requested read permissions for object #{{ notification.data['object_id'] }}, but your account has been marked as read only and you cannot grant permissions. {% else %} {{ get_user(notification.data['requester_id']).name }} has requested read permissions for object #{{ notification.data['object_id'] }}: View object permissions {% endif %} {% else %} Unknown notification type. {% endif %}
{% if not notification.was_read %}
{{ mark_notification_as_read_form.hidden_tag() }}
{% endif %}
{{ delete_notification_form.hidden_tag() }}
{% endif %} {% endblock %} {% block scripts %} {{ super() }} {% endblock %}