├── aldryn_newsblog ├── migrations │ ├── __init__.py │ ├── 0009_auto_20160211_1022.py │ ├── 0002_newsblogconfig_template_prefix.py │ ├── 0004_auto_20150622_1606.py │ ├── 0015_auto_20161208_0403.py │ ├── 0005_auto_20150807_0207.py │ ├── 0003_auto_20150422_1921.py │ ├── 0008_auto_20160106_1735.py │ ├── 0010_auto_20160316_0935.py │ ├── 0006_auto_20160105_1013.py │ ├── 0014_auto_20160821_1156.py │ ├── 0013_auto_20160623_1703.py │ ├── 0011_auto_20160412_1622.py │ ├── 0016_auto_20180329_1417.py │ ├── 0012_auto_20160503_1626.py │ └── 0007_default_newsblog_config.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── rebuild_article_search_data.py ├── sitemaps │ ├── __init__.py │ └── sitemap.py ├── tests │ ├── templates │ │ └── aldryn_newsblog │ │ │ └── dummy │ │ │ ├── article_list.html │ │ │ ├── article_detail.html │ │ │ └── plugins │ │ │ └── latest_articles.html │ ├── static │ │ └── featured_image.jpg │ ├── frontend │ │ ├── integration │ │ │ ├── handlers │ │ │ │ ├── loadFailures.js │ │ │ │ ├── pageErrors.js │ │ │ │ ├── externalMissing.js │ │ │ │ ├── missingPages.js │ │ │ │ └── suiteFailures.js │ │ │ ├── setup.js │ │ │ └── related-articles.js │ │ ├── .eslintrc.js │ │ ├── casperjs.conf.js │ │ ├── fixtures │ │ │ └── search.html │ │ ├── karma.conf.js │ │ └── unit │ │ │ └── test.cl.newsblog.js │ ├── test_managers.py │ ├── browser │ │ └── test_aldryn_newsblog.py │ ├── test_commands.py │ ├── test_admin.py │ ├── test_i18n.py │ ├── test_cms_wizards.py │ ├── test_search.py │ ├── test_utils.py │ ├── test_feeds.py │ └── test_sitemaps.py ├── locale │ ├── cs │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── de │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── en │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── es │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── fa │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── fr │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── it │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── lt │ │ └── LC_MESSAGES │ │ │ └── django.mo │ └── nl │ │ └── LC_MESSAGES │ │ └── django.mo ├── boilerplates │ └── bootstrap3 │ │ ├── templates │ │ └── aldryn_newsblog │ │ │ ├── base.html │ │ │ ├── plugins │ │ │ ├── featured_articles.html │ │ │ ├── latest_articles.html │ │ │ ├── authors.html │ │ │ ├── related_articles.html │ │ │ ├── tags.html │ │ │ ├── categories.html │ │ │ ├── article_search.html │ │ │ └── archive.html │ │ │ ├── fullwidth.html │ │ │ ├── article_list.html │ │ │ ├── two_column.html │ │ │ ├── includes │ │ │ ├── search_results.html │ │ │ ├── author.html │ │ │ ├── article.html │ │ │ └── pagination.html │ │ │ └── article_detail.html │ │ ├── private │ │ └── img │ │ │ ├── future.psd │ │ │ └── unpublished.psd │ │ └── static │ │ ├── img │ │ └── aldryn_newsblog │ │ │ ├── future.png │ │ │ ├── no-photo.png │ │ │ └── unpublished.png │ │ ├── css │ │ └── aldryn-newsblog │ │ │ └── article.css │ │ └── js │ │ └── addons │ │ └── cl.newsblog.js ├── apps.py ├── __init__.py ├── compat.py ├── utils │ ├── __init__.py │ └── migration.py ├── templates │ └── aldryn_newsblog │ │ ├── base.html │ │ ├── plugins │ │ ├── latest_articles.html │ │ ├── featured_articles.html │ │ ├── authors.html │ │ ├── related_articles.html │ │ ├── article_search.html │ │ ├── tags.html │ │ ├── categories.html │ │ └── archive.html │ │ ├── article_list.html │ │ ├── includes │ │ ├── author.html │ │ ├── search_results.html │ │ ├── article.html │ │ └── pagination.html │ │ └── article_detail.html ├── cms_apps.py ├── search_indexes.py ├── cms_menus.py ├── forms.py ├── feeds.py ├── urls.py ├── cms_wizards.py ├── managers.py ├── cms_toolbars.py ├── cms_appconfig.py └── admin.py ├── requirements.in ├── runserver.sh ├── browserslist ├── coverage.sh ├── addon.json ├── docs ├── images │ ├── tags.png │ ├── authors.png │ ├── news-archive.png │ └── news-page-example.jpg ├── upgrade.rst ├── requirements.txt ├── spelling_wordlist ├── how-to │ ├── index.rst │ ├── search.rst │ ├── plugins.rst │ ├── customising_news_output.rst │ ├── basic_usage.rst │ └── apphook_configurations.rst ├── index.rst ├── contributing.rst └── introduction.rst ├── test ├── updatetranslations.sh ├── .tx └── config ├── MANIFEST.in ├── .coveragerc ├── .editorconfig ├── package.json ├── test_requirements.txt ├── aldryn_config.py ├── .gitignore ├── .circleci ├── Dockerfile └── config.yml ├── LICENSE.txt ├── tox.ini ├── setup.py ├── gulpfile.js ├── README.rst ├── test_settings.py └── .eslintrc.js /aldryn_newsblog/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | aldryn-newsblog 2 | -------------------------------------------------------------------------------- /aldryn_newsblog/management/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /runserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python test_settings.py server & 4 | -------------------------------------------------------------------------------- /aldryn_newsblog/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /browserslist: -------------------------------------------------------------------------------- 1 | # Browsers that we support 2 | 3 | last 2 versions 4 | ie >= 9 5 | -------------------------------------------------------------------------------- /aldryn_newsblog/sitemaps/__init__.py: -------------------------------------------------------------------------------- 1 | from .sitemap import NewsBlogSitemap # NOQA 2 | -------------------------------------------------------------------------------- /coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | coverage run test_settings.py && coverage report -m 4 | -------------------------------------------------------------------------------- /addon.json: -------------------------------------------------------------------------------- 1 | { 2 | "package-name": "aldryn-newsblog", 3 | "installed-apps": [] 4 | } 5 | -------------------------------------------------------------------------------- /docs/images/tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/docs/images/tags.png -------------------------------------------------------------------------------- /docs/images/authors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/docs/images/authors.png -------------------------------------------------------------------------------- /aldryn_newsblog/tests/templates/aldryn_newsblog/dummy/article_list.html: -------------------------------------------------------------------------------- 1 | This is dummy article list page 2 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/templates/aldryn_newsblog/dummy/article_detail.html: -------------------------------------------------------------------------------- 1 | This is dummy article detail page 2 | -------------------------------------------------------------------------------- /docs/images/news-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/docs/images/news-archive.png -------------------------------------------------------------------------------- /aldryn_newsblog/tests/templates/aldryn_newsblog/dummy/plugins/latest_articles.html: -------------------------------------------------------------------------------- 1 | This is dummy latest articles plugin 2 | -------------------------------------------------------------------------------- /docs/images/news-page-example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/docs/images/news-page-example.jpg -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | djangocms-helper aldryn_newsblog --cms test --boilerplate --extra-settings=test_settings $@ 4 | -------------------------------------------------------------------------------- /aldryn_newsblog/locale/cs/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/cs/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/de/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/de/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/es/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/es/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/fa/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/fa/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/fr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/fr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/it/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/it/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/lt/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/lt/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /aldryn_newsblog/tests/static/featured_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/tests/static/featured_image.jpg -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/base.html: -------------------------------------------------------------------------------- 1 | {% extends CMS_TEMPLATE %} 2 | 3 | {% block content %}{% endblock content %} 4 | -------------------------------------------------------------------------------- /updatetranslations.sh: -------------------------------------------------------------------------------- 1 | cd aldryn_newsblog 2 | django-admin.py makemessages -l en 3 | tx push -s -l en 4 | tx pull -f -a 5 | django-admin.py compilemessages 6 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/private/img/future.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/boilerplates/bootstrap3/private/img/future.psd -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/private/img/unpublished.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/boilerplates/bootstrap3/private/img/unpublished.psd -------------------------------------------------------------------------------- /aldryn_newsblog/apps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from django.apps import AppConfig 3 | 4 | 5 | class AldrynNewsBlog(AppConfig): 6 | name = 'aldryn_newsblog' 7 | verbose_name = 'Aldryn News & Blog' 8 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/future.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/future.png -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/no-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/no-photo.png -------------------------------------------------------------------------------- /aldryn_newsblog/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | 6 | __version__ = '2.2.1' 7 | 8 | 9 | default_app_config = 'aldryn_newsblog.apps.AldrynNewsBlog' 10 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/unpublished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divio/aldryn-newsblog/HEAD/aldryn_newsblog/boilerplates/bootstrap3/static/img/aldryn_newsblog/unpublished.png -------------------------------------------------------------------------------- /docs/upgrade.rst: -------------------------------------------------------------------------------- 1 | .. _upgrading: 2 | 3 | ######### 4 | Upgrading 5 | ######### 6 | 7 | The `changelog `_ 8 | is maintained and updated within the repository. 9 | -------------------------------------------------------------------------------- /aldryn_newsblog/compat.py: -------------------------------------------------------------------------------- 1 | def toolbar_edit_mode_active(request): 2 | try: 3 | # cms 3.4.5 compat 4 | return request.toolbar.edit_mode 5 | except AttributeError: 6 | return request.toolbar.edit_mode_active 7 | -------------------------------------------------------------------------------- /aldryn_newsblog/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from .utilities import ( # NOQA 4 | add_prefix_to_path, default_reverse, get_cleaned_bits, get_field_value, 5 | get_plugin_index_data, get_request, strip_tags, 6 | ) 7 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | -f http://simple.crate.io/ 2 | MarkupSafe==0.23 3 | Pygments==2.0.2 4 | Sphinx==1.3.1 5 | aldryn-newsblog 6 | 7 | sphinx-autobuild==0.5.2 8 | sphinx_rtd_theme # always use latest version of the theme 9 | sphinxcontrib-spelling 10 | pyenchant -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/base.html: -------------------------------------------------------------------------------- 1 | {% extends CMS_TEMPLATE %} 2 | 3 | {% block content %} 4 | {% block newsblog_content %} 5 | {# article_list.html and article_detail.html extend this template #} 6 | {% endblock %} 7 | {% endblock content %} 8 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [aldryn-newsblog.aldryn_newsblog] 5 | file_filter = aldryn_newsblog/locale//LC_MESSAGES/django.po 6 | source_file = aldryn_newsblog/locale/en/LC_MESSAGES/django.po 7 | source_lang = en 8 | type = PO 9 | 10 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE.txt 2 | include README.rst 3 | recursive-include aldryn_newsblog/locale * 4 | recursive-include aldryn_newsblog/static * 5 | recursive-include aldryn_newsblog/templates * 6 | recursive-include aldryn_newsblog/boilerplates * 7 | recursive-exclude * *.py[co] 8 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/latest_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% for article in article_list %} 4 | {% include "aldryn_newsblog/includes/article.html" with namespace=instance.app_config.namespace %} 5 | {% empty %} 6 |

