From 106fb396cd8b4344a27dbf8311c75b83b8177a19 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 10 Apr 2020 18:48:26 +0500 Subject: [PATCH] Add partials --- .../passports/_common_descr_list.html.erb | 34 ++++++++ .../_registration_descr_list.html.erb | 46 ++++++++++ app/views/settings/passports/show.html.erb | 84 +------------------ .../staffs/people/passports/show.html.erb | 84 +------------------ 4 files changed, 88 insertions(+), 160 deletions(-) create mode 100644 app/views/passports/_common_descr_list.html.erb create mode 100644 app/views/passports/_registration_descr_list.html.erb diff --git a/app/views/passports/_common_descr_list.html.erb b/app/views/passports/_common_descr_list.html.erb new file mode 100644 index 0000000..55cb9e4 --- /dev/null +++ b/app/views/passports/_common_descr_list.html.erb @@ -0,0 +1,34 @@ +
+
<%= Passport.human_attribute_name :last_name %>
+
<%= passport.last_name %>
+ +
<%= Passport.human_attribute_name :first_name %>
+
<%= passport.first_name %>
+ +
<%= Passport.human_attribute_name :middle_name %>
+
<%= passport.middle_name %>
+ +
<%= Passport.human_attribute_name :sex %>
+
<%= translate_enum :sex, passport.sex %>
+ +
<%= Passport.human_attribute_name :date_of_birth %>
+
<%= localize passport.date_of_birth %>
+ +
<%= Passport.human_attribute_name :place_of_birth %>
+
<%= passport.place_of_birth %>
+ +
<%= Passport.human_attribute_name :series %>
+
<%= passport.series %>
+ +
<%= Passport.human_attribute_name :number %>
+
<%= passport.number %>
+ +
<%= Passport.human_attribute_name :issued_by %>
+
<%= passport.issued_by %>
+ +
<%= Passport.human_attribute_name :unit_code %>
+
<%= passport.unit_code %>
+ +
<%= Passport.human_attribute_name :date_of_issue %>
+
<%= localize passport.date_of_issue %>
+
diff --git a/app/views/passports/_registration_descr_list.html.erb b/app/views/passports/_registration_descr_list.html.erb new file mode 100644 index 0000000..e61eca8 --- /dev/null +++ b/app/views/passports/_registration_descr_list.html.erb @@ -0,0 +1,46 @@ +
+
<%= Passport.human_attribute_name :zip_code %>
+
<%= passport.zip_code %>
+ +
<%= Passport.human_attribute_name :town_type %>
+
<%= passport.town_type %>
+ +
<%= Passport.human_attribute_name :town_name %>
+
<%= passport.town_name %>
+ +
<%= Passport.human_attribute_name :settlement_type %>
+
<%= passport.settlement_type %>
+ +
<%= Passport.human_attribute_name :settlement_name %>
+
<%= passport.settlement_name %>
+ +
<%= Passport.human_attribute_name :district_type %>
+
<%= passport.district_type %>
+ +
<%= Passport.human_attribute_name :district_name %>
+
<%= passport.district_name %>
+ +
<%= Passport.human_attribute_name :street_type %>
+
<%= passport.street_type %>
+ +
<%= Passport.human_attribute_name :street_name %>
+
<%= passport.street_name %>
+ +
<%= Passport.human_attribute_name :residence_type %>
+
<%= passport.residence_type %>
+ +
<%= Passport.human_attribute_name :residence_name %>
+
<%= passport.residence_name %>
+ +
<%= Passport.human_attribute_name :building_type %>
+
<%= passport.building_type %>
+ +
<%= Passport.human_attribute_name :building_name %>
+
<%= passport.building_name %>
+ +
<%= Passport.human_attribute_name :apartment_type %>
+
<%= passport.apartment_type %>
+ +
<%= Passport.human_attribute_name :apartment_name %>
+
<%= passport.apartment_name %>
+
diff --git a/app/views/settings/passports/show.html.erb b/app/views/settings/passports/show.html.erb index 9790131..03e9305 100644 --- a/app/views/settings/passports/show.html.erb +++ b/app/views/settings/passports/show.html.erb @@ -5,89 +5,13 @@
-
-
<%= Passport.human_attribute_name :last_name %>
-
<%= @passport.last_name %>
- -
<%= Passport.human_attribute_name :first_name %>
-
<%= @passport.first_name %>
- -
<%= Passport.human_attribute_name :middle_name %>
-
<%= @passport.middle_name %>
- -
<%= Passport.human_attribute_name :sex %>
-
<%= translate_enum :sex, @passport.sex %>
- -
<%= Passport.human_attribute_name :date_of_birth %>
-
<%= localize @passport.date_of_birth %>
- -
<%= Passport.human_attribute_name :place_of_birth %>
-
<%= @passport.place_of_birth %>
- -
<%= Passport.human_attribute_name :series %>
-
<%= @passport.series %>
- -
<%= Passport.human_attribute_name :number %>
-
<%= @passport.number %>
- -
<%= Passport.human_attribute_name :issued_by %>
-
<%= @passport.issued_by %>
- -
<%= Passport.human_attribute_name :unit_code %>
-
<%= @passport.unit_code %>
- -
<%= Passport.human_attribute_name :date_of_issue %>
-
<%= localize @passport.date_of_issue %>
-
+ <%= render partial: 'passports/common_descr_list', + locals: { passport: @passport } %>
-
-
<%= Passport.human_attribute_name :zip_code %>
-
<%= @passport.zip_code %>
- -
<%= Passport.human_attribute_name :town_type %>
-
<%= @passport.town_type %>
- -
<%= Passport.human_attribute_name :town_name %>
-
<%= @passport.town_name %>
- -
<%= Passport.human_attribute_name :settlement_type %>
-
<%= @passport.settlement_type %>
- -
<%= Passport.human_attribute_name :settlement_name %>
-
<%= @passport.settlement_name %>
- -
<%= Passport.human_attribute_name :district_type %>
-
<%= @passport.district_type %>
- -
<%= Passport.human_attribute_name :district_name %>
-
<%= @passport.district_name %>
- -
<%= Passport.human_attribute_name :street_type %>
-
<%= @passport.street_type %>
- -
<%= Passport.human_attribute_name :street_name %>
-
<%= @passport.street_name %>
- -
<%= Passport.human_attribute_name :residence_type %>
-
<%= @passport.residence_type %>
- -
<%= Passport.human_attribute_name :residence_name %>
-
<%= @passport.residence_name %>
- -
<%= Passport.human_attribute_name :building_type %>
-
<%= @passport.building_type %>
- -
<%= Passport.human_attribute_name :building_name %>
-
<%= @passport.building_name %>
- -
<%= Passport.human_attribute_name :apartment_type %>
-
<%= @passport.apartment_type %>
- -
<%= Passport.human_attribute_name :apartment_name %>
-
<%= @passport.apartment_name %>
-
+ <%= render partial: 'passports/registration_descr_list', + locals: { passport: @passport } %>
diff --git a/app/views/staffs/people/passports/show.html.erb b/app/views/staffs/people/passports/show.html.erb index 656b889..b02fd79 100644 --- a/app/views/staffs/people/passports/show.html.erb +++ b/app/views/staffs/people/passports/show.html.erb @@ -8,89 +8,13 @@
-
-
<%= Passport.human_attribute_name :last_name %>
-
<%= @passport.last_name %>
- -
<%= Passport.human_attribute_name :first_name %>
-
<%= @passport.first_name %>
- -
<%= Passport.human_attribute_name :middle_name %>
-
<%= @passport.middle_name %>
- -
<%= Passport.human_attribute_name :sex %>
-
<%= translate_enum :sex, @passport.sex %>
- -
<%= Passport.human_attribute_name :date_of_birth %>
-
<%= localize @passport.date_of_birth %>
- -
<%= Passport.human_attribute_name :place_of_birth %>
-
<%= @passport.place_of_birth %>
- -
<%= Passport.human_attribute_name :series %>
-
<%= @passport.series %>
- -
<%= Passport.human_attribute_name :number %>
-
<%= @passport.number %>
- -
<%= Passport.human_attribute_name :issued_by %>
-
<%= @passport.issued_by %>
- -
<%= Passport.human_attribute_name :unit_code %>
-
<%= @passport.unit_code %>
- -
<%= Passport.human_attribute_name :date_of_issue %>
-
<%= localize @passport.date_of_issue %>
-
+ <%= render partial: 'passports/common_descr_list', + locals: { passport: @passport } %>
-
-
<%= Passport.human_attribute_name :zip_code %>
-
<%= @passport.zip_code %>
- -
<%= Passport.human_attribute_name :town_type %>
-
<%= @passport.town_type %>
- -
<%= Passport.human_attribute_name :town_name %>
-
<%= @passport.town_name %>
- -
<%= Passport.human_attribute_name :settlement_type %>
-
<%= @passport.settlement_type %>
- -
<%= Passport.human_attribute_name :settlement_name %>
-
<%= @passport.settlement_name %>
- -
<%= Passport.human_attribute_name :district_type %>
-
<%= @passport.district_type %>
- -
<%= Passport.human_attribute_name :district_name %>
-
<%= @passport.district_name %>
- -
<%= Passport.human_attribute_name :street_type %>
-
<%= @passport.street_type %>
- -
<%= Passport.human_attribute_name :street_name %>
-
<%= @passport.street_name %>
- -
<%= Passport.human_attribute_name :residence_type %>
-
<%= @passport.residence_type %>
- -
<%= Passport.human_attribute_name :residence_name %>
-
<%= @passport.residence_name %>
- -
<%= Passport.human_attribute_name :building_type %>
-
<%= @passport.building_type %>
- -
<%= Passport.human_attribute_name :building_name %>
-
<%= @passport.building_name %>
- -
<%= Passport.human_attribute_name :apartment_type %>
-
<%= @passport.apartment_type %>
- -
<%= Passport.human_attribute_name :apartment_name %>
-
<%= @passport.apartment_name %>
-
+ <%= render partial: 'passports/registration_descr_list', + locals: { passport: @passport } %>