pfletch1023/Gandalf — pull request #47 by rafi-khan (2013-01-11 01:53:12+00:00)
Title: Refactoring your code

Dear Paul,

It's great that you write a lot of code, but I wish you'd be a bit wiser about it. I've spent some time refactoring, reorganizing and removing a lot of the code you wrote because it was either unnecessary or clunky. Some notes:

- `a`'s should never be display block. instead, wrap them around the `li` or `img` or whatever.
- you had the style for `ul.main-list` in four different times (twice in the same file!). try to keep the same styles in the same place, in *one* block.
- on that note, styles that apply to multiple pages should go in main.css.scss. that's where .main-list is now.
- reuse classes when you can! we don't need 5 different classes with the style `width: $width; margin: 0 auto;`. there are existing classes with the styles you want, so use those! for now, i've made a class called `container` that only has the above styles; if you ever need those two lines, just add that class on!
- you're nesting styles a lot! you never need to nest an id—there should only be one of those anyway. if you're nesting a class style, that should be because the classname is common enough to be used somewhere else. .left-list probably doesn't apply. but makes sure to nest the ones that are common! you had an unnested `li` that did a lot of stuff—that could mess me up somewhere later on
- if you're going to post data manually with backbone's `save`, then you don't need to make forms! that makes things a lot more complicated with having to `e.stopPropogation` and `e.preventDefault`. just make it a div, and when the user clicks a button, get the values from the inputs and save those.

that's all for now. please be careful!