{ "info": { "author": "George Ma", "author_email": "george.ma1982@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "=====================\ndjango-html-sweatshop\n=====================\n\nSome common html renderings are tedious. Let django-html-sweatshop do the hard work.\n\nFeatures\n========\n\n- Digg style pagination with optional integration with django-tables2\n\n- Display messages\n\n- Pop up confirmation dialog before deleting\n\nInstallation\n============\n\nTo get started using ``django-html-sweatshop``:\n\n- install it with ``pip``::\n\n $ pip install django-html-sweatshop\n\n- add the app to ``INSTALLED_APPS``::\n\n INSTALLED_APPS = (\n ...\n 'html_sweatshop',\n \t'django_tables2', #Required if you need digg style pagination\n ...\n )\n\nDigg Style Pagination\n=====================\n\nA set of tags are provided to render digg style pagination. To use these tags, load them in the template\n\n\t{% load digg_pagination_tags %}\n\nRaw Pagination\n--------------\n\nUsage::\n\n\t{% digg_paginator page_obj page_field theme %}\n\nThis is the raw way to render pagination. You have to take care of actual work of pagination (some generic view can do that part of work for you) as outlined in https://docs.djangoproject.com/en/1.9/topics/pagination/. This tag will take care of the rendering of pagination. It provides greater flexibility than the other two.\n\n``page_obj``\n\n\tOptional. A page object as outlined in https://docs.djangoproject.com/en/1.9/topics/pagination/#page-objects. By default, a variable named \"page_obj\" in the context will be used if it's not provided.\n\n``page_field``\n\n\tOptional. The name of the page parameter in the url. For example, if \"page_field\" is set to \"page\", when the link of the second page is clicked, \"page=2\" will be appended to the url. The default value is \"page\".\n\n``theme``\n\n\tOptional. The theme pack to use. Right now Bootstrap 3 is the only valid theme available. So there's no need to set this parameter.\n\nDjango-table2 Integration\n------------------------------\n\nUsage::\n\n\t{% digg_paginator_tables2 table theme %}\n\nThis tag provides integration with django-tables2. It's usually used along side with the SingleTableView generic view shipped with django-tables2. But the tables rendered by django-tables2 tag might look alien with the pagination without overriding the default table template.\n\n``table``\n\n\tOptional. A table instance of django-tables2. Please refer to django-tables2 document regarding table class. By default, a variable named \"table\" in the context will be used if it's not provided.\n\n``theme``\n\n\tOptional. The theme pack to use. Right now Bootstrap 3 is the only valid theme available. So there's no need to set this parameter.\n\nDjango-table2 Seamless Integration\n----------------------------------\n\nUsage::\n\n\t{% render_paginated_table table theme %}\n\nThis tag provides seamless integration with django-tables2. Unlike the other two tags which only render pagination, this tag render table and pagination altogether.\n\n``table``\n\n\tOptional. A table instance of django-tables2. Please refer to django-tables2 document regarding table class. By default, a variable named \"table\" in the context will be used if it's not provided.\n\n``theme``\n\n\tOptional. The theme pack to use. Right now Bootstrap 3 is the only valid theme available. So there's no need to set this parameter.\n\nMessage Centre\n==============\n\nA tag to display all the messages with meaningful background color and icons. To use this tag, load it in the template\n\n\t{% load message_centre_tags %}\n\nThen at where you want to display the messages\n\n\t{% message_centre dismissible theme %}\n\n``dismissible``\n\n\tOptional. A boolean value to indicate if the messages are dissmissible (depending on the theme pack). By default, its value is HTML_SWEATSHOP_MESSAGE_CENTRE_MESSAGE_DISMISSIBLE which defaults to True.\n\n``theme``\n\n\tOptional. The theme pack to use. Right now Bootstrap 3 is the only valid theme available. So there's no need to set this parameter.\n\nOne Step Delete\n===============\n\nDeleteView generic view makes deletion a two step process. First step, a confirmation page is rendered. Second step, the deletion is submitted. But in most systems, it's more desirable to simply pop up a confirmation modal before submitting the deletion, all happening on the same page.\n\nA tag and a Jquery plugin are provided to make it simpler.\n\nLoad the tag definition\n-----------------------\n\n\t{% load one_step_delete_tags static %}\n\nLoad the JQuery plugin\n----------------------\n\nLoad the JQuery plugin at where js should be included. It's your own responsibility to include JQuery itself.\n\n\t{% include_one_step_delete_js %}\n\t\n\t\n\nRender delete buttons\n---------------------\n\nRender delete buttons depending on the theme pack. Take Bootstrap 3 theme as an example, a delete button can be\n\n\t\n\nA few JQuery plugin specific data properties can be defined to allow multiple delete buttons to share the same confirmation modal.\n\n``data-modal-title``\n\n\tReplace the modal title with this value when the button is clicked.\n\n``data-modal-action``\n\n\tReplace the action url of deletion submission with this value when the button is clicked.\n\n``data-obj-description``\n\n\tIf you are satisfied with the overall message in the modal body, you can replace the description of the object to delete with this value to fine tune the message when the button is clicked. \n\n``data-body``\n\n\tReplace the message of the modal body with this value totally when the button is clicked.\n\nRender confirmation modals\n--------------------------\n\nUse the following tag to render the confirmation modal. You can render each confirmation modal for each delete button or you can render one to be shared among delete buttons.\n\n\t{% render_confirm_modal dialog_id obj obj_description url title body theme %}\n\n``dialog_id``\n\n\tOptional. The HTML id of the confirmation modal. Defaults to \"confirmation-modal\".\n\n``obj``\n\n\tOptional. A model object to be deleted. Once provided, a default confirmation message can be inferred by the tag.\n\n``obj_description``\n\n\tOptional. The default confirmation message use the verbose name of \"obj\" as the description. It can be overridden by this parameter.\n\n``url``\n\n\tOptional. The action url delete is submitted to. By default it's empty.\n\n``title``\n\n\tOptional. The title of the confirmation modal. By default, it's \"Are you sure?\"\n\n``body``\n\n\tOptional. Used to override the whole default confirmation message.\n\n``theme``\n\n\tOptional. The theme pack to use. Right now Bootstrap 3 is the only valid theme available. So there's no need to set this parameter.\n\nSettings\n========\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_LEADING_PAGE_RANGE_DISPLAYED``\n\n\tDefaults to 10\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_TRAILING_PAGE_RANGE_DISPLAYED``\n\n\tDefaults to 10\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_NUM_PAGES_OUTSIDE_RANGE``\n\n\tDefaults to 2\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_LEADING_PAGE_RANGE``\n\n\tDefaults to 8\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_TRAILING_PAGE_RANGE``\n\n\tDefaults to 8\n\n``HTML_SWEATSHOP_DIGG_PAGINATION_ADJACENT_PAGES``\n\n\tDefaults to 4\n\n``HTML_SWEATSHOP_THEME``\n\n\tThe theme pack to use. Defauls to 'bootstrap3'\n\n``HTML_SWEATSHOP_MESSAGE_CENTRE_MESSAGE_DISMISSIBLE``\n\n\tIf the messages are dimissible. Defaults to True\n\nDemo\n====\n\nCheckout the source codes. Inside the source codes folder, run the following commands:\n\n\tmkvirtualenv demo\n\t\n\tpip install -r requirements.txt\n\t\n\tpython manage.py runserver\n\nHow to contribute\n=================\n\nFork the project and submit pull requests. Need more theme packs.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/georgema1982/django-html-sweatshop", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-html-sweatshop", "package_url": "https://pypi.org/project/django-html-sweatshop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-html-sweatshop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/georgema1982/django-html-sweatshop" }, "release_url": "https://pypi.org/project/django-html-sweatshop/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A Django app that simplifies some common HTML rendering", "version": "0.1.0" }, "last_serial": 2182153, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b8f782fad593aef73a5aa1c8fb3dfbc3", "sha256": "d46c7ea93f45f00f98ee1b1755e01c90e02ad405dfd3d45269fa52fc7d4e28d0" }, "downloads": -1, "filename": "django-html-sweatshop-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b8f782fad593aef73a5aa1c8fb3dfbc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12088, "upload_time": "2016-06-22T21:44:21", "url": "https://files.pythonhosted.org/packages/ab/e7/95e7498a5cf51f38693a74f9b9adc1790fa07d117850e10220064233767f/django-html-sweatshop-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b8f782fad593aef73a5aa1c8fb3dfbc3", "sha256": "d46c7ea93f45f00f98ee1b1755e01c90e02ad405dfd3d45269fa52fc7d4e28d0" }, "downloads": -1, "filename": "django-html-sweatshop-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b8f782fad593aef73a5aa1c8fb3dfbc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12088, "upload_time": "2016-06-22T21:44:21", "url": "https://files.pythonhosted.org/packages/ab/e7/95e7498a5cf51f38693a74f9b9adc1790fa07d117850e10220064233767f/django-html-sweatshop-0.1.0.tar.gz" } ] }