Commit 730d905c authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

Merge branch 'develop' into 'master'

Deploy Staging to production 2019-03-18

See merge request !937
parents c6cb11fc 27851eab
Pipeline #40057 passed with stage
in 38 minutes and 19 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
......
......@@ -57,11 +57,18 @@ gem 'will_paginate'
gem 'wkhtmltopdf-binary'
group :development do
gem 'awesome_print'
gem 'awesome_print', require: false
gem 'debase', require: false
gem 'debride', require: false
gem 'fasterer', require: false
gem 'i18n_yaml_sorter'
gem 'letter_opener_web', '~> 1.0'
gem 'overcommit', require: false
gem 'rcodetools', require: false
gem 'reek', require: false
gem 'rubocop', require: false
gem 'ruby-debug-ide', require: false
gem 'ruby-lint', require: false
gem 'scss_lint', require: false
end
......
......@@ -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)
......@@ -75,6 +75,10 @@ GEM
autoprefixer-rails (9.1.4)
execjs
awesome_print (1.8.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
axlsx_rails (0.5.1)
actionpack (>= 3.1)
axlsx (>= 2.0.1)
......@@ -130,12 +134,16 @@ 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)
cocoon (1.2.11)
codeclimate-engine-rb (0.4.1)
virtus (~> 1.0)
coderay (1.1.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
......@@ -143,6 +151,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorize (0.8.1)
combine_pdf (1.0.10)
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.0.5)
......@@ -158,7 +167,16 @@ GEM
sort_alphabetical (~> 1.0)
crass (1.0.4)
database_cleaner (1.7.0)
debase (0.2.2)
debase-ruby_core_source (>= 0.10.2)
debase-ruby_core_source (0.10.4)
debride (1.8.1)
path_expander (~> 1.0)
ruby_parser (~> 3.6)
sexp_processor (~> 4.5)
debug_inspector (0.0.3)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.4.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
......@@ -174,6 +192,7 @@ GEM
dotenv-rails (2.2.1)
dotenv (= 2.2.1)
railties (>= 3.2, < 5.2)
equalizer (0.0.11)
erubi (1.7.1)
execjs (2.7.0)
factory_bot (4.10.0)
......@@ -181,6 +200,9 @@ GEM
factory_bot_rails (4.10.0)
factory_bot (~> 4.10.0)
railties (>= 3.0.0)
fasterer (0.4.2)
colorize (~> 0.7)
ruby_parser (>= 3.12.0)
ffaker (2.9.0)
ffi (1.9.25)
globalid (0.4.1)
......@@ -194,6 +216,7 @@ GEM
i18n_rails_helpers (2.0.1)
rails (> 3.0.0)
i18n_yaml_sorter (0.2.0)
ice_nine (0.11.2)
iniparse (1.4.4)
io-like (0.3.0)
jaro_winkler (1.5.1)
......@@ -210,6 +233,7 @@ GEM
railties (>= 3.2)
sprockets-rails
kgio (2.11.2)
kwalify (0.7.2)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.6.0)
......@@ -273,6 +297,7 @@ GEM
activerecord (>= 4.0, < 5.3)
parser (2.5.1.0)
ast (~> 2.4.0)
path_expander (1.0.3)
pdf-reader (2.1.0)
Ascii85 (~> 1.0.0)
afm (~> 0.2.1)
......@@ -295,6 +320,7 @@ GEM
pry (~> 0.10)
pry-rails (0.3.6)
pry (>= 0.10.4)
psych (3.1.0)
public_suffix (3.0.2)
puma (3.11.4)
pundit (1.1.0)
......@@ -334,7 +360,14 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rcodetools (0.8.5.0)
redcarpet (3.4.0)
reek (5.3.1)
codeclimate-engine-rb (~> 0.4.0)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
psych (~> 3.1.0)
rainbow (>= 2.0, < 4.0)
ref (2.0.0)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
......@@ -350,9 +383,16 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-debug-ide (0.6.1)
rake (>= 0.8.1)
ruby-lint (2.3.1)
parser (~> 2.2)
slop (~> 3.4, >= 3.4.7)
ruby-progressbar (1.9.0)
ruby-rc4 (0.1.5)
ruby_dep (1.5.0)
ruby_parser (3.12.0)
sexp_processor (~> 4.9)
rubyzip (1.2.2)
sass (3.5.6)
sass-listen (~> 4.0.0)
......@@ -377,6 +417,7 @@ GEM
selenium-webdriver (3.12.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
sexp_processor (4.11.0)
simple_form (4.0.1)
actionpack (>= 5.0)
activemodel (>= 5.0)
......@@ -429,6 +470,11 @@ GEM
unicorn-rails (2.2.1)
rack
unicorn
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
warden (1.2.7)
rack (>= 1.0)
websocket-driver (0.6.5)
......@@ -464,10 +510,13 @@ DEPENDENCIES
countries_and_languages
country_select
database_cleaner
debase
debride
devise
devise-i18n
devise_invitable
factory_bot_rails
fasterer
ffaker
i18n_data
i18n_rails_helpers
......@@ -495,9 +544,13 @@ DEPENDENCIES
rails (~> 5.1)
rails-i18n
ransack!
rcodetools
redcarpet
reek
roo (~> 2.7.0)
rubocop
ruby-debug-ide
ruby-lint
rubyzip (>= 1.2.2)
sassc-rails
scss_lint
......
......@@ -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)
......