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
c8aab414
Commit
c8aab414
authored
Jul 14, 2017
by
Chrysanthi Lagodimou
Browse files
reintroduce nationality name
parent
b6002c77
Changes
9
Hide whitespace changes
Inline
Side-by-side
app/helpers/application_helper.rb
View file @
c8aab414
...
...
@@ -82,4 +82,10 @@ module ApplicationHelper
''
end
end
def
nationality_name
(
nationality
)
return
''
if
nationality
.
blank?
c
=
ISO3166
::
Country
[
nationality
]
c
.
translations
[
I18n
.
locale
.
to_s
]
||
c
.
name
end
end
app/models/volunteer.rb
View file @
c8aab414
...
...
@@ -101,14 +101,6 @@ class Volunteer < ApplicationRecord
Volunteer
.
includes
(
:assignment
).
where
(
assignments:
{
volunteer_id:
nil
})
end
def
nationality_long
ApplicationController
.
helpers
.
country
nationality
end
def
adittional_nationality_long
ApplicationController
.
helpers
.
country
additional_nationality
end
private
def
default_state
...
...
app/views/assignments/_without_client.html.slim
View file @
c8aab414
tr
td
=
without_client
.
contact
.
full_name
td
=
t
(
"gender.
#{
without_client
.
gender
}
"
)
if
without_client
.
gender
.
present?
td
=
country
(
without_client
.
nationality
)
td
=
country
(
without_client
.
additional_nationality
)
td
=
nationality_name
(
without_client
.
nationality
)
td
=
nationality_name
(
without_client
.
additional_nationality
)
td
=
without_client
.
contact
.
city
td
=
without_client
.
contact
.
postal_code
td
...
...
app/views/assignments/find_volunteer.html.slim
View file @
c8aab414
...
...
@@ -10,7 +10,7 @@
=
render
'contacts/show'
,
contact:
@client
.
contact
tr
td
=
t_attr
(
:nationality
,
Client
)
td
=
country
(
@client
.
nationality
)
td
=
nationality_name
(
@client
.
nationality
)
tr
td
=
t_attr
(
:permit
,
Client
)
td
=
@client
.
permit
...
...
@@ -41,8 +41,8 @@
tr
th
=
sort_link
@q
,
:contact_last_name
,
t_attr
(
:full_name
,
Volunteer
)
th
=
sort_link
@q
,
:gender
,
t_attr
(
:gender
,
Volunteer
)
th
=
sort_link
@q
,
:nationality
_long
,
t_attr
(
:nationality
,
Volunteer
)
th
=
sort_link
@q
,
:adittional_nationality
_long
,
t_attr
(
:additional_nationality
,
Volunteer
)
th
=
sort_link
@q
,
:nationality
,
t_attr
(
:nationality
,
Volunteer
)
th
=
sort_link
@q
,
:adittional_nationality
,
t_attr
(
:additional_nationality
,
Volunteer
)
th
=
sort_link
@q
,
:contact_city
,
t_attr
(
:city
,
Volunteer
)
th
=
sort_link
@q
,
:contact_postal_code
,
t_attr
(
:zip
,
Volunteer
)
th
=
t_attr
(
:languages
,
Volunteer
)
...
...
app/views/clients/_client.html.slim
View file @
c8aab414
...
...
@@ -7,7 +7,7 @@ tr
-
client
.
relatives
.
each
do
|
relative
|
=
relative
.
to_s
br
td
=
country
(
client
.
nationality
)
td
=
nationality_name
(
client
.
nationality
)
td
-
client
.
language_skills
.
each
do
|
language
|
=
language
.
full_language_skills
...
...
app/views/clients/show.html.slim
View file @
c8aab414
...
...
@@ -19,7 +19,7 @@
=
t
(
"gender.
#{
@client
.
gender
}
"
)
tr
td
=
t_attr
(
:nationality
)
td
=
country
(
@client
.
nationality
)
td
=
nationality_name
(
@client
.
nationality
)
tr
td
=
t_attr
(
:permit
)
td
=
@client
.
permit
...
...
app/views/volunteer_mailer/welcome_email.html.slim
View file @
c8aab414
...
...
@@ -51,11 +51,11 @@ h4= "#{t_attr(:avatar, Volunteer)}: "
p
=
image_tag
@volunteer
.
avatar
.
url
(
:thumb
)
if
@volunteer
.
avatar
.
present?
h4
=
"
#{
t_attr
(
:nationality
,
Volunteer
)
}
: "
p
=
country
(
@volunteer
.
nationality
)
p
=
nationality_name
(
@volunteer
.
nationality
)
-
if
@volunteer
.
additional_nationality
.
present?
h4
=
"
#{
t_attr
(
:additional_nationality
,
Volunteer
)
}
: "
p
=
country
(
@volunteer
.
additional_nationality
)
p
=
nationality_name
(
@volunteer
.
additional_nationality
)
-
if
@volunteer
.
language_skills
.
any?
h4
=
"
#{
t
(
'language_skills'
)
}
: "
...
...
app/views/volunteer_mailer/welcome_email.text.slim
View file @
c8aab414
...
...
@@ -50,11 +50,11 @@
-
if
@volunteer
.
nationality
.
present?
=
"
#{
rn2
}#{
t_attr
(
:nationality
,
Volunteer
)
}
:
#{
t3
}
"
=
country
(
@volunteer
.
nationality
)
=
nationality_name
(
@volunteer
.
nationality
)
-
if
@volunteer
.
additional_nationality
.
present?
=
"
#{
rn2
}#{
t_attr
(
:additional_nationality
,
Volunteer
)
}
:
\t
"
=
country
(
@volunteer
.
additional_nationality
)
=
nationality_name
(
@volunteer
.
additional_nationality
)
-
if
@volunteer
.
language_skills
.
any?
=
"
#{
rn2
}#{
t
(
'language_skills'
)
}
: "
...
...
app/views/volunteers/show.html.slim
View file @
c8aab414
...
...
@@ -20,10 +20,10 @@
td
=
image_tag
@volunteer
.
avatar
.
url
(
:thumb
)
if
@volunteer
.
avatar
.
present?
tr
td
=
t_attr
(
:nationality
)
td
=
country
(
@volunteer
.
nationality
)
td
=
nationality_name
(
@volunteer
.
nationality
)
tr
td
=
t_attr
(
:additional_nationality
)
td
=
country
(
@volunteer
.
additional_nationality
)
td
=
nationality_name
(
@volunteer
.
additional_nationality
)
=
render
'language_skills/show'
,
speaker:
@volunteer
...
...
@@ -106,4 +106,3 @@ h3= t_attr(:group_accompaniment)
=
form_navigation_btn
:edit
=
form_navigation_btn
:back
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