{% extends "base.html" %} {% block title %}Notifications — {{ service_name }}{% endblock %} {% block content %}
You do not have any notifications.
{% else %}Date | Message | {% if num_unread_notifications > 0 %} {% endif %} | |
---|---|---|---|
{{ 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 %} {% elif notification.type == NotificationType.INSTRUMENT_LOG_ENTRY_CREATED %} {% set instrument_log_entry = get_instrument_log_entry(notification.data['instrument_log_entry_id']) %} {{ get_user(instrument_log_entry.user_id).name }} has created a new log entry for the instrument {{ get_instrument(instrument_log_entry.instrument_id).name }}. {% elif notification.type == NotificationType.REFERENCED_BY_OBJECT_METADATA %} You were referenced in the metadata for object #{{ notification.data['object_id'] }}. {% elif notification.type == NotificationType.INSTRUMENT_LOG_ENTRY_EDITED %} {% set instrument_log_entry = get_instrument_log_entry(notification.data['instrument_log_entry_id']) %} {{ get_user(instrument_log_entry.user_id).name }} has edited a log entry for the instrument {{ get_instrument(instrument_log_entry.instrument_id).name }}. {% else %} Unknown notification type. {% endif %} |
{% if not notification.was_read %} {% endif %} |