SUSE/hackweek

View on GitHub
app/views/episodes/index.html.haml

Summary

Maintainability
Test Coverage
- content_for :title do
  Hackweeks

.row
  .col-sm-12
    - if @episodes.any?
      .row
        .col-sm-12
          %table.table#episodes_table
            %thead
              %th Name
              %th Number
              %th Date
              %th
            - @episodes.each do |episode|
              %tr{class: "#{episode.active}"}
                %td
                  = link_to episode_path(episode) do
                    = episode.name
                  - if episode.active
                    %span.label.label-success
                      Active
                %td
                  = episode.id
                %td
                  = "#{episode.start_date} - #{episode.end_date}"
                %td
                  = render :partial => "episodes/file_buttons", :locals => {:episode => episode }
    - else
      No hackweeks yet.
    %p
      - if can? :write, Episode
        = link_to "New Hackweek", new_episode_path, :class => "btn btn-success pull-right"