12 Commits

Author SHA1 Message Date
Simon Caminada
2963c0b3fb fix: update zip archiving 2024-06-17 14:40:34 +02:00
Simon Caminada
eac8a31856 fix: add debug to filer archive 2024-06-17 14:18:39 +02:00
Simon Caminada
0048f5ef99 fix: update path in public archive 2024-06-17 14:07:40 +02:00
Simon Caminada
a0bb334f05 fix: typo 2024-06-17 14:04:51 +02:00
Simon Caminada
1f3adfd482 fix: update media archive path 2024-06-17 14:00:14 +02:00
Simon Caminada
71fa095663 fix: update filer media archive 2024-06-17 13:51:33 +02:00
Simon Caminada
b27e30700f feat: update iframe plugin 2024-05-24 12:23:39 +02:00
Simon Caminada
d4b9ba68a5 feat: add flipbook plugin 2024-05-24 12:16:12 +02:00
Simon Caminada
6883bc9cb9 fix: typo in cookie banner 2023-09-08 16:46:19 +02:00
Simon Caminada
5a0457d4ff fix: update cookie banner 2023-09-08 16:40:46 +02:00
Simon Caminada
7f11089915 feat: move to google tag manager 2023-03-03 16:07:43 +01:00
Simon Caminada
93de30564d feat: add blacklist to form 2022-07-04 17:24:38 +02:00
12 changed files with 122 additions and 26 deletions

View File

@@ -38,3 +38,4 @@
@import "modules/plugins/_timetable.scss";
@import "modules/plugins/_reference_list.scss";
@import "modules/plugins/_form.scss";
@import "modules/plugins/_iframe.scss";

View File

@@ -0,0 +1,3 @@
.iframe {
margin: em(50px) 0;
}

View File

@@ -38,3 +38,8 @@ django-meta==1.7.0
tablib==0.14.0
django-simple-sso==0.14.1
easy-thumbnails==2.7.1
dj-database-url==0.5.0
django-js-asset==1.2.3
idna==3.4
cssselect==1.1.0
lxml-html-clean==0.1.1

View File

@@ -264,3 +264,9 @@ RECAPTCHA_PUBLIC_KEY = '6LeILd0ZAAAAAB9xO_y8kS292wv2ikl0M8s7zFn9'
RECAPTCHA_PRIVATE_KEY = '6LeILd0ZAAAAAOGF1AvxdiGcXWLjr2BzHaQ8Zush'
RECAPTCHA_SCORE_THRESHOLD = 0.5
ALDRYN_FORMS_ACTION_BACKENDS = {
'default': 'project.action_backends.DefaultAction',
'email_only': 'aldryn_forms.action_backends.EmailAction',
'none': 'aldryn_forms.action_backends.NoAction',
}

View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from aldryn_forms.action_backends_base import BaseAction
class DefaultAction(BaseAction):
verbose_name = 'Default'
def form_valid(self, cmsplugin, instance, request, form):
email = form.cleaned_data.get('emailfield_1', None)
if email and email in ['eric.jones.z.mail@gmail.com']:
return
recipients = cmsplugin.send_notifications(instance, form)
form.instance.set_recipients(recipients)
form.save()

View File

