Sprankelprachtig aan/afmeldsysteem

show.html.haml 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. %h2
  2. = @group.name
  3. .row
  4. .groupmenu(class=@groupmenu)
  5. .panel.panel-default
  6. .panel-heading
  7. = @group.name
  8. .panel-body
  9. .list-group
  10. = link_to group_members_path(@group), class: 'list-group-item' do
  11. = @group.members.count
  12. = t 'groups.member.plural'
  13. = link_to group_activities_path(@group), class: 'list-group-item' do
  14. = @group.activities.count
  15. = t 'activities.plural'
  16. - if @group.leader?(current_person)
  17. = link_to new_group_activity_path(@group), class: 'list-group-item' do
  18. = t 'activities.new'
  19. = link_to edit_group_path(@group), class: 'list-group-item' do
  20. = t 'groups.edit'
  21. - if @organized_activities && @organized_activities.count > 0
  22. .col-md-6
  23. .panel.panel-default
  24. .panel-heading
  25. = t 'activities.upcoming_yours'
  26. .panel-body
  27. %table.table
  28. %tr
  29. %th
  30. = t 'activities.attrs.name'
  31. %th
  32. = t 'activities.attrs.when'
  33. - @organized_activities.each do |p|
  34. - a = p.activity
  35. %tr
  36. %td
  37. = link_to group_activity_path(@group, a) do
  38. = a.name
  39. = render partial: 'activities/state_counts', locals: {counts: a.state_counts}
  40. %td
  41. = distance_of_time_in_words_to_now(a.start)
  42. .row
  43. .col-md-12
  44. .panel.panel-default
  45. .panel-heading
  46. = t 'activities.yours'
  47. .panel-body
  48. %table.table.table-striped
  49. %tbody
  50. - @upcoming.each do |a|
  51. - p = @upcoming_ps[a.id]
  52. - if p
  53. %tr{class: p.row_class, data: {activity_id: a.id, person_id: current_person.id}}
  54. %td
  55. = link_to group_activity_path(a.group, a) do
  56. = a.name
  57. %td
  58. = render partial: "activities/presence_buttons", locals: {activity: a, person: current_person, state: p.attending}
  59. %td
  60. = editable p, :notes, url: presence_group_activity_path(a.group, a, person_id: current_person.id), title: t('activities.participant.notes'), value: p.notes, emptytext: t('activities.participant.notes')
  61. - else
  62. %tr
  63. %td
  64. = link_to group_activity_path(a.group, a) do
  65. = a.name
  66. %td
  67. %td