%ul.breadcrumb
  %li
    %a{:href => "/"} Home
    %span.divider /
  %li.active
    %a{:href => "/puzzles"} Puzzles

.actions
  - if current_user.staff?
    = link_to 'New Puzzle', new_puzzle_path, :class => 'btn btn-primary'

.puzzles
  - access = current_user.level_access
  - @levels.each do |level, puzzles|
    %h2 Level #{level}
    - if access.can_access?(level)
      - puzzles.each_with_index do |puzzle, index|
        %h3.puzzle
          - if current_user.staff?
            = link_to 'Edit', edit_puzzle_path(puzzle), :class => 'btn'
          = (index + 1).to_s + '. '
          - guessed_class = current_user.team.guessed?(puzzle) ? "done" : ''
          = link_to puzzle.name, puzzle, :class => "puzzle #{guessed_class}"
    - else
      %p Solve all puzzles on level #{level-1} to unlock level #{level}!



%ul.breadcrumb
  %li
    %a{:href => "/"} Home
    %span.divider /
  %li.active
    %a{:href => "/puzzles"} Puzzles

.actions
  - if current_user.staff?
    = link_to 'New Puzzle', new_puzzle_path, :class => 'btn btn-primary'

.puzzles
  - access = current_user.level_access
  - team = current_user.team
  - @levels.each do |level, puzzles|
    %h2 Level #{level}
    - if access.can_access?(level)
      - puzzles.each_with_index do |puzzle, index|
        %h3.puzzle
          - if current_user.staff?
            = link_to 'Edit', edit_puzzle_path(puzzle), :class => 'btn'
          = (index + 1).to_s + '. '
          - if team
            - guessed_class = team.guessed?(puzzle) ? "done" : ''
            = link_to puzzle.name, puzzle, :class => "puzzle #{guessed_class}"
          - else
            = link_to puzzle.name, puzzle, :class => "puzzle"

    - else
      %p Solve all puzzles on level #{level-1} to unlock level #{level}!



Fix crash on staff and puzzles page
Fix crash on staff and puzzles page
