feat: Add customizable external site warning to
This commit is contained in:
		@@ -45,13 +45,14 @@ There is a system for customizing texts in Notfellchen. Not every change of a te
 | 
				
			|||||||
Therefore, a solution is used where a number of predefined texts per site are supported. These markdown texts will then be included in the site, if defined.
 | 
					Therefore, a solution is used where a number of predefined texts per site are supported. These markdown texts will then be included in the site, if defined.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| Textcode                | Location              |
 | 
					| Textcode                | Location              |
 | 
				
			||||||
|---------------------|----------|
 | 
					|-------------------------|-----------------------|
 | 
				
			||||||
| `how_to`                | Index                 |
 | 
					| `how_to`                | Index                 |
 | 
				
			||||||
| `introduction`          | Index                 |
 | 
					| `introduction`          | Index                 |
 | 
				
			||||||
| `privacy_statement`     | About                 |
 | 
					| `privacy_statement`     | About                 |
 | 
				
			||||||
| `terms_of_service`      | About                 |
 | 
					| `terms_of_service`      | About                 |
 | 
				
			||||||
| `imprint`               | About                 |
 | 
					| `imprint`               | About                 |
 | 
				
			||||||
| `about_us`              | About                 |
 | 
					| `about_us`              | About                 |
 | 
				
			||||||
 | 
					| `external_site_warning` | External Site Warning |
 | 
				
			||||||
| Any rule                | About                 |
 | 
					| Any rule                | About                 |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Developer Notes
 | 
					# Developer Notes
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,15 @@
 | 
				
			|||||||
{% extends "fellchensammlung/base_generic.html" %}
 | 
					{% extends "fellchensammlung/base_generic.html" %}
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					    {% load custom_tags %}
 | 
				
			||||||
{% block content %}
 | 
					{% block content %}
 | 
				
			||||||
    <div class="card">
 | 
					    <div class="card">
 | 
				
			||||||
 | 
					        {% if external_site_warning %}
 | 
				
			||||||
 | 
					            {{ external_site_warning.content | render_markdown }}
 | 
				
			||||||
 | 
					        {% else %}
 | 
				
			||||||
            {% blocktranslate %}
 | 
					            {% blocktranslate %}
 | 
				
			||||||
                <p>Achtung du verlässt notfellchen.org</p>
 | 
					                <p>Achtung du verlässt notfellchen.org</p>
 | 
				
			||||||
            {% endblocktranslate %}
 | 
					            {% endblocktranslate %}
 | 
				
			||||||
        <a href="{{ url }}" class="btn button" >{% translate "Weiter" %}</a>
 | 
					        {% endif %}
 | 
				
			||||||
 | 
					        <a href="{{ url }}" class="btn button">{% translate "Weiter" %}</a>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
{% endblock content %}
 | 
					{% endblock content %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -537,6 +537,7 @@ def external_site_warning(request):
 | 
				
			|||||||
    context = {"url": url}
 | 
					    context = {"url": url}
 | 
				
			||||||
    language_code = translation.get_language()
 | 
					    language_code = translation.get_language()
 | 
				
			||||||
    lang = Language.objects.get(languagecode=language_code)
 | 
					    lang = Language.objects.get(languagecode=language_code)
 | 
				
			||||||
    Text.get_texts(["external_site_warning", "good_adoption_practices"], language=lang)
 | 
					    texts = Text.get_texts(["external_site_warning", "good_adoption_practices"], language=lang)
 | 
				
			||||||
 | 
					    context.update(texts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render(request, 'fellchensammlung/external_site_warning.html', context=context)
 | 
					    return render(request, 'fellchensammlung/external_site_warning.html', context=context)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user