Closed Bug 757202 Opened 12 years ago Closed 12 years ago

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

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asqueella, Assigned: asqueella)

Details

(Whiteboard: t=2012-05-29)

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.
https://github.com/mozilla/kuma/pull/220/
Assignee: nobody → asqueella
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/aa4e397a14e2845b2b08a5da06cd257d8ddca36c
Bug 757202: miscellaneous Table of Contents fixes

* Set initial value for the check box on edit_document appropriately.
  (apps/wiki/forms.py)
* 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

https://github.com/mozilla/kuma/commit/56bccba604be092ffdd3f5a3e64c6628b949190f
Merge pull request #220 from nickolay/757202-table-of-contents

Bug 757202: miscellaneous Table of Contents fixes
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: t=2012-05-29
Version: Kuma → unspecified
Component: Docs Platform → Editing
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.