Sprankelprachtig aan/afmeldsysteem

home.html.haml 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .container
  2. .row
  3. - if @need_response.any?
  4. .col-md-12
  5. .hidden-xs
  6. .panel.panel-default
  7. .panel-heading
  8. = t 'activities.state.need_response'
  9. .panel-body
  10. %table.table.table-bordered
  11. %thead
  12. %tr
  13. %th
  14. = t 'activities.attrs.name'
  15. %th
  16. = t 'activities.attrs.group'
  17. %th
  18. = t 'activities.attrs.when'
  19. %th
  20. = t 'activities.attrs.where'
  21. %th
  22. = t 'activities.attrs.actions'
  23. %tbody
  24. - @need_response.each do |p|
  25. - e = p.activity
  26. %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
  27. %td
  28. = link_to group_activity_path(e.group, e) do
  29. = e.name
  30. %td
  31. = e.group.name
  32. %td
  33. = l e.start, format: :long
  34. %td
  35. = e.location
  36. %td
  37. = render partial: "activities/presence_buttons", locals: {activity: e, person: current_person, state: p.attending}
  38. .panel-footer.text-center.sv-nomargins
  39. = will_paginate @need_response, param_name: 'nrpage', renderer: WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm pagination'
  40. .hidden-sm.hidden-md.hidden-lg
  41. .panel.panel-default
  42. .panel-heading
  43. %a{role: 'button', href: '#needresponse-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
  44. %span.sv-show-collapsed
  45. %i.fas.fa-angle-down
  46. %span.sv-show-expanded
  47. %i.fas.fa-angle-up
  48. = t 'activities.state.need_response'
  49. %span.badge
  50. = @need_response.count
  51. .panel-body.collapse#needresponse-collapse
  52. %table.table
  53. %tbody
  54. - @need_response.each do |p|
  55. - e = p.activity
  56. %tr{class: p.row_class, data: {activity_id: e.id, person_id: p.person_id}}
  57. %td
  58. = link_to group_activity_path(e.group, e) do
  59. = e.name
  60. %td
  61. = l e.start, format: :short
  62. %tr{class: p.row_class, data: {activity_id: e.id, person_id: p.person_id}}
  63. %td
  64. = e.location
  65. %td
  66. = render partial: 'activities/presence_buttons', locals: {activity: e, person: p.person, state: p.attending}
  67. .sv-nomargins.text-center
  68. = will_paginate @need_response, page_links: false, param_name: 'nrpage', renderer: WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm pagination'
  69. .row
  70. .col-md-6
  71. .panel.panel-default
  72. .panel-heading
  73. = t 'groups.plural'
  74. .panel-body
  75. %table.table.table-bordered
  76. %tbody
  77. - current_person.groups.each do |group|
  78. %tr
  79. %td
  80. = link_to group do
  81. = group.name
  82. - if @user_organized.any?
  83. .col-md-6
  84. .panel.panel-default
  85. .panel-heading
  86. = t 'dashboard.organized_you'
  87. .panel-body
  88. %table.table.table-striped.table-bordered
  89. %tbody
  90. - @user_organized.each do |p|
  91. - a = p.activity
  92. %tr
  93. %td
  94. = link_to group_activity_url(a.group, a) do
  95. = a.name
  96. = "(#{a.human_state_counts})"
  97. .row
  98. .col-md-12
  99. .hidden-xs
  100. .panel.panel-default
  101. .panel-heading
  102. = t 'dashboard.participant_you'
  103. .panel-body
  104. %table.table.table-striped
  105. %tbody
  106. - @upcoming.each do |p|
  107. - e = p.activity
  108. %tr{class: p.row_class, data: {activity_id: e.id, person_id: current_person.id}}
  109. %td
  110. = link_to group_activity_path(e.group, e) do
  111. = e.name
  112. %td
  113. = render partial: "activities/presence_buttons", locals: {activity: e, person: current_person, state: p.attending}
  114. %td
  115. = editable p, :notes, url: presence_group_activity_path(e.group, e, person_id: current_person.id), title: t('activities.participant.notes'), value: p.notes, emptytext: t('activities.participant.add_notes')
  116. .panel-footer.text-center.sv-nomargins
  117. = will_paginate(@upcoming, param_name: 'upage', renderer: WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm pagination')
  118. .hidden-sm.hidden-md.hidden-lg
  119. .panel.panel-default
  120. .panel-heading
  121. = t 'dashboard.participant_you'
  122. %span.badge
  123. = @upcoming.count
  124. .panel-body
  125. %table.table
  126. %tbody
  127. - @upcoming.each do |p|
  128. - e = p.activity
  129. %tr{class: p.row_class, data: {activity_id: e.id, person_id: p.person_id}}
  130. %td
  131. = link_to group_activity_path(e.group, e) do
  132. = e.name
  133. %td
  134. = render partial: 'activities/presence_buttons', locals: {activity: e, person: p.person, state: p.attending}
  135. %tr{class: p.row_class, data: {activity_id: e.id, person_id: p.person_id}}
  136. %td{colspan: 2}
  137. = editable p, :notes, url: presence_group_activity_path(e.group, e, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: t('activities.participant.add_notes')
  138. .sv-nomargins.text-center
  139. = will_paginate @upcoming, page_links: false, param_name: 'upage', renderer: WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm pagination'