Improvements to hint UI

- Created and moved duplicated code into new partials:
  - _add_hint.html.haml
  - _edit_hint_table.html.haml
  - edit_hint_table_status_button.html.haml
- Renamed variable @level_source_hints to @hints (because I accidentally got the whole
  database table when I forgot to initialize it).
- Removed infrequently used links and unneeded columns.
- Improved messaging around empty tables, restrictions, and hint solicitation.
- Added new view show_hints (which I may later merge with an existing view).
TODO:
- i18n
- Facilitate reviewing hints by enabling restrictions on more views, not just review_hints.

See this diagram, which helped me understand the flow among pages: https://docs.google.com/a/code.org/drawings/d/1yidY-TLCtQODoNyfMgfrSdo1-MspOGrCNkxD1vJybZw/edit?usp=sharing
It's updated in the database but not on the html page that has already been
rendered.


On Wed, Aug 13, 2014 at 1:16 PM, Brian Jordan <notifications@github.com>
wrote:

> In app/views/shared/_edit_hint_table.html.haml:
>
> > +-ordered_columns = [:user_id, :hint, :puzzle, :status]
> > +-sorted_columns = columns.sort { |x,y| ordered_columns.index(x) <=> ordered_columns.index(y) }
> > +%table{:id => 'hint-table'}
> > +  %thead
> > +    %tr
> > +      -sorted_columns.each do |name|
> > +        %th #{name.to_s.capitalize}
> > +  %tbody
> > +    -hints.each do |level_source_hint|
> > +      %tr
> > +        -if columns.include? :user_id
> > +          %td{:align => "center"}= level_source_hint.user_id
> > +        -if columns.include? :hint
> > +          %td{:class => 'hint-field'}
> > +            -if user && (user.admin? || user.id == level_source_hint.user_id)
> > +              -# TODO: Change displayed status value to "new" if user is not admin.
>
> Is this already done in the controller?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/code-dot-org/dashboard/pull/1146/files#r16202240>.
>