kuma: "table of contents" checkbox not populated on edit, should default to True and be editable on new pages



Mozilla Developer Network
6 years ago
6 years ago


(Reporter: Nickolay_Ponomarev, Assigned: Nickolay_Ponomarev)



(Whiteboard: t=2012-05-29)



6 years ago
This is a follow-up to bug 665715 and bug 742516.

We have a checkbox 'Generate Table of contents' in the document metadata (visible after you click on the (i) near the title) on the edit_document pages (with URLs docs/...$edit). The checkbox defaults to True for pages migrated from MT.

There are a few issues with it:
1) If you edit a page with TOC enabled, the checkbox will be unchecked.
   This is because the show_toc is missing from the Meta class on
   kuma.apps.wiki.forms.RevisionForm, see https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form

2) The checkbox is missing from the new_document template meaning that in order
   to uncheck it you have to edit the page again after saving.

3) New documents created via /docs/new have the TOC disabled, despite the fact
   that the default for show_toc in the model is True. This is because the 
   form elements have their own defaults unrelated to the model.

4) The checkbox label looks weird due to the max-width CSS rule for the labels.
   I think changing it to say "TOC" (with tooltip explaining what it does) is the
   easiest way to fix this.

Pull request coming up.

Comment 1

6 years ago
Assignee: nobody → asqueella

Comment 2

6 years ago
Commits pushed to master at https://github.com/mozilla/kuma

Bug 757202: miscellaneous Table of Contents fixes

* Set initial value for the check box on edit_document appropriately.
* Add the TOC checkbox on the new_document page.
* Enable TOC on new pages by default (apps/wiki/views.py)
* Change the checkbox label to fit the label's width

Merge pull request #220 from nickolay/757202-table-of-contents

Bug 757202: miscellaneous Table of Contents fixes


6 years ago
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: t=2012-05-29
Version: Kuma → unspecified
Component: Docs Platform → Editing
Product: Mozilla Developer Network → Mozilla Developer Network
You need to log in before you can comment on or make changes to this bug.