{ "info": { "author": "Byron Ruth", "author_email": "b@devel.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "Intended Audience :: Healthcare Industry", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-concerns\n\nA good use of thiapp was in a web app containing de-identifed patient information\n\n\n## Install\n\n```bash\npip install django-concerns\n```\n\n\n## Setup\n\nAdd `concerns` to `INSTALLED_APPS` along with the following Django contrib apps:\n\n```python\nINSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.sites',\n 'concerns',\n ...\n)\n```\n\nAt a minimum, the following middleware must be installed:\n\n```python\nMIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n)\n```\n\nInclude the `concerns.urls` in the the `ROOT_URLCONF`:\n\n```python\nfrom django.conf.urls import url, patterns, include\n\nurlpatterns = patterns('',\n url(r'^concerns/', include('concerns.urls')),\n ...\n)\n```\n\n\n## Settings\n\n- `CONCERN_EMAIL_SUBJECT` - The subject-line of the email sent to managers. Defaults to `Concern Report for {site}` where `{site}` is a string formatting variable for the current site's name, e.g. `Concern Report for example.com`\n- `CONCERN_RESOLVERS` - A list or tuple with the same structure as `ADMINS` and `MANAGERS` of users who should receive an email when a concern is reported.\n- `CONCERN_STATUSES` - A list of statuses that a reported concern could be in during review. The first status in the list is used as the default for new concerns. Default are `New`, `In Review`, `Duplicate`, and `Closed`.\n\n\n## Templates\n\nThe templates that come with the django-concerns are functional, but _very_ minimal:\n\n- `concerns/concern_list.html` - Renders a list of concerns with links to their detail pages\n - Context received:\n - `concerns` - `Concern` queryset\n- `concerns/concern_detail.html`\n - Context received:\n - `concern` - `Concern` instance\n - `form` - Minimal form for resolving the concern.\n- `concerns/report_concern.html`\n - Context recieved:\n - `form` - Minimal form for reporting a concern.\n\nAn email template is also provided and can be customized as well:\n\n- `concerns/concern_email.txt`\n - Context recieved:\n - `protocol` - The site's protocol, either `http` or `https` for constructing the permalink to the concern detail page.\n - `site` - The `site` object which contains the domain for constructing the permalink.\n - `concern` - The `concern` instance itself for including details about the concern or getting the absolute URL.\n\n\n## Usage\n\nThe recommended way for exposing a \"report a concern\" form in your application is having button that opens an in-page modal/dialog for filling out details of the concern. Most likely the concern they have is about something on the page they are currently viewing, so directing them to a separate page to fill out the form is not generally a good idea since they will lose the exact state of the page (in case it is not static).\n\nThe `Concern` model has a field `document` that is used for storing the HTML captured at the time of the concern was reported. JavaScript can be used to capture the HTML in the current state. We recommend using [jquery.freeze](http://cbmi.github.io/jquery.freeze/) which makes it trivial to _freeze_ the current state of the DOM. Note that if a modal is used, it should be hidden prior to freeze the DOM, otherwise the modal will visible in the HTML when the concern is reported.\n\n```javascript\n// Bind to button or listen for a event, freeze the dom and send\n// a POST to log the document. The server-side could write the data\n// to an HTML file for later viewing.\n$('#freezer').click(function(event) {\n event.preventDefault();\n $.post('/screenlog/', $.param({document: $.freeze()}));\n});\n```\n\n### Example: Bootstrap's Modal\n\nThis example assumes [Bootstrap 2.3.2](http://getbootstrap.com/2.3.2/) is being used (version 3 requires minor changes) as well as jquery.freeze.js (recommended above).\n\n**Modal HTML markup**\n\n```html\n
When you click \"Submit Concern\", a copy of this Web page will be sent to the administrators. Please provide any additional details regarding the concern we might not be able to see on the page.
\n \nUnfortunately the submission \\\n failed. Please contact us at foo@example.com \\\n with as much detail as you can about the nature of the concern. Thank you.
'\n\n// Bind to click event of the submission button\nconcernSubmit.on('click', function(event) {\n event.preventDefault();\n // Hide the modal before freezing the DOM\n concernModal.modal('hide');\n\n var data = $.param({\n document: $.freeze(),\n comment: concernComment.val(),\n });\n\n $.ajax({\n type: 'POST',\n data: data,\n url: concernSubmit.data('url'),\n success: function(resp) {\n // Clear comment box, temporarily show 'thank you' message on button\n concernComment.val('');\n\n var buttonText = concernButton.text();\n concernButton.addClass('btn-success').text('Submitted. Thank You!')\n setTimeout(function() {\n concernButton.removeClass('btn-success').text(buttonText);\n }, 3000);\n },\n error: function(xhr, code, error) {\n // Re-open modal with fallback message\n concernModal.modal('open');\n concernComment.before(fallbackMessage);\n }\n });\n});\n```\n", "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/cbmi/django-concerns/", "keywords": "PHI privacy concerns", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-concerns", "package_url": "https://pypi.org/project/django-concerns/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-concerns/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/cbmi/django-concerns/" }, "release_url": "https://pypi.org/project/django-concerns/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Django app for reporting privacy concerns", "version": "0.1.0" }, "last_serial": 858792, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "373af652c546d864a755a8b2b253bb04", "sha256": "aca5c43234d4d9e52047ab1530023ee765d872532da3c29b7af7995b051d6283" }, "downloads": -1, "filename": "django-concerns-0.1.0.tar.gz", "has_sig": false, "md5_digest": "373af652c546d864a755a8b2b253bb04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10164, "upload_time": "2013-09-06T15:04:02", "url": "https://files.pythonhosted.org/packages/69/70/e3befb79d3200532cf11ac57d21b6d0392cfa45dc337eea0bca1ff3b60ea/django-concerns-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "373af652c546d864a755a8b2b253bb04", "sha256": "aca5c43234d4d9e52047ab1530023ee765d872532da3c29b7af7995b051d6283" }, "downloads": -1, "filename": "django-concerns-0.1.0.tar.gz", "has_sig": false, "md5_digest": "373af652c546d864a755a8b2b253bb04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10164, "upload_time": "2013-09-06T15:04:02", "url": "https://files.pythonhosted.org/packages/69/70/e3befb79d3200532cf11ac57d21b6d0392cfa45dc337eea0bca1ff3b60ea/django-concerns-0.1.0.tar.gz" } ] }