Changed Checklist template format

Review Request #5933 — Created June 4, 2014 and submitted

Information

rb-extension-pack
ac2d7a5...

Reviewers

The template has been recreated using cascading format, not a table format. Also, the layout of the extension has be alternated; the input text field was moved to the buttom of the extenson. And icons has been replaced with text links, fits better with RB style.

Run RB with checklist extenion enabled on Chrome and Firefox browser, they both have consistent look.


Description From Last Updated

It would be nice to format this to be more readable: '<div class="checklist_box" id="checklist">', ' <div class="checklist_header">', ' <div class="checklist_title">Checklist</div>', …

daviddavid

This could be more efficient as this.$('.checklist_box')

daviddavid

Same here with this.$

daviddavid

Can you move this comment to be just above the render: function() { line?

daviddavid

This doesn't look like it's used.

daviddavid

There should be a blank line between methods, and a comment above the method explaining what it does.

daviddavid

I'd like some style changes in here. I think it also is nice to toggle the variable first and then …

daviddavid

You run this.$('.checklist_box') twice. Can you assign that to a variable at the top of the method and then use …

daviddavid

Trailing whitespace.

daviddavid

You should assign the selector to a variable and then use that, rather than running it twice.

daviddavid

We didn't catch this in the original code, but can you remove the space between function and ()?

daviddavid

Can you rename this to checklistTemplate?

daviddavid

We didn't catch this in the original code, but can you remove the space between function and ()?

daviddavid

Can you use camelCase for the variable names, and prefix any jquery object variable name with $? We also try …

daviddavid

Add a space after "if"

daviddavid

The comments above each line here don't add anything particularly useful--I think it would be just as clear without them, …

daviddavid

This comment isn't necessary.

daviddavid

Trailing whitespace.

daviddavid

We didn't catch this in the original code, but can you remove the space between function and ()?

daviddavid

Should use camelCase, $ prefixes, and a single var statement.

daviddavid

Can you remove the space between function and ()?

daviddavid

One more spot with "function ("

daviddavid

Can you align everything with the (? _.bindAll(this, 'render', ..., 'removeItemDB', ..., 'createNewChecklist', ...);

daviddavid

This line shouldn't end with a comma.

daviddavid

This line shouldn't end with a comma.

daviddavid

This line shouldn't end with a comma.

daviddavid

This line shouldn't end with a comma.

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
SA
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
SA
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
      Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
mike_conley
  1. Heh, give up and use tables, eh? :)

    Using tables for layout is, at least for me, a last-resort solution. Can we not do this same thing with an ordered (or unordered) list and some CSS magic?

    1. Any update on this stuff?

    2. ! It can definetily be done with a list and css as you'r saying. I thought it would allow more options or better look.
      Should have asked about this first.

    3. yes, I'm going to open a hackpad for it before I update the post.

  2. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
david
  1. 
      
  2. checklist/checklist/static/js/views/checklistView.js (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    It would be nice to format this to be more readable:

    '<div class="checklist_box" id="checklist">',
    ' <div class="checklist_header">',
    '  <div class="checklist_title">Checklist</div>',
    '  <div class="actions">',
    '   <ul class="checklist_header_btn">',
    '    <li><a id="checklist_toggle_size" class="checklist_min">Min</a></li>',
    '    <li><a id="checklist_exit">Close</a></li>',
    '   </ul>',
    '  </div>',
    ' </div>',
    ' <div class="checklist_body">',
    '  <ul class="checklist_items"></ul>',
    ' </div>',
    ' <div class="checklist_footer>',
    '  <input name="checklist_item_description" ',
    '         placeholder="Add a new item" />
    '  <a id="checklist_clear" href="#">X</a>',
    ' </div>',
    '</div>'
    

    I'd also like you to change the "actions" class to be "checklist_actions" and "checklist_itemDesc" to be "checklist_item_description". You may also want to get rid of the "checklist_min" class because that element already has an ID that you could use for styling.

  3. Show all issues

    This could be more efficient as this.$('.checklist_box')

  4. Show all issues

    Same here with this.$

  5. 
      
SA
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    Can you move this comment to be just above the render: function() { line?

  3. Show all issues

    This doesn't look like it's used.

  4. Show all issues

    There should be a blank line between methods, and a comment above the method explaining what it does.

  5. Show all issues

    I'd like some style changes in here. I think it also is nice to toggle the variable first and then make the necessary changes to the view. The individual comment above each line aren't particularly necessary (I think the code is pretty self explanatory):

    this.isMinimized = !this.isMinimized;
    
    if (this.isMinimized) {
        /* Minimize the view */
        ...
    } else {
        /* Maximize the view */
        ...
    }
    

    It might also be nice to extract the '25' number into a property (this.CHECKLIST_MINIMIZED_HEIGHT?) and rename this.curHeight to this.savedHeight to make it even more self-explanatory.

  6. Show all issues

    You run this.$('.checklist_box') twice. Can you assign that to a variable at the top of the method and then use the variable?

  7. Show all issues

    Trailing whitespace.

  8. Show all issues

    You should assign the selector to a variable and then use that, rather than running it twice.

  9. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    We didn't catch this in the original code, but can you remove the space between function and ()?

  3. Show all issues

    Can you rename this to checklistTemplate?

  4. Show all issues

    We didn't catch this in the original code, but can you remove the space between function and ()?

  5. Show all issues

    Can you use camelCase for the variable names, and prefix any jquery object variable name with $?

    We also try to have only one 'var' statement per method:

    var heightChange = 0,
        $checklistBox = this.$('.checklist_box'),
        $sizeTextToggle = this.$('#checklist_toggle_size');
    
  6. Show all issues

    Add a space after "if"

  7. checklist/checklist/static/js/views/checklistView.js (Diff revision 6)
     
     
     
     
     
     
     
     
    Show all issues

    The comments above each line here don't add anything particularly useful--I think it would be just as clear without them, now that we've renamed some of the variables and constants.

  8. Show all issues

    This comment isn't necessary.

  9. Show all issues

    Trailing whitespace.

  10. Show all issues

    We didn't catch this in the original code, but can you remove the space between function and ()?

  11. Show all issues

    Should use camelCase, $ prefixes, and a single var statement.

  12. Show all issues

    Can you remove the space between function and ()?

  13. 
      
SA
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    One more spot with "function ("

  3. 
      
SA
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    Can you align everything with the (?

    _.bindAll(this, 'render', ...,
              'removeItemDB', ...,
              'createNewChecklist', ...);
    
  3. Show all issues

    This line shouldn't end with a comma.

  4. Show all issues

    This line shouldn't end with a comma.

  5. Show all issues

    This line shouldn't end with a comma.

  6. Show all issues

    This line shouldn't end with a comma.

  7. 
      
SA
david
  1. Ship It!

  2. 
      
SA
Review request changed
Status:
Completed
Change Summary:
Pushed to dev/checklist-extension (69cecdd)
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        checklist/checklist/static/js/views/checklistView.js
    
    
  2.