Commit a4dad5b1 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou
Browse files

review view changes

parent 4d8f3b31
......@@ -29,4 +29,8 @@ class GroupOffer < ApplicationRecord
def archived
archived
end
def responsible?(volunteer)
group_assignments.find_by(volunteer: volunteer).responsible
end
end
.nested-fields.group-assignment-fields
.volunteer_from_list
.col-xs-12.col-md-2
- if policy(GroupOffer).supervisor_privileges?
= f.association :volunteer, prompt: true
- else
= f.association :volunteer,
collection: Volunteer.without_active_assignment.not_in_any_group_offer
.col-xs-12.col-md-2
= f.input :responsible
.col-xs-12.col-md-3
= f.input :period_start, include_blank: true
.col-xs-12.col-md-3
= f.input :period_end, include_blank: true
.col-xs-12.col-md-2
br
= link_to_remove_association t('.remove_volunteer'), f, class: 'btn btn-danger'
.col-xs-12.col-md-3
- if policy(GroupOffer).supervisor_privileges?
= f.association :volunteer, prompt: true
- else
= f.association :volunteer,
collection: Volunteer.without_active_assignment.not_in_any_group_offer
.col-xs-12.col-md-2
= f.input :responsible
.col-xs-12.col-md-3
= f.input :period_start, include_blank: true
.col-xs-12.col-md-3
= f.input :period_end, include_blank: true
.col-xs-12.col-md-1
br
= link_to_remove_association t('.remove_volunteer'), f, class: 'btn btn-danger'
......@@ -56,6 +56,12 @@ table.table.table-striped
td
- offer.volunteers.each do |volunteer|
= link_to volunteer, volunteer_path(volunteer)
- if offer.responsible?(volunteer)
br
= t_attr(:responsible, GroupAssignment)
-else
br
= t_attr(:member, GroupAssignment)
br
td= offer.group_offer_category.category_name
td= link_to t_action(:show), group_offer_path(offer)
......
h1= @group_offer.title
.row
.col-xs-12
.table-responsive
table.table.table-no-border-top
tbody
tr
td= t_attr(:active)
td= t(@group_offer.active)
tr
td= t_attr(:offer_type)
td
- if @group_offer.offer_type?
= t("offer_type.#{@group_offer.offer_type}")
br
- if @group_offer.external? && @group_offer.organization?
= "#{t('group_offers.index.offer_of')} "
= @group_offer.organization
br
= @group_offer.location
br
- if !@group_offer.external? && @group_offer.department
= "#{t('group_offers.index.offer_of')} "
= link_to @group_offer.department, department_path(@group_offer.department.id)
tr
td= t_attr(:offer_state)
td= t("offer_state.#{@group_offer.offer_state}") if @group_offer.offer_state?
tr
td= t_attr(:group_offer_category)
td= @group_offer.group_offer_category.category_name
tr
td= t_attr(:volunteer_state)
td
- if @group_offer.necessary_volunteers
= t('group_offers.index.necessary_volunteers', amount: @group_offer.necessary_volunteers)
.table-responsive
table.table.table-no-border-top
tbody
tr
td= t_attr(:active)
td= t(@group_offer.active)
tr
td= t_attr(:offer_type)
td
- if @group_offer.offer_type?
= t("offer_type.#{@group_offer.offer_type}")
br
- if @group_offer.external? && @group_offer.organization?
= "#{t('group_offers.index.offer_of')} "
= @group_offer.organization
br
= @group_offer.location
br
- if !@group_offer.external? && @group_offer.department
= "#{t('group_offers.index.offer_of')} "
= link_to @group_offer.department, department_path(@group_offer.department.id)
tr
td= t_attr(:offer_state)
td= t("offer_state.#{@group_offer.offer_state}") if @group_offer.offer_state?
tr
td= t_attr(:group_offer_category)
td= @group_offer.group_offer_category.category_name
tr
td= t_attr(:volunteer_state)
td
- if @group_offer.necessary_volunteers
= t('group_offers.index.necessary_volunteers', amount: @group_offer.necessary_volunteers)
br
- if @group_offer.volunteer_state?
= t("volunteer_state.#{@group_offer.volunteer_state}")
tr
td= t_attr(:description)
td= @group_offer.description
tr
td= t_attr(:target_group)
td
- if @group_offer.all?
= t_attr(:all)
- else
- GroupOffer::TARGET_GROUP.each do |target|
- if @group_offer[target]
= t_attr(target)
br
- if @group_offer.volunteer_state?
= t("volunteer_state.#{@group_offer.volunteer_state}")
tr
td= t_attr(:description)
td= @group_offer.description
tr
td= t_attr(:target_group)
td
- if @group_offer.all?
= t_attr(:all)
- else
- GroupOffer::TARGET_GROUP.each do |target|
- if @group_offer[target]
= t_attr(target)
br
tr
td= t_attr(:duration)
td
- GroupOffer::DURATION.each do |duration|
- if @group_offer[duration]
= t_attr(duration)
br
tr
td= t_attr(:availability)
td
- availability_collection.each do |availability|
- if @group_offer[availability]
= t("availability.#{availability}")
br
tr
td= t_attr(:schedule_details)
td= @group_offer.schedule_details
tr
td= t_attr(:duration)
td
- GroupOffer::DURATION.each do |duration|
- if @group_offer[duration]
= t_attr(duration)
br
tr
td= t_attr(:availability)
td
- availability_collection.each do |availability|
- if @group_offer[availability]
= t("availability.#{availability}")
br
tr
td= t_attr(:schedule_details)
td= @group_offer.schedule_details
- if @group_offer.group_assignments.any?
h3= t_attr(:volunteers)
ul
- @group_offer.group_assignments.each do |group_assignment|
li
.col-xs-12.col-md-3
= link_to group_assignment.volunteer, volunteer_path(group_assignment.volunteer)
.col-xs-12.col-md-3
= group_assignment.responsible ? t_attr(:responsible, GroupAssignment) : t_attr(:member, GroupAssignment)
.col-xs-12.col-md-3
= l(group_assignment.period_start) if group_assignment.period_start
.col-xs-12.col-md-3
= l(group_assignment.period_end) if group_assignment.period_end
.table-responsive
table.table.table-no-border-top
thead
tr
th= t_attr(:volunteer)
th= t_attr(:role, GroupAssignment)
th= t_attr(:period_start, GroupAssignment)
th= t_attr(:period_end, GroupAssignment)
tbody
- @group_offer.group_assignments.each do |group_assignment|
tr
td= link_to group_assignment.volunteer, volunteer_path(group_assignment.volunteer)
td= group_assignment.responsible ? t_attr(:responsible, GroupAssignment) : t_attr(:member, GroupAssignment)
td= l(group_assignment.period_start) if group_assignment.period_start
td= l(group_assignment.period_end) if group_assignment.period_end
- unless params[:format] == 'pdf'
= form_navigation_btn :edit
......
......@@ -2,7 +2,7 @@ table.table.table-striped
thead
tr
th= t_attr(:title, GroupOffer)
th= t_attr(:volunteer_role, GroupAssignment)
th= t_attr(:role, GroupAssignment)
th= t_attr(:period_start, GroupAssignment)
th= t_attr(:period_end, GroupAssignment)
th colspan=(editable == 'yes' ? '6' : '2')
......
......@@ -282,8 +282,8 @@ de:
period_end: Enddatum
period_start: Anfangsdatum
responsible: Verantwortliche/r für die Freiwilligengruppe
role: Rolle
volunteer: Freiwillige
volunteer_role: Freiwillige Rolle
group_offer:
active: Aktiv
all: Alle
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment