diff --git a/aldryn_disqus/admin.py b/aldryn_disqus/admin.py new file mode 100644 index 0000000..7800981 --- /dev/null +++ b/aldryn_disqus/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin + +from .models import DisqusService + +admin.site.register(DisqusService) diff --git a/aldryn_disqus/cms_plugins.py b/aldryn_disqus/cms_plugins.py index 3c29f1e..8216fab 100644 --- a/aldryn_disqus/cms_plugins.py +++ b/aldryn_disqus/cms_plugins.py @@ -7,17 +7,19 @@ class DisqusPlugin(CMSPluginBase): - + model = models.DisqusPlugin + name = _('Disqus Plugin') render_template = 'aldryn_disqus/disqus.html' admin_preview = False - name = _('Disqus Plugin') - model = models.DisqusPlugin page_only = True + allow_children = True def render(self, context, instance, placeholder): - context['DISQUS_SHORTNAME'] = settings.DISQUS_SHORTNAME + context['DISQUS_SHORTNAME'] = instance.disqus.shortname if instance and instance.disqus and \ + instance.disqus.shortname else None context['instance'] = instance context['developer_mode'] = settings.DEBUG return context + plugin_pool.register_plugin(DisqusPlugin) diff --git a/aldryn_disqus/locale/de/LC_MESSAGES/django.mo b/aldryn_disqus/locale/de/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index 987abe7..39462a2 Binary files a/aldryn_disqus/locale/de/LC_MESSAGES/django.mo and b/aldryn_disqus/locale/de/LC_MESSAGES/django.mo differ diff --git a/aldryn_disqus/locale/de/LC_MESSAGES/django.po b/aldryn_disqus/locale/de/LC_MESSAGES/django.po old mode 100644 new mode 100755 index 7c8967e..ef69b53 --- a/aldryn_disqus/locale/de/LC_MESSAGES/django.po +++ b/aldryn_disqus/locale/de/LC_MESSAGES/django.po @@ -7,24 +7,44 @@ msgid "" msgstr "" "Project-Id-Version: cmsplugin-disqus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 15:36+0100\n" -"PO-Revision-Date: 2011-11-14 13:45+0000\n" +"POT-Creation-Date: 2018-02-02 20:01+0330\n" +"PO-Revision-Date: 2018-02-02 20:05+0330\n" "Last-Translator: ojii \n" -"Language-Team: LANGUAGE \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language-Team: \n" +"X-Generator: Poedit 2.0.6\n" -#: cms_plugins.py:12 +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 msgid "Disqus Plugin" msgstr "Disqus Plugin" -#: models.py:10 -msgid "Title" -msgstr "Titel" +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "Kurzer Name" -#: models.py:11 -msgid "Title for your comments, if empty, the page title will be used" -msgstr "Titel der Kommentare. Falls leer wird der Seiten Titel benutzt." +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "Disqus Service" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" +"Bitte aktivieren Sie JavaScript, um die Kommentare von Disqus anzuzeigen. " + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" +msgstr "" +"Blogkommentare powered by Disqus " + +#~ msgid "Title" +#~ msgstr "Titel" + +#~ msgid "Title for your comments, if empty, the page title will be used" +#~ msgstr "Titel der Kommentare. Falls leer wird der Seiten Titel benutzt." diff --git a/aldryn_disqus/locale/en/LC_MESSAGES/django.mo b/aldryn_disqus/locale/en/LC_MESSAGES/django.mo old mode 100644 new mode 100755 diff --git a/aldryn_disqus/locale/en/LC_MESSAGES/django.po b/aldryn_disqus/locale/en/LC_MESSAGES/django.po old mode 100644 new mode 100755 index 9d7bb69..bbd9182 --- a/aldryn_disqus/locale/en/LC_MESSAGES/django.po +++ b/aldryn_disqus/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 15:36+0100\n" +"POT-Creation-Date: 2018-02-02 20:01+0330\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,30 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: cms_plugins.py:12 +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 msgid "Disqus Plugin" msgstr "Disqus Plugin" -#: models.py:10 -msgid "Title" -msgstr "Title" +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "" + +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" +msgstr "" + +#~ msgid "Title" +#~ msgstr "Title" -#: models.py:11 -msgid "Title for your comments, if empty, the page title will be used" -msgstr "Title for your comments, if empty, the page title will be used" +#~ msgid "Title for your comments, if empty, the page title will be used" +#~ msgstr "Title for your comments, if empty, the page title will be used" diff --git a/aldryn_disqus/locale/fa/LC_MESSAGES/django.mo b/aldryn_disqus/locale/fa/LC_MESSAGES/django.mo new file mode 100644 index 0000000..1538de5 Binary files /dev/null and b/aldryn_disqus/locale/fa/LC_MESSAGES/django.mo differ diff --git a/aldryn_disqus/locale/fa/LC_MESSAGES/django.po b/aldryn_disqus/locale/fa/LC_MESSAGES/django.po new file mode 100644 index 0000000..1ce336d --- /dev/null +++ b/aldryn_disqus/locale/fa/LC_MESSAGES/django.po @@ -0,0 +1,44 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 20:02+0330\n" +"PO-Revision-Date: 2018-02-02 19:40+0330\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.0.6\n" + +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 +msgid "Disqus Plugin" +msgstr "پلاگین دیسکاس" + +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "نام کوتاه در Disqus" + +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "سرویس دیسکاس" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" +"لطفا جاوا اسکریپت را فعال کنید تا " +"دیدگاه‌های قدرت گرفته از دیسکاس را مشاهده کنید. " + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" +msgstr "" +"نظرات وبلاگ قدرت گرفته شده توسط دیسکاس " diff --git a/aldryn_disqus/locale/fr/LC_MESSAGES/django.mo b/aldryn_disqus/locale/fr/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index 22f31d9..268743d Binary files a/aldryn_disqus/locale/fr/LC_MESSAGES/django.mo and b/aldryn_disqus/locale/fr/LC_MESSAGES/django.mo differ diff --git a/aldryn_disqus/locale/fr/LC_MESSAGES/django.po b/aldryn_disqus/locale/fr/LC_MESSAGES/django.po old mode 100644 new mode 100755 index cc93c8d..c22710b --- a/aldryn_disqus/locale/fr/LC_MESSAGES/django.po +++ b/aldryn_disqus/locale/fr/LC_MESSAGES/django.po @@ -7,24 +7,45 @@ msgid "" msgstr "" "Project-Id-Version: cmsplugin-disqus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 15:36+0100\n" -"PO-Revision-Date: 2011-11-14 13:45+0000\n" +"POT-Creation-Date: 2018-02-02 20:02+0330\n" +"PO-Revision-Date: 2018-02-02 20:07+0330\n" "Last-Translator: ojii \n" -"Language-Team: LANGUAGE \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language-Team: \n" +"X-Generator: Poedit 2.0.6\n" -#: cms_plugins.py:12 +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 msgid "Disqus Plugin" msgstr "Disqus Plugin" -#: models.py:10 -msgid "Title" -msgstr "Titre" +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "Nom court" -#: models.py:11 -msgid "Title for your comments, if empty, the page title will be used" -msgstr "Titre des commentaires, si vide, le titre de page sera utilisé" +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "Disqus Service" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" +"Veuillez activer JavaScript pour afficher les commentaires générés par Disqus. " + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" +msgstr "" +"commentaires du blog alimentés par Disqus " +"" + +#~ msgid "Title" +#~ msgstr "Titre" + +#~ msgid "Title for your comments, if empty, the page title will be used" +#~ msgstr "Titre des commentaires, si vide, le titre de page sera utilisé" diff --git a/aldryn_disqus/locale/it/LC_MESSAGES/django.mo b/aldryn_disqus/locale/it/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index 117e8c5..3d847bc Binary files a/aldryn_disqus/locale/it/LC_MESSAGES/django.mo and b/aldryn_disqus/locale/it/LC_MESSAGES/django.mo differ diff --git a/aldryn_disqus/locale/it/LC_MESSAGES/django.po b/aldryn_disqus/locale/it/LC_MESSAGES/django.po old mode 100644 new mode 100755 index eaa9b8c..0a0d5b5 --- a/aldryn_disqus/locale/it/LC_MESSAGES/django.po +++ b/aldryn_disqus/locale/it/LC_MESSAGES/django.po @@ -8,25 +8,45 @@ msgid "" msgstr "" "Project-Id-Version: cmsplugin-disqus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 15:36+0100\n" -"PO-Revision-Date: 2011-11-14 14:18+0000\n" +"POT-Creation-Date: 2018-02-02 20:02+0330\n" +"PO-Revision-Date: 2018-02-02 20:08+0330\n" "Last-Translator: evildmp \n" -"Language-Team: LANGUAGE \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language-Team: \n" +"X-Generator: Poedit 2.0.6\n" -#: cms_plugins.py:12 +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 msgid "Disqus Plugin" msgstr "Plugin Disqus" -#: models.py:10 -msgid "Title" -msgstr "Titolo" +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "Nome corto" -#: models.py:11 -msgid "Title for your comments, if empty, the page title will be used" +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "Servizio di Disqus" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" +"Abilitare JavaScript per visualizzare i commenti pubblicati da Disqus. " + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" msgstr "" -"Titolo per i vostri commenti; se vuoto, sarà usato il titolo della pagina" +"commenti del blog basati su Disqus " + +#~ msgid "Title" +#~ msgstr "Titolo" + +#~ msgid "Title for your comments, if empty, the page title will be used" +#~ msgstr "" +#~ "Titolo per i vostri commenti; se vuoto, sarà usato il titolo della pagina" diff --git a/aldryn_disqus/locale/ja/LC_MESSAGES/django.mo b/aldryn_disqus/locale/ja/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index efd7365..17bd041 Binary files a/aldryn_disqus/locale/ja/LC_MESSAGES/django.mo and b/aldryn_disqus/locale/ja/LC_MESSAGES/django.mo differ diff --git a/aldryn_disqus/locale/ja/LC_MESSAGES/django.po b/aldryn_disqus/locale/ja/LC_MESSAGES/django.po old mode 100644 new mode 100755 index 84da7fa..5775c84 --- a/aldryn_disqus/locale/ja/LC_MESSAGES/django.po +++ b/aldryn_disqus/locale/ja/LC_MESSAGES/django.po @@ -7,24 +7,43 @@ msgid "" msgstr "" "Project-Id-Version: cmsplugin-disqus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-14 15:36+0100\n" -"PO-Revision-Date: 2011-11-14 13:45+0000\n" +"POT-Creation-Date: 2018-02-02 20:02+0330\n" +"PO-Revision-Date: 2018-02-02 20:09+0330\n" "Last-Translator: ojii \n" -"Language-Team: LANGUAGE \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Team: \n" +"X-Generator: Poedit 2.0.6\n" -#: cms_plugins.py:12 +#: apps/aldryn_disqus/aldryn_disqus/cms_plugins.py:12 msgid "Disqus Plugin" -msgstr "Disqusのプラグイン" +msgstr "Disqus プラグイン" -#: models.py:10 -msgid "Title" -msgstr "タイトル" +#: apps/aldryn_disqus/aldryn_disqus/models.py:9 +msgid "Shortname" +msgstr "ショートネーム" -#: models.py:11 -msgid "Title for your comments, if empty, the page title will be used" -msgstr "コメントのタイトル。空の場合、ページのタイトルが使用されます。" +#: apps/aldryn_disqus/aldryn_disqus/models.py:21 +msgid "Disqus Service" +msgstr "" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:4 +msgid "" +"Please enable JavaScript to view the comments powered by Disqus." +msgstr "" +" Disqusが提供するコメントを表" +"示するには、JavaScriptを有効にしてください。" + +#: apps/aldryn_disqus/aldryn_disqus/templates/aldryn_disqus/disqus.html:5 +msgid "blog comments powered by Disqus" +msgstr " Disqus のブログコメント" + +#~ msgid "Title" +#~ msgstr "タイトル" + +#~ msgid "Title for your comments, if empty, the page title will be used" +#~ msgstr "コメントのタイトル。空の場合、ページのタイトルが使用されます。" diff --git a/aldryn_disqus/migrations/0002_auto_20180202_1919.py b/aldryn_disqus/migrations/0002_auto_20180202_1919.py new file mode 100644 index 0000000..268fae7 --- /dev/null +++ b/aldryn_disqus/migrations/0002_auto_20180202_1919.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('aldryn_disqus', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='DisqusService', + fields=[ + ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), + ('shortname', models.CharField(verbose_name='Shortname', max_length=100, blank=True, unique=True)), + ], + ), + migrations.AlterField( + model_name='disqusplugin', + name='cmsplugin_ptr', + field=models.OneToOneField(primary_key=True, to='cms.CMSPlugin', related_name='aldryn_disqus_disqusplugin', serialize=False, auto_created=True, parent_link=True), + ), + migrations.AddField( + model_name='disqusplugin', + name='disqus', + field=models.ForeignKey(to='aldryn_disqus.DisqusService', on_delete=django.db.models.deletion.SET_NULL, blank=True, verbose_name='Disqus Service', null=True), + ), + ] diff --git a/aldryn_disqus/models.py b/aldryn_disqus/models.py index 6d67e87..0ef05a1 100644 --- a/aldryn_disqus/models.py +++ b/aldryn_disqus/models.py @@ -1,7 +1,30 @@ # -*- coding: utf-8 -*- from cms.models.pluginmodel import CMSPlugin +from django.db import models +from django.utils.translation import ugettext_lazy as _ +class DisqusService(models.Model): + shortname = models.CharField( + verbose_name=_('Shortname'), + unique=True, + blank=True, + max_length=100 + ) + + def __str__(self): + return '{}'.format(self.shortname) + class DisqusPlugin(CMSPlugin): + disqus = models.ForeignKey( + DisqusService, + verbose_name=_('Disqus Service'), + on_delete=models.SET_NULL, + blank=True, null=True + ) + + def __str__(self): + return '{}'.format(self.disqus) - pass + def copy_relations(self, old_instance): + self.disqus = old_instance.disqus diff --git a/aldryn_disqus/templates/aldryn_disqus/disqus.html b/aldryn_disqus/templates/aldryn_disqus/disqus.html index 3e87355..bc9879e 100644 --- a/aldryn_disqus/templates/aldryn_disqus/disqus.html +++ b/aldryn_disqus/templates/aldryn_disqus/disqus.html @@ -1,8 +1,9 @@ -{% load sekizai_tags %} +{% load i18n sekizai_tags %}
- -blog comments powered by Disqus + +{% trans 'blog comments powered by Disqus' %} + {% addtoblock "js" %}