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
3169bbb8
Commit
3169bbb8
authored
Mar 28, 2018
by
Emily Wangler
Browse files
add buttons to volunteers
parent
9865cc4f
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/assets/stylesheets/layout/_content.scss
View file @
3169bbb8
...
...
@@ -21,7 +21,7 @@
}
.section-navigation
{
margin-bottom
:
0
;
margin-bottom
:
10px
;
margin-top
:
0
;
hr
,
...
...
app/helpers/navigation_and_button_helper.rb
View file @
3169bbb8
...
...
@@ -43,7 +43,12 @@ module NavigationAndButtonHelper
print:
{
text:
'Ausdrucken'
,
glyph:
'print'
},
download:
{
text:
'Herunterladen'
,
glyph:
'download-alt'
},
yes:
{
text:
'Ja'
,
glyph:
'ok'
},
no:
{
text:
'Nein'
,
glyph:
'remove'
}
no:
{
text:
'Nein'
,
glyph:
'remove'
},
journal:
{
text:
'Journal'
,
glyph:
'book'
},
hours:
{
text:
'Stunden erfassen'
,
glyph:
'time'
},
billing_expenses:
{
text:
'Spesen'
,
glyph:
'usd'
},
assignment:
{
text:
'Begleitung'
,
glyph:
'user'
},
certificate:
{
text:
'Nachweis'
,
glyph:
'education'
}
}
glyph_span
(
translate_glyph
[
icon_type
.
to_sym
])
end
...
...
app/views/volunteers/_buttons.html.slim
0 → 100644
View file @
3169bbb8
nav
.navbar.section-navigation
ul
.list-inline.pull-right
-
if
policy
(
Volunteer
).
superadmin_privileges?
li
=
button_link
navigation_glyph
(
:journal
),
polymorphic_path
([
@volunteer
,
Journal
]),
'primary'
,
title:
'Journal'
ul
.list-inline
li
=
form_navigation_btn
:back
,
with_row:
false
unless
current_user
.
volunteer?
-
if
policy
(
@volunteer
).
terminate?
li
.button-acceptance
=
link_to
t
(
"volunteer_applications.acceptance.
#{
@volunteer
.
acceptance
}
"
),
'#'
,
class
:
"btn
btn-acceptance-
#{
@volunteer
.
acceptance
}
"
li
=
link_to
navigation_glyph
(
:terminate
),
terminate_volunteer_path
(
@volunteer
),
class:
'btn btn-default'
,
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
@volunteer
.
internal_and_started_assignments?
li
=
button_link
navigation_glyph
(
:billing_expenses
),
volunteer_billing_expenses_path
(
@volunteer
),
title:
t_title
(
:index
,
BillingExpense
)
li
=
button_link
navigation_glyph
(
:certificate
),
volunteer_certificates_path
(
@volunteer
),
title:
t
(
'volunteer_applications.show.new_certificate'
)
app/views/volunteers/_volunteer.html.slim
View file @
3169bbb8
...
...
@@ -24,7 +24,7 @@ tr
'
Importiert
td
=
t
(
"salutation.
#{
volunteer
.
salutation
}
"
)
if
volunteer
.
salutation?
-
if
action_name
==
'index'
||
action_name
==
'seeking_clients'
||
controller_name
==
'group_offers'
td
=
link_to
volunteer
.
contact
.
full_name
,
volunteer
td
=
link_to
volunteer
.
contact
.
full_name
,
edit_
volunteer
_path
(
volunteer
)
td
=
volunteer
.
contact
.
city
td
=
volunteer
.
contact
.
postal_code
td
=
mail_to
volunteer
.
contact
.
primary_email
...
...
app/views/volunteers/edit.html.slim
View file @
3169bbb8
h1
=
t_title
(
:edit
)
=
simple_form_for
(
@volunteer
)
do
|
f
|
h1
=
@volunteer
.
full_name
=
render
'buttons'
=
f
.
button
:submit
=
render
'volunteers/form'
,
f:
f
,
volunteer:
@volunteer
-
if
@volunteer
.
assignments
.
unterminated
.
any?
h2
.small
#assignments
Aktuelle
Begleitungen
=
render
'assignments/client_volunteer_index',
assignments:
@volunteer
.assignments.unterminated
-
if
@volunteer
.
assignment_logs
.
any?
h2
.small
Archivierte
Begleitungen
=
render
'assignment_logs/assignment_logs_volunteer_index',
assignment_logs:
@volunteer
.assignment_logs
-
if
@volunteer
.
group_assignments
.
unterminated
.
any?
h2
.small
#assignments
=
t
(
'volunteer_applications.show.group_assignments'
)
=
render
'group_assignments/volunteer_group_assignments'
,
group_assignments:
@volunteer
.
group_assignments
.
unterminated
,
editable:
true
-
if
@volunteer
.
group_assignment_logs
.
any?
h2
.small
=
t
(
'volunteer_applications.show.old_group_assignments'
)
=
render
'group_assignments/volunteer_group_assignments_logs'
,
group_assignment_logs:
@volunteer
.
group_assignment_logs
-
if
policy
(
Event
).
show?
&&
@volunteer_events
.
present?
=
render
'events/volunteer_events'
,
events:
@volunteer_events
-
if
current_user
.
volunteer?
=
f
.
button
:submit
,
t
(
'update_profile'
)
-
else
=
f
.
button
:submit
-
unless
current_user
.
volunteer?
=
form_navigation_btn
:back
=
render
'buttons'
app/views/volunteers/new.html.slim
View file @
3169bbb8
h1
=
t_title
(
:new
)
=
simple_form_for
(
@volunteer
,
url:
volunteers_path
)
do
|
f
|
=
f
.
button
:submit
=
render
'volunteers/form'
,
f:
f
=
f
.
button
:submit
...
...
app/views/volunteers/show.html.slim
View file @
3169bbb8
...
...
@@ -5,37 +5,7 @@ h1= @volunteer.contact.full_name
-
if
@volunteer
.
rejection_text
.
present?
h4
=
"
#{
t_attr
(
:rejection_text
)
}
:
#{
@volunteer
.
rejection_text
}
"
nav
.navbar.section-navigation
ul
.list-inline.pull-right
-
if
policy
(
Volunteer
).
superadmin_privileges?
li
=
button_link
'Journal'
,
polymorphic_path
([
@volunteer
,
Journal
]),
'primary'
ul
.list-inline
-
if
policy
(
@volunteer
).
terminate?
li
.button-acceptance
=
link_to
t
(
".acceptance.
#{
@volunteer
.
acceptance
}
"
),
'#'
,
class
:
"btn
btn-acceptance-
#{
@volunteer
.
acceptance
}
"
li
=
link_to
'Beenden'
,
terminate_volunteer_path
(
@volunteer
),
class:
'btn btn-default'
,
method: :put
unless
@volunteer
.
resigned?
-
if
policy
(
Volunteer
).
superadmin_privileges?
ul
.list-inline
-
if
@volunteer
.
seeking_clients?
li
=
button_link
t_title
(
:new
,
Assignment
),
new_assignment_path
(
volunteer_id:
@volunteer
)
-
if
@volunteer
.
internal_and_started_assignments?
li
=
simple_form_for
[
@volunteer
,
BillingExpense
.
new
]
do
|
f
|
=
f
.
hidden_field
:volunteer_id
,
value:
@volunteer
.
id
=
f
.
button
:submit
-
if
@volunteer
.
billing_expenses
.
any?
li
=
button_link
t_title
(
:index
,
BillingExpense
),
volunteer_billing_expenses_path
(
@volunteer
)
li
=
button_link
t
(
'.new_certificate'
),
new_volunteer_certificate_path
(
@volunteer
)
-
if
@volunteer
.
certificates
.
size
==
1
li
=
button_link
t
(
'.show_certificate'
),
volunteer_certificate_path
(
@volunteer
,
@volunteer
.
certificates
.
first
)
-
elsif
@volunteer
.
certificates
.
size
>
1
li
=
button_link
t
(
'.show_certificates'
),
volunteer_certificates_path
(
@volunteer
)
ul
.list-inline
-
if
@volunteer
.
internal_and_started_assignments?
li
=
button_link
t
(
'.report_hours'
),
new_volunteer_hour_url
(
@volunteer
)
li
=
button_link
t
(
'.hour_reports'
),
volunteer_hours_path
(
@volunteer
)
li
=
button_link
current_user
.
volunteer?
?
t
(
'edit_profile'
)
:
t_title
(
:edit
),
edit_volunteer_path
(
@volunteer
)
li
=
form_navigation_btn
:back
,
with_row:
false
unless
current_user
.
volunteer?
=
render
'buttons'
-
if
policy
(
Volunteer
).
superadmin_privileges?
-
if
@volunteer
.
import
.
present?
...
...
@@ -190,8 +160,4 @@ h4.label-list
-
if
policy
(
Event
).
show?
&&
@volunteer_events
.
present?
=
render
'events/volunteer_events'
,
events:
@volunteer_events
nav
.navbar.section-navigation
ul
.list-inline
li
=
button_link
current_user
.
volunteer?
?
t
(
'edit_profile'
)
:
t_title
(
:edit
),
edit_volunteer_path
(
@volunteer
)
-
if
policy
(
Volunteer
).
index?
li
=
form_navigation_btn
:back
,
with_row:
false
=
render
'buttons'
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