Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
1d6c14c4
Commit
1d6c14c4
authored
May 03, 2018
by
Tugce Nur Tas
Browse files
Merge branch 'fixes/external-volunteer-matching' into 'develop'
Fixes/external volunteer matching See merge request
!620
parents
a30ef51c
58667c2d
Pipeline
#18799
passed with stage
in 39 minutes and 46 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/models/volunteer.rb
View file @
1d6c14c4
...
...
@@ -50,7 +50,7 @@ class Volunteer < ApplicationRecord
has_many
:group_assignments
,
dependent: :delete_all
has_many
:group_assignment_logs
has_many
:group_offers
,
through: :group_assignments
# categories done in group offers
has_many
:categories_from_group_assignments
,
through: :group_offers
,
source: :group_offer_category
...
...
@@ -155,7 +155,7 @@ class Volunteer < ApplicationRecord
seeking_clients
}
scope
:seeking_clients
,
lambda
{
accepted
.
where
(
active:
false
).
or
(
accepted
.
activeness_ended
)
internal
.
accepted
.
where
(
active:
false
).
or
(
internal
.
accepted
.
activeness_ended
)
}
scope
:seeking_clients_will_take_more
,
lambda
{
seeking_clients
.
or
(
accepted
.
will_take_more_assignments
)
...
...
@@ -294,7 +294,7 @@ class Volunteer < ApplicationRecord
end
def
seeking_clients?
accepted?
&&
inactive?
||
take_more_assignments?
&&
active?
internal?
&&
(
accepted?
&&
inactive?
||
take_more_assignments?
&&
active?
)
end
def
self
.
acceptance_collection
...
...
app/views/departments/_form.html.slim
View file @
1d6c14c4
=
simple_form_for
(
@department
)
do
|
f
|
=
simple_error_notice
f
.row
.col-xs-12.col-md-6.d
epartment_assoc
able
-
if
policy
(
D
epartment
).
can
_assoc
iate_user?
-
if
policy
(
D
epartment
).
can
_assoc
iate_user?
.col-xs-12.col-md-6.d
epartment_assoc
able
=
f
.
association
:user
,
as: :check_boxes
,
collection:
User
.
department_assocable
.
sort_by
(
&
:to_s
)
=
f
.
simple_fields_for
:contact
do
|
c
|
...
...
app/views/volunteers/_buttons.html.slim
View file @
1d6c14c4
...
...
@@ -11,9 +11,8 @@ nav.navbar.section-navigation
title
:
'Beenden',
method:
:put
unless
@volunteer
.resigned
?
-
if
@volunteer
.
internal_and_started_assignments?
li
=
button_link
navigation_glyph
(
:hours
),
volunteer_hours_path
(
@volunteer
),
title:
t
(
'volunteer_applications.show.hour_reports'
)
-
if
policy
(
Volunteer
).
superadmin_privileges?
-
if
@volunteer
.
seeking_clients?
li
=
button_link
navigation_glyph
(
:assignment
),
find_client_volunteer_path
(
id:
@volunteer
),
title:
t
(
'seeking_clients'
)
-
if
policy
(
Volunteer
).
superadmin_privileges?
&&
@volunteer
.
seeking_clients?
li
=
button_link
navigation_glyph
(
:assignment
),
find_client_volunteer_path
(
id:
@volunteer
),
title:
t
(
'seeking_clients'
)
-
if
@volunteer
.
internal_and_started_assignments?
li
=
button_link
navigation_glyph
(
:billing_expenses
),
volunteer_billing_expenses_path
(
@volunteer
),
title:
'Spesenformulare'
-
if
policy
(
Volunteer
).
superadmin_privileges?
...
...
config/locales/de.yml
View file @
1d6c14c4
...
...
@@ -898,7 +898,7 @@ de:
relatives
:
Familienangehörige im Haushalt
remember_me
:
Angemeldet bleiben
reserve
:
Begleitung erstellen
seeking_clients
:
Klient
e
n suchen
seeking_clients
:
Klient
/i
n suchen
show_my_profile
:
Mein Profil
simple_form
:
error_notification
:
...
...
test/system/volunteers_test.rb
View file @
1d6c14c4
...
...
@@ -338,4 +338,22 @@ class VolunteersTest < ApplicationSystemTestCase
visit
edit_volunteer_path
(
@resigned
)
assert
page
.
has_field?
'Prozess'
,
disabled:
true
end
test
'external volunteer can not get machted with a client'
do
@external
=
create
:volunteer_external
,
acceptance: :accepted
visit
volunteers_path
# "Klient/en" suchen button is not shown on volunteer index
within
page
.
find
(
'tr'
,
text:
@external
.
full_name
)
do
assert_text
'Nicht zuweisbar'
end
# "Klient/en" suchen button is not shown on volunteer show
visit
volunteer_path
(
@external
)
refute
page
.
has_button?
'Klient/in suchen'
# "Klient/en" suchen button is not shown on volunteer edit
visit
edit_volunteer_path
(
@external
)
refute
page
.
has_button?
'Klient/in suchen'
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment