Skip to content

Commit

Permalink
Merge pull request #456 from okfn/django2
Browse files Browse the repository at this point in the history
Upgrade to django 2.2/django-cms 3.7 + associated plugins/ecosystem
  • Loading branch information
chris48s committed Oct 5, 2020
2 parents e36d8e0 + a474f57 commit 9f40d7c
Show file tree
Hide file tree
Showing 50 changed files with 889 additions and 116 deletions.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ COPY deployment/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY deployment/gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf

COPY aldryn_quote ./aldryn_quote
COPY aldryn_video ./aldryn_video
COPY article_list_item ./article_list_item
COPY docs ./docs
COPY foundation ./foundation
Expand All @@ -37,4 +38,10 @@ EXPOSE $PORT

RUN python manage.py collectstatic --noinput

CMD python manage.py migrate && python manage.py update_index && /usr/bin/supervisord
CMD pip install django-reversion==3.0.1 &&\
python manage.py migrate reversion &&\
pip install django-reversion==3.0.8 &&\
python manage.py migrate reversion &&\
python manage.py migrate &&\
python manage.py update_index &&\
/usr/bin/supervisord
9 changes: 8 additions & 1 deletion aldryn_quote/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Quote',
fields=[
('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
('cmsplugin_ptr', models.OneToOneField(
parent_link=True,
auto_created=True,
primary_key=True,
serialize=False,
to='cms.CMSPlugin',
on_delete=models.CASCADE,
)),
('style', models.CharField(default=b'standard', max_length=50, verbose_name='Style', choices=[(b'standard', 'Standard')])),
('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Created at')),
('content', models.TextField(default=b'', verbose_name='Quote')),
Expand Down
24 changes: 24 additions & 0 deletions aldryn_video/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2012, Divio AG
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Divio AG nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL DIVIO AG BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions aldryn_video/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Vendored copy of
https://github.com/aldryn/aldryn-video
which is not actively maintained
2 changes: 2 additions & 0 deletions aldryn_video/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '1.0.0'
Binary file added aldryn_video/boilerplates/.DS_Store
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="aldryn aldryn-video hidden-print">
<div class="embed-responsive embed-responsive-16by9">
<iframe src="{{ instance.oembed_data.player_url }}{% if instance.auto_play %}&amp;autoplay=1{% endif %}{% if instance.loop_video %}&amp;loop=1{% endif %}{% if instance.custom_params|escape %}&amp;{{ instance.custom_params|escape }}{% endif %}"
class="embed-responsive-item"
style="{% if instance.width %}width: {{ instance.width }}px; {% endif %}{% if instance.height %}height: {{ instance.height }}px;{% endif %}"></iframe>
</div>
</div>
Binary file added aldryn_video/boilerplates/legacy/.DS_Store
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ instance.html|safe }}
46 changes: 46 additions & 0 deletions aldryn_video/cms_plugins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
from django.utils.six.moves.urllib.parse import urljoin

from django.templatetags.static import PrefixNode
from django.utils.translation import ugettext_lazy as _

from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool

from aldryn_video import models


class OEmbedVideoPlugin(CMSPluginBase):

name = _('Video')
model = models.OEmbedVideoPlugin
render_template = 'aldryn_video/video.html'
text_enabled = True

fieldsets = (
(None, {'fields': ['url']},),
(
_('Advanced Options'),
{
'fields': [
('width', 'height'),
('iframe_width', 'iframe_height'),
'auto_play',
'loop_video',
'custom_params'
]
}
)
)

def render(self, context, instance, placeholder):
context['instance'] = instance
return context

def icon_src(self, instance):
path = 'img/aldryn_video/video-32x32.png'
prefix = PrefixNode.handle_simple("STATIC_URL") or PrefixNode.handle_simple("MEDIA_URL")
return urljoin(prefix, path)


plugin_pool.register_plugin(OEmbedVideoPlugin)
69 changes: 69 additions & 0 deletions aldryn_video/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# TRANSLATIONS
# This file is distributed under the same license as the package.
# Translators:
# Angelo Dini <finalangeljp@hotmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-15 09:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Angelo Dini <finalangeljp@hotmail.com>, 2016\n"
"Language-Team: German (https://www.transifex.com/divio/teams/58664/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: cms_plugins.py:15
msgid "Video"
msgstr "Video"

#: cms_plugins.py:24
msgid "Advanced Options"
msgstr "Erweiterte Einstellungen"