{% trans "No items available" %}

7 | {% endfor %} 8 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/featured_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% for article in articles_list %} 4 | {% include "aldryn_newsblog/includes/article.html" with namespace=instance.app_config.namespace %} 5 | {% empty %} 6 |

{% trans "No items available" %}

7 | {% endfor %} 8 | -------------------------------------------------------------------------------- /docs/spelling_wordlist: -------------------------------------------------------------------------------- 1 | addon 2 | Admin 3 | admin 4 | Aldryn 5 | app 6 | apphook 7 | apphooks 8 | Apps 9 | Backend 10 | Blog 11 | CMS 12 | Divio 13 | django 14 | excecute 15 | Frontend 16 | frontend 17 | i 18 | placeholder 19 | placeholders 20 | plugins 21 | py 22 | settings 23 | setup 24 | toolbar 25 | weblog 26 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | source = aldryn_newsblog 4 | omit = 5 | migrations/* 6 | tests/* 7 | 8 | [report] 9 | exclude_lines = 10 | pragma: no cover 11 | def __repr__ 12 | if self.debug: 13 | if settings.DEBUG 14 | raise AssertionError 15 | raise NotImplementedError 16 | if 0: 17 | if __name__ == .__main__.: 18 | ignore_errors = True 19 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/featured_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 8 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/authors.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 12 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/handlers/loadFailures.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // Handles load failure errors 5 | 6 | module.exports = { 7 | bind: function () { 8 | casper.on('load.failed', function (error) { 9 | casper.echo(JSON.stringify(error), 'ERROR'); 10 | }); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/handlers/pageErrors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // Handles JavaScript page errors 5 | 6 | module.exports = { 7 | bind: function () { 8 | casper.on('page.error', function (msg) { 9 | casper.echo('Error on page: ' + JSON.stringify(msg), 'ERROR'); 10 | }); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/latest_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 | {% for article in article_list %} 5 | {% include "aldryn_newsblog/includes/article.html" with namespace=instance.app_config.namespace %} 6 | {% empty %} 7 |

{% trans "No items available" %}

8 | {% endfor %} 9 |
10 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/article_list.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/base.html" %} 2 | {% load i18n %} 3 | 4 | {% block newsblog_content %} 5 | {% for article in article_list %} 6 | {% include "aldryn_newsblog/includes/article.html" %} 7 | {% empty %} 8 |

{% trans "No items available" %}

9 | {% endfor %} 10 | 11 | {% include "aldryn_newsblog/includes/pagination.html" %} 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/handlers/externalMissing.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // Handles external resources load failures 5 | 6 | module.exports = { 7 | bind: function () { 8 | casper.on('resource.error', function (resource) { 9 | casper.echo('Resource failed to load: ' + resource.url, 'ERROR'); 10 | }); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/static/css/aldryn-newsblog/article.css: -------------------------------------------------------------------------------- 1 | .aldryn-newsblog-article-search .results-list .unpublished, 2 | .aldryn-newsblog-article.unpublished { 3 | background: #f9fcee url('../../img/aldryn_newsblog/unpublished.png') repeat; /* hsl(44, 70%, 97%) */ 4 | } 5 | 6 | .aldryn-newsblog-article-search .results-list .future, 7 | .aldryn-newsblog-article.future { 8 | background: #eefcfc url('../../img/aldryn_newsblog/future.png') repeat; /* hsl(181, 70%, 96%) */ 9 | } 10 | -------------------------------------------------------------------------------- /docs/how-to/index.rst: -------------------------------------------------------------------------------- 1 | .. _how_to: 2 | 3 | ########### 4 | How-to 5 | ########### 6 | 7 | .. note: 8 | 9 | Before using Aldryn News & Blog, you need to :ref:`set up your django CMS project appropriately 10 | ` (in short, making sure that you have a page with a News & Blog apphook - this 11 | only takes a moment). 12 | 13 | 14 | .. toctree:: 15 | :maxdepth: 1 16 | 17 | basic_usage 18 | plugins 19 | apphook_configurations 20 | customising_news_output 21 | search 22 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/setup.js: -------------------------------------------------------------------------------- 1 | // ############################################################################# 2 | // Init all settings and event handlers on suite start 3 | 'use strict'; 4 | 5 | require('./../casperjs.conf').init(); 6 | 7 | require('./handlers/pageErrors').bind(); 8 | require('./handlers/loadFailures').bind(); 9 | require('./handlers/missingPages').bind(); 10 | require('./handlers/externalMissing').bind(); 11 | require('./handlers/suiteFailures').bind(); 12 | 13 | casper.test.done(); 14 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/related_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% if article %} 4 |
    5 | {% for article in article_list %} 6 |
  • 7 |

    {{ article.title }}

    8 |

    {% trans "by" %} {{ article.author }} {{ article.publishing_date|date }}

    9 |
  • 10 | {% empty %} 11 |
  • {% trans "No items available" %}
  • 12 | {% endfor %} 13 |
14 | {% endif %} 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | max_line_length = 80 13 | 14 | [*.py] 15 | max_line_length = 120 16 | quote_type = single 17 | 18 | [*.{scss,js,html}] 19 | max_line_length = 120 20 | indent_style = space 21 | quote_type = double 22 | 23 | [*.js] 24 | max_line_length = 120 25 | quote_type = single 26 | 27 | [*.rst] 28 | max_line_length = 80 29 | 30 | [*.yml] 31 | indent_size = 2 32 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/authors.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 |
    5 | {% for author in authors_list %} 6 |
  • 7 | {% include "aldryn_newsblog/includes/author.html" with author_view="true" namespace=instance.app_config.namespace %} 8 |
  • 9 | {% empty %} 10 |
  • {% trans "No items available" %}
  • 11 | {% endfor %} 12 |
13 |
14 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/handlers/missingPages.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // Handles 404 and 500 pages 5 | 6 | module.exports = { 7 | bind: function () { 8 | casper.on('http.status.404', function (resource) { 9 | casper.echo('404 page found: ' + resource.url, 'ERROR'); 10 | }); 11 | 12 | casper.on('http.status.500', function (resource) { 13 | casper.echo('500 page found: ' + resource.url, 'ERROR'); 14 | }); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0009_auto_20160211_1022.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.1 on 2016-02-11 10:22 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('aldryn_newsblog', '0008_auto_20160106_1735'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='article', 17 | name='is_published', 18 | field=models.BooleanField(db_index=True, default=False, verbose_name='is published'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0002_newsblogconfig_template_prefix.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='newsblogconfig', 16 | name='template_prefix', 17 | field=models.CharField(max_length=20, null=True, verbose_name='Prefix for template dirs', blank=True), 18 | preserve_default=True, 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0004_auto_20150622_1606.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0003_auto_20150422_1921'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='newsblogconfig', 16 | name='template_prefix', 17 | field=models.CharField(max_length=20, null=True, verbose_name='Prefix for template dirs', blank=True), 18 | preserve_default=True, 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package", 3 | "private": true, 4 | "devDependencies": { 5 | "djangocms-casper-helpers": "^3.0.0", 6 | "gulp": "3.9.0", 7 | "gulp-eslint": "^2.0.0", 8 | "gulp-util": "3.0.6", 9 | "jasmine-core": "2.3.4", 10 | "karma": "^0.13.15", 11 | "karma-coverage": "^0.5.3", 12 | "karma-coveralls": "^1.1.2", 13 | "karma-fixture": "^0.2.5", 14 | "karma-html2js-preprocessor": "^0.1.0", 15 | "karma-jasmine": "^0.3.6", 16 | "karma-json-fixtures-preprocessor": "0.0.4", 17 | "karma-phantomjs-launcher": "^1.0.0", 18 | "minimist": "1.1.1", 19 | "phantomjs-prebuilt": "^2.1.7" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/fullwidth.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/base.html" %} 2 | {% load i18n cms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 |
8 |
9 | {% block newsblog_content %}{% endblock %} 10 |
11 |
12 |
13 | 14 |
15 | {% block newsblog_footer %}{% endblock %} 16 |
17 |
18 | {% endblock content %} 19 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0015_auto_20161208_0403.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | import sortedm2m.fields 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('aldryn_newsblog', '0014_auto_20160821_1156'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='article', 18 | name='related', 19 | field=sortedm2m.fields.SortedManyToManyField(help_text=None, to='aldryn_newsblog.Article', verbose_name='related articles', blank=True), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/article_search.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {# submission of this form will forward to "includes/search_results.html" #} 4 | {# this form can also be submitted using ajax and "includes/search_results.html" is returned #} 5 |
6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0005_auto_20150807_0207.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0004_auto_20150622_1606'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='newsblogconfig', 16 | name='template_prefix', 17 | field=models.CharField(blank=True, max_length=20, null=True, verbose_name='Prefix for template dirs', choices=[(b'dummy', b'dummy')]), 18 | preserve_default=True, 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/article_list.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/two_column.html" %} 2 | {% load i18n cms_tags %} 3 | 4 | {% block newsblog_content %} 5 |
6 | {% for article in article_list %} 7 | {% include "aldryn_newsblog/includes/article.html" %} 8 | {% empty %} 9 |

{% trans "No items available" %}

10 | {% endfor %} 11 |
12 | {% endblock %} 13 | 14 | {% block newsblog_footer %} 15 |
16 | {% include "aldryn_newsblog/includes/pagination.html" %} 17 |
18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0003_auto_20150422_1921.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0002_newsblogconfig_template_prefix'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='newsblogconfig', 16 | name='template_prefix', 17 | field=models.CharField(blank=True, max_length=20, null=True, verbose_name='Prefix for template dirs', choices=[(b'dummy', b'dummy')]), 18 | preserve_default=True, 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/tags.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 | 16 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/categories.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 | 14 | -------------------------------------------------------------------------------- /test_requirements.txt: -------------------------------------------------------------------------------- 1 | #aldryn-apphooks-config 2 | https://github.com/vThaian/aldryn-apphooks-config/archive/fixes-for-django-20-and-up.zip 3 | 4 | aldryn-categories 5 | aldryn-people 6 | django-haystack 7 | aldryn-boilerplates 8 | django-taggit 9 | 10 | # NOTE: These are for Filer 11 | django-mptt 12 | django_polymorphic 13 | 14 | aldryn-search>=0.2.12 15 | coverage>=3.7.1 16 | dj-database-url 17 | django-classy-tags 18 | django-sekizai 19 | django-treebeard>=2.0 20 | djangocms-admin-style 21 | djangocms-helper 22 | djangocms-text-ckeditor 23 | docopt 24 | flake8 25 | tox>=2.9.1 26 | pyflakes 27 | selenium 28 | python-dateutil 29 | 30 | # docs 31 | sphinx 32 | sphinx-rtd-theme 33 | 34 | sphinxcontrib-spelling 35 | pyenchant 36 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/related_articles.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% if article %} 4 | 16 | {% endif %} 17 | -------------------------------------------------------------------------------- /aldryn_newsblog/cms_apps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from django.utils.translation import ugettext_lazy as _ 6 | 7 | from cms.apphook_pool import apphook_pool 8 | 9 | from aldryn_apphooks_config.app_base import CMSConfigApp 10 | 11 | from aldryn_newsblog.cms_appconfig import NewsBlogConfig 12 | 13 | 14 | @apphook_pool.register 15 | class NewsBlogApp(CMSConfigApp): 16 | name = _('NewsBlog') 17 | app_name = 'aldryn_newsblog' 18 | app_config = NewsBlogConfig 19 | 20 | def get_urls(self, page=None, language=None, **kwargs): 21 | return ['aldryn_newsblog.urls'] 22 | 23 | # NOTE: Please do not add a «menu» here, menu’s should only be added by at 24 | # the discretion of the operator. 25 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/includes/author.html: -------------------------------------------------------------------------------- 1 | {% load i18n staticfiles thumbnail apphooks_config_tags %} 2 | 3 | {% if author %} 4 |

5 | 6 | {% if author.visual %} 7 | {% thumbnail author.visual "50x50" crop upscale subject_location=author.visual.subject_location as author_image %} 8 | {{ author.name }} 9 | {% endif %} 10 | {{ author.name }} 11 | 12 |

13 | {% if author.function %}

{{ author.function }}

{% endif %} 14 | {% if author.article_count %}

{{ author.article_count }}

{% endif %} 15 | {% endif %} 16 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "node": true 4 | }, 5 | "globals": { 6 | "$": true, 7 | "module": true, 8 | "process": true, 9 | "it": true, 10 | "CMS": true, 11 | "expect": true, 12 | "jasmine": true, 13 | "describe": true, 14 | "casper": true, 15 | "beforeEach": true, 16 | "afterEach": true, 17 | "beforeAll": true, 18 | "afterAll": true, 19 | "spyOn": true, 20 | "spyOnEvent": true, 21 | "fixture": true, 22 | "pending": true 23 | }, 24 | "rules": { 25 | "no-magic-numbers": 0, 26 | "max-nested-callbacks": [2, 8], 27 | "newline-after-var": 0, 28 | "strict": [2, "global"] 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /aldryn_config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from aldryn_client import forms 3 | 4 | 5 | class Form(forms.BaseForm): 6 | 7 | def to_settings(self, data, settings): 8 | # from functools import partial 9 | # from aldryn_addons.utils import boolean_ish, djsenv 10 | # env = partial(djsenv, settings=settings) 11 | 12 | settings['INSTALLED_APPS'].extend([ 13 | 'aldryn_apphooks_config', 14 | 'aldryn_boilerplates', 15 | 'aldryn_categories', 16 | 'aldryn_common', 17 | 'aldryn_newsblog', 18 | 'aldryn_people', 19 | 'aldryn_translation_tools', 20 | 'easy_thumbnails', 21 | 'filer', 22 | 'sortedm2m', 23 | 'taggit', 24 | 'treebeard' 25 | ]) 26 | return settings 27 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/casperjs.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // CasperJS options 5 | 6 | module.exports = { 7 | init: function () { 8 | this.viewportSize(); 9 | this.timeout(20000); 10 | }, 11 | 12 | viewportSize: function (width, height) { 13 | var viewportWidth = width || 1280; 14 | var viewportHeight = height || 1024; 15 | 16 | casper.echo('Current viewport size is ' + viewportWidth + 'x' + viewportHeight + '.', 'INFO'); 17 | 18 | casper.options.viewportSize = { 19 | width: viewportWidth, 20 | height: viewportHeight 21 | }; 22 | }, 23 | 24 | timeout: function (timeout) { 25 | casper.options.waitTimeout = timeout || 10000; 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /aldryn_newsblog/sitemaps/sitemap.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from aldryn_translation_tools.sitemaps import I18NSitemap 6 | 7 | from ..models import Article 8 | 9 | 10 | class NewsBlogSitemap(I18NSitemap): 11 | 12 | changefreq = "never" 13 | priority = 0.5 14 | 15 | def __init__(self, *args, **kwargs): 16 | self.namespace = kwargs.pop('namespace', None) 17 | super(NewsBlogSitemap, self).__init__(*args, **kwargs) 18 | 19 | def items(self): 20 | qs = Article.objects.published() 21 | if self.language is not None: 22 | qs = qs.translated(self.language) 23 | if self.namespace is not None: 24 | qs = qs.filter(app_config__namespace=self.namespace) 25 | return qs 26 | 27 | def lastmod(self, obj): 28 | return obj.publishing_date 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | *.lock 4 | *.log 5 | *.pid 6 | cms/django 7 | *.DS_Store 8 | *.svn 9 | .* 10 | !.tx 11 | !.travis.yml 12 | !.coveragerc 13 | !.codeclimate.yml 14 | !.editorconfig 15 | !.eslintrc.js 16 | *.xml 17 | /*env*/ 18 | *.sqlite 19 | cms/media/cms_page_media/ 20 | cms/docs/build 21 | example/run 22 | example/local_settings.py 23 | /reversion/ 24 | htmlcov 25 | build 26 | dist 27 | .ropeproject 28 | .project 29 | .pydevproject 30 | .settings 31 | /*.egg-info/ 32 | /*.egg/ 33 | *.egg 34 | develop-eggs 35 | downloads 36 | eggs 37 | parts 38 | bin 39 | /dist 40 | *~ 41 | /docs/_build 42 | /docs/*.html 43 | distribute-*.tar.gz 44 | include/ 45 | lib/ 46 | man/ 47 | share/ 48 | cms/static/cms/compass_app_log.txt 49 | *.sublime-project 50 | *.sublime-workspace 51 | coverage-*.txt 52 | docs/env 53 | node_modules/ 54 | aldryn_newsblog/tests/frontend/coverage/ 55 | requirements.txt 56 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/tags.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 |
4 | 17 |
18 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/categories.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 |
4 | 15 |
16 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/article_detail.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/base.html" %} 2 | {% load i18n cms_tags apphooks_config_tags %} 3 | 4 | {% block title %} 5 | {{ article.title }} - {{ block.super }} 6 | {% endblock %} 7 | 8 | {% block newsblog_content %} 9 | {% include "aldryn_newsblog/includes/article.html" with detail_view="true" %} 10 | 11 | {% static_placeholder "newsblog_social" %} 12 | 13 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/two_column.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/base.html" %} 2 | {% load i18n cms_tags %} 3 | 4 | {% block content %} 5 |
6 |
7 |
8 | {% if view.show_header %} 9 | {% static_placeholder "newsblog_feature" %} 10 | {% endif %} 11 |
12 | {% block newsblog_content %}{% endblock %} 13 |
14 |
15 |
16 | {% static_placeholder "newsblog_sidebar" %} 17 | {% block newsblog_sidebar %}{% endblock %} 18 |
19 |
20 |
21 | {% block newsblog_footer %}{% endblock %} 22 | {% endblock content %} 23 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/integration/handlers/suiteFailures.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ############################################################################# 4 | // Handles test suite errors (assert and waitFor) 5 | 6 | module.exports = { 7 | bind: function () { 8 | casper.on('step.error', function (error) { 9 | casper.die('assert failed: ' + error.message); 10 | }); 11 | 12 | casper.on('waitFor.timeout', function (timeout, error) { 13 | if (error.selector) { 14 | casper.die('waitFor failed, couldn\'t find ' + error.selector + ' within ' + timeout + 'ms'); 15 | } else if (error.visible) { 16 | casper.die('waitFor failed, couldn\'t find ' + error.visible + ' within ' + timeout + 'ms'); 17 | } else { 18 | casper.die('waitFor failed with error', JSON.stringify(error, null, 4)); 19 | } 20 | }); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/test_managers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from aldryn_newsblog.models import Article 6 | 7 | from . import NewsBlogTestCase 8 | 9 | 10 | class TestManagers(NewsBlogTestCase): 11 | 12 | def test_published_articles_filtering(self): 13 | for i in range(5): 14 | self.create_article() 15 | unpublised_article = Article.objects.first() 16 | unpublised_article.is_published = False 17 | unpublised_article.save() 18 | self.assertEqual(Article.objects.published().count(), 4) 19 | self.assertNotIn(unpublised_article, Article.objects.published()) 20 | 21 | # TODO: Should also test for publishing_date 22 | def test_view_article_not_published(self): 23 | article = self.create_article(is_published=False) 24 | article_url = article.get_absolute_url() 25 | response = self.client.get(article_url) 26 | self.assertEqual(response.status_code, 404) 27 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/browser/test_aldryn_newsblog.py: -------------------------------------------------------------------------------- 1 | from django.test import LiveServerTestCase 2 | 3 | from selenium import webdriver 4 | 5 | 6 | class NewVisitorTest(LiveServerTestCase): 7 | 8 | def setUp(self): 9 | self.browser = webdriver.Firefox() 10 | self.browser.implicitly_wait(2) 11 | 12 | def tearDown(self): 13 | self.browser.quit() 14 | 15 | def test_sees_an_empty_page_message(self): 16 | # visit the home page of the facts appplication 17 | self.browser.get(self.live_server_url) 18 | 19 | # the default title of the home page is "News" 20 | self.assertIn("News", self.browser.title) 21 | 22 | # the default h1 is also "News" 23 | h1_text = self.browser.find_element_by_tag_name("h1").text 24 | self.assertIn("News", h1_text) 25 | 26 | def test_admin_user_can_login(self): 27 | # go to the admin 28 | self.browser.get("http://localhost:8000/admin") 29 | 30 | self.fail("finish the test") 31 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0008_auto_20160106_1735.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | import django.db.models.deletion 5 | from django.db import migrations, models 6 | 7 | import app_data.fields 8 | import filer.fields.image 9 | 10 | 11 | class Migration(migrations.Migration): 12 | 13 | dependencies = [ 14 | ('aldryn_newsblog', '0007_default_newsblog_config'), 15 | ] 16 | 17 | operations = [ 18 | migrations.AlterField( 19 | model_name='article', 20 | name='featured_image', 21 | field=filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.SET_NULL, blank=True, to='filer.Image', null=True), 22 | preserve_default=True, 23 | ), 24 | migrations.AlterField( 25 | model_name='newsblogconfig', 26 | name='app_data', 27 | field=app_data.fields.AppDataField(default=b'{}', editable=False), 28 | preserve_default=True, 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /.circleci/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PYTHON_VERSION=3.6 2 | FROM circleci/python:$PYTHON_VERSION 3 | 4 | RUN mkdir -p /home/circleci/app/ 5 | WORKDIR /home/circleci/app/ 6 | 7 | COPY . /home/circleci/app/ 8 | 9 | ENV NODE_VERSION=6.14.1 10 | 11 | RUN \ 12 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash && \ 13 | export NVM_DIR="$HOME/.nvm" && \ 14 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ 15 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \ 16 | nvm install $NODE_VERSION && \ 17 | nvm use $NODE_VERSION && \ 18 | npm config set spin false && \ 19 | npm install -g gulp@3.9.0 && \ 20 | npm install -g codeclimate-test-reporter && \ 21 | npm install 22 | 23 | ENV NODE_PATH=/home/circleci/.nvm/versions/node/v$NODE_VERSION/lib/node_modules \ 24 | PATH=/home/circleci/.nvm/versions/node/v$NODE_VERSION/bin:$PATH 25 | 26 | RUN sudo apt-get install libenchant-dev 27 | 28 | RUN sudo chown -R circleci:circleci * 29 | 30 | RUN sudo pip install tox coveralls 31 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0010_auto_20160316_0935.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0009_auto_20160211_1022'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='newsblogconfig', 16 | name='pagination_pages_start', 17 | field=models.PositiveIntegerField(default=10, help_text='When paginating list views, after how many pages should we start grouping the page numbers.', verbose_name='Pagination pages start'), 18 | ), 19 | migrations.AddField( 20 | model_name='newsblogconfig', 21 | name='pagination_pages_visible', 22 | field=models.PositiveIntegerField(default=4, help_text='When grouping page numbers, this determines how many pages are visible on each side of the active page.', verbose_name='Pagination pages visible'), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/frontend/fixtures/search.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 8 | 9 |
10 | 12 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
    21 |

    Most recent articles containing "test"

    22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0006_auto_20160105_1013.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | import djangocms_text_ckeditor.fields 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('aldryn_newsblog', '0005_auto_20150807_0207'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterModelOptions( 17 | name='newsblogconfig', 18 | options={'verbose_name': 'config', 'verbose_name_plural': 'configs'}, 19 | ), 20 | migrations.AlterModelOptions( 21 | name='newsblogconfigtranslation', 22 | options={'default_permissions': (), 'verbose_name': 'config Translation', 'managed': True}, 23 | ), 24 | migrations.AlterField( 25 | model_name='articletranslation', 26 | name='lead_in', 27 | field=djangocms_text_ckeditor.fields.HTMLField(default='', help_text='Optional. Will be displayed in lists, and at the start of the detail page (in bold)', verbose_name='lead-in', blank=True), 28 | ), 29 | ] 30 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/plugins/archive.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 | {% regroup dates by date.year as years %} 4 | {% with current_year=year current_month=month %} 5 | 6 | 25 | 26 | {% endwith %} 27 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0014_auto_20160821_1156.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('aldryn_newsblog', '0013_auto_20160623_1703'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='newsblogarchiveplugin', 16 | name='cache_duration', 17 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's content should be cached."), 18 | ), 19 | migrations.AlterField( 20 | model_name='newsbloglatestarticlesplugin', 21 | name='cache_duration', 22 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's content should be cached."), 23 | ), 24 | migrations.AlterField( 25 | model_name='newsblogrelatedplugin', 26 | name='cache_duration', 27 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's content should be cached."), 28 | ), 29 | ] 30 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/includes/search_results.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 | 25 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/article_search.html: -------------------------------------------------------------------------------- 1 | {% load i18n sekizai_tags staticfiles %} 2 | 3 |
