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
3efdb7ad
Commit
3efdb7ad
authored
Jul 28, 2017
by
Chrysanthi Lagodimou
Browse files
views and policies
parent
7cb23ecc
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/policies/volunteer_policy.rb
View file @
3efdb7ad
...
...
@@ -46,6 +46,10 @@ class VolunteerPolicy < ApplicationPolicy
user
.
superadmin?
end
def
checklist?
user
&&
user
.
superadmin?
end
private
def
volunteers_owns_profile
...
...
app/views/volunteers/_form.html.slim
View file @
3efdb7ad
...
...
@@ -8,6 +8,21 @@
=
f
.
input
:rejection_type
,
collection:
Volunteer
::
REJECTIONS
,
as: :radio_buttons
.col-xs-12
=
f
.
input
:rejection_text
-
if
policy
(
Volunteer
).
checklist?
h3
=
t
(
'checklist'
)
.row
.col-xs-12
=
f
.
input
:trial_period
.col-xs-12
=
f
.
input
:intro_course
.col-xs-12
=
f
.
input
:doc_sent
.col-xs-12
=
f
.
input
:bank_account
.col-xs-12
=
f
.
input
:evaluation
.row
.col-xs-12
=
f
.
input
:salutation
,
...
...
app/views/volunteers/show.html.slim
View file @
3efdb7ad
...
...
@@ -10,6 +10,28 @@
-
if
policy
(
Volunteer
).
supervisor?
=
render
'journals/journal_block'
,
journaled_for:
@volunteer
-
if
policy
(
Volunteer
).
checklist?
h3
=
t
(
'checklist'
)
.table-responsive
table
.table.table-no-border-top
tbody
tr
td
=
t_attr
(
:trial_period
)
td
=
Volunteer
.
human_boolean
(
@volunteer
.
trial_period
)
tr
td
=
t_attr
(
:intro_course
)
td
=
Volunteer
.
human_boolean
(
@volunteer
.
intro_course
)
tr
td
=
t_attr
(
:doc_sent
)
td
=
Volunteer
.
human_boolean
(
@volunteer
.
doc_sent
)
tr
td
=
t_attr
(
:bank_account
)
td
=
Volunteer
.
human_boolean
(
@volunteer
.
bank_account
)
tr
td
=
t_attr
(
:evaluation
)
td
=
Volunteer
.
human_boolean
(
@volunteer
.
evaluation
)
h3
=
t
(
'personal_background'
)
.table-responsive
table
.table.table-no-border-top
tbody
...
...
config/locales/de.yml
View file @
3efdb7ad
...
...
@@ -104,15 +104,18 @@ de:
address
:
Adresse
adults
:
Erwachsene
avatar
:
Foto
bank_account
:
Kontodaten eingetragen
birth_year
:
Jahrgang
children
:
Kinder
city
:
Stadt
created_at
:
Erstellt am
creative
:
Kreativ
culture
:
Kultur
doc_sent
:
Dossier Freiwillige engagiert verschick
duration
:
Dauer der Begleitung
education
:
Ausbildung
email
:
Email
evaluation
:
Abschlussevaluation erhalten
expectations
:
Erwartungen
experience
:
Erfahrung
family
:
Familie
...
...
@@ -122,6 +125,7 @@ de:
german_course
:
Deutsch-Kurs
group_accompaniment
:
Gruppenangebot (meist in Asylzentren)
interests
:
Interessen
intro_course
:
Einführungskurs besucht
kid
:
Kinder
languages
:
Sprachen
last_name
:
Nachname
...
...
@@ -144,6 +148,7 @@ de:
strengths
:
Stärken
teenagers
:
Jugendliche
training
:
Bildung
trial_period
:
Probezeitbericht erhalten
volunteer_experience_desc
:
Falls sie bereits Erfahrungen mit Freiwilligenarbeit haben, bitte diese genauer erläutern.
woman
:
Frau
working_percent
:
Stellenprozent
...
...
@@ -264,6 +269,7 @@ de:
change_my_password
:
Ihr Passwort ändern
change_password
:
Ihr Passwort ändern
changed_by
:
Geändert durch
checklist
:
Abhak-Liste
client_created
:
Klient/in wurde erfolgreich erstellt.
client_destroyed
:
Klient/in wurde erfolgreich gelöscht.
client_updated
:
Klient/in wurde erfolgreich aktualisiert.
...
...
config/locales/en.yml
View file @
3efdb7ad
...
...
@@ -30,12 +30,16 @@ en:
additional_email_addresses
:
Additional email addresses
additional_phone_numbers
:
Additional phone numbers
address
:
Address
bank_account
:
Bank account details entered
creative
:
Creative
culture
:
Culture
doc_sent
:
Engaged volunteer's documents sent
duration
:
Duration of the accompaniment
evaluation
:
Final evaluation
family
:
Family
full_name
:
Name
german_course
:
German course
intro_course
:
Introductory course
kid
:
Kid
man
:
Man
music
:
Music
...
...
@@ -45,6 +49,7 @@ en:
single_accompaniment
:
Single accompaniment
sport
:
Sport
training
:
Training
trial_period
:
Trial period report
volunteer_experience_desc
:
If you have any experiences with voluntary work, please describe here.
woman
:
Woman
working_percent
:
Employment rate (in Percent)
...
...
@@ -129,6 +134,7 @@ en:
change_my_password
:
Change my password
change_password
:
Change your password
changed_by
:
Changed by
checklist
:
Checklist
clients
:
Clients
clients_need_accompanying
:
Clients who need accompanying
contact_info
:
Contact information
...
...
test/system/volunteers_test.rb
View file @
3efdb7ad
...
...
@@ -53,9 +53,7 @@ class VolunteersTest < ApplicationSystemTestCase
click_button
'Create Volunteer'
within
'.table-no-border-top'
do
assert
page
.
has_text?
'Kosovo'
end
assert
page
.
has_text?
'Kosovo'
end
test
'conditional field for radio button is shown on radio chosen'
do
...
...
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