-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
108 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from django.conf import settings | ||
|
||
_default_js = ('fluentcms_cookielaw/js/cookielaw.js',) | ||
_default_js = ("fluentcms_cookielaw/js/cookielaw.js",) | ||
|
||
# Allow overriding the complete FrontendMedia definition | ||
FLUENTCMS_COOKIELAW_JS = getattr(settings, 'FLUENTCMS_COOKIELAW_JS', _default_js) | ||
FLUENTCMS_COOKIELAW_CSS = getattr(settings, 'FLUENTCMS_COOKIELAW_CSS', {}) | ||
FLUENTCMS_COOKIELAW_JS = getattr(settings, "FLUENTCMS_COOKIELAW_JS", _default_js) | ||
FLUENTCMS_COOKIELAW_CSS = getattr(settings, "FLUENTCMS_COOKIELAW_CSS", {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
from django.db import models, migrations | ||
import fluent_contents.extensions | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fluent_contents', '0001_initial'), | ||
("fluent_contents", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CookieLawItem', | ||
name="CookieLawItem", | ||
fields=[ | ||
('contentitem_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='fluent_contents.ContentItem', on_delete=models.CASCADE)), | ||
('text', fluent_contents.extensions.PluginHtmlField(help_text="For example: 'We use cookies to ensure you get the best experience on our website'", verbose_name='Text')), | ||
('button_text', models.CharField(max_length=100, verbose_name='Button text')), | ||
( | ||
"contentitem_ptr", | ||
models.OneToOneField( | ||
parent_link=True, | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="fluent_contents.ContentItem", | ||
on_delete=models.CASCADE, | ||
), | ||
), | ||
( | ||
"text", | ||
fluent_contents.extensions.PluginHtmlField( | ||
help_text="For example: 'We use cookies to ensure you get the best experience on our website'", | ||
verbose_name="Text", | ||
), | ||
), | ||
("button_text", models.CharField(max_length=100, verbose_name="Button text")), | ||
], | ||
options={ | ||
'db_table': 'contentitem_fluentcms_cookielaw_cookielawitem', | ||
'verbose_name': 'Cookie notification', | ||
'verbose_name_plural': 'Cookie notifications', | ||
"db_table": "contentitem_fluentcms_cookielaw_cookielawitem", | ||
"verbose_name": "Cookie notification", | ||
"verbose_name_plural": "Cookie notifications", | ||
}, | ||
bases=('fluent_contents.contentitem',), | ||
bases=("fluent_contents.contentitem",), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[tool.isort] | ||
profile = "black" | ||
line_length = 99 | ||
|
||
[tool.black] | ||
line-length = 99 | ||
exclude = ''' | ||
/( | ||
\.git | ||
| \.venv | ||
| \.tox | ||
| dist | ||
)/ | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
#!/usr/bin/env python | ||
from setuptools import setup, find_packages | ||
from os import path | ||
import codecs | ||
import os | ||
import re | ||
import sys | ||
from os import path | ||
|
||
from setuptools import find_packages, setup | ||
|
||
# When creating the sdist, make sure the django.mo file also exists: | ||
if 'sdist' in sys.argv or 'develop' in sys.argv: | ||
os.chdir('fluentcms_cookielaw') | ||
if "sdist" in sys.argv or "develop" in sys.argv: | ||
os.chdir("fluentcms_cookielaw") | ||
try: | ||
from django.core import management | ||
management.call_command('compilemessages', stdout=sys.stderr, verbosity=1) | ||
|
||
management.call_command("compilemessages", stdout=sys.stderr, verbosity=1) | ||
except ImportError: | ||
if 'sdist' in sys.argv: | ||
if "sdist" in sys.argv: | ||
raise | ||
finally: | ||
os.chdir('..') | ||
os.chdir("..") | ||
|
||
|
||
def read(*parts): | ||
file_path = path.join(path.dirname(__file__), *parts) | ||
return codecs.open(file_path, encoding='utf-8').read() | ||
return codecs.open(file_path, encoding="utf-8").read() | ||
|
||
|
||
def find_version(*parts): | ||
|
@@ -34,49 +35,43 @@ def find_version(*parts): | |
|
||
|
||
setup( | ||
name='fluentcms-cookielaw', | ||
version=find_version('fluentcms_cookielaw', '__init__.py'), | ||
license='Apache 2.0', | ||
|
||
name="fluentcms-cookielaw", | ||
version=find_version("fluentcms_cookielaw", "__init__.py"), | ||
license="Apache 2.0", | ||
install_requires=[ | ||
'django-fluent-contents>=2.0', # Need frontend_media support. | ||
"django-fluent-contents>=2.0", # Need frontend_media support. | ||
], | ||
requires=[ | ||
'Django (>=1.10)', | ||
"Django (>=1.10)", | ||
], | ||
|
||
description='A cookie notification banner for django-fluent-contents', | ||
long_description=read('README.rst'), | ||
|
||
author='Diederik van der Boor', | ||
author_email='[email protected]', | ||
|
||
url='https://github.com/edoburu/fluentcms-cookielaw', | ||
download_url='https://github.com/edoburu/fluentcms-cookielaw/zipball/master', | ||
|
||
packages=find_packages(exclude=('example*',)), | ||
description="A cookie notification banner for django-fluent-contents", | ||
long_description=read("README.rst"), | ||
author="Diederik van der Boor", | ||
author_email="[email protected]", | ||
url="https://github.com/edoburu/fluentcms-cookielaw", | ||
download_url="https://github.com/edoburu/fluentcms-cookielaw/zipball/master", | ||
packages=find_packages(exclude=("example*",)), | ||
include_package_data=True, | ||
|
||
zip_safe=False, | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.6', | ||
'Framework :: Django', | ||
'Framework :: Django :: 1.10', | ||
'Framework :: Django :: 1.11', | ||
'Framework :: Django :: 2.0', | ||
'Topic :: Internet :: WWW/HTTP', | ||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
] | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Framework :: Django", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.6", | ||
"Framework :: Django", | ||
"Framework :: Django :: 1.10", | ||
"Framework :: Django :: 1.11", | ||
"Framework :: Django :: 2.0", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
], | ||
) |