diff --git a/kn/subscriptions/media/event_detail.js b/kn/subscriptions/media/event_detail.js index 19f9d8ded..50398c94f 100644 --- a/kn/subscriptions/media/event_detail.js +++ b/kn/subscriptions/media/event_detail.js @@ -27,21 +27,18 @@ function reopen_event () { event_set_opened('true'); } -function copy_emailaddresses_to_clipboard () { - _api({'action': 'get-email-addresses', - 'id': event_object_id}, - function(d) { - if(d.error) { - alert(d.error); - return; - } - var s = ''; - var first = true; - for(var i = 0; i < d.addresses.length; i++) { - if (first) first = false; - else s += ', '; - s += d.addresses[i]; - } - prompt("Dit zijn de e-mail adressen", s); - }); +function copy_emailaddresses_to_clipboard (elem) { + var emails = [].join.call($('#subscribed > li > a').map(function() { + return $(this).data('email') + }), ', '); + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(emails).catch(function(rej) { + prompt("Dit zijn de e-mail adressen", emails); + }).then(function() { + $(elem).text("Gekopieerd!"); + }) + } else { + prompt("Dit zijn de e-mail adressen", emails); + } + return true; } diff --git a/kn/subscriptions/templates/subscriptions/event_detail.html b/kn/subscriptions/templates/subscriptions/event_detail.html index acb8f1800..50c66e8ff 100644 --- a/kn/subscriptions/templates/subscriptions/event_detail.html +++ b/kn/subscriptions/templates/subscriptions/event_detail.html @@ -154,24 +154,24 @@

{{ object.humanName }}

{% endif %}{# has_write_access #} {% if has_read_access or object.has_public_subscriptions %} - {% if listSubscribed %}

{% trans "Aanmeldingen" %} ({{ listSubscribed|length }})

- {% include "subscriptions/include_list.html" with list=listSubscribed %} + {% include "subscriptions/include_list.html" with list=listSubscribed listid="subscribed" %} {% else %}

{% trans "Er zijn (nog) geen aanmeldingen." %}

{% endif %}{# listSubscribed #} {% if listUnsubscribed %}

{% trans "Afmeldingen" %} ({{ listUnsubscribed|length }})

- {% include "subscriptions/include_list.html" with list=listUnsubscribed %} + {% include "subscriptions/include_list.html" with list=listUnsubscribed listid="unsubscribed" %} {% endif %}{# listUnsubscribed #} {% if listInvited %}

{% trans "Uitnodigingen" %} ({{ listInvited|length }})

- {% include "subscriptions/include_list.html" with list=listInvited %} + {% include "subscriptions/include_list.html" with list=listInvited listid="invited" %} {% endif %}{# listInvited #} {% endif %}{# has_read_access or object.has_public_subscriptions#} {% endblock %} diff --git a/kn/subscriptions/templates/subscriptions/include_list.html b/kn/subscriptions/templates/subscriptions/include_list.html index b6c1eb332..168288e3e 100644 --- a/kn/subscriptions/templates/subscriptions/include_list.html +++ b/kn/subscriptions/templates/subscriptions/include_list.html @@ -1,7 +1,8 @@ {% load i18n %} -