Browse Source

changed languages default to german, translated last labels (verbosename) for variables

master
alpcentaur 1 year ago
parent
commit
73ad8f90cf
7 changed files with 23 additions and 10 deletions
  1. +8
    -0
      foerderbarometer/urls.py
  2. +1
    -1
      input/admin.py
  3. +0
    -2
      input/management/commands/sendmails.py
  4. +5
    -5
      input/models.py
  5. +6
    -0
      input/settings.py
  6. +2
    -2
      input/urls.py
  7. +1
    -0
      input/views.py

+ 8
- 0
foerderbarometer/urls.py View File

@ -15,9 +15,17 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.i18n import i18n_patterns
urlpatterns = [
path('', include("input.urls")),
path('admin/', admin.site.urls),
path('accounts/', include('django.contrib.auth.urls')),
]
#urlpatterns = i18n_patterns('',
# path('', include("input.urls")),
# path('admin/', admin.site.urls),
# path('accounts/', include('django.contrib.auth.urls')),
# #your urls
#)

+ 1
- 1
input/admin.py View File

@ -22,7 +22,7 @@ def export_as_csv(self, request, queryset):
return response
export_as_csv.short_description = "Export Selected"
export_as_csv.short_description = "Ausgewähltes zu CSV exportieren"
admin.site.add_action(export_as_csv)

+ 0
- 2
input/management/commands/sendmails.py View File

@ -150,7 +150,6 @@ class Command(BaseCommand):
# [IF_EMAIL],
# fail_silently=False)
project.end_mail_send = True
project.mail_state = 'END'
try:
project.save()
@ -209,7 +208,6 @@ class Command(BaseCommand):
# [IF_EMAIL],
# fail_silently=False)
project.end_mail_send = True
project.mail_state = 'END'
project.save()
except BadHeaderError:

+ 5
- 5
input/models.py View File

@ -17,8 +17,8 @@ class Volunteer(models.Model):
help_text=format_html('Bitte gib deine E-Mail-Adresse ein, damit dich<br>Wikimedia Deutschland bei Rückfragen oder für<br>die Zusage kontaktieren kann.'))
# the following Fields are not supposed to be edited by users
granted = models.BooleanField(null=True)
granted_date = models.DateField(null=True)
granted = models.BooleanField(null=True, verbose_name='bewilligt')
granted_date = models.DateField(null=True, verbose_name='bewilligt am')
survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken')
survey_mail_date = models.DateField(verbose_name='Umfragemail wurde verschickt am', null=True, blank=True)
mail_state = models.CharField(max_length=6, choices=EMAIL_STATES.items(), default='NONE')
@ -61,7 +61,7 @@ class Account(models.Model):
code = models.CharField('Kostenstelle', max_length=5, default="DEF",
null=False, primary_key = True)
description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION')
intern_notes = models.TextField(max_length=1000, blank=True)
intern_notes = models.TextField(max_length=1000, blank=True, verbose_name="interne Anmerkungen")
def __str__(self):
return f"{self.code} {self.description}"
@ -81,7 +81,7 @@ class Project(Volunteer):
insurance = models.BooleanField(default=False, verbose_name='Haftpflichtversicherung')
insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland')
support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung')
cost = models.IntegerField(blank=True, null=True)
cost = models.IntegerField(blank=True, null=True, verbose_name='Kosten')
account = models.ForeignKey('Account', on_delete=models.CASCADE, null=True, to_field='code', db_constraint = False)
granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von')
notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen')
@ -89,7 +89,7 @@ class Project(Volunteer):
# the following Fields are not supposed to be edited by users
pid = models.CharField(max_length=15, null=True, blank=True)
end_mail_send = models.BooleanField(null=True)
end_mail_send = models.BooleanField(null=True, verbose_name='Endmail versenden')
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet'),('NOT','nicht stattgefunden')),default='RUN')
persons = models.IntegerField(default=1)
finance_id = models.CharField(max_length=15, null= True, blank=True)

+ 6
- 0
input/settings.py View File

@ -12,6 +12,12 @@ DATAPROTECTION = "https://www.wikimedia.de/datenschutz/#datenerfassung"
FOERDERRICHTLINIEN = "https://de.wikipedia.org/wiki/Wikipedia:Wikimedia_Deutschland/F%C3%B6rderrichtlinien"
NUTZUNGSBEDINGUNGEN = 'static/input/nutzungsbedingungen.html'
LANGUAGE_CODE = 'de'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
ACCOUNTS ={ # "21103": '21103 Willkommen',
"DEF": 'DEFAULT VALUE, you hould not see this!',

+ 2
- 2
input/urls.py View File

@ -1,12 +1,12 @@
from django.urls import path
from .views import ExternView, done, authorize, deny, InternView, export
urlpatterns = [
path('', ExternView.as_view(), name='extern'),
# path('intern', InternView.as_view(), name='intern'),
path('saved', done, name='done'),
path('export', export, name='export'),
path('authorize/<str:choice>/<int:pk>', authorize, name='authorize'),
path('deny/<str:choice>/<int:pk>', deny, name='deny')
path('deny/<str:choice>/<int:pk>', deny, name='deny'),
]

+ 1
- 0
input/views.py View File

@ -12,6 +12,7 @@ from django.template import Context
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.html import format_html
from django.utils.translation import gettext as _
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\
HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\

Loading…
Cancel
Save