~trimardio/widelands-website/scheduler_utc_fix

« back to all changes in this revision

Viewing changes to mainpage/views.py

  • Committer: franku
  • Date: 2019-04-09 06:34:51 UTC
  • mfrom: (530.1.5 mv_main_files)
  • Revision ID: somal@arcor.de-20190409063451-orglu7d2oda37ej9
moved files stored in folder widelands to folder widelands/mainpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from settings import WIDELANDS_SVN_DIR, INQUIRY_RECIPIENTS
 
1
from django.conf import settings
2
2
from templatetags.wl_markdown import do_wl_markdown
3
3
from operator import itemgetter
4
4
from django.core.mail import send_mail
33
33
 
34
34
            # get email addresses which are in form of ('name','email'),
35
35
            recipients = []
36
 
            for recipient in INQUIRY_RECIPIENTS:
 
36
            for recipient in settings.INQUIRY_RECIPIENTS:
37
37
                recipients.append(recipient[1])
38
38
 
39
39
            send_mail(subject, message, sender,
46
46
 
47
47
    return render(request, 'mainpage/legal_notice.html', {
48
48
        'form': form,
49
 
        'inquiry_recipients': INQUIRY_RECIPIENTS,
 
49
        'inquiry_recipients': settings.INQUIRY_RECIPIENTS,
50
50
    })
51
51
 
52
52
 
67
67
    txt = '[TOC]\n\n'
68
68
    transl_files = []
69
69
    transl_list = []
70
 
    path = os.path.normpath(WIDELANDS_SVN_DIR + 'data/i18n/locales/')
 
70
    path = os.path.normpath(settings.WIDELANDS_SVN_DIR + 'data/i18n/locales/')
71
71
    try:
72
72
        transl_files = os.listdir(path)
73
73
        if transl_files:
100
100
    # Get other developers, put in the translators list
101
101
    # at given position and prepare all for wl_markdown
102
102
    try:
103
 
        with open(WIDELANDS_SVN_DIR + 'data/txts/developers.json', 'r') as f:
 
103
        with open(settings.WIDELANDS_SVN_DIR + 'data/txts/developers.json', 'r') as f:
104
104
            json_data = json.load(f)['developers']
105
105
 
106
106
        for head in json_data:
145
145
    This replaces the wiki changelog
146
146
 
147
147
    """
148
 
    data = codecs.open(WIDELANDS_SVN_DIR + 'ChangeLog', encoding='utf-8', mode='r').read()
 
148
    data = codecs.open(settings.WIDELANDS_SVN_DIR + 'ChangeLog', encoding='utf-8', mode='r').read()
149
149
    return render(request, 'mainpage/changelog.html',
150
150
                  {'changelog': data},
151
151
                  )