4 |
5 | {% csrf_token %} 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |
17 |
18 | 19 | {% addtoblock "css" %}{% endaddtoblock %} 20 | {% addtoblock "js" %}{% endaddtoblock %} 21 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/test_commands.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from django.core.management import call_command 6 | from django.utils.translation import activate 7 | 8 | from aldryn_newsblog.models import Article 9 | 10 | from . import NewsBlogTestCase 11 | 12 | 13 | class TestCommands(NewsBlogTestCase): 14 | 15 | def test_rebuild_search_data_command(self): 16 | # Just make sure we have a known language 17 | activate(self.language) 18 | 19 | article = self.create_article() 20 | 21 | search_data = article.get_search_data(language=self.language) 22 | 23 | # make sure the search_data is empty 24 | # we avoid any handler that automatically sets the search_data 25 | article.translations.filter( 26 | language_code=self.language).update(search_data='') 27 | 28 | # get fresh article from db 29 | article = Article.objects.language(self.language).get(pk=article.pk) 30 | 31 | # make sure search data is empty 32 | self.assertEqual(article.search_data, '') 33 | # now run the command 34 | call_command('rebuild_article_search_data', languages=[self.language]) 35 | # now verify the article's search_data has been updated. 36 | self.assertEqual(article.search_data, search_data) 37 | -------------------------------------------------------------------------------- /aldryn_newsblog/templates/aldryn_newsblog/includes/search_results.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/base.html" %} 2 | {% load i18n apphooks_config_tags %} 3 | 4 | {% block newsblog_content %} 5 | 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/includes/author.html: -------------------------------------------------------------------------------- 1 | {% load i18n staticfiles thumbnail apphooks_config_tags %} 2 | 3 |
4 | {% if author and author.slug %} 5 | 15 |
16 |

