Commit c8aab414 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou
Browse files

reintroduce nationality name

parent b6002c77
......@@ -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
......@@ -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
......
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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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')}: "
......
......@@ -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')}: "
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment