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

volunteer show GA

parent 58b7a5f5
......@@ -14,6 +14,7 @@ class GroupOffer < ApplicationRecord
accepts_nested_attributes_for :group_assignments, allow_destroy: true
validates :title, presence: true
validates :necessary_volunteers, numericality: { greater_than: 0 }, allow_nil: true
scope :active, (-> { where(active: true) })
......
......@@ -4,7 +4,7 @@
- if policy(GroupOffer).supervisor_privileges?
= f.association :volunteer, prompt: true
- else
= f.association :volunteers,
= f.association :volunteer,
collection: Volunteer.without_active_assignment.not_in_any_group_offer
.col-xs-12.col-md-3
= f.input :responsible
......
- group_assignments.each do |group_assignment|
table.table.table-striped
thead
tr
th= t_attr(:title, GroupOffer)
th= t_attr(:responsible, GroupAssignment)
th= t_attr(:start_date, GroupAssignment)
th= t_attr(:end_date, GroupAssignment)
tbody
tr
td= link_to group_assignment.group_offer.title, group_offer_path(group_assignment.group_offer)
td= t_attr(:responsible, GroupAssignment) if group_assignment.responsible
td= l(group_assignment.start_date)
td= l(group_assignment.end_date)
......@@ -174,6 +174,12 @@ h3= t('.availability')
h3= t('assignments')
= render 'assignments/volunteer_index', assignments: @volunteer.assignments
- if @volunteer.group_assignments.any?
.row
.col-xs-12#group_assignments
h3= t('.group_assignments')
= render 'group_assignments', group_assignments: @volunteer.group_assignments
nav.navbar.section-navigation
ul.list-inline
li= button_link current_user.volunteer? ? t('edit_profile') : t_title(:edit), edit_volunteer_path(@volunteer)
......
......@@ -180,6 +180,7 @@ de:
acceptance: *id-volunteer-acceptance
state: *id-volunteer-active-states
availability: Verfügbarkeit
group_assignments: Gruppenangebote
hour_reports: Stunden Rapporte
new_certificate: Nachweis ausstellen
report_hours: Stunden erfassen
......
......@@ -171,6 +171,7 @@ en:
inactive: Inactive
show_assignments: Show Assignments
availability: Availability for voluntary engagement
group_assignments: Group offers
hour_reports: Hour reports
new_certificate: Create certificate
report_hours: Report hours
......
......@@ -32,6 +32,7 @@ class GroupOffersTest < ApplicationSystemTestCase
login_as department_manager
visit new_group_offer_path
fill_in 'Title', with: 'asdf'
select @group_offer_category.category_name, from: 'Group offer category'
click_button 'Create Group offer'
assert page.has_text? 'Group offer was successfully created.'
......
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