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
b5de6ba8
Commit
b5de6ba8
authored
Oct 05, 2017
by
Chrysanthi Lagodimou
Browse files
volunteer show GA
parent
58b7a5f5
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/models/group_offer.rb
View file @
b5de6ba8
...
...
@@ -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
)
})
...
...
app/views/group_offers/_group_assignment_fields.html.slim
View file @
b5de6ba8
...
...
@@ -4,7 +4,7 @@
-
if
policy
(
GroupOffer
).
supervisor_privileges?
=
f
.
association
:volunteer
,
prompt:
true
-
else
=
f
.
association
:volunteer
s
,
=
f
.
association
:volunteer
,
collection:
Volunteer
.
without_active_assignment
.
not_in_any_group_offer
.col-xs-12.col-md-3
=
f
.
input
:responsible
...
...
app/views/volunteers/_group_assignments.html.slim
0 → 100644
View file @
b5de6ba8
-
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
)
app/views/volunteers/show.html.slim
View file @
b5de6ba8
...
...
@@ -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
)
...
...
config/locales/de.yml
View file @
b5de6ba8
...
...
@@ -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
...
...
config/locales/en.yml
View file @
b5de6ba8
...
...
@@ -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
...
...
test/system/group_offers_test.rb
View file @
b5de6ba8
...
...
@@ -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.'
...
...
Write
Preview
Markdown
is supported
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