{{ author.name }}

17 | {% if author_view and author.slug %} 18 |

{{ author.function }}

19 |

{{ author.article_count }}

20 | {% else %} 21 |

{{ article.publishing_date|date }}

22 | {% endif %} 23 |
24 | {% endif %} 25 |
26 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/plugins/archive.html: -------------------------------------------------------------------------------- 1 | {% load i18n apphooks_config_tags %} 2 | 3 | {% regroup dates by date.year as years %} 4 | {% with current_year=year current_month=month %} 5 | 6 |
7 |
8 | {% for year in years %} 9 |
10 | {{ year.grouper }} 11 |
12 | {# month list #} 13 |
14 | {# NOTE: Wrapping the following anchor markup will break tests #} 15 | {% for month in year.list %} 16 | {{ month.date|date:"F" }}{{ month.num_articles }} 17 | {% endfor %} 18 |
19 | {% empty %} 20 |
21 |

{% trans "No items available" %}

22 |
23 | {% endfor %} 24 |
25 |
26 | 27 | {% endwith %} 28 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/static/js/addons/cl.newsblog.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @author: Divio AG 3 | * @copyright: http://www.divio.ch 4 | */ 5 | 6 | var Cl = window.Cl || {}; 7 | 8 | (function ($) { 9 | 'use strict'; 10 | 11 | Cl.newsBlog = { 12 | 13 | init: function () { 14 | var that = this; 15 | 16 | // there might be more addons available within one page 17 | $('.js-aldryn-newsblog-article-search').each(function () { 18 | that._search($(this)); 19 | }); 20 | }, 21 | 22 | _handler: function (e) { 23 | e.preventDefault(); 24 | 25 | var form = $(this); 26 | 27 | $.ajax({ 28 | type: 'GET', 29 | url: form.attr('action'), 30 | data: form.serialize() 31 | }).always(function (data) { 32 | form.siblings('.js-search-results').html(data); 33 | }).fail(function () { 34 | alert('REQUEST TIMEOUT'); // eslint-disable-line 35 | }); 36 | }, 37 | 38 | // container should be a jQuery object 39 | _search: function (container) { 40 | var form = container.find('form'); 41 | 42 | form.on('submit', this._handler); 43 | } 44 | 45 | }; 46 | 47 | // autoload 48 | $(function () { 49 | if ($('.js-aldryn-newsblog-article-search').length) { 50 | Cl.newsBlog.init(); 51 | } 52 | }); 53 | 54 | })(jQuery); 55 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Divio AG 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Divio AG nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL DIVIO AG BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/article_detail.html: -------------------------------------------------------------------------------- 1 | {% extends "aldryn_newsblog/fullwidth.html" %} 2 | {% load i18n cms_tags apphooks_config_tags %} 3 | 4 | {% block title %}{{ article.title }} - {{ block.super }}{% endblock %} 5 | {% block breadcrumb %}{% endblock %} 6 | 7 | {% block newsblog_content %} 8 |
9 | {% include "aldryn_newsblog/includes/article.html" with detail_view="true" %} 10 |
11 | {% static_placeholder "newsblog_social" %} 12 | {% endblock %} 13 | 14 | {% block newsblog_footer %} 15 |
16 | 29 |
30 | {% static_placeholder "newsblog_comments" %} 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /aldryn_newsblog/migrations/0013_auto_20160623_1703.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.6 on 2016-06-23 21:03 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | import app_data.fields 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | dependencies = [ 13 | ('aldryn_newsblog', '0012_auto_20160503_1626'), 14 | ] 15 | 16 | operations = [ 17 | migrations.AddField( 18 | model_name='newsblogarchiveplugin', 19 | name='cache_duration', 20 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's contentshould be cached. Values between 5 minutes (300) and one day (84600) recommended)."), 21 | ), 22 | migrations.AddField( 23 | model_name='newsbloglatestarticlesplugin', 24 | name='cache_duration', 25 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's contentshould be cached. Values between 5 minutes (300) and one day (84600) recommended)."), 26 | ), 27 | migrations.AddField( 28 | model_name='newsblogrelatedplugin', 29 | name='cache_duration', 30 | field=models.PositiveSmallIntegerField(default=0, help_text="The maximum duration (in seconds) that this plugin's contentshould be cached. Values between 5 minutes (300) and one day (84600) recommended)."), 31 | ), 32 | migrations.AlterField( 33 | model_name='newsblogconfig', 34 | name='app_data', 35 | field=app_data.fields.AppDataField(default='{}', editable=False), 36 | ), 37 | ] 38 | -------------------------------------------------------------------------------- /aldryn_newsblog/tests/test_admin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from django.test import TransactionTestCase 6 | 7 | from aldryn_people.models import Person 8 | 9 | from aldryn_newsblog.cms_appconfig import NewsBlogConfig 10 | from aldryn_newsblog.models import Article 11 | 12 | from . import NewsBlogTestsMixin 13 | 14 | 15 | class AdminTest(NewsBlogTestsMixin, TransactionTestCase): 16 | 17 | def test_admin_owner_default(self): 18 | from django.contrib import admin 19 | admin.autodiscover() 20 | # since we now have data migration to create the default 21 | # NewsBlogConfig (if migrations were not faked, django >1.7) 22 | # we need to delete one of configs to be sure that it is pre selected 23 | # in the admin view. 24 | if NewsBlogConfig.objects.count() > 1: 25 | # delete the app config that was created during test set up. 26 | NewsBlogConfig.objects.filter(namespace='NBNS').delete() 27 | user = self.create_user() 28 | user.is_superuser = True 29 | user.save() 30 | 31 | Person.objects.create(user=user, name=u' '.join( 32 | (user.first_name, user.last_name))) 33 | 34 | admin_inst = admin.site._registry[Article] 35 | self.request = self.get_request('en') 36 | self.request.user = user 37 | self.request.META['HTTP_HOST'] = 'example.com' 38 | response = admin_inst.add_view(self.request) 39 | option = r'