Skip to content
3 changes: 1 addition & 2 deletions cmsplugin_socialsharekit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
__version__ = "0.0.4"

2 changes: 1 addition & 1 deletion cmsplugin_socialsharekit/cms_plugins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-


from django.contrib import admin
from django.conf import settings
Expand Down
8 changes: 4 additions & 4 deletions cmsplugin_socialsharekit/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals



from django.db import migrations, models

Expand Down Expand Up @@ -27,7 +27,7 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='SocialShareKitPlugin',
fields=[
('cmsplugin_ptr', models.OneToOneField(primary_key=True, serialize=False, to='cms.CMSPlugin', parent_link=True, auto_created=True, related_name='cmsplugin_socialsharekit_socialsharekitplugin')),
('cmsplugin_ptr', models.OneToOneField(on_delete=models.deletion.CASCADE, primary_key=True, serialize=False, to='cms.CMSPlugin', parent_link=True, auto_created=True, related_name='cmsplugin_socialsharekit_socialsharekitplugin')),
('size', models.CharField(verbose_name='size', max_length=2, default='sm', choices=[('xs', 'Extra Small'), ('s', 'Small'), ('sm', 'Regular'), ('lg', 'Large')])),
('style', models.CharField(verbose_name='style', max_length=10, default='square', choices=[('square', 'Square'), ('round', 'Round'), ('rounded', 'Rounded')])),
('count', models.BooleanField(verbose_name='count', default=False)),
Expand All @@ -46,6 +46,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='socialbutton',
name='plugin',
field=models.ForeignKey(to='cmsplugin_socialsharekit.SocialShareKitPlugin', related_name='buttons'),
field=models.ForeignKey(on_delete=models.deletion.CASCADE, to='cmsplugin_socialsharekit.SocialShareKitPlugin', related_name='buttons'),
),
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals



from django.db import migrations, models

Expand Down
5 changes: 3 additions & 2 deletions cmsplugin_socialsharekit/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-


from django.db import models
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -32,7 +32,8 @@ class SocialButton(models.Model):
'cmsplugin_socialsharekit.SocialShareKitPlugin',
related_name="buttons",
blank=False,
null=False
null=False,
on_delete=models.CASCADE,
)
order = models.PositiveIntegerField(
default=0,
Expand Down
2 changes: 1 addition & 1 deletion cmsplugin_socialsharekit/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-


from django.utils.translation import ugettext_lazy as _

Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@
{% if instance.align_width %} style="width:{{ instance.align_width }}"{% endif %}
id="ssk-{{ instance.pk }}">
{% for socialbutton in instance.buttons.all %}
<a href="" class="ssk
ssk-{{ socialbutton.button }}
{% if socialbutton.icononly and not instance.greyscale %} ssk-icon{% endif %}
{% if socialbutton.text %} ssk-text{% endif %}">
<a href=""
role="button"
aria-label="Share to {{ socialbutton.button }}"
class="ssk
ssk-{{ socialbutton.button }}
{% if socialbutton.icononly and not instance.greyscale %} ssk-icon{% endif %}
{% if socialbutton.text %} ssk-text{% endif %}">
{% if socialbutton.text %}{{ socialbutton.text|safe }}{% endif %}</a>
{% endfor %}
</div>
{% endspaceless %}

{% addtoblock "css" %}<link rel="stylesheet" href="{% static 'cmsplugin_socialsharekit/css/social-share-kit.css' %}">{% endaddtoblock %}
{# CSS #}
{#This does not work with django compressor and compressor.contrib.sekizai.compress#}
{#{% addtoblock "css" %}<link rel="preload" href="{% static 'cmsplugin_socialsharekit/fonts/social-share-kit.woff' %}" as="font" type="font/woff" crossorigin="anonymous">{% endaddtoblock %}#}
{% addtoblock "css" %}<link rel="stylesheet" href="{% static 'cmsplugin_socialsharekit/css/social-share-kit.min.css' %}">{% endaddtoblock %}

{# JS #}
{% addtoblock "js" %}<script src="{% static 'cmsplugin_socialsharekit/js/social-share-kit.min.js' %}"></script>{% endaddtoblock %}
{% addtoblock "js" %}
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

import json
from pprint import pprint

Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-


from setuptools import setup, find_packages
from cmsplugin_socialsharekit import __version__

REQUIREMENTS = [
'Django>=1.8,<1.10',
'Django>=1.11',
'django-admin-sortable2>=0.6.10',
'django-cms>=3.3',
]
Expand All @@ -18,16 +17,18 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development',
]

setup(
name='cmsplugin-socialsharekit',
version=__version__,
version="0.2.1",
description='Allows embeding Social Share Kit into the site',
author='Mathieu Meylan',
author_email='m.meylan@gmail.com',
Expand Down