Skip to content

Commit

Permalink
Create a button for admin to list users and their email address (#777)
Browse files Browse the repository at this point in the history
* add modal to list users

* copy to clipboard and table with date next year

* update translation files for event

* fix multi line translation
  • Loading branch information
CJGutz authored Oct 31, 2023
1 parent f22f701 commit 1f88aee
Show file tree
Hide file tree
Showing 22 changed files with 139 additions and 134 deletions.
16 changes: 8 additions & 8 deletions applications/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -111,40 +111,40 @@ msgstr ""
"Below you will find information about the main groups currently open for "
"admission"

#: applications/templates/applications/application_info.html:66
#: applications/templates/applications/application_info.html:95
#: applications/templates/applications/application_info.html:65
#: applications/templates/applications/application_info.html:92
msgid "Ingen grupper lagt til i opptaket."
msgstr "No groups added to the admission process."

#: applications/templates/applications/application_info.html:79
#: applications/templates/applications/application_info.html:76
msgid "Prosjektgruppene"
msgstr "Project Groups"

#: applications/templates/applications/application_info.html:80
#: applications/templates/applications/application_info.html:77
msgid ""
"Prosjektgruppene gjennomfører en rekke prosjekter som varierer fra år til "
"år. Prosjektene varer som oftest i to semestre."
msgstr ""
"The project groups carry out a variety of projects that vary from year to "
"year. Projects usually last for two semesters."

#: applications/templates/applications/application_info.html:81
#: applications/templates/applications/application_info.html:78
msgid ""
"Som medlem av en prosjektgruppe jobber du konkret på et prosjekt sammen med "
"andre på gruppen."
msgstr ""
"As a member of a project group, you work actively on a project alongside "
"others in the group."

#: applications/templates/applications/application_info.html:82
#: applications/templates/applications/application_info.html:79
msgid ""
"Om du har forslag til noen andre prosjekter, kan dette sendes med et "
"søknadsskjema."
msgstr ""
"If you have suggestions for other projects, you can include them in your "
"application."

#: applications/templates/applications/application_info.html:83
#: applications/templates/applications/application_info.html:80
msgid "Under finner du informasjon om prosjektene som har opptak nå."
msgstr ""
"Below you will find information about the projects currently open for "
Expand Down
16 changes: 8 additions & 8 deletions applications/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -91,34 +91,34 @@ msgstr ""
msgid "Under finner du informasjon om hovedgruppene som har opptak nå"
msgstr ""

#: applications/templates/applications/application_info.html:66
#: applications/templates/applications/application_info.html:95
#: applications/templates/applications/application_info.html:65
#: applications/templates/applications/application_info.html:92
msgid "Ingen grupper lagt til i opptaket."
msgstr ""

#: applications/templates/applications/application_info.html:79
#: applications/templates/applications/application_info.html:76
msgid "Prosjektgruppene"
msgstr ""

#: applications/templates/applications/application_info.html:80
#: applications/templates/applications/application_info.html:77
msgid ""
"Prosjektgruppene gjennomfører en rekke prosjekter som varierer fra år til "
"år. Prosjektene varer som oftest i to semestre."
msgstr ""

#: applications/templates/applications/application_info.html:81
#: applications/templates/applications/application_info.html:78
msgid ""
"Som medlem av en prosjektgruppe jobber du konkret på et prosjekt sammen med "
"andre på gruppen."
msgstr ""

#: applications/templates/applications/application_info.html:82
#: applications/templates/applications/application_info.html:79
msgid ""
"Om du har forslag til noen andre prosjekter, kan dette sendes med et "
"søknadsskjema."
msgstr ""

#: applications/templates/applications/application_info.html:83
#: applications/templates/applications/application_info.html:80
msgid "Under finner du informasjon om prosjektene som har opptak nå."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion files/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion files/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% load i18n %}

<div class="collection card-panel">
{% if users %}
<button onclick="copyToClip()" class="btn waves-effect waves-light">
<i class="material-icons left">content_paste</i>{% trans "Kopier til utklippstavle" %}
</button>
<table class="striped" id="tableToCopy">
<thead>
<th>{% trans "Navn" %}</th>
<th>{% trans "Epost" %}</th>
<th>{% trans "Tilgang til" %}</th>
</thead>
<tbody>

{% for user in users %}
<tr>
<td>{{ user.first_name }} {{ user.last_name }}</td>
<td>{{ user.email }}</td>
<td>{{ next_year|date:"d.m.Y" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "Ingen aktive medlemmer." %}</p>
{% endif %}
</div>
<script>
function copyToClip() {
let copyText = document.getElementById("tableToCopy");
navigator.clipboard.writeText(copyText.innerText.trim());
}
</script>
12 changes: 12 additions & 0 deletions internalportal/templates/internalportal/internalportal.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ <h5>{% trans "Adminpanel" %}</h5>
</div>
</a>
</div>

<div class="col s12 m4">
<a href="#door-access-list" class="modal-trigger">
<div class="card-panel center">
<i class="material-icons large black-text">group</i>
<h5>{% trans "Medlemsliste for dørtilgang" %}</h5>
</div>
</a>
</div>
<div class="modal" id="door-access-list">
{% include "internalportal/door-access-member-list.html" with users=door_access_member_list next_year=next_year only %}
</div>
{% endif %}
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion internalportal/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from datetime import datetime, timedelta

from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.views.generic import TemplateView

Expand All @@ -15,6 +16,7 @@ def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)

context["current_date"] = datetime.now()
context["next_year"] = datetime.now() + timedelta(days=365)

