From df866b50ce458317b8259717032c6e611d2e54b9 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 30 Nov 2018 06:56:44 +0500 Subject: [PATCH] Display list of passports --- app/views/passports/index.html.erb | 54 ++++++++++++++++++++++++++++++ config/locales/activerecord/en.yml | 3 ++ config/locales/activerecord/ru.yml | 3 ++ 3 files changed, 60 insertions(+) diff --git a/app/views/passports/index.html.erb b/app/views/passports/index.html.erb index e69de29..163a34d 100644 --- a/app/views/passports/index.html.erb +++ b/app/views/passports/index.html.erb @@ -0,0 +1,54 @@ +
+ + + + + + + + + + + + + + + + + <% @passports.each do |passport| %> + + + + + + + + + + + + <% end %> + +
+ <%= Passport.human_attribute_name :id %> + + <%= Passport.human_attribute_name :surname %> + + <%= Passport.human_attribute_name :given_name %> + + <%= Passport.human_attribute_name :patronymic %> + + <%= Passport.human_attribute_name :sex %> + + <%= Passport.human_attribute_name :date_of_birth %> + + <%= Passport.human_attribute_name :place_of_birth %> + + <%= Passport.human_attribute_name :series %> + + <%= Passport.human_attribute_name :number %> +
<%= passport.id %><%= truncate passport.surname %><%= truncate passport.given_name %><%= truncate passport.patronymic %> + <%= Passport.human_attribute_name \ + "sex.#{Passport.sexes.key(passport.sex)}" %> + <%= localize passport.date_of_birth %><%= truncate passport.place_of_birth %><%= passport.series.to_s.rjust(4, '0') %><%= passport.number.to_s.rjust(6, '0') %>
+
diff --git a/config/locales/activerecord/en.yml b/config/locales/activerecord/en.yml index 3d3ca99..388ad6f 100644 --- a/config/locales/activerecord/en.yml +++ b/config/locales/activerecord/en.yml @@ -12,6 +12,7 @@ en: other: Users attributes: membership_application: + id: ID first_name: First name last_name: Last name middle_name: Middle name @@ -23,6 +24,7 @@ en: organization_membership: Membership in other social organizations comment: Comment passport: + id: ID surname: Surname given_name: Given names patronymic: Patronymic @@ -38,6 +40,7 @@ en: male: Male female: Female user: + id: ID confirmation_sent_at: Confirmation sent at confirmation_token: Confirmation token confirmed_at: Confirmed at diff --git a/config/locales/activerecord/ru.yml b/config/locales/activerecord/ru.yml index bf9ac6f..12e27c2 100644 --- a/config/locales/activerecord/ru.yml +++ b/config/locales/activerecord/ru.yml @@ -12,6 +12,7 @@ ru: other: Пользователи attributes: membership_application: + id: ID first_name: Имя last_name: Фамилия middle_name: Отчество @@ -23,6 +24,7 @@ ru: organization_membership: Членство в других общественных организациях comment: Комментарий passport: + id: ID surname: Фамилия given_name: Имя patronymic: Отчество @@ -38,6 +40,7 @@ ru: male: Мужской female: Женский user: + id: ID confirmation_sent_at: Дата отправки подтверждения confirmation_token: Токен подтверждения confirmed_at: Дата подтверждения