diff --git a/district/migrations/0051_alter_districtarticlepage_content.py b/district/migrations/0051_alter_districtarticlepage_content.py index d89ac89a1b5ef1526d1662072a6aba0a847a0545..c78c5d77456ff5ffce57fc90bbac0c13ccbb2863 100644 --- a/district/migrations/0051_alter_districtarticlepage_content.py +++ b/district/migrations/0051_alter_districtarticlepage_content.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.3 on 2022-04-01 14:13 +# Generated by Django 4.0.3 on 2022-04-01 14:55 import wagtail.core.blocks import wagtail.core.fields @@ -28,6 +28,7 @@ class Migration(migrations.Migration): "bold", "italic", "ol", + "embed", "ul", "link", "document-link", diff --git a/district/templates/district/base.html b/district/templates/district/base.html index ea83320f5d05c69ba38acd910d0e7bf4da316f08..af425062dd49d131613afa3a846d01a786e830a1 100644 --- a/district/templates/district/base.html +++ b/district/templates/district/base.html @@ -18,6 +18,7 @@ <!-- Styles --> <link rel="stylesheet" href="{% static "styleguide18/assets/css/styles.css" %}"> <link href="{% static "shared/vendor/fancybox/jquery.fancybox.min.css" %}" rel="stylesheet"> + <link rel="stylesheet" href="{% static "shared/css/helpers.css" %}"> <style type="text/css"> .inline-block { diff --git a/majak/settings/base.py b/majak/settings/base.py index 1af5e8f2e89628afeeff51871a04f4b74f835b3b..927b9215e9ba0b04c24ea4e1d3383e7bcef1490a 100644 --- a/majak/settings/base.py +++ b/majak/settings/base.py @@ -230,6 +230,14 @@ WAGTAILSEARCH_BACKENDS = { } } +WAGTAILEMBEDS_FINDERS = [ + { + "class": "shared.finders.CustomPeertubeFinder", + }, +] + +WAGTAILEMBEDS_RESPONSIVE_HTML = True + # Base URL to use when referring to full URLs within the Wagtail admin backend - # e.g. in notification emails. Don't include '/admin' or a trailing slash BASE_URL = env.str("BASE_URL", default="https://majak.pirati.cz") diff --git a/region/migrations/0026_alter_regionarticlepage_content.py b/region/migrations/0026_alter_regionarticlepage_content.py index f81ad07004edde357281ff17fc0a49750442b27f..929b04706388f4b0789ef7f519910b16c65128e2 100644 --- a/region/migrations/0026_alter_regionarticlepage_content.py +++ b/region/migrations/0026_alter_regionarticlepage_content.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.3 on 2022-04-01 14:13 +# Generated by Django 4.0.3 on 2022-04-01 14:55 import wagtail.core.blocks import wagtail.core.fields @@ -28,6 +28,7 @@ class Migration(migrations.Migration): "bold", "italic", "ol", + "embed", "ul", "link", "document-link", diff --git a/region/templates/region/base.html b/region/templates/region/base.html index 18eab8c095baa7b4467bc18cb88bf786d2041b6e..d4e24e48eea517ef952aebdcb1e2dc88a948336a 100644 --- a/region/templates/region/base.html +++ b/region/templates/region/base.html @@ -18,6 +18,7 @@ <!-- Styles --> <link rel="stylesheet" href="{% static "styleguide18/assets/css/styles.css" %}"> <link href="{% static "shared/vendor/fancybox/jquery.fancybox.min.css" %}" rel="stylesheet"> + <link rel="stylesheet" href="{% static "shared/css/helpers.css" %}"> <style type="text/css"> .inline-block { diff --git a/shared/finders.py b/shared/finders.py new file mode 100644 index 0000000000000000000000000000000000000000..d75fc41d30c6eebcaea45ad4f8951f2f2603fbb1 --- /dev/null +++ b/shared/finders.py @@ -0,0 +1,9 @@ +from wagtail.embeds.finders.oembed import OEmbedFinder + + +class CustomPeertubeFinder(OEmbedFinder): + def _get_endpoint(self, url): + return "https://tv.pirati.cz/services/oembed" + + +embed_finder_class = CustomPeertubeFinder diff --git a/shared/models.py b/shared/models.py index 6e847cac7a984110d6e60ff96aea953df6284f7a..847f58547e2ceeffcce05ac380287f4e5bfeb874 100644 --- a/shared/models.py +++ b/shared/models.py @@ -38,6 +38,7 @@ class ArticleMixin(models.Model): "bold", "italic", "ol", + "embed", "ul", "link", "document-link", diff --git a/shared/static/shared/css/helpers.css b/shared/static/shared/css/helpers.css new file mode 100644 index 0000000000000000000000000000000000000000..0ba59e24bf3c7bc8acb442cf1cf30bfcebc7180b --- /dev/null +++ b/shared/static/shared/css/helpers.css @@ -0,0 +1,13 @@ +.responsive-object { + position: relative; +} + +.responsive-object iframe, +.responsive-object object, +.responsive-object embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/uniweb/migrations/0023_alter_uniwebarticlepage_content.py b/uniweb/migrations/0023_alter_uniwebarticlepage_content.py index 5745f5a15fad6851e80c0271c47e7a5ce771868d..368b1cb0d44fce4c259ea955606bb96188cb03cf 100644 --- a/uniweb/migrations/0023_alter_uniwebarticlepage_content.py +++ b/uniweb/migrations/0023_alter_uniwebarticlepage_content.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.3 on 2022-04-01 14:13 +# Generated by Django 4.0.3 on 2022-04-01 14:55 import wagtail.core.blocks import wagtail.core.fields @@ -28,6 +28,7 @@ class Migration(migrations.Migration): "bold", "italic", "ol", + "embed", "ul", "link", "document-link",