# Find the 5 loan apps that have gone unapproved the longest
context["loan_app_list"] = ItemLoan.objects.filter(
Expand All @@ -30,4 +32,10 @@ def get_context_data(self, *args, **kwargs):
internal=True, draft=False
).order_by("-pub_date")[:5]

context["door_access_member_list"] = (
get_user_model()
.objects.filter(groups__name="Medlem")
.order_by("-date_joined")
)

return context
2 changes: 1 addition & 1 deletion inventory/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion inventory/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
14 changes: 7 additions & 7 deletions news/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -320,19 +320,19 @@ msgstr "The registration deadline has passed."
#: news/templates/news/event.html:129 news/templates/news/event.html:131
#: news/templates/news/event.html:212
msgid "Meld deg av"
msgstr "Unsubscribe"
msgstr "Withdraw registration"

#: news/templates/news/event.html:132
msgid "Fristen for avregistrering er ute."
msgstr "The unsubscription deadline has passed."
msgstr "The withdrawal deadline has passed."

#: news/templates/news/event.html:136
msgid "Frist for påmelding er"
msgstr "The registration deadline is"

#: news/templates/news/event.html:137
msgid "Frist for avmelding er"
msgstr "The unsubscription deadline is"
msgstr "The withdrawal deadline is"

#: news/templates/news/event.html:139
msgid "Arrangementet benytter ekstern nettside for pålogging."
Expand Down Expand Up @@ -364,7 +364,7 @@ msgstr "Registration information"

#: news/templates/news/event.html:195
msgid "Du forsøker å melde deg av arrangementet."
msgstr "You are trying to unsubscribe from the event."
msgstr "You are trying to withdraw your registration from the event."

#: news/templates/news/event.html:196
msgid ""
Expand All @@ -379,7 +379,7 @@ msgid ""
"Arrangementets påmeldingsfrist er utløpt. Dersom du melder deg av, har du "
"ikke mulighet til å melde deg på igjen."
msgstr ""
"The registration deadline for the event has expired. If you unsubscribe, you "
"The registration deadline for the event has expired. If you withdraw your registration, you "
"will not be able to register again."

#: news/templates/news/event.html:201
Expand All @@ -388,7 +388,7 @@ msgstr "By registering for this event, it is expected that you attend."

#: news/templates/news/event.html:202
msgid "Du kan ikke melde deg av etter"
msgstr "You cannot unsubscribe after"
msgstr "You cannot withdraw your registration after"

#: news/templates/news/event.html:204
msgid "Dette arrangementet har servering. Sørg for at dine"
Expand Down
2 changes: 1 addition & 1 deletion news/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
22 changes: 13 additions & 9 deletions news/templates/news/edit_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ <h5>{% trans "Innhold" %}</h5>
<span class="helper-text hs-red-text">{{ form.main_content.errors }}</span>
{{ form.main_content }}
<div class="helper-text">
<p>{% trans "Bare markdown støttes i dette feltet, html blir returnert som plaintext. Bilder kan legges til ved drag-and-drop." %}</p>
<p>{% trans "Bare markdown støttes i dette feltet, html blir returnert som plaintext. Bilder
kan legges til ved drag-and-drop." %}</p>
<p><a href="https://www.markdownguide.org/cheat-sheet/">Markdown cheat-sheet</a></p>
</div>
</div>
Expand Down Expand Up @@ -200,7 +201,8 @@ <h5>{% trans "Ferdigheter" %}</h5>
<div class="row">
<div class="col s12">
<h5>{% trans "Filer" %}</h5>
<p>{% trans "Det kan være nyttig å legge ved powerpoint eller andre relevante filer i arrangementet.
<p>{% trans "Det kan være nyttig å legge ved powerpoint eller andre relevante filer i
arrangementet.
Da får deltakerene mulighet til å gjøre seg klare før arrangementet starter." %}</p>
<div class="divider"></div>
<br>
Expand Down Expand Up @@ -234,13 +236,15 @@ <h5>{% trans "Ferdig" %}</h5>
<span class="helper-text hs-red-text">{{ form.internal.errors }}</span>
</div>
</div>
<button id="submit" class="hide btn btn-large hs-green waves-effect waves-light"
type="submit" name="form_submit">{% trans "Lagre og publiser arrangement" %}
<button id="submit" class="hide btn btn-large hs-green waves-effect waves-light" type="submit"
name="form_submit">{% trans "Lagre og publiser arrangement" %}
</button>
<a class="btn btn-large hs-green waves-effect waves-light" onclick="saveAndPublish()">{% trans "Lagre
og publiser arrangement" %}</a>
<a class="btn btn-large hs-gray waves-effect waves-light" onclick="saveAsDraft()">{% trans "Lagre som
utkast" %}</a>
<a class="btn btn-large hs-green waves-effect waves-light" onclick="saveAndPublish()">
{% trans "Lagre og publiser arrangement" %}
</a>
<a class="btn btn-large hs-gray waves-effect waves-light" onclick="saveAsDraft()">
{% trans "Lagre som utkast" %}
</a>
</div>
</div>
</div>
Expand All @@ -250,4 +254,4 @@ <h5>{% trans "Ferdig" %}</h5>
<script src="{% static 'news/js/edit_event.js' %}"></script>
<script src="{% static 'news/js/save_draft_or_publish.js' %}"></script>

{% endblock content %}
{% endblock content %}
2 changes: 1 addition & 1 deletion projectarchive/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion projectarchive/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion reservations/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion reservations/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion userprofile/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion userprofile/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-29 19:48+0200\n"
"POT-Creation-Date: 2023-10-23 17:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Loading

0 comments on commit 1f88aee

Please sign in to comment.