mconf/mconf-web

View on GitHub
app/views/events/_unified_event.html.haml

Summary

Maintainability
Test Coverage
-# Locals:
-#   event (Event): the target model
-#   is_participant (boolean): Whether the current user is a participant in the event or not

- unless event.nil?
  = content_tag(:div, :name => event.slug, :class => "thread thread-event #{cycle("thread-even" , "thread-odd")} unified-event") do
    .logo-in-thread
      = event_logo_link(event, :title => sanitize(event.name), :class => "logo logo-event")

    .thread-content
      .thread-title
        -# - if is_participant
        -#   %span.is-member= t('.user_is_member')
        %span
          = link_to first_words(event.name, 80), event_path(event), :title => event.name, :class => "list-title"
      .thread-description
        - if event.public
          .resource-visibility.small.public
            = icon_space_public
            - text = t(".public")
            - if event.past?
              - text = "#{text}, #{t('.closed')}"
            = text
        - else
          .resource-visibility.small.private
            = icon_space_private
            - text = t(".private")
            - if event.past?
              - text = "#{text}, #{t('.closed')}"
            = text

        .event-description-date
          = t('.starts_at') + ':'
          = formatted_date_in_time_zone(event, event.start_on, Time.zone.name)

        %span= t('_other.participants', :count => event.participants.count)