Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for mailing list footers without subscribe link #582

Merged
merged 7 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions myhpi/locale/de/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: 2024-03-13 17:26+0100\n"
"POT-Creation-Date: 2024-07-29 19:26+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 @@ -372,12 +372,16 @@ msgid "Mailing Lists"
msgstr "Mailinglisten"

#: myhpi/tenca_django/forms.py:15
msgid "Not subscribed users are allowed to post."
msgstr "Nichtmitglieder dürfen an diese Liste schreiben."
msgid "Not subscribed users are allowed to post"
msgstr "Nichtmitglieder dürfen an diese Liste schreiben"

#: myhpi/tenca_django/forms.py:18
msgid "Replies are addressed to the list per default."
msgstr "Antworten gehen immer an den Verteiler."
msgid "Replies are addressed to the list per default"
msgstr "Antworten gehen immer an den Verteiler"

#: myhpi/tenca_django/forms.py:21
msgid "Footer contains invitation link"
msgstr "Fußzeile beinhaltet Einladungslink"

#: myhpi/tenca_django/models.py:30
#: myhpi/tenca_django/templates/tenca_django/manage_list.html:6
Expand Down Expand Up @@ -428,7 +432,7 @@ msgstr "Deine Mitgliedschaften"

#: myhpi/tenca_django/templates/tenca_django/delete_list.html:5
#: myhpi/tenca_django/templates/tenca_django/delete_list.html:10
#: myhpi/tenca_django/templates/tenca_django/manage_list.html:48
#: myhpi/tenca_django/templates/tenca_django/manage_list.html:40
msgid "Delete list"
msgstr "Liste Löschen"

Expand All @@ -444,6 +448,7 @@ msgstr ""
"\t"

#: myhpi/tenca_django/templates/tenca_django/delete_list.html:20
#: venv/lib/python3.12/site-packages/django/forms/formsets.py:499
#, fuzzy
#| msgid "Delete list"
msgid "Delete"
Expand Down Expand Up @@ -480,11 +485,11 @@ msgstr "Teile diesen Link, um neue Mitglieder einzuladen:"
msgid "List options"
msgstr "Listeneinstellungen"

#: myhpi/tenca_django/templates/tenca_django/manage_list.html:47
#: myhpi/tenca_django/templates/tenca_django/manage_list.html:39
msgid "Save"
msgstr "Speichern"

#: myhpi/tenca_django/templates/tenca_django/manage_list.html:51
#: myhpi/tenca_django/templates/tenca_django/manage_list.html:43
msgid "Members"
msgstr "Mitglieder"

Expand Down Expand Up @@ -602,11 +607,6 @@ msgstr "Die Anmeldung von {email} auf {list} wurde rückgänig gemacht."
#~ msgid "Draft"
#~ msgstr "Entwurf"

#, fuzzy
#~| msgid "[missing link]"
#~ msgid "[missing image]"
#~ msgstr "[link fehlt]"

#~ msgid "Sorry, this page could not be found."
#~ msgstr ""
#~ " Die angeforderte Seite existiert nicht. Bitte überprüfe die URL oder "
Expand Down
8 changes: 6 additions & 2 deletions myhpi/tenca_django/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ class TencaNewListForm(Form):

class TencaListOptionsForm(Form):
notsubscribed_allowed_to_post = BooleanField(
label=_("Not subscribed users are allowed to post."), required=False
label=_("Not subscribed users are allowed to post"), required=False
)
replies_addressed_to_list = BooleanField(
label=_("Replies are addressed to the list per default."), required=False
label=_("Replies are addressed to the list per default"), required=False
)
footer_has_subscribe_link = BooleanField(
label=_("Footer contains invitation link"), required=False
)
# Fields should be named according to their respective setting on the tenca list object

Expand All @@ -24,6 +27,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for key, field in self.fields.items():
field.initial = getattr(mailing_list, key)
self.label_suffix = ""


class TencaMemberEditForm(Form):
Expand Down
22 changes: 7 additions & 15 deletions myhpi/tenca_django/templates/tenca_django/manage_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,13 @@ <h3>{% trans "Invite Link" %}</h3>
<h3>{% trans "List options" %}</h3>
<form method="post">
{% csrf_token %}
<div class="form-group">
<div class="form-check">
<input type="checkbox" name="notsubscribed_allowed_to_post" class="form-check-input" id="id_notsubscribed_allowed_to_post" checked="">
<label class="form-check-label" for="id_notsubscribed_allowed_to_post">
Not subscribed users are allowed to post.
</label>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input type="checkbox" name="replies_addressed_to_list" class="form-check-input" id="id_replies_addressed_to_list">
<label class="form-check-label" for="id_replies_addressed_to_list">
Replies are addressed to the list per default.
</label>
</div>
<div class="form-group mb-3">
{% for field in form %}
<div class="form-check">
{{ field|addcss:"form-check-input" }}
{{ field.label_tag }}
</div>
{% endfor %}
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
Expand Down
5 changes: 5 additions & 0 deletions myhpi/tenca_django/templatetags/tenca_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ def fqdn_ize(list_id):
from myhpi.tenca_django.connection import connection

return connection.fqdn_ize(list_id)


@register.filter(name='addcss')
def addcss(field, css):
return field.as_widget(attrs={"class":css})