Commit 20bf3613 authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou
Browse files

(not final) views and translations

parent 01cea38f
......@@ -22,4 +22,21 @@ module ApplicationHelper
[:monday, :tuesday, :wednesday, :thursday, :friday]
end
end
# volunteer collections
def duration_collection
[:short, :long]
end
def region_collection
[:city, :region, :canton]
end
def single_accompaniment
[:man, :woman, :family, :kid]
end
def group_accompaniment
[:sport, :creative, :music, :culture, :training, :german_course]
end
end
class Volunteer < ApplicationRecord
def nationality_name
return '' if nationality.blank?
c = ISO3166::Country[nationality]
c.translations[I18n.locale.to_s] || c.name
end
end
......@@ -27,7 +27,13 @@
.row
.col-xs-12
= f.input :address
= f.input :street
.col-xs-6
= f.input :zip
.col-xs-6
= f.input :city
.col-xs-12.col-md-6
= f.input :email
......@@ -52,7 +58,7 @@
.row
.col-xs-12
= f.input :duration, collection: [t('short'), t('long')], as: :radio_buttons
= f.input :duration, collection: duration_collection, as: :radio_buttons
.row
h3= t('single_accompaniment')
......@@ -102,7 +108,7 @@
.row
h3= t('your_region')
.col-xs-12
= f.input :region, collection: [t('city'), t('region'), t('canton')], as: :radio_buttons, label: false
= f.input :region, collection: region_collection, as: :radio_buttons, label: false
.row
.col-xs-12
......
tr
td = volunteer.first_name
td = volunteer.last_name
td = link_to t_action(:show), volunteer
td = link_to t_action(:edit), edit_volunteer_path(volunteer)
td = link_to t_action(:destroy), volunteer, data: { confirm: t('are_you_sure')}, method: :delete
h1 Editing volunteer
.row
.col-xs-12
h1= t_title(:edit)
== render 'form'
= link_to 'Show', @volunteer
' |
= link_to 'Back', volunteers_path
.row
.col-xs-12
p= link_to t_action(:show), @volunteer, class: 'btn btn-default'
p= link_to t('back'), volunteers_path, class: 'btn btn-default'
h1 Listing volunteers
.row
.col-xs-12
h1= t('volunteers')
table
thead
tr
th First name
th Last name
th
th
th
tbody
- @volunteers.each do |volunteer|
.row
.col-xs-12
table.table.table-striped
thead
tr
td = volunteer.first_name
td = volunteer.last_name
td = link_to 'Show', volunteer
td = link_to 'Edit', edit_volunteer_path(volunteer)
td = link_to 'Destroy', volunteer, data: { confirm: 'Are you sure?' }, method: :delete
th= t_attr(:first_name)
th= t_attr(:last_name)
th
th
th
br
tbody
= render @volunteers
= link_to 'New Volunteer', new_volunteer_path
.row
.col-xs-12
= link_to t('create_volunteer'), new_volunteer_path, class: 'btn btn-success'
h1 New volunteer
.row
.col-xs-12
h1= t_title(:new)
== render 'form'
.row
.col-xs-12
p= render 'form'
= link_to 'Back', volunteers_path
.row
.col-xs-12
p= link_to t('back'), volunteers_path, class: 'btn btn-default'
p#notice = notice
.row
.col-xs-12
h1
= @volunteer.first_name
| ,
= @volunteer.last_name
.row
.col-xs-12
.table-responsive
table.table.table-no-border-top
tbody
tr
td= t_attr(:date_of_birth)
td= l(@volunteer.date_of_birth) if @volunteer.date_of_birth
tr
td= t_attr(:gender)
td= t("gender.#{@volunteer.gender}") unless @volunteer.gender.blank?
tr
td= t_attr(:nationality)
td= @volunteer.nationality_name
tr
td= t_attr(:dual_nationality)
td= @volunteer.dual_nationality
tr
td= t_attr(:street)
td= @volunteer.street
tr
td= t_attr(:zip)
td= @volunteer.zip
tr
td= t_attr(:city)
td= @volunteer.city
tr
td= 'Email'
td= @volunteer.email
tr
td= t_attr(:phone)
td= @volunteer.phone
tr
td= t_attr(:profession)
td= @volunteer.profession
tr
td= t_attr(:education)
td= @volunteer.education
tr
td= t_attr(:motivation)
td= @volunteer.motivation
tr
td= t_attr(:experience)
td= @volunteer.experience
tr
td= t_attr(:expectations)
td= @volunteer.expectations
tr
td= t_attr(:strengths)
td= @volunteer.strengths
tr
td= t_attr(:skills)
td= @volunteer.skills
tr
td= t_attr(:interests)
td= @volunteer.interests
tr
td= t_attr(:state)
td= @volunteer.state
tr
td= t_attr(:duration)
td= t("duration.#{@volunteer.duration}") unless @volunteer.duration.blank?
tr
td= t_attr(:region)
td= t("region.#{@volunteer.region}") unless @volunteer.region.blank?
p
strong First name:
= @volunteer.first_name
p
strong Last name:
= @volunteer.last_name
.row
.col-xs-12
h3= t('single_accompaniment')
table.table.table-striped
thead
tr
- single_accompaniment.each do |single|
th.text-center
= t("accompaniment.#{single}")
tbody
tr
- single_accompaniment.each do |single|
td.text-center
- if @volunteer.read_attribute(single)
i.glyphicon.glyphicon-ok.text-success
- else
i.glyphicon.glyphicon-remove.text-danger
= link_to 'Edit', edit_volunteer_path(@volunteer)
' |
= link_to 'Back', volunteers_path
.row
.col-xs-12
h3= t('group_accompaniment')
table.table.table-striped
thead
tr
- group_accompaniment.each do |group|
th.text-center
= t("accompaniment.#{group}")
tbody
tr
- group_accompaniment.each do |group|
td.text-center
- if @volunteer.read_attribute(group)
i.glyphicon.glyphicon-ok.text-success
- else
i.glyphicon.glyphicon-remove.text-danger
.row
.col-xs-12
p= link_to t_action(:edit), edit_volunteer_path(@volunteer), class: 'btn btn-default'
p= link_to t('back'), volunteers_path, class: 'btn btn-default'
......@@ -27,6 +27,7 @@ de:
client: Klient
profile: Profil
user: Benutzer
volunteer: Freiwillige
attributes:
client:
first_name: Vorname
......@@ -79,7 +80,9 @@ de:
last_name: Nachname
date_of_birth: Geburtsdatum
gender: Geschlecht
address: Adresse
street: Strasse
zip: Postleitzahl
city: Stadt
nationality: Nationalität
dual_nationality: Doppelte Nationalität
phone: Telefonnummer
......@@ -232,9 +235,20 @@ de:
rejected: Abgelehnt
user:
role:
superadmin: 'Superadmin'
social_worker: 'Sozialarbeiter'
department_manager: 'Standort Leiter'
superadmin: Superadmin
social_worker: Sozialarbeiter
department_manager: Standort Leiter
volunteer:
gender:
female: Weiblich
male: Mänlich
region:
city: Stadt
region: Region
canton: Kanton
duration:
short: Kurzfristig
long: Längerfristige (min 6 Mt.)
"yes": 'Ja'
"no": 'Nein'
required:
......@@ -301,24 +315,41 @@ de:
friday: Freitag
saturday: Samstag
sunday: Sonntag
accompaniment:
man: Mann
woman: Frau
family: Familie
kid: Kind
sport: Sport
creative: Kreativ
music: Musik
culture: Kultur
training: Bildung
german_course: Deutsch-Kurs
region:
city: Stadt
region: Region
canton: Kanton
duration:
short: Kurzfristig
long: Längerfristige (min 6 Mt.)
add_language: Sprache hinzufügen
add_relative: Verwandte hinzufügen
are_you_sure: Sind Sie sicher?
are_you_sure_invitation: Sind Sie sicher, dass Sie eine Einladung verschicken möchten?
are_you_sure_delete_user: 'Sind Sie sicher, dass sie %{email} löschen möchten?'
back: Zurück
canton: Kanton
change_my_password: Ihr Passwort ändern
change_password: Ihr Passwort ändern
city: Stadt
client_created: KlientIn wurde erfolgreich erstellt.
client_updated: KlientIn wurde erfolgreich aktualisiert.
client_destroyed: KlientIn wurde erfolgreich gelöscht.
clients: Klienten
contact_info: Kontakt Informationen
create_client: KlientIn erfassen
create_user: Benutzer erfassen
create_profile: Profil erfassen
create_user: Benutzer erfassen
create_volunteer: Freiwillige erfassen
edit_login: Login bearbeiten
edit_profile: Profil bearbeiten
forgot_password: Passwort vergessen?
......@@ -327,26 +358,24 @@ de:
language_skills: Sprachkenntnisse
login: Anmelden
logout: Abmelden
long: Längerfristige (min 6 Mt.)
not_authorized: Sie sind nicht berechtigt diese Aktion durchzuführen.
password_reset_instructions: Ich möchte mein Passwort zurücksetzen
personal_background: Persönlicher Hintergrund
profile_created: Profil wurde erfolgreich erstellt.
profile_updated: Profil wurde erfolgreich aktualisiert.
region: Region
registered_by: 'SozialberaterIn'
relatives: Verwandte
remember_me: Angemeldet bleiben
remove_language: Sprache entfernen
remove_relative: Verwandte entfernen
schedule: Zeitplan
short: Kurzfristig
show_my_profile: Mein Profil
show_profile: Profil anzeigen
single_accompaniment: Einzelbegleitung
target_groups: Zielgruppe
users: Benutzer
user_destroyed: Benutzer wurde erfolgreich gelöscht.
volunteers: Freiwillige
voluntary_platform: Freiwilligen Plattform
when: Zeit
working_days: Arbeitstage
......
......@@ -4,6 +4,7 @@ en:
client: Client
user: User
profile: Profile
volunteer: Volunteer
devise:
confirmations:
confirmed: Your email address has been successfully confirmed.
......@@ -128,9 +129,20 @@ en:
rejected: Rejected
user:
role:
superadmin: 'Superadmin'
social_worker: 'Social worker'
department_manager: 'Departement manager'
superadmin: Superadmin
social_worker: Social worker
department_manager: Department manager
volunteer:
gender:
female: Female
male: Man
region:
city: City
region: Region
canton: Canton
duration:
short: Short term
long: Long term (min 6 months)
"yes": 'Yes'
"no": 'No'
required:
......@@ -174,24 +186,41 @@ en:
friday: Friday
saturday: Saturday
sunday: Sunday
accompaniment:
man: Man
woman: Woman
family: Family
kid: Kid
sport: Sport
creative: Creative
music: Music
culture: Culture
training: Education
german_course: German course
region:
city: City
region: Region
canton: Canton
duration:
short: Short term
long: Long term (min 6 months)
add_language: Add language
add_relative: Add family member
are_you_sure: Are you sure?
are_you_sure_invitation: Are you sure you want to send an invitation?
are_you_sure_delete_user: 'Are you sure you want to delete %{email}?'
back: Back
canton: Canton
change_my_password: Change my password
change_password: Change your password
city: City
contact_info: Contact information
clients: Clients
client_created: Client was successfully created.
client_updated: Client was successfully updated.
client_destroyed: Client was successfully deleted.
create_client: Create client
create_user: Create user
create_profile: Create profile
create_user: Create user
create_volunteer: Create Volunteer
edit_login: Edit login
edit_profile: Edit profile
forgot_password: Forgot your password?
......@@ -200,26 +229,24 @@ en:
language_skills: Language skills
login: Log in
logout: Logout
long: Long term (min 6 months)
not_authorized: You are not authorized to perform this action.
password_reset_instructions: I want to reset my password
personal_background: Personal background
profile_created: Profile was successfully created.
profile_updated: Profile was successfully updated.
region: Region
registered_by: Responsible Volunteer
relatives: Family members
remember_me: Remember me
remove_language: Remove language
remove_relative: Remove family member
schedule: Schedule
short: Short term
show_profile: Show profile
show_my_profile: My profile
single_accompaniment: Single accompaniment
target_groups: Target groups
users: Users
user_destroyed: '%{email} was successfully deleted.'
volunteers: volunteers
voluntary_platform: Voluntaries Platform
when: Time
working_days: Working days
......
......@@ -5,7 +5,9 @@ class CreateVolunteers < ActiveRecord::Migration[5.1]
t.string :last_name
t.date :date_of_birth
t.string :gender
t.text :address
t.string :street
t.string :zip
t.string :city
t.string :nationality
t.string :dual_nationality
t.string :email
......@@ -33,7 +35,6 @@ class CreateVolunteers < ActiveRecord::Migration[5.1]
t.boolean :adults
t.boolean :teenagers
t.boolean :children
t.boolean :city
t.string :region
t.timestamps
end
......
......@@ -134,7 +134,9 @@ ActiveRecord::Schema.define(version: 20170511135554) do
t.string "last_name"
t.date "date_of_birth"
t.string "gender"
t.text "address"
t.string "street"
t.string "zip"
t.string "city"
t.string "nationality"
t.string "dual_nationality"
t.string "email"
......@@ -162,7 +164,6 @@ ActiveRecord::Schema.define(version: 20170511135554) do
t.boolean "adults"
t.boolean "teenagers"
t.boolean "children"
t.boolean "city"
t.string "region"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
......
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