├── .coveragerc ├── .github └── workflows │ └── tests.yaml ├── .gitignore ├── .prettierrc ├── .tx └── config ├── AUTHORS ├── CHANGES.rst ├── LICENSE ├── MANIFEST.in ├── README.rst ├── docs ├── Makefile ├── _ext │ └── djangodummy │ │ ├── __init__.py │ │ ├── requirements.txt │ │ └── settings.py ├── api │ ├── admin.rst │ ├── analyzer.rst │ ├── cache.rst │ ├── extensions.rst │ ├── index.rst │ ├── middleware.rst │ ├── models.rst │ ├── rendering.rst │ ├── templatetags.fluent_contents_tags.rst │ └── utils.rst ├── changelog.rst ├── cms.rst ├── conf.py ├── configuration.rst ├── filters.rst ├── images │ ├── admin │ │ ├── placeholdereditoradmin1.png │ │ ├── placeholdereditoradmin2.png │ │ ├── placeholderfieldadmin1.png │ │ └── placeholderfieldadmin2.png │ ├── fields │ │ ├── anyurlfield1.png │ │ ├── anyurlfield2.png │ │ └── filebrowsefield.png │ ├── newplugins │ │ ├── announcementblock-addpopup.png │ │ └── announcementblock-admin.png │ └── plugins │ │ ├── code-admin.png │ │ ├── code-html.png │ │ ├── commentsarea-admin.png │ │ ├── commentsarea-html.png │ │ ├── disquscommentsarea-admin.png │ │ ├── disquscommentsarea-html.png │ │ ├── formdesignerlink-admin.png │ │ ├── formdesignerlink-html.png │ │ ├── gist-admin.png │ │ ├── gist-html.png │ │ ├── googledocsviewer-admin.png │ │ ├── googledocsviewer-html.png │ │ ├── iframe-admin.png │ │ ├── iframe-html.png │ │ ├── markup-admin.png │ │ ├── markup-html.png │ │ ├── oembeditem-admin.png │ │ ├── oembeditem-html.png │ │ ├── picture-admin.png │ │ ├── picture-html.png │ │ ├── rawhtml-admin.png │ │ ├── rawhtml-admin2.png │ │ ├── rawhtml-html2.png │ │ ├── sharedcontent-admin1.png │ │ ├── sharedcontent-admin2.png │ │ ├── text-admin.png │ │ ├── text-html.png │ │ ├── twitterfeed-search-admin.png │ │ └── twitterfeed-user-admin.png ├── index.rst ├── make.bat ├── multilingual.rst ├── newplugins │ ├── admin.rst │ ├── index.rst │ ├── models.rst │ └── rendering.rst ├── optional-integration.rst ├── plugins │ ├── code.rst │ ├── commentsarea.rst │ ├── disquscommentsarea.rst │ ├── formdesignerlink.rst │ ├── gist.rst │ ├── googledocsviewer.rst │ ├── iframe.rst │ ├── index.rst │ ├── markup.rst │ ├── oembeditem.rst │ ├── picture.rst │ ├── rawhtml.rst │ ├── sharedcontent.rst │ ├── text.rst │ └── twitterfeed.rst ├── quickstart.rst └── templatetags.rst ├── example ├── __init__.py ├── article │ ├── __init__.py │ ├── admin.py │ ├── content_plugins.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── templates │ │ └── article │ │ │ └── plugins │ │ │ └── text.html │ ├── urls.py │ └── views.py ├── manage.py ├── requirements.txt ├── settings.py ├── simplecms │ ├── __init__.py │ ├── admin.py │ ├── appconfig.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── static │ │ └── simplecms │ │ │ └── admin │ │ │ └── simplecms_layouts.js │ ├── templates │ │ └── admin │ │ │ └── simplecms │ │ │ └── page │ │ │ └── change_form.html │ ├── test │ │ └── __init__.py │ ├── urls.py │ └── views.py ├── theme1 │ ├── __init__.py │ ├── static │ │ └── theme1 │ │ │ └── site.css │ └── templates │ │ ├── article │ │ └── details.html │ │ ├── comments │ │ ├── base.html │ │ └── posted.html │ │ └── theme1 │ │ ├── base.html │ │ ├── pages │ │ ├── standard-twocols.html │ │ └── standard.html │ │ └── parts │ │ └── sidebar.html └── urls.py ├── fluent_contents ├── __init__.py ├── admin │ ├── __init__.py │ ├── contentitems.py │ ├── genericextensions.py │ ├── placeholdereditor.py │ └── placeholderfield.py ├── analyzer.py ├── appsettings.py ├── cache.py ├── conf │ └── plugin_template │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ └── __init__.py │ │ ├── models.py │ │ └── tests.py ├── extensions │ ├── __init__.py │ ├── model_fields.py │ ├── pluginbase.py │ └── pluginpool.py ├── forms │ ├── __init__.py │ ├── fields.py │ └── widgets.py ├── locale │ ├── en │ │ └── LC_MESSAGES │ │ │ └── django.po │ └── nl │ │ └── LC_MESSAGES │ │ └── django.po ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ ├── find_contentitem_urls.py │ │ ├── prefix_content_item_types.py │ │ ├── remove_stale_contentitems.py │ │ └── start_content_plugin.py ├── middleware.py ├── migrations │ ├── 0001_initial.py │ └── __init__.py ├── models │ ├── __init__.py │ ├── db.py │ ├── fields.py │ ├── managers.py │ └── mixins.py ├── panels.py ├── plugins │ ├── __init__.py │ ├── code │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── backend.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── fluent_contents │ │ │ │ └── code │ │ │ │ └── code_admin.css │ │ └── templates │ │ │ ├── admin │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── code │ │ │ │ └── admin_form.html │ │ │ └── fluent_contents │ │ │ └── plugins │ │ │ └── code │ │ │ └── code.html │ ├── commentsarea │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── commentsarea │ │ │ │ ├── comments_closed.html │ │ │ │ └── commentsarea.html │ │ └── templatetags │ │ │ ├── __init__.py │ │ │ └── commentsarea_tags.py │ ├── disquswidgets │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ └── templates │ │ │ └── fluent_contents │ │ │ └── plugins │ │ │ └── disquswidgets │ │ │ ├── comments.html │ │ │ └── comments_closed.html │ ├── formdesignerlink │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ └── models.py │ ├── gist │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ └── models.py │ ├── googledocsviewer │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ └── models.py │ ├── iframe │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ └── models.py │ ├── markup │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── backend.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_fix_polymorphic_ctype.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── markup │ │ │ │ └── markup_admin.css │ │ └── tests.py │ ├── oembeditem │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── backend.py │ │ ├── content_plugins.py │ │ ├── fields.py │ │ ├── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ │ ├── __init__.py │ │ │ │ └── debug_oembed.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── oembed │ │ │ │ └── oembed_admin.css │ │ └── templates │ │ │ ├── admin │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── oembeditem │ │ │ │ └── admin_form.html │ │ │ └── fluent_contents │ │ │ └── plugins │ │ │ └── oembed │ │ │ ├── default.html │ │ │ ├── image.html │ │ │ ├── link.html │ │ │ └── photo.html │ ├── picture │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── picture │ │ │ │ └── picture_admin.css │ │ └── templates │ │ │ └── fluent_contents │ │ │ └── plugins │ │ │ └── picture │ │ │ └── default.html │ ├── rawhtml │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ └── static │ │ │ └── fluent_contents │ │ │ └── plugins │ │ │ └── rawhtml │ │ │ └── rawhtml_admin.css │ ├── sharedcontent │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── appsettings.py │ │ ├── cache.py │ │ ├── content_plugins.py │ │ ├── managers.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── admin │ │ │ │ └── sharedcontent │ │ │ │ └── sharedcontent │ │ │ │ └── change_form.html │ │ ├── templatetags │ │ │ ├── __init__.py │ │ │ └── sharedcontent_tags.py │ │ └── utils.py │ ├── text │ │ ├── __init__.py │ │ ├── content_plugins.py │ │ ├── filters │ │ │ ├── __init__.py │ │ │ ├── smartypants.py │ │ │ └── softhyphen.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_textitem_text_final.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── admin │ │ │ │ └── fluent_contents │ │ │ │ └── plugins │ │ │ │ └── text │ │ │ │ └── admin_init.html │ │ └── tests.py │ └── twitterfeed │ │ ├── __init__.py │ │ ├── appsettings.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ │ ├── models.py │ │ ├── static │ │ └── fluent_contents │ │ │ └── twitterfeed │ │ │ └── jquery.tweet.js │ │ ├── templates │ │ └── plugins │ │ │ └── twitterfeed │ │ │ ├── base.html │ │ │ ├── recent_entries.html │ │ │ └── search.html │ │ └── templatetags │ │ ├── __init__.py │ │ └── twitterfeed_tags.py ├── rendering │ ├── __init__.py │ ├── core.py │ ├── main.py │ ├── markers.py │ ├── media.py │ ├── search.py │ └── utils.py ├── static │ └── fluent_contents │ │ └── admin │ │ ├── cp_admin.css │ │ ├── cp_admin.js │ │ ├── cp_admin_classic.css │ │ ├── cp_admin_flat.css │ │ ├── cp_data.js │ │ ├── cp_plugins.js │ │ ├── cp_tabs.js │ │ ├── cp_widgets.js │ │ ├── fluent_contents.js │ │ ├── img │ │ └── admin │ │ │ ├── arrow-move-ns.png │ │ │ ├── arrow-move-we.png │ │ │ ├── arrow-move.png │ │ │ ├── arrow_down.gif │ │ │ ├── arrow_up.gif │ │ │ ├── default-bg.gif │ │ │ ├── icon_deletelink.gif │ │ │ ├── nav-bg-reverse.gif │ │ │ └── nav-bg.gif │ │ ├── jquery.cookie.js │ │ └── vendor │ │ └── Sortable.js ├── templates │ ├── admin │ │ └── fluent_contents │ │ │ ├── contentitem │ │ │ ├── admin_form.html │ │ │ ├── admin_form_without_labels.html │ │ │ └── inline_container.html │ │ │ ├── fieldset.html │ │ │ ├── fieldset_line.html │ │ │ ├── fieldset_line_without_labels.html │ │ │ ├── fieldset_without_labels.html │ │ │ ├── placeholder │ │ │ ├── change_form.html │ │ │ └── inline_tabs.html │ │ │ └── placeholderfield │ │ │ ├── controls.html │ │ │ ├── inline_init.html │ │ │ ├── pane.html │ │ │ ├── pane_tabbar.html │ │ │ └── widget.html │ └── fluent_contents │ │ └── debug_toolbar_panel.html ├── templatetags │ ├── __init__.py │ ├── fluent_contents_tags.py │ ├── placeholder_admin_tags.py │ └── placeholder_tags.py ├── tests │ ├── __init__.py │ ├── factories.py │ ├── test_admin.py │ ├── test_models.py │ ├── test_rendering.py │ ├── test_search.py │ ├── test_templatetags.py │ ├── testapp │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── content_plugins.py │ │ ├── migrations │ │ │ ├── 0001_initial.py │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── testapp │ │ │ │ ├── media_item.html │ │ │ │ ├── placeholder_splitter.html │ │ │ │ └── testpage.html │ │ ├── urls.py │ │ └── views.py │ └── utils.py └── utils │ ├── __init__.py │ ├── filters.py │ ├── html.py │ ├── search.py │ ├── templatetags.py │ └── validators.py ├── makemessages.py ├── pyproject.toml ├── runtests.py ├── setup.py ├── test-requirements.txt └── tox.ini /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = fluent_contents/ 3 | omit = 4 | */migrations/* 5 | -------------------------------------------------------------------------------- /.github/workflows/tests.yaml: -------------------------------------------------------------------------------- 1 | name: CI Testing 2 | on: 3 | pull_request: 4 | branches: 5 | - master 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | test: 12 | name: "Python ${{ matrix.python }} Django ${{ matrix.django }}" 13 | runs-on: ubuntu-latest 14 | strategy: 15 | # max-parallel: 8 # default is max available 16 | fail-fast: false 17 | matrix: 18 | include: 19 | # Django 3.2 20 | - django: "3.2" 21 | python: "3.8" 22 | # Django 4.0 23 | - django: "4.2" 24 | python: "3.10" 25 | # Django 5.0 26 | - django: "5.0" 27 | python: "3.12" 28 | 29 | steps: 30 | - name: Install gettext 31 | run: sudo apt-get install -y gettext 32 | 33 | - name: Checkout code 34 | uses: actions/checkout@v2 35 | 36 | - name: Setup Python ${{ matrix.python }} 37 | uses: actions/setup-python@v2 38 | with: 39 | python-version: ${{ matrix.python }} 40 | 41 | - name: Install Packages 42 | run: | 43 | python -m pip install -U pip 44 | python -m pip install "Django~=${{ matrix.django }}" codecov -e .[tests] 45 | 46 | - name: Run Tests 47 | run: | 48 | echo "Python ${{ matrix.python }} / Django ${{ matrix.django }}" 49 | coverage run --rcfile=.coveragerc runtests.py 50 | codecov 51 | continue-on-error: ${{ contains(matrix.django, '5.1') }} 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.mo 4 | *.db 5 | *.egg-info/ 6 | *.egg/ 7 | .coverage 8 | .project 9 | .idea/ 10 | .pydevproject 11 | .idea/workspace.xml 12 | .tox/ 13 | .DS_Store 14 | build/ 15 | dist/ 16 | docs/_build/ 17 | htmlcov/ 18 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "semi": true, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "useTabs": false, 7 | "trailingComma": "es5", 8 | "overrides": [ 9 | { 10 | "files": "*.scss", 11 | "options": { 12 | "tabWidth": 2, 13 | "singleQuote": false 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [django-fluent-contents.djangopo] 5 | file_filter = fluent_contents/locale//LC_MESSAGES/django.po 6 | source_file = fluent_contents/locale/en/LC_MESSAGES/django.po 7 | source_lang = en 8 | type = PO 9 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Original authors 2 | ================ 3 | 4 | * Diederik van der Boor (@vdboor) 5 | 6 | 7 | Contributions by 8 | ================ 9 | 10 | * Alec Koumjian (@akoumjian) 11 | * Alexey Boriskin (@uruz) 12 | * Basil Shubin 13 | * Ben Konrath (@benkonrath) 14 | * Ben van D.. (@benvand) 15 | * Chad Shryock (@gannettchad) 16 | * Greg Turner 17 | * James Murty 18 | * Jonathan Potter (@jpotterm) 19 | * Mario Rosa (@vinnyrose) 20 | * Philipp Bosch 21 | * Philippe Ombredanne 22 | * Shabda Raaj (@shabda) 23 | * Tai Lee (@mrmachine) 24 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS 2 | include README.rst 3 | include LICENSE 4 | recursive-include fluent_contents/conf/plugin_template *.py 5 | recursive-include fluent_contents/locale * 6 | recursive-include fluent_contents/templates *.html 7 | recursive-include fluent_contents/static * 8 | recursive-include fluent_contents/plugins/*/static * 9 | recursive-include fluent_contents/plugins/*/templates *.html 10 | recursive-include fluent_contents/tests/testapp/templates *.html 11 | global-exclude .DS_Store 12 | global-exclude Thumbs.db 13 | global-exclude Desktop.ini 14 | global-exclude *.swp 15 | global-exclude *~ 16 | global-exclude *.bak 17 | -------------------------------------------------------------------------------- /docs/_ext/djangodummy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/_ext/djangodummy/__init__.py -------------------------------------------------------------------------------- /docs/_ext/djangodummy/requirements.txt: -------------------------------------------------------------------------------- 1 | # for readthedocs 2 | # Remaining requirements are picked up from setup.py 3 | Django==3.2.9 4 | django-fluent-utils == 2.0.1 5 | django-mptt == 0.13.4 6 | django-parler == 2.2.1 7 | django-polymorphic == 3.0.0 8 | django-tag-parser == 3.2 9 | sphinxcontrib-django == 0.5.1 10 | -------------------------------------------------------------------------------- /docs/_ext/djangodummy/settings.py: -------------------------------------------------------------------------------- 1 | # Settings file to allow parsing API documentation of Django modules, 2 | # and provide defaults to use in the documentation. 3 | # 4 | # This file is placed in a subdirectory, 5 | # so the docs root won't be detected by find_packages() 6 | import os 7 | 8 | # Display sane URLs in the docs: 9 | STATIC_URL = "/static/" 10 | 11 | # Required by Django 12 | SECRET_KEY = "foo" 13 | SITE_ID = 1 14 | 15 | INSTALLED_APPS = [ 16 | "fluent_contents", 17 | "django.contrib.admin", 18 | "django.contrib.auth", 19 | "django.contrib.contenttypes", 20 | "django.contrib.sites", 21 | "mptt", 22 | "polymorphic", 23 | ] 24 | 25 | MIDDLEWARE = [ 26 | "django.contrib.sessions.middleware.SessionMiddleware", 27 | "django.contrib.auth.middleware.AuthenticationMiddleware", 28 | "django.contrib.messages.middleware.MessageMiddleware", 29 | ] 30 | 31 | TEMPLATES = [ 32 | { 33 | "BACKEND": "django.template.backends.django.DjangoTemplates", 34 | "DIRS": (), 35 | "OPTIONS": { 36 | "loaders": ( 37 | "django.template.loaders.filesystem.Loader", 38 | "django.template.loaders.app_directories.Loader", 39 | ) 40 | }, 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /docs/api/admin.rst: -------------------------------------------------------------------------------- 1 | .. _fluent_contents.admin: 2 | 3 | fluent_contents.admin 4 | ===================== 5 | 6 | .. automodule:: fluent_contents.admin 7 | 8 | The ``PlaceholderEditorAdmin`` class 9 | ------------------------------------ 10 | 11 | .. autoclass:: fluent_contents.admin.PlaceholderEditorAdmin 12 | :members: 13 | 14 | The ``PlaceholderFieldAdmin`` class 15 | ----------------------------------- 16 | 17 | .. autoclass:: fluent_contents.admin.PlaceholderFieldAdmin 18 | :members: 19 | 20 | The ``PlaceholderEditorBaseMixin`` class 21 | ---------------------------------------- 22 | 23 | .. autoclass:: fluent_contents.admin.PlaceholderEditorBaseMixin 24 | :members: 25 | 26 | The ``PlaceholderEditorInline`` class 27 | ------------------------------------- 28 | 29 | .. autoclass:: fluent_contents.admin.PlaceholderEditorInline 30 | :members: 31 | 32 | The ``get_content_item_inlines`` function 33 | ----------------------------------------- 34 | 35 | .. autofunction:: fluent_contents.admin.get_content_item_inlines 36 | -------------------------------------------------------------------------------- /docs/api/analyzer.rst: -------------------------------------------------------------------------------- 1 | .. _fluent_contents.analyzer: 2 | 3 | fluent_contents.analyzer 4 | ======================== 5 | 6 | .. For some reason, the automodule fails. 7 | Since it's just one function, document it manually. 8 | 9 | .. automodule:: fluent_contents.analyzer 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/api/cache.rst: -------------------------------------------------------------------------------- 1 | .. _fluent_contents.cache: 2 | 3 | fluent_contents.cache 4 | ======================== 5 | 6 | .. automodule:: fluent_contents.cache 7 | :members: 8 | -------------------------------------------------------------------------------- /docs/api/extensions.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.extensions 2 | ========================== 3 | 4 | .. automodule:: fluent_contents.extensions 5 | 6 | The ``ContentPlugin`` class 7 | --------------------------- 8 | 9 | .. autoclass:: fluent_contents.extensions.ContentPlugin 10 | :members: 11 | 12 | The ``PluginPool`` class 13 | ------------------------ 14 | 15 | .. autoclass:: fluent_contents.extensions.PluginPool 16 | :members: 17 | 18 | The ``plugin_pool`` attribute 19 | ----------------------------- 20 | 21 | .. attribute:: fluent_contents.extensions.plugin_pool 22 | 23 | The global plugin pool, a instance of the :class:`PluginPool` class. 24 | 25 | 26 | Model fields 27 | ------------ 28 | 29 | .. versionadded:: 0.9.0 30 | 31 | The model fields ensure a consistent look and feel between plugins. 32 | It's recommended to use these fields instead of the standard Django counterparts, 33 | so all plugins have a consistent look and feel. 34 | See :ref:`optional-integration` for more details. 35 | 36 | .. autoclass:: fluent_contents.extensions.PluginFileField 37 | :members: 38 | 39 | .. autoclass:: fluent_contents.extensions.PluginHtmlField 40 | :members: 41 | 42 | .. autoclass:: fluent_contents.extensions.PluginImageField 43 | :members: 44 | 45 | .. autoclass:: fluent_contents.extensions.PluginUrlField 46 | :members: 47 | 48 | 49 | Classes for custom forms 50 | ------------------------ 51 | 52 | .. versionadded:: 0.9.0 53 | The canonical place to import this class has moved, previously it was available via :mod:`fluent_contents.forms`. 54 | 55 | .. autoclass:: fluent_contents.extensions.ContentItemForm 56 | :members: 57 | 58 | 59 | Other classes 60 | ------------- 61 | 62 | .. autoclass:: fluent_contents.extensions.PluginContext 63 | :members: 64 | 65 | .. autoexception:: fluent_contents.extensions.PluginAlreadyRegistered 66 | 67 | .. autoexception:: fluent_contents.extensions.PluginNotFound 68 | 69 | -------------------------------------------------------------------------------- /docs/api/index.rst: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | API documentation 4 | ================= 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | admin 10 | analyzer 11 | cache 12 | extensions 13 | middleware 14 | models 15 | rendering 16 | templatetags.fluent_contents_tags 17 | utils 18 | -------------------------------------------------------------------------------- /docs/api/middleware.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.middleware 2 | ========================== 3 | 4 | .. automodule:: fluent_contents.middleware 5 | 6 | The ``HttpRedirectRequestMiddleware`` class 7 | ------------------------------------------- 8 | 9 | .. autoclass:: fluent_contents.middleware.HttpRedirectRequestMiddleware 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/api/models.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.models 2 | ====================== 3 | 4 | .. automodule:: fluent_contents.models 5 | 6 | The ``Placeholder`` class 7 | ------------------------- 8 | 9 | .. autoclass:: fluent_contents.models.Placeholder 10 | :members: 11 | 12 | The ``PlaceholderManager`` class 13 | -------------------------------- 14 | 15 | .. autoclass:: fluent_contents.models.PlaceholderManager 16 | :members: 17 | 18 | The ``ContentItem`` class 19 | ------------------------- 20 | 21 | .. autoclass:: fluent_contents.models.ContentItem 22 | :members: 23 | 24 | The ``PlaceholderField`` class 25 | ------------------------------ 26 | 27 | .. autoclass:: fluent_contents.models.PlaceholderField 28 | :members: 29 | 30 | The ``PlaceholderRelation`` class 31 | --------------------------------- 32 | 33 | .. autoclass:: fluent_contents.models.PlaceholderRelation 34 | :members: 35 | 36 | The ``ContentItemRelation`` class 37 | --------------------------------- 38 | 39 | .. autoclass:: fluent_contents.models.ContentItemRelation 40 | :members: 41 | 42 | The ``PlaceholderData`` class 43 | ----------------------------- 44 | 45 | .. autoclass:: fluent_contents.models.PlaceholderData 46 | :members: 47 | 48 | The ``ContentItemOutput`` class 49 | ------------------------------- 50 | 51 | .. autoclass:: fluent_contents.models.ContentItemOutput 52 | :members: 53 | 54 | The ``get_parent_lookup_kwargs`` function 55 | ----------------------------------------- 56 | 57 | .. autofunction:: fluent_contents.models.get_parent_lookup_kwargs 58 | 59 | -------------------------------------------------------------------------------- /docs/api/rendering.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.rendering 2 | ========================= 3 | 4 | .. automodule:: fluent_contents.rendering 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/api/templatetags.fluent_contents_tags.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.templatetags.fluent_contents_tags 2 | ================================================= 3 | 4 | .. versionchanged:: 1.0 5 | The template tag library was called ``placeholder_tags`` in the past. 6 | 7 | .. automodule:: fluent_contents.templatetags.fluent_contents_tags 8 | 9 | The ``PagePlaceholderNode`` class 10 | --------------------------------- 11 | 12 | .. autoclass:: fluent_contents.templatetags.fluent_contents_tags.PagePlaceholderNode 13 | :members: 14 | 15 | The ``RenderPlaceholderNode`` class 16 | ----------------------------------- 17 | 18 | .. autoclass:: fluent_contents.templatetags.fluent_contents_tags.RenderPlaceholderNode 19 | :members: 20 | 21 | The ``RenderContentItemsMedia`` class 22 | ------------------------------------- 23 | 24 | .. autoclass:: fluent_contents.templatetags.fluent_contents_tags.RenderContentItemsMedia 25 | :members: 26 | 27 | -------------------------------------------------------------------------------- /docs/api/utils.rst: -------------------------------------------------------------------------------- 1 | fluent_contents.utils 2 | ===================== 3 | 4 | .. automodule:: fluent_contents.utils 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CHANGES.rst 2 | -------------------------------------------------------------------------------- /docs/images/admin/placeholdereditoradmin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/admin/placeholdereditoradmin1.png -------------------------------------------------------------------------------- /docs/images/admin/placeholdereditoradmin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/admin/placeholdereditoradmin2.png -------------------------------------------------------------------------------- /docs/images/admin/placeholderfieldadmin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/admin/placeholderfieldadmin1.png -------------------------------------------------------------------------------- /docs/images/admin/placeholderfieldadmin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/admin/placeholderfieldadmin2.png -------------------------------------------------------------------------------- /docs/images/fields/anyurlfield1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/fields/anyurlfield1.png -------------------------------------------------------------------------------- /docs/images/fields/anyurlfield2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/fields/anyurlfield2.png -------------------------------------------------------------------------------- /docs/images/fields/filebrowsefield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/fields/filebrowsefield.png -------------------------------------------------------------------------------- /docs/images/newplugins/announcementblock-addpopup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/newplugins/announcementblock-addpopup.png -------------------------------------------------------------------------------- /docs/images/newplugins/announcementblock-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/newplugins/announcementblock-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/code-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/code-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/code-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/code-html.png -------------------------------------------------------------------------------- /docs/images/plugins/commentsarea-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/commentsarea-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/commentsarea-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/commentsarea-html.png -------------------------------------------------------------------------------- /docs/images/plugins/disquscommentsarea-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/disquscommentsarea-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/disquscommentsarea-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/disquscommentsarea-html.png -------------------------------------------------------------------------------- /docs/images/plugins/formdesignerlink-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/formdesignerlink-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/formdesignerlink-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/formdesignerlink-html.png -------------------------------------------------------------------------------- /docs/images/plugins/gist-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/gist-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/gist-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/gist-html.png -------------------------------------------------------------------------------- /docs/images/plugins/googledocsviewer-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/googledocsviewer-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/googledocsviewer-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/googledocsviewer-html.png -------------------------------------------------------------------------------- /docs/images/plugins/iframe-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/iframe-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/iframe-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/iframe-html.png -------------------------------------------------------------------------------- /docs/images/plugins/markup-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/markup-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/markup-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/markup-html.png -------------------------------------------------------------------------------- /docs/images/plugins/oembeditem-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/oembeditem-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/oembeditem-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/oembeditem-html.png -------------------------------------------------------------------------------- /docs/images/plugins/picture-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/picture-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/picture-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/picture-html.png -------------------------------------------------------------------------------- /docs/images/plugins/rawhtml-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/rawhtml-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/rawhtml-admin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/rawhtml-admin2.png -------------------------------------------------------------------------------- /docs/images/plugins/rawhtml-html2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/rawhtml-html2.png -------------------------------------------------------------------------------- /docs/images/plugins/sharedcontent-admin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/sharedcontent-admin1.png -------------------------------------------------------------------------------- /docs/images/plugins/sharedcontent-admin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/sharedcontent-admin2.png -------------------------------------------------------------------------------- /docs/images/plugins/text-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/text-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/text-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/text-html.png -------------------------------------------------------------------------------- /docs/images/plugins/twitterfeed-search-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/twitterfeed-search-admin.png -------------------------------------------------------------------------------- /docs/images/plugins/twitterfeed-user-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/images/plugins/twitterfeed-user-admin.png -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to django-fluent-contents' documentation! 2 | ================================================= 3 | 4 | This documentation covers the latest release of django-fluent-contents, a collection of applications 5 | to build an end user CMS for the `Django `_ administration interface. 6 | django-fluent-contents includes: 7 | 8 | * A ``PlaceholderField`` to display various content on a model. 9 | * A ``PlaceholderEditorAdmin`` to build CMS interfaces. 10 | * A default set of plugins to display WYSIWYG content, reStructuredText, highlighted code, Gist snippets and more. 11 | * an extensible plugin API. 12 | 13 | To get up and running quickly, consult the :ref:`quick-start guide `. 14 | The chapters below describe the configuration of each specific plugin in more detail. 15 | 16 | Preview 17 | ------- 18 | 19 | .. image:: /images/admin/placeholdereditoradmin1.png 20 | :width: 770px 21 | :height: 362px 22 | :alt: django-fluent-contents placeholder editor preview 23 | 24 | 25 | Getting started 26 | --------------- 27 | 28 | .. toctree:: 29 | :maxdepth: 2 30 | 31 | quickstart 32 | configuration 33 | templatetags 34 | optional-integration 35 | filters 36 | 37 | 38 | Using the plugins 39 | ----------------- 40 | 41 | .. toctree:: 42 | :maxdepth: 2 43 | 44 | plugins/index 45 | newplugins/index 46 | 47 | 48 | Advanced topics 49 | --------------- 50 | 51 | .. toctree:: 52 | :maxdepth: 2 53 | 54 | multilingual 55 | cms 56 | 57 | 58 | API documentation 59 | ----------------- 60 | 61 | .. toctree:: 62 | :maxdepth: 2 63 | 64 | api/index 65 | changelog 66 | 67 | 68 | Roadmap 69 | ======= 70 | 71 | The following features are on the radar for future releases: 72 | 73 | * Frontend editing support 74 | * Bridging other plugin systems, like Django CMS 75 | * Inline support (e.g. building a linklist plugin). 76 | 77 | Please contribute your improvements or work on these area's! 78 | 79 | Indices and tables 80 | ================== 81 | 82 | * :ref:`genindex` 83 | * :ref:`modindex` 84 | * :ref:`search` 85 | 86 | 87 | .. _django-polymorphic: https://github.com/django-polymorphic/django-polymorphic 88 | .. _django.contrib.contenttypes: https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/ 89 | -------------------------------------------------------------------------------- /docs/newplugins/index.rst: -------------------------------------------------------------------------------- 1 | .. _newplugins: 2 | 3 | Creating new plugins 4 | ==================== 5 | 6 | The idea of this module is that you can create a custom layout 7 | by defining "content items" for each unique design. 8 | 9 | Typically, a project consists of some standard modules, and additional custom items. 10 | Creating custom items is easy, and the following pages explain the details. 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | 15 | models 16 | rendering 17 | admin 18 | 19 | -------------------------------------------------------------------------------- /docs/plugins/disquscommentsarea.rst: -------------------------------------------------------------------------------- 1 | .. _disquscommentsarea: 2 | 3 | The disquscommentsarea plugin 4 | ============================= 5 | 6 | The `disquscommentsarea` plugin displays a comments area powed by DISQUS_. 7 | 8 | .. image:: /images/plugins/disquscommentsarea-admin.* 9 | :width: 732px 10 | :height: 61px 11 | 12 | This displays the DISQUS_ comments area: 13 | 14 | .. image:: /images/plugins/disquscommentsarea-html.* 15 | :width: 441px 16 | :height: 490px 17 | 18 | In the background, DISQUS_ uses a JavaScript include to embed the comments. 19 | Google indexes the comments nevertheless. 20 | 21 | The plugin uses django-disqus_ internally to render the HTML output. 22 | The django-disqus_ module also offers management commands 23 | to import the comments of django.contrib.comments_ to DISQUS_, 24 | or export the comments from DISQUS_ as JSON or WXR feed. 25 | 26 | 27 | Installation 28 | ------------ 29 | 30 | Install the dependencies via *pip*:: 31 | 32 | pip install django-fluent-contents[disquscommentsarea] 33 | 34 | This installs django-disqus_. 35 | 36 | Add the following settings to ``settings.py``: 37 | 38 | .. code-block:: python 39 | 40 | INSTALLED_APPS += ( 41 | 'disqus', 42 | 'fluent_contents.plugins.disquscommentsarea', 43 | ) 44 | 45 | DISQUS_API_KEY = '..' # Insert API key here. 46 | DISQUS_SHORTNAME = '..' # Insert the website shortname. 47 | 48 | 49 | Configuration 50 | ------------- 51 | 52 | The plugin does not provide any additional configuration, 53 | it fully relies on the templatetags of django-disqus_ to provide a proper comments area. 54 | 55 | * The API key can be created at the DISQUS_ website. 56 | You can `get your API key here`_ (you must be logged in on the DISQUS_ website). 57 | To see the shortname of your website, navigate to Settings->General on the DISQUS_ website. 58 | 59 | * Secondly, make sure the `django.contrib.sites` framework is configured, 60 | including the domain name where the pages should be displayed. 61 | 62 | .. tip:: 63 | 64 | While the DISQUS_ include provides all default styles, it can be useful to specify some default styling as well. 65 | This avoids any undesired minor jumps by page elements when DISQUS_ is loading. 66 | 67 | .. _get your API key here: http://disqus.com/api/get_my_key/ 68 | .. _DISQUS: http://disqus.com 69 | .. _django-disqus: https://github.com/arthurk/django-disqus 70 | .. _django.contrib.comments: https://docs.djangoproject.com/en/dev/ref/contrib/comments/ 71 | -------------------------------------------------------------------------------- /docs/plugins/gist.rst: -------------------------------------------------------------------------------- 1 | .. _gist: 2 | 3 | The gist plugin 4 | =============== 5 | 6 | The `gist` plugin provides highlighting of programming code snippets (referred to as `Gists `_), 7 | which are hosted at `GitHub `_. 8 | 9 | .. image:: /images/plugins/gist-admin.* 10 | :width: 732px 11 | :height: 146px 12 | 13 | Gist snippets are built by a JavaScript include, which renders the Gist with syntax highlighting: 14 | 15 | .. image:: /images/plugins/gist-html.* 16 | :width: 500px 17 | :height: 521px 18 | 19 | 20 | Installation 21 | ------------ 22 | 23 | Add the following settings to ``settings.py``: 24 | 25 | .. code-block:: python 26 | 27 | INSTALLED_APPS += ( 28 | 'fluent_contents.plugins.gist', 29 | ) 30 | 31 | The plugin does not provide additional configuration options, nor does it have dependencies on other packages. 32 | -------------------------------------------------------------------------------- /docs/plugins/googledocsviewer.rst: -------------------------------------------------------------------------------- 1 | .. _googledocsviewer: 2 | 3 | The googledocsviewer plugin 4 | =========================== 5 | 6 | The `googledocsviewer` plugin allows inserting an embedded Google Docs Viewer in the page. 7 | This can be used to display various files - like PDF or DOCX files - inline in the HTML page. 8 | 9 | .. image:: /images/plugins/googledocsviewer-admin.* 10 | :width: 732px 11 | :height: 208px 12 | 13 | The document is rendered by Google: 14 | 15 | .. image:: /images/plugins/googledocsviewer-html.* 16 | :width: 552px 17 | :height: 602px 18 | 19 | 20 | Installation 21 | ------------ 22 | 23 | Add the following settings to ``settings.py``: 24 | 25 | .. code-block:: python 26 | 27 | INSTALLED_APPS += ( 28 | 'fluent_contents.plugins.googledocsviewer', 29 | ) 30 | 31 | The plugin does not provide additional configuration options, nor does it have dependencies on other packages. 32 | 33 | The Google Docs Viewer is rendered as ``'.format( 33 | src=escape(url), width=instance.width, height=instance.height 34 | ) 35 | ) 36 | -------------------------------------------------------------------------------- /fluent_contents/plugins/googledocsviewer/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | from django.db import migrations, models 2 | 3 | import fluent_contents.utils.validators 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [("fluent_contents", "0001_initial")] 9 | 10 | operations = [ 11 | migrations.CreateModel( 12 | name="GoogleDocsViewerItem", 13 | fields=[ 14 | ( 15 | "contentitem_ptr", 16 | models.OneToOneField( 17 | parent_link=True, 18 | auto_created=True, 19 | primary_key=True, 20 | serialize=False, 21 | to="fluent_contents.ContentItem", 22 | on_delete=models.CASCADE, 23 | ), 24 | ), 25 | ( 26 | "url", 27 | models.URLField( 28 | help_text="Specify the URL of an online document, for example a PDF or DOCX file.", 29 | verbose_name="File URL", 30 | ), 31 | ), 32 | ( 33 | "width", 34 | models.CharField( 35 | default="100%", 36 | help_text="Specify the size in pixels, or a percentage of the container area size.", 37 | max_length=10, 38 | verbose_name="Width", 39 | validators=[fluent_contents.utils.validators.validate_html_size], 40 | ), 41 | ), 42 | ( 43 | "height", 44 | models.CharField( 45 | default="600", 46 | help_text="Specify the size in pixels.", 47 | max_length=10, 48 | verbose_name="Height", 49 | validators=[fluent_contents.utils.validators.validate_html_size], 50 | ), 51 | ), 52 | ], 53 | options={ 54 | "db_table": "contentitem_googledocsviewer_googledocsvieweritem", 55 | "verbose_name": "Embedded document", 56 | "verbose_name_plural": "Embedded document", 57 | }, 58 | bases=("fluent_contents.contentitem",), 59 | ) 60 | ] 61 | -------------------------------------------------------------------------------- /fluent_contents/plugins/googledocsviewer/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/googledocsviewer/migrations/__init__.py -------------------------------------------------------------------------------- /fluent_contents/plugins/googledocsviewer/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import gettext_lazy as _ 3 | 4 | from fluent_contents.models import ContentItem, ContentItemManager 5 | from fluent_contents.utils import validate_html_size 6 | 7 | 8 | class GoogleDocsViewerItem(ContentItem): 9 | """ 10 | A Google Docs viewer that is displayed at the page. 11 | """ 12 | 13 | url = models.URLField( 14 | _("File URL"), 15 | help_text=_("Specify the URL of an online document, for example a PDF or DOCX file."), 16 | ) 17 | width = models.CharField( 18 | _("Width"), 19 | max_length=10, 20 | validators=[validate_html_size], 21 | default="100%", 22 | help_text=_("Specify the size in pixels, or a percentage of the container area size."), 23 | ) 24 | height = models.CharField( 25 | _("Height"), 26 | max_length=10, 27 | validators=[validate_html_size], 28 | default="600", 29 | help_text=_("Specify the size in pixels."), 30 | ) 31 | 32 | objects = ContentItemManager() # Avoid Django 1.10 migrations 33 | 34 | class Meta: 35 | verbose_name = _("Embedded document") 36 | verbose_name_plural = _("Embedded document") 37 | 38 | def __str__(self): 39 | return self.url 40 | -------------------------------------------------------------------------------- /fluent_contents/plugins/iframe/__init__.py: -------------------------------------------------------------------------------- 1 | VERSION = (0, 1) 2 | -------------------------------------------------------------------------------- /fluent_contents/plugins/iframe/content_plugins.py: -------------------------------------------------------------------------------- 1 | """ 2 | Plugin to add an ``'.format( 19 | src=escape(instance.src), width=instance.width, height=instance.height 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /fluent_contents/plugins/iframe/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | from django.db import migrations, models 2 | 3 | import fluent_contents.utils.validators 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [("fluent_contents", "0001_initial")] 9 | 10 | operations = [ 11 | migrations.CreateModel( 12 | name="IframeItem", 13 | fields=[ 14 | ( 15 | "contentitem_ptr", 16 | models.OneToOneField( 17 | parent_link=True, 18 | auto_created=True, 19 | primary_key=True, 20 | serialize=False, 21 | to="fluent_contents.ContentItem", 22 | on_delete=models.CASCADE, 23 | ), 24 | ), 25 | ("src", models.URLField(verbose_name="Page URL")), 26 | ( 27 | "width", 28 | models.CharField( 29 | default="100%", 30 | help_text="Specify the size in pixels, or a percentage of the container area size.", 31 | max_length=10, 32 | verbose_name="Width", 33 | validators=[fluent_contents.utils.validators.validate_html_size], 34 | ), 35 | ), 36 | ( 37 | "height", 38 | models.CharField( 39 | default="600", 40 | help_text="Specify the size in pixels.", 41 | max_length=10, 42 | verbose_name="Height", 43 | validators=[fluent_contents.utils.validators.validate_html_size], 44 | ), 45 | ), 46 | ], 47 | options={ 48 | "db_table": "contentitem_iframe_iframeitem", 49 | "verbose_name": "Iframe", 50 | "verbose_name_plural": "Iframes", 51 | }, 52 | bases=("fluent_contents.contentitem",), 53 | ) 54 | ] 55 | -------------------------------------------------------------------------------- /fluent_contents/plugins/iframe/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/django-fluent/django-fluent-contents/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/iframe/migrations/__init__.py -------------------------------------------------------------------------------- /fluent_contents/plugins/iframe/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import gettext_lazy as _ 3 | 4 | from fluent_contents.models import ContentItem, ContentItemManager 5 | from fluent_contents.utils import validate_html_size 6 | 7 | 8 | class IframeItem(ContentItem): 9 | """ 10 | An ``