Django Scratchpad ========================== Django-scratchpad is an applitation for managing scratchpads in a multi-user way. This application needs: django-muaccounts django-saaskit-todo django-threadedcomments to be already installed. Table of Contents ================= 1 Installation 2 Models 3 Views 4 URLs 5 Template tags 6 Templates 7 Example code 8 Integration with cs-kit 9 Bugs and omissions 1 Installation ~~~~~~~~~~~~~~ Copy or symlink `scratchpad/' subdirectory to Python path. Copy or symlink 'templates/' subdirectory to project templates folder. In order to use application, add `scratchpad' to INSTALLED_APPS in Django project `settings.py' file. Add: (r'^scratchpad/', include('scratchpad.urls')) in your urls.py run python manage.py syncdb 2 Models ~~~~~~~~ Application defines 3 models. ScratchPad, associated with a muaccount. Item, stores the scratch'ed data 3 Views ~~~~~~~ view_list List all scratchpads a site has new_scratchpad Shows new scratchpad form and does the actual form processing del_item [item_id] Delete an item from a scratchpad scratchpad_del [scratch_id] Delete a scratchpad scratchpad [scratch_id] Shows list items in a scratchpad add_to Show add-to form save Save item sent via add-to form item [item_id] Shows scratchpad item details test Test page of add-to scratchpad tag 4 URLs ~~~~~~ scratchpad/list List all the scratchpads associated with the muaccount, and shows a new scratchpad form scratchpad/new Shows only the new scratchpad form scratchpad/<scratch_id> List all items in a scratchpad scratchpad/test Shows a test page with text and images to test the "add to scratchpad" template tag. 5 Template Tag ~~~~~~~~~~~~~~ In scratchpad/templatetags is the, so far, basic template tag. It's used by, first, adding {% load scratchpad_tags %} in your template And then adding {% get_add_to_html 'HTML_ITEM_ID' %} HTML_ITEM_ID is the id of the element you wish to be added into the scratchpad. This will generate a link that will send, via POST, the HTML_ITEM_ID content to our "add to scratchpad" form. Your page where you'll be showing this template needs to have this code in <head> <script> function addToScratchPad(id) { obj = document.getElementById(id); frm = document.getElementById("scratchpad_add_"+id); frm.data.value = obj.innerHTML; frm.submit(); } </script> 6 Templates ~~~~~~~~~~~ addto_scratchpad.html Form shown in "add to scratchpad" page confirmdel_scratchpad_item.html Page to confirm deletion of a scratchpad item confirmdel_scratchpad.html Page to confirm deletion of a scratchpad list_scratchpads.html List all scratchpads and shows a form to add a new scratchpad new_scratchpad.html Form to add a new scratchpad test.html Test page for "add to scratchpad" tag. view_scratchpad_item.html Show scratchpad's item details view_scratchpad.html Show scratchpad details and it's items. 7 Example code ~~~~~~~~~~~~~~ Example usage and templates are available as `django-saaskit-scratchpad' project at [http://github.com/saas-kit/django-saaskit-scratchpad/] 8 Integration with cs-kit ~~~~~~~~~~~~~~~~~~~~~~~~~ No modifications have been done in cs-kit. All integration was done in django-saaskit-scratchpad with modifications in django-saaskit-todo and django-threaddedcomments django-saaskit-todo: * Template modifications: * use body block instead of content block * use head instead of extrahead * Some links have been added to allow scratchpad<->tasks navegation * Views/Models/Forms modifications: * models.List now uses account = models.ForeignKey(muamodels.MUAccount) instead of group = models.ForeignKey(Group) to group tasks and tasks list. * All security checkings in view now check if current user is in a member or the owner of the active muaccoubn * All forms now filter available users to assign task to members and owner of the muaccount. django-threadedcomments: * Template modifications: * threadedcomments_base.html * Extends base.main * Use body block instead of content block
zhaque/django-saaskit-scratchpad
a scratchpad to store audio, video, image, text, urls and share it with others.
PythonNOASSERTION