TMP commit

This commit is contained in:
Bilal
2020-07-09 20:43:05 +02:00
parent 2020761649
commit 578403bb5c
4 changed files with 19 additions and 9 deletions

View File

@@ -6,9 +6,6 @@ module CsvExportable
COMMON_HEADERS = %i[notes tags signed_at].freeze
COMMON_VALUES = %w[clean_notes clean_tags signed_on].freeze
ACQUIRED_MEDIA_HEADERS = %i[name file_infos_count].freeze + COMMON_HEADERS
ACQUIRED_MEDIA_VALUES = %w[name file_count].freeze + COMMON_VALUES
APPEARANCE_HEADERS = %i[name contact_info].freeze + COMMON_HEADERS
APPEARANCE_VALUES = %w[name contact_info].freeze + COMMON_VALUES
@@ -22,19 +19,21 @@ module CsvExportable
MEDICAL_VALUES = %w[approved? name contact_info].freeze + COMMON_VALUES
HEADERS = {
acquired_media_release: ACQUIRED_MEDIA_HEADERS,
acquired_media_release: %i[name file_infos_count] + COMMON_HEADERS,
appearance_release: APPEARANCE_HEADERS,
location_release: LOCATION_HEADERS,
material_release: MATERIAL_HEADERS,
medical_release: MEDICAL_HEADERS
medical_release: MEDICAL_HEADERS,
misc_release: %i[name contact_info] + COMMON_HEADERS
}.freeze
VALUES = {
acquired_media_release: ACQUIRED_MEDIA_VALUES,
acquired_media_release: %w[name file_count] + COMMON_VALUES,
appearance_release: APPEARANCE_VALUES,
location_release: LOCATION_VALUES,
material_release: MATERIAL_VALUES,
medical_release: MEDICAL_VALUES
medical_release: MEDICAL_VALUES,
misc_release: %w[name contact_info] + COMMON_VALUES
}.freeze
included do
@@ -64,8 +63,8 @@ module CsvExportable
def contact_info
contact_info = ''
contact_info += "#{person_address}; " if person_address.present?
contact_info += "#{person_phone}; " if person_phone.present?
contact_info += "#{person_email}" if person_email.present?
contact_info += "P: #{person_phone}; " if person_phone.present?
contact_info += "E: #{person_email}" if person_email.present?
contact_info.delete_suffix '; '
end

View File

@@ -9,6 +9,7 @@ class MiscRelease < ApplicationRecord
include PersonName
include GuardianName
include GuardianPhotoable
include CsvExportable
NUMBER_OF_CUSTOM_FIELDS = 15

View File

@@ -822,6 +822,8 @@ en:
search: Search
empty: Misc Releases will appear here
table_headers:
name: Person name
contact_info: Contact info
notes: Notes
signed_at: Date Signed
tags: Tags

View File

@@ -497,3 +497,11 @@ es:
tags: Tags (ES)
acquired_media_release:
no_media: No Media (ES)
misc_releases:
index:
table_headers:
name: Person name (ES)
contact_info: Contact info (ES)
notes: Notes (ES)
signed_at: Date Signed (ES)
tags: Tags (ES)