hacken-in/hacken-in

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

Summary

Maintainability
Test Coverage
.event-participents
  %h3 Teilnehmer
  - if @single_event.users.empty?
    %p.no-participators
      %em keine Teilnehmer
  - else
    %ul.participators.clearfix
      - @single_event.users.each_with_index do |user, index|
        %li
          = link_to user_path(user) do
            = avatar_for_user(user, 85, "user_gravatar")

  - if user_signed_in?
    .participate
      - if @single_event.attended_by_user?(current_user)
        = button_to t('single_events.show.unparticipate'), event_single_event_participate_path(@single_event.event, @single_event, state: :delete), { method: :put, class: 'button small' }
      - else
        = button_to t('single_events.show.participate'), event_single_event_participate_path(@single_event.event, @single_event, state: :push), { method: :put, class: 'button small' }