#: models.py:25
msgid "URL"
msgstr "URL"

#: models.py:25
msgid "vimeo and youtube supported."
msgstr "Vimeo und YouTube werden unterstützt."

#: models.py:26
msgid "Width"
msgstr "Breite"

#: models.py:27
msgid "Height"
msgstr "Höhe"

#: models.py:28
msgid "iframe width"
msgstr "Iframe Breite"

#: models.py:29
msgid "iframe height"
msgstr "Iframe Höhe"

#: models.py:30
msgid "auto play"
msgstr "automatisches Abspielen"

#: models.py:31
msgid "loop"
msgstr "Dauerdurchlauf"

#: models.py:31
msgid "when true, the video repeats itself when over."
msgstr "falls aktiviert, wiederholt sich das Video endlos."

#: models.py:34
msgid "custom params"
msgstr "Benutzerdefinierte Parameter"

#: models.py:34
msgid "define custom params (e.g. \"start=10&end=50\")"
msgstr "Benutzerdefinierte Parameter definieren (z.B. \"start=10&end=50\")"
66 changes: 66 additions & 0 deletions aldryn_video/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# TRANSLATIONS
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-15 09:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"

#: cms_plugins.py:15
msgid "Video"
msgstr "Video"

#: cms_plugins.py:24
msgid "Advanced Options"
msgstr "Advanced Options"

#: models.py:25
msgid "URL"
msgstr "URL"

#: models.py:25
msgid "vimeo and youtube supported."
msgstr "vimeo and youtube supported."

#: models.py:26
msgid "Width"
msgstr "Width"

#: models.py:27
msgid "Height"
msgstr "Height"

#: models.py:28
msgid "iframe width"
msgstr "iframe width"

#: models.py:29
msgid "iframe height"
msgstr "iframe height"

#: models.py:30
msgid "auto play"
msgstr "auto play"

#: models.py:31
msgid "loop"
msgstr "loop"

#: models.py:31
msgid "when true, the video repeats itself when over."
msgstr "when true, the video repeats itself when over."

#: models.py:34
msgid "custom params"
msgstr "custom params"

#: models.py:34
msgid "define custom params (e.g. \"start=10&end=50\")"
msgstr "define custom params (e.g. \"start=10&end=50\")"
66 changes: 66 additions & 0 deletions aldryn_video/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# TRANSLATIONS
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-15 09:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Language-Team: French (https://www.transifex.com/divio/teams/58664/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: cms_plugins.py:15
msgid "Video"
msgstr ""

#: cms_plugins.py:24
msgid "Advanced Options"
msgstr ""

#: models.py:25
msgid "URL"
msgstr ""

#: models.py:25
msgid "vimeo and youtube supported."
msgstr ""

#: models.py:26
msgid "Width"
msgstr ""

#: models.py:27
msgid "Height"
msgstr ""

#: models.py:28
msgid "iframe width"
msgstr ""

#: models.py:29
msgid "iframe height"
msgstr ""

#: models.py:30
msgid "auto play"
msgstr ""

#: models.py:31
msgid "loop"
msgstr ""

#: models.py:31
msgid "when true, the video repeats itself when over."
msgstr ""

#: models.py:34
msgid "custom params"
msgstr ""

#: models.py:34
msgid "define custom params (e.g. \"start=10&end=50\")"
msgstr ""
66 changes: 66 additions & 0 deletions aldryn_video/locale/it/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# TRANSLATIONS
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-15 09:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Language-Team: Italian (https://www.transifex.com/divio/teams/58664/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: cms_plugins.py:15
msgid "Video"
msgstr ""

#: cms_plugins.py:24
msgid "Advanced Options"
msgstr ""

#: models.py:25
msgid "URL"
msgstr ""

#: models.py:25
msgid "vimeo and youtube supported."
msgstr ""

#: models.py:26
msgid "Width"
msgstr ""

#: models.py:27
msgid "Height"
msgstr ""

#: models.py:28
msgid "iframe width"
msgstr ""

#: models.py:29
msgid "iframe height"
msgstr ""

#: models.py:30
msgid "auto play"
msgstr ""

#: models.py:31
msgid "loop"
msgstr ""

#: models.py:31
msgid "when true, the video repeats itself when over."
msgstr ""

#: models.py:34
msgid "custom params"
msgstr ""

#: models.py:34
msgid "define custom params (e.g. \"start=10&end=50\")"
msgstr ""
Loading

0 comments on commit 9f40d7c

Please sign in to comment.