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
02f69065
Verified
Commit
02f69065
authored
Jan 26, 2018
by
Kaspar Vollenweider
👻
Browse files
form and filter use
parent
9cb9d43d
Changes
9
Hide whitespace changes
Inline
Side-by-side
app/assets/stylesheets/layout/_content.scss
View file @
02f69065
...
...
@@ -185,3 +185,7 @@ li.button-acceptance a {
max-height
:
150px
;
overflow-y
:
auto
;
}
.disabled-title
{
color
:
$gray-light
;
}
app/controllers/group_assignments_controller.rb
View file @
02f69065
...
...
@@ -35,7 +35,8 @@ class GroupAssignmentsController < ApplicationController
def
set_end_today
if
@group_assignment
.
update
(
period_end:
Time
.
zone
.
today
,
period_end_set_by:
current_user
)
redirect_to
@group_assignment
.
group_offer
,
notice:
'Einsatzende wurde erfolgreich gesetzt.'
redirect_to
polymorphic_path
(
@group_assignment
.
group_offer
,
action:
params
[
:redirect_to
]),
notice:
'Einsatzende wurde erfolgreich gesetzt.'
else
redirect_to
@group_assignment
.
group_offer
,
notice:
'Einsatzende konnte nicht gesetzt werden.'
end
...
...
app/controllers/group_offers_controller.rb
View file @
02f69065
...
...
@@ -77,9 +77,17 @@ class GroupOffersController < ApplicationController
end
end
def
initiate_termination
;
end
def
initiate_termination
@group_offer
.
period_end
=
Time
.
zone
.
today
end
def
submit_initiate_termination
;
end
def
submit_initiate_termination
if
@group_offer
.
update
(
period_end:
group_offer_params
[
:period_end
],
period_end_set_by:
current_user
)
redirect_to
group_offers_path
,
notice:
'Gruppenangebots beendigung erfolgreich eingeleitet.'
else
render
:initiate_termination
end
end
private
...
...
@@ -121,6 +129,6 @@ class GroupOffersController < ApplicationController
:necessary_volunteers
,
:description
,
:women
,
:men
,
:children
,
:teenagers
,
:unaccompanied
,
:all
,
:long_term
,
:regular
,
:short_term
,
:workday
,
:weekend
,
:morning
,
:afternoon
,
:evening
,
:flexible
,
:schedule_details
,
:department_id
,
:creator_id
,
:organization
,
:location
,
:group_offer_category_id
,
group_assignments_attributes
)
:group_offer_category_id
,
:period_end
,
group_assignments_attributes
)
end
end
app/views/group_offers/_group_assignments_index.html.slim
0 → 100644
View file @
02f69065
-
redirect_to_action
||=
nil
.table-responsive.assignments-table
table
.table.table-no-border-top
thead
tr
th
=
t_attr
(
:volunteer
,
GroupAssignment
)
th
=
t_attr
(
:role
,
GroupAssignment
)
th
=
t_attr
(
:period_start
,
GroupAssignment
)
th
=
t_attr
(
:period_end
,
GroupAssignment
)
th
.hidden-print
colspan
=
2
Aktionen
tbody
-
group_assignments
.
each
do
|
group_assignment
|
tr
td
=
link_to_if
(
policy
(
Volunteer
).
show?
,
group_assignment
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
group_assignment
.
volunteer
))
-
if
params
[
:format
]
==
'pdf'
td
=
group_assignment
.
volunteer
.
contact
.
primary_email
td
=
group_assignment
.
responsible
?
t_attr
(
:responsible
,
GroupAssignment
)
:
t_attr
(
:member
,
GroupAssignment
)
td
=
l
(
group_assignment
.
period_start
)
if
group_assignment
.
period_start
td
=
l
(
group_assignment
.
period_end
)
if
group_assignment
.
period_end
td
.index-action-cell.hidden-print
=
link_to_if
(
policy
(
group_assignment
).
edit?
,
'Bearbeiten'
,
edit_group_assignment_path
(
group_assignment
))
{
''
}
-
if
group_assignment
.
period_end
.
blank?
=
link_to_if
(
policy
(
group_assignment
).
set_end_today?
,
'Heute beenden'
,
set_end_today_group_assignment_path
(
group_assignment
,
redirect_to:
redirect_to_action
),
data:
{
method:
'PUT'
})
{
''
}
-
elsif
group_assignment
.
termination_submitted_by_id
.
blank?
=
link_to_if
(
policy
(
group_assignment
).
terminate?
,
'Beendigungsformular an Freiwillige/n mailen'
,
polymorphic_path
([
group_assignment
,
ReminderMailing
],
action: :new_termination
),
class:
'index-action-link'
)
=
link_to_if
(
policy
(
group_assignment
).
terminate?
,
'Beendigungsformular ausfüllen'
,
polymorphic_path
(
group_assignment
,
action: :terminate
))
td
-
if
group_assignment
.
period_end
.
present?
&&
policy
(
GroupAssignment
).
verify_termination?
=
link_to_if
(
group_assignment
.
termination_verified_by
.
blank?
,
'Beendigung Quittieren'
,
verify_termination_group_assignment_path
(
group_assignment
),
class:
'btn btn-default'
,
data:
{
method:
'PATCH'
})
{
''
}
app/views/group_offers/index.html.slim
View file @
02f69065
...
...
@@ -17,7 +17,12 @@ nav.navbar.section-navigation#filters
ul
.list-inline
li
=
button_link
t
(
'clear_filters'
),
group_offers_path
,
dimension:
'sm'
=
custom_filter_dropdown
(
'Standort'
,
*
Department
.
filterable
)
=
boolean_toggler_filter_dropdown
(
:active
,
'Status'
,
'Aktiv'
,
'Beendet'
)
=
boolean_toggler_filter_dropdown
(
:active
,
'Status'
,
'Aktiv'
,
'Deaktiviert'
)
=
custom_filter_dropdown
(
'Beendet'
,
{
q: :period_end_blank
,
text:
'Laufend'
,
value:
'true'
},
{
q: :period_end_not_null
,
text:
'Beendung initiert'
,
value:
'true'
},
{
q: :termination_verified_by_id_blank
,
qs:
[
:period_end_not_null
],
text:
'Unquitiert'
,
value:
'true'
},
{
q: :termination_verified_by_id_not_null
,
text:
'Beendet'
,
value:
'true'
})
=
list_filter_dropdown
(
:offer_state
,
GroupOffer
::
OFFER_STATES
)
=
custom_filter_dropdown
(
'Kategorie'
,
*
GroupOfferCategory
.
filterable_group_offer
)
=
button_link
'Beendete Begleitungen'
,
...
...
app/views/group_offers/initiate_termination.html.slim
View file @
02f69065
h1
Gruppenangebot
Beenden
=
simple_form_for
(
@group_offer
,
url:
initiate_termination_group_offer_path
(
@group_offer
)
)
do
|f|
=
f
.
input
:period_end
,
as: :date_picker
=
simple_form_for
(
@group_offer
,
method: :put
,
url:
submit_initiate_termination_group_offer_path
(
@group_offer
)
)
do
|f|
-
if
@group_offer
.
group_assignments
.
running
.
any?
h2
Noch
nicht
beendete
Gruppeneinsä
tze
=
render
'group_assignments_index',
group_assignments:
@group_offer
.group_assignments.running
,
redirect_to_action
:
:initiate_termination
h2
class
=
(
'disabled-title'
if
@group_offer
.group_assignments.running.any
?)
Enddatum
für
das
Gruppenangebot
setzen
-
if
@group_offer
.
group_assignments
.
running
.
any?
p
.text-danger.text-bigger-1
Um
das
Gruppenangebot
zu
beenden,
müssen
erst
alle
zugehörigen
Gruppeneinsätze
beendet
sein
.
=
f
.
input
:period_end
,
as: :date_picker
,
disabled:
@group_offer
.
group_assignments
.
running
.
any?
p
.text-info.m-b-10.text-bigger-1
em
Die
Voreinstellung
für
das
Enddatum
kann
auf
ein
beliebiges
Datum
angepasst
werden
hr
=
f
.
button
:submit
,
disabled:
@group_offer
.
group_assignments
.
running
.
any?
app/views/group_offers/show.html.slim
View file @
02f69065
...
...
@@ -73,44 +73,7 @@ h2= @group_offer.title
-
if
@group_offer
.
group_assignments
.
any?
h2
Aktuelle
Gruppeneinsä
tze
.table-responsive.assignments-table
table
.table.table-no-border-top
thead
tr
th
=
t_attr
(
:volunteer
,
GroupAssignment
)
-
if
params
[
:format
]
==
'pdf'
th
Freiwillige
Mailadresse
th
=
t_attr
(
:role
,
GroupAssignment
)
th
=
t_attr
(
:period_start
,
GroupAssignment
)
th
=
t_attr
(
:period_end
,
GroupAssignment
)
th
.hidden-print
colspan
=
2
Aktionen
tbody
-
@group_offer
.
group_assignments
.
each
do
|
group_assignment
|
-
if
group_assignment
.
volunteer
tr
td
=
link_to_if
(
policy
(
Volunteer
).
show?
,
group_assignment
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
group_assignment
.
volunteer
))
-
if
params
[
:format
]
==
'pdf'
td
=
group_assignment
.
volunteer
.
contact
.
primary_email
td
=
group_assignment
.
responsible
?
t_attr
(
:responsible
,
GroupAssignment
)
:
t_attr
(
:member
,
GroupAssignment
)
td
=
l
(
group_assignment
.
period_start
)
if
group_assignment
.
period_start
td
=
l
(
group_assignment
.
period_end
)
if
group_assignment
.
period_end
td
.index-action-cell.hidden-print
=
link_to_if
(
policy
(
group_assignment
).
edit?
,
'Bearbeiten'
,
edit_group_assignment_path
(
group_assignment
))
{
''
}
-
if
group_assignment
.
period_end
.
blank?
=
link_to_if
(
policy
(
group_assignment
).
set_end_today?
,
'Heute beenden'
,
set_end_today_group_assignment_path
(
group_assignment
),
data:
{
method:
'PUT'
})
{
''
}
-
elsif
group_assignment
.
termination_submitted_by_id
.
blank?
=
link_to_if
(
policy
(
group_assignment
).
terminate?
,
'Beendigungsformular an Freiwillige/n mailen'
,
polymorphic_path
([
group_assignment
,
ReminderMailing
],
action: :new_termination
))
=
link_to_if
(
policy
(
group_assignment
).
terminate?
,
'Beendigungsformular ausfüllen'
,
polymorphic_path
(
group_assignment
,
action: :terminate
))
td
-
if
group_assignment
.
period_end
.
present?
&&
policy
(
GroupAssignment
).
verify_termination?
=
link_to_if
(
group_assignment
.
termination_verified_by
.
blank?
,
'Beendigung Quittieren'
,
verify_termination_group_assignment_path
(
group_assignment
),
class:
'btn btn-default'
,
data:
{
method:
'PATCH'
})
{
''
}
=
render
'group_assignments_index',
group_assignments:
@group_offer
.group_assignments
-
if
@group_offer
.
group_assignment_logs
.
any?
h2
Archivierte
Gruppeneinsätze
...
...
config/locales/de.yml
View file @
02f69065
...
...
@@ -364,6 +364,7 @@ de:
volunteers
:
Freiwillige
volunteer_state
:
Interne oder externe Freiwillige
women
:
Frauen
period_end
:
Angebotsenddatum
group_offer_category
:
category_name
:
Name
category_state
:
Status
...
...
config/routes.rb
View file @
02f69065
...
...
@@ -69,7 +69,7 @@ Rails.application.routes.draw do
resources
:group_offers
,
concerns: :search
do
put
:change_active_state
,
on: :member
get
:initiate_termination
,
on: :member
put
:initiate_termination
,
on: :member
,
to:
'group_offers#submit_initiate_termination'
put
:
submit_
initiate_termination
,
on: :member
end
get
'list_responses/hours'
,
to:
'list_responses#hours'
...
...
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