gnowledge/gstudio — pull request #183 by AvadootNachankar (2014-02-17 19:45:20+00:00)
Title: Page-node can now also be deleted (actually hiding from UI) but only by it's creator

* In models.py file:
- STATUS_CHOICES_TU: Variable added that holds mongokit's IS operator with values (u'DRAFT', u'HIDDEN', u'PUBLISHED')
- This variable is assigned to Node class's 'status' field; it means 'status' can hold a value only from one of the three given values!
- By default, for status field -- 'DRAFT' value is set from now onwards for every document that gets created.

* In urls/page.py file:
- 'page_delete' url is added that accepts group_name and node's ObjectId as it's parameters; and in turn calls to a view function named 'delete_page'.

* In views/page.py file:
- 'delete_page' view function: Updates the status field to 'HIDDEN' for the node whose ObjectId is passed to it!
NOTE: Here instead of mongodb's save() function, update() function is used.
- In page-list-view, those pages are listed: which are public pages, belongs to the current accessed group and whose status is other than 'HIDDEN'.

* In node_edit_base.html:
- Positions of Tag and Privacy elements are swapped.