@@ -15,7 +15,7 @@ from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget
from project.forms import NewsletterSubscriptionForm
from project.models import Section, Quote, SliderItem, SectionText, Video, DownloadSection, DownloadSectionFolder, \
TextSliderItem, HighlightListItem, ReferenceListItem, SocialMediaList, SocialMediaListItem, Timetable, \
TimetableItem, Partner, HighlightList, Image, TitleListItem, TitleList, IntroImage, Gallery
TimetableItem, Partner, HighlightList, Image, TitleListItem, TitleList, IntroImage, Gallery, Iframe
@plugin_pool.register_plugin
@@ -29,7 +29,7 @@ class SectionPlugin(CMSPluginBase):
'SectionTextPlugin', 'VideoPlugin', 'DownloadSectionPlugin', 'TextSliderPlugin',
'HighlightListPlugin', 'ReferenceListPlugin', 'FormPlugin', 'PicturePlugin', 'SubPageListPlugin',
'PartnerPlugin', 'NewsletterSubscriptionPlugin', 'NewsletterArchivePlugin',
'SocialMediaListPlugin', 'GalleryPlugin']
'SocialMediaListPlugin', 'GalleryPlugin', 'IframePlugin']
@plugin_pool.register_plugin
@@ -348,3 +348,11 @@ class GalleryPlugin(CMSPluginBase):
module = 'Content'
name = 'Gallery'
render_template = 'project/plugins/content/gallery.html'
@plugin_pool.register_plugin
class IframePlugin(CMSPluginBase):
model = Iframe
module = 'Content'
name = 'Iframe'
render_template = 'project/plugins/content/iframe.html'

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2024-05-23 15:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms', '0020_old_tree_cleanup'),
('project', '0011_auto_20211104_1608'),
]
operations = [
migrations.CreateModel(
name='Iframe',
fields=[
('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='project_iframe', serialize=False, to='cms.CMSPlugin')),
('html', models.TextField(verbose_name='HTML')),
],
options={
'verbose_name': 'Iframe',
'verbose_name_plural': 'Iframes',
'abstract': False,
},
bases=('cms.cmsplugin',),
),
]

View File

@@ -349,3 +349,14 @@ class Gallery(CMSPlugin):
@property
def files(self):
return self.folder.files.all().order_by('name')
class Iframe(CMSPlugin):
html = models.TextField('HTML')
class Meta(CMSPlugin.Meta):
verbose_name = 'Iframe'
verbose_name_plural = 'Iframes'
def __str__(self):
return self.html

View File

@@ -177,12 +177,14 @@
<div id="privacy-message" style="display: none;">
<div class="privacy-message__frame">
<p>
{% page_url 'imprint' as privacy_url %}
{% blocktrans with privacy_url=privacy_url %}
{% page_url 'privacy' as privacy_url %}
{% if LANGUAGE_CODE == 'de' %}
Um diese Webseite optimal gestalten und fortlaufend verbessern zu können, verwenden wir Cookies.
Weitere Informationen finden Sie in unserer
<a href="{{ privacy_url }}">Datenschutzerklärung im Impressum</a>.
{% endblocktrans %}
Weitere Informationen finden Sie in unserer <a href="{{ privacy_url }}">Datenschutzerklärung</a>.
{% else %}
In order to optimize this website and to continuously improve it, we use cookies.
Further information can be found in our <a href="{{ privacy_url }}">data protection policy</a>.
{% endif %}
</p>
<div class="privacy-message__actions">
<a href="#" class="button button--small button--ghost privacy_action--decline">
@@ -208,30 +210,20 @@
<script>
$(function() {
var init_google_analytics = function() {
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-116863155-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
var init_tag_manager = function() {
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WVRJ872');
};
if (window.privacy_accepted) {
init_google_analytics();
init_tag_manager();
}
$('body').on('enable_tracking', function() {
init_google_analytics();
init_tag_manager();
});
});
</script>

View File

@@ -0,0 +1,5 @@
<div class="iframe reveal_container">
<div class="reveal reveal_animation">
<div style="display:inline-block;vertical-align:top;width:300px;margin:20px auto;color:#333;background:#fff;border:1px solid #ddd;line-height:1.2;text-decoration:none;padding:0"><a href="https://read.bookcreator.com/Y0SYhDEKm4Wfw50K2K1EsVR6BSO2/3EzILpspTZubAkL9btIklA" style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal" target="_blank" rel="noreferrer"><img src="https://assets.api.bookcreator.com/Y0SYhDEKm4Wfw50K2K1EsVR6BSO2/books/3EzILpspTZubAkL9btIklA/cover/share" style="max-height:300px;max-width:100%;display:block;margin:0 auto;padding:0;border:none" alt="Unsere Lieblingstiere"/></a><div style="display:block;padding:20px;overflow:hidden;overflow-x:hidden;border-top:1px solid #ddd"><div style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal;font-size:21px;margin:0 0 0.25em"><a href="https://read.bookcreator.com/Y0SYhDEKm4Wfw50K2K1EsVR6BSO2/3EzILpspTZubAkL9btIklA" style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal" target="_blank" rel="noreferrer">Unsere Lieblingstiere</a></div><div style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal;font-size:16px;margin:0 0 0.5em"><a href="https://read.bookcreator.com/Y0SYhDEKm4Wfw50K2K1EsVR6BSO2/3EzILpspTZubAkL9btIklA" style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal" target="_blank" rel="noreferrer">Click to read this book, made with Book Creator</a></div><div style="display:block;color:#455a64;line-height:1.2;text-decoration:none;padding:0;font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px"><a href="https://read.bookcreator.com/Y0SYhDEKm4Wfw50K2K1EsVR6BSO2/3EzILpspTZubAkL9btIklA" style="display:block;color:#333;line-height:1.2;text-decoration:none;padding:0;font-weight:normal" target="_blank" rel="noreferrer">read.bookcreator.com</a></div></div></div>
</div>
</div>

View File

@@ -3,7 +3,7 @@ from django.conf.urls import url, include
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import TemplateView
from project.views import SearchView, NewsletterSubscriptionView, LoginRedirectView, MediaRedirectView
from project.views import SearchView, NewsletterSubscriptionView, LoginRedirectView, MediaRedirectView, ArchiveFilerPublic
urlpatterns = [
url(_(r'^suche/'), SearchView.as_view(), kwargs={'search': True}, name='search'),
@@ -13,4 +13,5 @@ urlpatterns = [
name='newsletter_subscription_success'),
url(r'^login/redirect/$', LoginRedirectView.as_view(), name='login_redirect'),
url(r'^media/bridge/$', MediaRedirectView.as_view(), name='media_bridge'),
url(r'^media/archive/$', ArchiveFilerPublic.as_view(), name='media_archive'),
]

View File

@@ -2,6 +2,7 @@
from aldryn_search.views import AldrynSearchView
from cms.models import Page
from django.core.urlresolvers import reverse_lazy
from django.views import View
from django.views.generic import RedirectView
from django.views.generic.edit import FormView
from aldryn_forms.admin.views import FormExportWizardView
@@ -9,6 +10,8 @@ from aldryn_forms.admin.exporter import Exporter
from tablib import Dataset
from django.http import HttpResponse
from project.forms import NewsletterSubscriptionForm
import os
import zipfile
class SearchView(AldrynSearchView):
@@ -102,3 +105,21 @@ class CustomFormExportWizardView(FormExportWizardView):
response = HttpResponse(dataset.xls, content_type=content_type)
response['Content-Disposition'] = 'attachment; filename=%s' % filename
return response
class ArchiveFilerPublic(View):
def get(self, request):
path = '/app/data/media/filer_public/'
with zipfile.ZipFile('filer_public.zip', 'w', zipfile.ZIP_DEFLATED) as zipf:
for root, dirs, files in os.walk(path):
for file in files:
filePath = os.path.join(root, file)
try:
with open(filePath) as tempFile:
pass
zipf.write(filePath, os.path.relpath(filePath, os.path.join(path, '..')))
except IOError:
print(filePath)
return HttpResponse('success')