hacken-in/hacken-in

View on GitHub
app/views/single_events/show.html.haml

Summary

Maintainability
Test Coverage
- content_for :title do
  - @single_event.event.name

- color = @single_event.category.try(:color)

.single-event{ itemscope: true, itemtype: 'http://schema.org/Event' }
  .event-indicator
    %meta{ itemprop: 'startDate', content: I18n.localize(@single_event.occurrence, format: "%FT%R%:z") }
    %h2= I18n.localize @single_event.occurrence, format: "%a, %d. %b %Y"
  .event-title.clearfix
    %h1.black-bar-title{ itemprop: "name" }
      = @single_event.event.name
    - if !@single_event.full_day
      %h4= I18n.localize(@single_event.occurrence, format: "%H:%M Uhr")
    = render partial: 'modules/categories/indicator', locals: { submodule: 'big', category: @single_event.category }

  .tags-list.clearfix
    - tags = (@single_event.tags | @single_event.event.tags).sort_by(&:name)
    - tags.each do |tag|
      = render partial: "modules/tags/tag", locals: { tag: tag }

  .event-content
    - if @single_event.name?
      %h4= @single_event.name

    - if @single_event.picture.present?
      .event-image-box
        = image_tag(@single_event.picture.box_image.url, class: 'event-image')

    = render "events/description", event: @single_event

    - unless privacy_mode?
      = render "events/map",   event: @single_event

  = render 'single_events/participants'