Commit 27851eab authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

Merge branch 'feat/reenable_terminated_clients' into 'develop'

Feat/reenable terminated clients

See merge request !936
parents 5e0cd5b5 35530146
Pipeline #40073 passed with stage
in 45 minutes and 24 seconds
image: git.panter.ch:5001/panter/gitlab-ci-docker-images/ruby-and-rails:ruby-2.4.5-node8-chrome-imagemagick
image: git.panter.ch:5001/panter/gitlab-ci-docker-images/ruby-and-rails:ruby-2.4.5-node8-chrome-imagemagick-chromedriver
stages:
- test
......
......@@ -66,7 +66,7 @@ GEM
afm (0.2.2)
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
archive-zip (0.11.0)
archive-zip (0.12.0)
io-like (~> 0.3.0)
arel (8.0.0)
ast (2.4.0)
......@@ -134,7 +134,7 @@ GEM
selenium-webdriver
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.2.0)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
climate_control (0.2.0)
......
......@@ -53,9 +53,17 @@
.index-action-cell {
white-space: nowrap;
a, span {
a,
span {
display: block;
margin-right: 2px;
&.single-line {
& > span,
& > a {
display: inline-block;
}
}
}
a.btn {
......@@ -74,9 +82,6 @@
}
}
.modal-header-sm {
padding: 7px 15px;
}
......@@ -216,3 +221,22 @@ li.button-acceptance a {
margin: 16px;
font-size: 16px;
}
.link-icon-span-text {
.glyphicon {
display: inline-block;
}
.icon-span-text {
display: inline-block;
margin-left: 5px;
}
&:hover,
&:focus,
&:active {
.icon-span-text {
text-decoration: underline;
}
}
}
......@@ -144,7 +144,7 @@ class AssignmentsController < ApplicationController
end
def reactivate
state = @assignment.reactivate! ? 'success' : 'failure'
state = @assignment.reactivate!(current_user) ? 'success' : 'failure'
redirect_back fallback_location: edit_assignment_path(@assignment),
notice: t("assignments.notices.reactivation.#{state}")
end
......
......@@ -4,7 +4,7 @@ class ClientsController < ApplicationController
include ContactAttributes
rescue_from Client::NotDestroyableError, with: :user_not_authorized
before_action :set_client, only: [:show, :edit, :update, :destroy, :set_terminated]
before_action :set_client, only: [:show, :edit, :update, :destroy, :set_terminated, :reactivate]
before_action :set_social_worker_collection, only: [:new, :create, :edit, :update]
before_action :set_assignments, only: [:show, :edit]
......@@ -79,6 +79,11 @@ class ClientsController < ApplicationController
end
end
def reactivate
state = @client.reactivate!(current_user) ? 'success' : 'failure'
redirect_to edit_client_path(@client), notice: t("clients.notices.reactivation.#{state}")
end
private
def create_success_notice
......
......@@ -103,7 +103,7 @@ class GroupAssignmentsController < ApplicationController
end
def reactivate
state = @group_assignment.reactivate! ? 'success' : 'failure'
state = @group_assignment.reactivate!(current_user) ? 'success' : 'failure'
redirect_back fallback_location: edit_group_assignment_path(@group_assignment),
notice: t("group_assignments.notices.reactivation.#{state}")
end
......
class VolunteersController < ApplicationController
before_action :set_volunteer, only: [:show, :edit, :update, :terminate, :account, :update_bank_details, :reactivate]
before_action :set_active_and_archived_missions, only: [:show, :edit]
def index
authorize Volunteer
......@@ -27,12 +28,6 @@ class VolunteersController < ApplicationController
@group_offer_categories = @volunteer.group_offer_categories.active.without_house_moving
@group_offer_categories_house_moving = @volunteer.group_offer_categories.active.house_moving
@current_assignments = @volunteer.assignments.unterminated
@archived_assignments = @volunteer.assignment_logs
@current_group_assignments = @volunteer.group_assignments.unterminated
@archived_group_assignments = @volunteer.group_assignment_logs
end
def new
......@@ -119,7 +114,7 @@ class VolunteersController < ApplicationController
end
def reactivate
state = @volunteer.reactivate! ? 'success' : 'failure'
state = @volunteer.reactivate!(current_user) ? 'success' : 'failure'
redirect_to edit_volunteer_path(@volunteer), notice: t("volunteers.notices.reactivation.#{state}")
end
......@@ -151,6 +146,14 @@ class VolunteersController < ApplicationController
authorize @volunteer
end
def set_active_and_archived_missions
@current_assignments = @volunteer.assignments.unterminated
@archived_assignments = @volunteer.assignment_logs
@current_group_assignments = @volunteer.group_assignments.unterminated
@archived_group_assignments = @volunteer.group_assignment_logs
end
def volunteer_params
params.require(:volunteer).permit policy(Volunteer).permitted_attributes
end
......
module ActionAndControllerNameHelper
def action_new?
action_name == 'new' || action_name == 'create'
def action_name?(action)
action_name == action.to_s
end
def action_index?
action_name == 'index'
action_name?(:index)
end
def action_show?
action_name == 'show'
action_name?(:show)
end
def action_new?
action_name?(:new) || action_name?(:create)
end
def action_edit?
action_name == 'edit' || action_name == 'update'
action_name?(:edit) || action_name?(:update)
end
def action_in?(*names)
names.map(&:to_s).include? action_name
end
def controller_name?(name)
controller_name == name.to_s
end
def controller_in?(*names)
names.map(&:to_s).include? controller_name
end
def controller_action?(controller, action)
controller_name?(controller) && action_name?(action)
end
end
......@@ -2,7 +2,10 @@ class Assignment < ApplicationRecord
include AssignmentCommon
include VolunteersGroupAndTandemStateUpdate
has_one :assignment_log
belongs_to :reactivated_by, class_name: 'User', inverse_of: 'reactivated_assignments',
optional: true
has_one :assignment_log, dependent: :nullify
has_many :hours, as: :hourable
has_many :feedbacks, as: :feedbackable
......
......@@ -18,6 +18,8 @@ class Client < ApplicationRecord
belongs_to :user, -> { with_deleted }, inverse_of: 'clients'
belongs_to :resigned_by, class_name: 'User', inverse_of: 'resigned_clients',
optional: true
belongs_to :reactivated_by, class_name: 'User', inverse_of: 'reactivated_clients',
optional: true
belongs_to :involved_authority, -> { with_deleted }, class_name: 'User',
inverse_of: 'involved_authorities', optional: true
has_many :manager_departments, through: :user, source: :departments
......@@ -125,6 +127,10 @@ class Client < ApplicationRecord
assignments.with_deleted.blank?
end
def reactivate!(user)
update!(acceptance: 'accepted', resigned_at: nil, reactivated_by: user, reactivated_at: Time.zone.now)
end
private
def check_if_destroyable!
......
......@@ -74,12 +74,12 @@ module GroupAssignmentAndAssignmentCommon
end
def reactivatable?
terminated? && volunteer.accepted?
terminated? && dependency_allows_reactivation? && volunteer.accepted?
end
def reactivate!
def reactivate!(user)
update!(period_end: nil, termination_verified_at: nil, termination_submitted_at: nil, termination_verified_by: nil,
termination_submitted_by: nil, period_end_set_by: nil)
termination_submitted_by: nil, period_end_set_by: nil, reactivated_by: user, reactivated_at: Time.zone.now)
if assignment?
assignment_log.delete
elsif group_assignment?
......@@ -89,6 +89,14 @@ module GroupAssignmentAndAssignmentCommon
private
def dependency_allows_reactivation?
if assignment?
client.accepted?
else
!group_offer.terminated?
end
end
def add_remaining_hours
return unless remaining_hours?
......
......@@ -2,10 +2,10 @@ class GroupAssignment < ApplicationRecord
include VolunteersGroupAndTandemStateUpdate
include GroupAssignmentCommon
after_save :update_group_offer_search_field
has_many :group_assignment_logs
belongs_to :reactivated_by, class_name: 'User', inverse_of: 'reactivated_group_assignments',
optional: true
has_many :group_assignment_logs, dependent: :nullify
has_many :hours, ->(object) { where(volunteer: object.volunteer) }, through: :group_offer
delegate :title, to: :group_offer
......@@ -15,6 +15,8 @@ class GroupAssignment < ApplicationRecord
message: 'Diese/r Freiwillige ist schon im Gruppenangebot'
}
after_save :update_group_offer_search_field
scope :running, (-> { no_end.have_start })
def termination_verifiable?
......
......@@ -21,9 +21,9 @@ class GroupOffer < ApplicationRecord
has_many :group_assignment_logs
has_many :hours, as: :hourable, dependent: :destroy, inverse_of: :hourable
has_many :trial_feedbacks, as: :trial_feedbackable, inverse_of: :trial_feedbackable,
dependent: :destroy
has_many :hours, as: :hourable, dependent: :destroy
has_many :feedbacks, as: :feedbackable, dependent: :destroy
has_many :trial_feedbacks, as: :trial_feedbackable, dependent: :destroy
has_many :volunteers, through: :group_assignments
has_many :volunteer_contacts, through: :volunteers, source: :contact
......
......@@ -72,6 +72,16 @@ class User < ApplicationRecord
has_many :resigned_clients, class_name: 'Client', foreign_key: 'resigned_by_id',
inverse_of: 'resigned_by'
# reactivated relations
has_many :reactivated_clients, class_name: 'Client', foreign_key: 'reactivated_by_id',
inverse_of: 'reactivated_by'
has_many :reactivated_volunteers, class_name: 'Volunteer', foreign_key: 'reactivated_by_id',
inverse_of: 'reactivated_by'
has_many :reactivated_assignments, class_name: 'Assignment', foreign_key: 'reactivated_by_id',
inverse_of: 'reactivated_by'
has_many :reactivated_group_assignments, class_name: 'GroupAssignment', foreign_key: 'reactivated_by_id',
inverse_of: 'reactivated_by'
# Mailing process done relation
has_many :mailing_volunteer_processes_submitted, class_name: 'ReminderMailingVolunteer',
inverse_of: 'process_submitted_by', foreign_key: 'process_submitted_by_id'
......
......@@ -28,6 +28,8 @@ class Volunteer < ApplicationRecord
belongs_to :user, -> { with_deleted }, inverse_of: 'volunteer', optional: true
belongs_to :registrar, -> { with_deleted }, class_name: 'User', foreign_key: 'registrar_id', optional: true,
inverse_of: :volunteers
belongs_to :reactivated_by, class_name: 'User', inverse_of: 'reactivated_volunteers',
optional: true
belongs_to :department, optional: true
has_one :registrar_department, through: :registrar
......@@ -508,7 +510,7 @@ class Volunteer < ApplicationRecord
end
def user_needed_for_invitation?
!user.present? && accepted?
user.blank? && accepted?
end
def invite_email_valid?
......@@ -526,8 +528,8 @@ class Volunteer < ApplicationRecord
end
end
def reactivate!
update!(acceptance: 'accepted')
def reactivate!(user)
update!(acceptance: 'accepted', reactivated_by: user, reactivated_at: Time.zone.now, resigned_at: nil)
return true if external?
if user.present? && (user.sign_in_count.zero? || !user.invitation_accepted?)
......
......@@ -16,15 +16,20 @@ class ClientPolicy < ApplicationPolicy
social_worker? && (user_owns_record? || user_involved_authority?)
end
def reactivate?
record.class.name == 'Client' && record.resigned? &&
superadmin_or_client_responsible?
end
# controller action policies
alias_method :index?, :superadmin_or_department_manager_or_social_worker?
alias_method :search?, :superadmin_or_department_manager_or_social_worker?
alias_method :new?, :superadmin_or_department_manager_or_social_worker?
alias_method :create?, :superadmin_or_department_manager_or_social_worker?
alias_method :show?, :superadmin_or_department_manager_or_social_worker?
alias_method :destroy?, :superadmin_or_client_responsible?
alias_method :edit?, :superadmin_or_client_responsible?
alias_method :update?, :superadmin_or_client_responsible?
alias_method :index?, :superadmin_or_department_manager_or_social_worker?
alias_method :search?, :superadmin_or_department_manager_or_social_worker?
alias_method :new?, :superadmin_or_department_manager_or_social_worker?
alias_method :create?, :superadmin_or_department_manager_or_social_worker?
alias_method :show?, :superadmin_or_department_manager_or_social_worker?
alias_method :destroy?, :superadmin_or_client_responsible?
alias_method :edit?, :superadmin_or_client_responsible?
alias_method :update?, :superadmin_or_client_responsible?
alias_method :set_terminated?, :superadmin_or_department_managers_record?
# suplementary policies
......
......@@ -52,7 +52,6 @@ class VolunteerPolicy < ApplicationPolicy
alias_method :update?, :volunteer_managing_or_volunteers_profile?
alias_method :update_bank_details?, :volunteer_managing_or_volunteers_profile?
alias_method :account?, :superadmin?
alias_method :reactivate?, :reactivate?
# supplementary policies
alias_method :superadmin_privileges?, :superadmin?
......
table.table.table-striped.assignments-table
thead
tr
th
th= t_model(Volunteer)
th= t_model(Client)
th= t_attr(:period_start, Assignment)
th= t_attr(:period_end, Assignment)
th= t_attr(:created_by)
......@@ -10,10 +10,29 @@ table.table.table-striped.assignments-table
th Bemerkungen
tbody
- assignments.each do |assignment|
- assignments.each do |assignment_log|
- assignment = assignment_log.assignment
- volunteer = assignment.volunteer
tr
td = link_to_if policy(assignment.volunteer).show?, assignment.volunteer, assignment.volunteer
td= link_to_if policy(assignment.client).show?, assignment.client, assignment.client
td.index-action-cell.hidden-print
- if policy(assignment).reactivate?
span.single-line
= button_link icon_span(:edit), edit_assignment_path(assignment)
span.m-l-10
em= t('.edit_for_reactivate')
td.index-action-cell
- if policy(volunteer).reactivate?
= link_to edit_volunteer_path(volunteer), target: '_blank', rel: 'noopener',
class: 'link-icon-span-text',
title: t('.ractivate_link_title') do
= icon_span(:edit)
span.icon-span-text= volunteer.full_name
- elsif policy(volunteer).show?
= link_to volunteer_path(volunteer), class: 'link-icon-span-text' do
= icon_span(:show)
span.icon-span-text= volunteer.full_name
- else
= volunteer.full_name
td= l(assignment.period_start) if assignment.period_start
td= l(assignment.period_end) if assignment.period_end
td= link_to_if policy(User).show?,
......@@ -21,4 +40,3 @@ table.table.table-striped.assignments-table
profile_url_path(assignment.client.involved_authority || assignment.creator)
- if policy(Assignment).show_comments?
= td_truncate_content_modal(assignment.comments, 'Bemerkungen')
......@@ -10,39 +10,56 @@ table.table.table-striped.assignment-logs-table
th= t_attr(:comments)
th colspan=2
tbody
- assignment_logs.each do |assignment|
- assignment_logs.each do |assignment_log|
- assignment = assignment_log.assignment
- client = assignment.client
tr
td.index-action-cell.hidden-print
- if policy(assignment.assignment).show? && assignment.assignment.pdf.exists?
= button_link icon_span(:download), assignment_path(assignment.assignment, format: :pdf),
- if policy(assignment).show? && assignment.pdf.exists?
= button_link icon_span(:download), assignment_path(assignment, format: :pdf),
title: 'Herunterladen'
- if policy(assignment.assignment).reactivate?
= button_link icon_span(:edit), edit_assignment_path(assignment.assignment)
td= link_to_if(policy(Client).show?, assignment.client.contact.full_name, assignment.client)
- if policy(assignment).reactivate?
span.single-line
= button_link icon_span(:edit), edit_assignment_path(assignment)
span.m-l-10
em= t('.edit_for_reactivate')
td.index-action-cell
- if policy(client).reactivate?
= link_to edit_client_path(client), target: '_blank', rel: 'noopener',
class: 'link-icon-span-text',
title: t('.ractivate_link_title') do
= icon_span(:edit)
span.icon-span-text= client.contact.full_name
- elsif policy(client).show?
= link_to client_path(client), class: 'link-icon-span-text' do
= icon_span(:show)
span.icon-span-text= client.contact.full_name
- else
= client.contact.full_name
td= l(assignment.period_start) if assignment.period_start
td= l(assignment.period_end) if assignment.period_end
td
- if assignment.client.involved_authority
- if client.involved_authority
= link_to_if policy(User).show?,
assignment.client.involved_authority.full_name,
profile_url_path(assignment.client.involved_authority)
client.involved_authority.full_name,
profile_url_path(client.involved_authority)
- else
= link_to_if policy(User).show?,
assignment.creator.full_name,
profile_url_path(assignment.creator)
td= link_to_if(assignment.assignment && policy(assignment.assignment).show?,
t_action(:show), assignment.assignment) { '' }
td= link_to_if(assignment && policy(assignment).show?,
t_action(:show), assignment) { '' }
- if policy(Assignment).show_comments?
= td_truncate_content_modal(assignment.comments, 'Bemerkungen')
td.index-action-cell.hidden-print
span
- unless assignment.assignment.volunteer.external?
- unless assignment.volunteer.external?
= link_to_if(policy(TrialFeedback).index?, t_title(:index, TrialFeedback),
polymorphic_path([assignment.assignment.volunteer, assignment.assignment, TrialFeedback])) { '' }
polymorphic_path([assignment.volunteer, assignment, TrialFeedback])) { '' }
= link_to_if(policy(Feedback).index?, t_title(:index, Feedback),
polymorphic_path([assignment.assignment.volunteer, assignment.assignment, Feedback])) { '' }
polymorphic_path([assignment.volunteer, assignment, Feedback])) { '' }
= link_to_if(policy(Assignment).verify_termination?, 'Beendigungsformular',
polymorphic_path(assignment.assignment, action: :terminate)) { '' }
polymorphic_path(assignment, action: :terminate)) { '' }
td.index-action-cell.hidden-print
span
= "Quittiert von "
......
......@@ -7,9 +7,9 @@ tr
- if policy(assignment).show? && assignment.pdf.exists?
= button_link icon_span(:download), assignment_path(assignment, format: :pdf), title: 'Herunterladen'
td.button-acceptance= assignment_status_badge(assignment)
- if controller_name != 'volunteers'
- unless controller_in?(:volunteers)
td = link_to_if policy(assignment.volunteer).show?, assignment.volunteer, edit_volunteer_path(assignment.volunteer)
- if controller_name != 'clients'
- unless controller_in?(:clients)
td= link_to_if policy(assignment.client).show?, assignment.client.contact.full_name, edit_client_path(assignment.client)
td= l(assignment.period_start) if assignment.period_start
td= l(assignment.period_end) if assignment.period_end
......
......@@ -3,9 +3,9 @@ table.table.table-striped.assignments-table
tr
th.hidden-print Aktionen
th Status
- if controller_name != 'volunteers'
- unless controller_in?(:volunteers)
th= t_model(Volunteer)
- if controller_name != 'clients'
- unless controller_in?(:clients)
th= t_model(Client)
th= t_attr(:period_start, Assignment)
th= t_attr(:period_end, Assignment)
......
......@@ -4,4 +4,4 @@
- if @archived_assignments.present?
h3 Archivierte Begleitungen
= render 'assignment_logs/client_volunteer_index', assignments: @archived_assignments
= render 'assignment_logs/client_index', assignments: @archived_assignments
= simple_error_notice f
- if policy(f.object).reactivate?
h3.m-t-30= t('.reactivate.title')
p== t('.reactivate.hint')
= link_to t('.reactivate.button'), reactivate_client_path(f.object), class: 'btn btn-default m-t-10',
data: { confirm: t('.reactivate.confirm') }
hr.m-y-30
.row
.col-xs-12.col-md-6
fieldset
......
- ga_logs.order('created_at asc').each do |ga_log|
- group_assignment = ga_log.group_assignment
- volunteer = group_assignment.volunteer
tr
td.index-action-cell.hidden-print
- if policy(group_assignment).show? && group_assignment.pdf.exists?
= button_link icon_span(:download), group_assignment_path(group_assignment, format: :pdf),
title: 'Herunterladen'
- if policy(group_assignment).reactivate?
span.single-line
= button_link icon_span(:edit), edit_group_assignment_path(group_assignment)
span.m-l-10
em= t('.edit_for_reactivate')
td.index-action-cell
- if policy(volunteer).reactivate?
= link_to edit_volunteer_path(volunteer), target: '_blank', rel: 'noopener',
class: 'link-icon-span-text',
title: t('.ractivate_link_title') do
= icon_span(:edit)
span.icon-span-text= volunteer.full_name
- else
= link_to_if policy(volunteer).edit?, volunteer.contact.full_name, edit_volunteer_path(volunteer)
td= ga_log.responsible ? t_attr(:responsible, GroupAssignment) : t_attr(:member, GroupAssignment)
td= l(ga_log.period_start) if ga_log.period_start
td= l(ga_log.period_end) if ga_log.period_end
td= l(ga_log.created_at)
td
= "Quittiert von "
= link_to_if policy(ga_log.termination_verified_by.profile).edit?,
ga_log.termination_verified_by.full_name,
profile_url_path(ga_log.termination_verified_by)
= " am #{l(ga_log.termination_verified_at.to_date)}"
table.table.table-striped.group-assignments-table
thead
tr
th
th= t_attr(:title, GroupOffer)
th= t_attr(:role, GroupAssignment)
th= t_attr(:period_start, GroupAssignment)
th= t_attr(:period_end, GroupAssignment)
- if policy(GroupAssignment).show_comments?
th= t_attr(:comments)
th colspan=2
tbody
- group_assignment_logs.each do |group_assignment_log|
- group_assignment = group_assignment_log.group_assignment
- group_offer = group_assignment.group_offer
tr
td.index-action-cell.hidden-print
- if policy(group_assignment).reactivate?
span.single-line
= link_to edit_group_assignment_path(group_assignment), target: '_blank', rel: 'noopener',
class: 'link-icon-span-text',
title: t('.ractivate_link_title') do
= icon_span(:edit)
span.icon-span-text= t('.reactivatable_link')
td.index-action-cell.hidden-print
span.single-line
- if policy(group_offer).show?
= link_to group_offer_path(group_offer), class: 'link-icon-span-text' do
= icon_span(:show)
span.icon-span-text= group_offer.title
- else
= group_offer.title
td= t_attr(group_assignment.responsible ? :responsible : :member, GroupAssignment)
td= l(group_assignment.period_start) if group_assignment.period_start
td= l(group_assignment.period_end) if group_assignment.period_end
- if policy(GroupAssignment).show_comments?
= td_truncate_content_modal(group_assignment.comments, 'Bemerkungen')
td= link_to_if(policy(group_offer).show? && !group_offer.deleted?,
t_action(:show), group_offer_path(group_offer)) { '' }
td.index-action-cell.hidden-print
span
- unless @volunteer.external?
= link_to_if(policy(TrialFeedback).index?, t_title(:index, TrialFeedback),
polymorphic_path([@volunteer, group_offer, TrialFeedback])) { '' }
= link_to_if(policy(Feedback).index?, t_title(:index, Feedback),
polymorphic_path([@volunteer, group_offer, Feedback])) { '' }
= link_to_if(policy(GroupAssignment).verify_termination?, 'Beendigungsformular',
polymorphic_path(group_assignment, action: :terminate)) { '' }
td.index-action-cell.hidden-print
span
= "Quittiert von "
= link_to_if(policy(Assignment).verify_termination?, group_assignment.termination_verified_by.full_name,
profile_url_path(group_assignment.termination_verified_by)) { '' }
= " am #{l(group_assignment.termination_verified_at.to_date)}"
......@@ -16,19 +16,4 @@
th Begleitung Beendet
th Archiviert
tbody
- @group_offer.group_assignment_logs.order('created_at asc').each do |ga_log|
tr
td.index-action-cell.hidden-print
- if policy(ga_log.group_assignment).show? && ga_log.group_assignment.pdf.exists?
= button_link icon_span(:download), group_assignment_path(ga_log.group_assignment, format: :pdf),
title: 'Herunterladen'
td= link_to_if(policy(Volunteer).edit?, ga_log.volunteer.contact.full_name,
edit_volunteer_path(ga_log.volunteer)) { ga_log.volunteer.contact.full_name }
td= ga_log.responsible ? t_attr(:responsible, GroupAssignment) : t_attr(:member, GroupAssignment)
td= l(ga_log.period_start) if ga_log.period_start
td= l(ga_log.period_end) if ga_log.period_end
td= l(ga_log.created_at)
td
= "Quittiert von "
= link_to_if policy(ga_log.termination_verified_by.profile).edit?, ga_log.termination_verified_by.full_name, profile_url_path(ga_log.termination_verified_by)
= " am #{l(ga_log.termination_verified_at.to_date)}"
= render 'group_assignment_logs/group_offer_index', ga_logs: @group_offer.group_assignment_logs
- if @current_assignments.any? || @current_group_assignments.any?
h2.small Aktuelle Einsätze
- if @current_assignments.any?
h3.small#assignments Begleitungen
= render 'assignments/client_volunteer_index', assignments: @current_assignments
- if @current_group_assignments.any?
h3.small#assignments Gruppenangebote
= render 'group_assignments/volunteer_group_assignments', group_assignments: @current_group_assignments, editable: true
- if @archived_assignments.any? || @archived_group_assignments.any?
h2.small Archivierte Einsätze
- if @archived_assignments.any?
h3.small Begleitungen
= render 'assignment_logs/volunteer_index', assignment_logs: @archived_assignments
- if @archived_group_assignments.any?
h3.small Gruppenangebote
= render 'group_assignment_logs/volunteer_index', group_assignment_logs: @archived_group_assignments
hr
......@@ -7,22 +7,7 @@
= f.button :submit
= render 'volunteers/form', f: f, volunteer: @volunteer