{ "info": { "author": "abidibo", "author_email": "abidibo@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development" ], "description": "# django-resckeditor\n\nThis is a django app which provides and infrastructure you can use to include custom contents of other apps directly inside ckeditor.\n\nIt requires [django-ckeditor](https://github.com/django-ckeditor/django-ckeditor)\n\nIt defines a custom CKEDITOR plugin which implements two dialog tabs: the first to select the resource, and the second to dynamically set options.\n\n**Full documentation**: [https://django-resckeditor.readthedocs.io/en/latest/](https://django-resckeditor.readthedocs.io/en/latest/)\n\n![Screenshot](docs/images/list.png)\n![Screenshot](docs/images/options.png)\n\n## Getting Started\n\nInstall django-resckeditor:\n\n $ pip install django-resckeditor\n\nAdd resckeditor to your installed apps:\n\n INSTALLED_APPS = (\n # ...\n 'ckeditor',\n 'ckeditor_uploader',\n 'resckeditor',\n # ...\n )\n\nadd the urls in your core application:\n\n urlpatterns = [\n # ...\n url(r'^resckeditor/', include('resckeditor.urls', namespace='resckeditor')),\n ]\n\n**N.B.** do not change the **resckeditor** path, since it is hardcoded in the js code.\n\nAdd the resource and ajax plugins to your ckeditor instance:\n\n CKEDITOR_CONFIGS = {\n 'default': {\n 'skin': 'moono',\n 'toolbar_Full': [\n // ..\n ['Res'/*, ...*/],\n // ..\n ],\n 'toolbar': 'Full',\n // ...\n 'extraPlugins': 'ajax,resource',\n }\n }\n\nDefine functions export resources for ckeditor, so for example in your settings:\n\n RESCKEDITOR_CONFIG = {\n 'RESOURCES': [\n {\n 'list': 'path.to.module.func.defining.resources',\n 'output': 'path.to.module.func.returning.html',\n 'label': 'My group of widgets'\n },\n ]\n }\n\n\nThe `list` function is invoked without arguments and should return a dictionary defining all the available resources\n(i.e. all the news we want to export) and the available options:\n\n def my_list_function():\n res = []\n for n in News.objects.published():\n res.append({\n 'label': n.title,\n 'id': n.id\n })\n return {\n 'resources': res,\n 'options': [\n {\n 'type': 'text',\n 'name': 'news-dialog-options-section-title',\n 'label': 'Last News',\n 'default': ''\n },\n {\n 'type': 'checkbox',\n 'name': 'news-dialog-options-show-title',\n 'label': 'Show title',\n 'default': True\n },\n {\n 'type': 'number',\n 'name': 'news-dialog-options-num-chars',\n 'label': 'Number of chars',\n 'default': 50\n },\n {\n 'type': 'select',\n 'name': 'news-dialog-options-layout',\n 'label': 'Layout',\n 'data': [\n {'label': 'one row', 'value': 'row'},\n {'label': 'two columns', 'value': 'col-2'},\n {'label': 'three columns', 'value': 'col-3'},\n {'label': 'four columns', 'value': 'col-4'},\n ]\n }\n ]\n\n }\n\nThe `output` function will receive the id of the resource selected and a dictionary containing the provided options.\nIt should return the html output of the resource.\n\n def my_output_function(id, options):\n n = News.objects.get(pk=id)\n return '

%s

' % n.title\n\n## Supported options\n\nCurrently only 4 types of options are supported: checkbox, text, number and select, but should be sufficient for almost all use cases.\nThe syntax and required properties are the one you may se in the example above (text has the same props as number).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/otto-torino/django-resckeditor", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-resckeditor", "package_url": "https://pypi.org/project/django-resckeditor/", "platform": "", "project_url": "https://pypi.org/project/django-resckeditor/", "project_urls": { "Homepage": "http://github.com/otto-torino/django-resckeditor" }, "release_url": "https://pypi.org/project/django-resckeditor/1.0.0/", "requires_dist": [ "django-ckeditor" ], "requires_python": "", "summary": "A django app which provides and infrastructure you can use to include custom contents of other apps directly inside ckeditor.", "version": "1.0.0" }, "last_serial": 4725657, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1275ab2e4edfbf49e6e2855e4e659766", "sha256": "ee770ce9b2f0ff3f16c0c0971041fe1a72d417a5a5f84fd3f8984c065a253642" }, "downloads": -1, "filename": "django_resckeditor-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1275ab2e4edfbf49e6e2855e4e659766", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17310, "upload_time": "2019-01-22T11:57:48", "url": "https://files.pythonhosted.org/packages/46/21/46c53a71cb3182b17c55575c11ab4a01412c9a3740855613ed9af3c999f9/django_resckeditor-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afac96c42cc78bb59c02ba590040b440", "sha256": "e8030034b6ad49724fa918adb0de125cb5a266b81d9b16bed8ff27dd8a44cf26" }, "downloads": -1, "filename": "django-resckeditor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "afac96c42cc78bb59c02ba590040b440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15611, "upload_time": "2019-01-22T11:57:50", "url": "https://files.pythonhosted.org/packages/89/ff/ffab60d13068c1f4953f98f679151dde0d7d6989fd007b19350fad783ad0/django-resckeditor-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1275ab2e4edfbf49e6e2855e4e659766", "sha256": "ee770ce9b2f0ff3f16c0c0971041fe1a72d417a5a5f84fd3f8984c065a253642" }, "downloads": -1, "filename": "django_resckeditor-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1275ab2e4edfbf49e6e2855e4e659766", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17310, "upload_time": "2019-01-22T11:57:48", "url": "https://files.pythonhosted.org/packages/46/21/46c53a71cb3182b17c55575c11ab4a01412c9a3740855613ed9af3c999f9/django_resckeditor-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afac96c42cc78bb59c02ba590040b440", "sha256": "e8030034b6ad49724fa918adb0de125cb5a266b81d9b16bed8ff27dd8a44cf26" }, "downloads": -1, "filename": "django-resckeditor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "afac96c42cc78bb59c02ba590040b440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15611, "upload_time": "2019-01-22T11:57:50", "url": "https://files.pythonhosted.org/packages/89/ff/ffab60d13068c1f4953f98f679151dde0d7d6989fd007b19350fad783ad0/django-resckeditor-1.0.0.tar.gz" } ] }