[checklist] Implement checklist templates in account pages

Review Request #7099 — Created March 21, 2015 and submitted

Sunxperous
rb-extension-pack
6969, 7103
7176
d09b682...
rb-extension-pack, students

An additional functionality of the checklist extension is to allow users to create individual templates which can be quickly added to any existing checklists. This change does not enable checklist templates to be imported into existing checklists.

Checklist templates are stored with two attributes, their title as a string and their list of items in JSON format.

The form for users to modify their checklist templates is under their account preferences page. In the form, users can add checklist templates, remove checklist templates, or edit an existing checklist template.

The form will automatically add new item fields when it detects that the user is editing the last item field, or when the user presses enter.

On Chrome 41.0.2272 and Safari 8.0.2:

  • Basic CRUD functionality - adding, editing and removing - works as it should.
  • Does not accept templates without a title.
  • Empty items are not included upon form submission.
  • Tested and ensured that the UI shortcuts (enter, tab) work.
  • Verified that the issue where the menu entry will disappear has been resolved (after #7103).
  • Ensured that users can only view and edit their own templates.
Loading file attachments...

  • 0
  • 0
  • 24
  • 0
  • 24
Description From Last Updated
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. checklist/checklist/extension.py (Diff revision 1)
     
     
     'AccountPageFormsHook' imported but unused
    
  3. checklist/checklist/extension.py (Diff revision 1)
     
     
    Col: 50
     E231 missing whitespace after ','
    
  4. checklist/checklist/extension.py (Diff revision 1)
     
     
    Col: 56
     E231 missing whitespace after ','
    
  5. checklist/checklist/extension.py (Diff revision 1)
     
     
    Col: 80
     E501 line too long (83 > 79 characters)
    
  6. checklist/checklist/models.py (Diff revision 1)
     
     
    Col: 1
     W391 blank line at end of file
    
  7. Col: 1
     E302 expected 2 blank lines, found 1
    
  8.  undefined name 'ObjectDoesNotExist'
    
  9.  undefined name 'DOES_NOT_EXIST'
    
  10. 
      
  1. Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2.  undefined name 'webapi_response_errors'
    
  3. 
      
  1. Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/checklist.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. 
      
  1. Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. 
      
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. 
      
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. 
      
david
  1. 
      
  2. No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective).

  3. No blank line here (django, djblets, and reviewboard are all "3rd party" from checklist's perspective).

  4. These can also be chained, eliminating the need to define $itemLi (which seems to be missing a var statement anyway):

    $('<li class="rbchecklist-template-item" />')
        .text(item)
        .appendTo($items);
    
  5. These can be chained:

    this.$el
        .hide()
        .before(editView.$el);
    
  6. In javascript, a trailing comma on the last entry in an array or object can break on some browsers.

  7. We generally use _$ instead of $_ for internal jquery variables.

  8. In javascript, a trailing comma on the last entry in an array or object can break on some browsers.

  9. This needs to independently test keyCode against ENTER and 13. Right now this evaluates to only testing against ENTER:

    if (event.keyCode === $.ui.keyCode.ENTER ||
        event.keyCode === 13) {
    
  10. 
      
  1. Tool: PEP8 Style Checker
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        checklist/checklist/models.py
        checklist/checklist/resources/checklist_template.py
        checklist/checklist/extension.py
        checklist/checklist/resources/__init__.py
        checklist/checklist/resources/checklist_resource.py
    
    Ignored Files:
        checklist/checklist/static/css/accountpage.less
        checklist/checklist/static/js/models/checklistTemplate.js
        checklist/checklist/static/js/views/checklistAccountPageView.js
    
    
  2. 
      
david
  1. I'm going to make some slight changes to the stylesheets and push this. Thanks!

  2. 
      
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (b747249)
Loading...