SUSE/hackweek

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

Summary

Maintainability
Test Coverage
.row
  .col-md-12
    .page-header
      - if @episode
        %h1
          = @episode.name
          %small
            = "#{@episode.start_date.strftime("%A %d %B")} - #{@episode.end_date.strftime("%A %d %B %Y")}"
      - else
        %div
          = image_tag 'hackweek-label.png', class: 'img-responsive', alt: 'Hack Week'
.row
  .col-md-7
    - if @episode.try(:description).blank?
      %p.lead
        Hack Week is the time SUSE employees experiment, innovate & learn interruption-free
        for a whole week! Across teams or alone, but always without limits.
      %p.lead
        A SUSE tradition since 2007, Hack Week has brought together hundreds of hackers around
        the globe to collaborate on open source. Learn more
        = link_to about_path do
          about Hack Week.
      %p.lead
        What are you going to hack on?
    - else
      .lead
        :markdown
          #{ @episode.description }
  .col-md-5
    - if @episode.try(:avatar).blank?
      = image_tag 'hackweek-logo-dark.png', class: 'img-responsive', alt: 'Hack Week'
    - else
      = image_tag(url_for(@episode.avatar), class: 'img-responsive', alt: 'Hack Week')
.row
  .col-md-8.col-md-offset-2
    %p
      .btn-group.btn-group-justified.btn-group-lg
        = link_to new_project_path, class: 'btn btn-lg btn-info' do
          Start
          %span.hidden-xs
            a Project
        = link_to projects_path(@episode), class: 'btn btn-lg btn-success' do
          Join
          %span.hidden-xs
            a Project

- if @episode
  .row
    .col-sm-12
      %h2
        Popular Topics
  .row
    - @popular_keywords.each do |keyword|
      .col-sm-4
        .well#topic-highlight
          - if keyword.avatar.attached?
            = image_tag(url_for(keyword.avatar), width: '150', class: 'img-responsive center-block')
          - else
            %img{"data-src": "holder.js/150x150?text=#{keyword.name}", class: 'center-block'}
          = link_to keyword_path(@episode, keyword.name) do
            %h2.text-center
              = keyword.name
          %p
            = truncate(keyword.description, length: 100) if keyword.description
  .row
    .col-sm-12
      %p.text-right
        = link_to keywords_path(@episode), class: 'btn btn-default' do
          Browse all
  .row
    .col-sm-12
      %h2
        Popular Projects
  .row
    - @popular_projects.each do |project|
      .col-sm-4
        %h4
          = link_to project_path(@episode, project) do
            - if project.avatar.attached?
              = image_tag(url_for(project.avatar), width: '20')
            = project.title
        .md-preview
          :markdown
            #{mdpreview(project.description, lines: 2)}

  .row
    .col-sm-12
      %p.text-right
        = link_to projects_path(@episode), class: 'btn btn-default' do
          Browse all