Commit eaf6299d authored by Zsolt Benke's avatar Zsolt Benke
Browse files

Added assignments table client pages

parent d0ae3113
Pipeline #21155 passed with stage
in 31 minutes and 59 seconds
......@@ -5,6 +5,7 @@ class ClientsController < ApplicationController
before_action :set_client, only: [:show, :edit, :update, :set_terminated]
before_action :set_social_worker_collection, only: [:new, :create, :edit, :update]
before_action :set_assignments, only: [:show, :edit]
def index
authorize Client
......@@ -28,10 +29,7 @@ class ClientsController < ApplicationController
end
end
def show
@current_assignments = @client.assignments.unterminated
@archived_assignments = @client.assignment_logs
end
def show; end
def new
@client = Client.new(user: current_user)
......@@ -111,6 +109,11 @@ class ClientsController < ApplicationController
@social_workers = User.social_workers
end
def set_assignments
@current_assignments = @client.assignments.unterminated
@archived_assignments = @client.assignment_logs
end
def client_params
params.require(:client).permit(
:gender_request, :age_request, :other_request, :birth_year, :salutation,
......
- if @current_assignments.present?
h3#assignments Aktuelle Begleitungen
= render 'assignments/client_volunteer_index', assignments: @current_assignments
- if @archived_assignments.present?
h3 Archivierte Begleitungen
= render 'assignment_logs/client_volunteer_index', assignments: @archived_assignments
= f.button :submit
......@@ -6,6 +6,6 @@
= render 'buttons'
= f.button :submit
= render 'form', f: f
= f.button :submit
= render 'assignments'
= render 'buttons'
......@@ -79,13 +79,5 @@ h1.m-b-20= @client.contact.full_name
h3 Wann sind Sie verfügbar?
= render 'availability/show', available: @client
- if @current_assignments.present?
h3#assignments Aktuelle Begleitungen
= render 'assignments/client_volunteer_index', assignments: @current_assignments
- if @archived_assignments.present?
h3 Archivierte Begleitungen
= render 'assignment_logs/client_volunteer_index', assignments: @archived_assignments
= render 'assignments'
= render 'show_navigation'
Supports Markdown
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