~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to privacy_policy/views.py

  • Committer: franku
  • Date: 2018-10-02 16:55:42 UTC
  • mto: This revision was merged to the branch mainline in revision 503.
  • Revision ID: somal@arcor.de-20181002165542-k5a3bwy01y5td8v8
added an privacy policy app

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
from __future__ import unicode_literals
 
3
 
 
4
from django.shortcuts import render
 
5
from privacy_policy.models import PrivacyPolicy
 
6
 
 
7
 
 
8
def privacy_policy(request):
 
9
    """Creates the text of all policies and prepare them for markdown."""
 
10
 
 
11
    text = '[TOC]\n'
 
12
    policies = PrivacyPolicy.objects.all()
 
13
    for policy in policies:
 
14
        text = text + '\n#' + policy.language
 
15
        text = text + '\n' + policy.policy_text
 
16
        text = text + '\n\n---------------------------'
 
17
    return render(request, 'privacy_policy.html', {'text': text})