Skip to content

Commit

Permalink
279 4.12 hide infos in application print (#344)
Browse files Browse the repository at this point in the history
* remove address from applications print

* use i18n for genders in applications print
  • Loading branch information
phnm authored and Niklas Kiefer committed Jan 23, 2017
1 parent 8bf8a2c commit 2a94f7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions config/locales/de.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ de:
validation:
birthday_in_future: "Das Geburtsdatum darf nicht in der Zukunft liegen."
genders:
male: "Männlich"
female: "Weiblich"
other: "Andere"
male: "männlich"
female: "weiblich"
other: "andere"
confirm_deletion: "Willst du dieses Profil wirklich löschen?"
successful_update: "Profil erfolgreich aktualisiert"
successful_deletion: "Profil erfolgreich gelöscht"
Expand Down
5 changes: 2 additions & 3 deletions lib/pdf_generation/applications_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def overview_table_data
ApplicationLetter.human_attribute_name(:status)]]
data += @event.application_letters.map do |a|
[a.user.profile.name,
a.user.profile.gender,
t("profiles.genders.#{a.user.profile.gender}"),
a.applicant_age_when_event_starts,
"#{a.user.accepted_applications_count(@event)} / #{a.user.rejected_applications_count(@event)}",
t("application_status.#{a.status}")]
Expand Down Expand Up @@ -113,9 +113,8 @@ def create_application_page_content(application_letter)
end

def applicants_detail_data(application_letter)
[[Profile.human_attribute_name(:gender)+":", application_letter.user.profile.gender],
[[Profile.human_attribute_name(:gender)+":", t("profiles.genders.#{application_letter.user.profile.gender}")],
[t('application_letters.show.age_when_event_starts')+":", application_letter.applicant_age_when_event_starts],
[Profile.human_attribute_name(:address)+":", application_letter.user.profile.address],
[User.human_attribute_name(:accepted_application_count)+":", application_letter.user.accepted_applications_count(@event)],
[User.human_attribute_name(:rejected_application_count)+":", application_letter.user.rejected_applications_count(@event)],
[Profile.human_attribute_name(:status)+":", t("application_status.#{application_letter.status}")]]
Expand Down
3 changes: 1 addition & 2 deletions spec/controllers/events_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,10 @@
expect(text).to include(
a.user.profile.name,
a.user.profile.age_at_time(@event.start_date).to_s,
a.user.profile.gender,
I18n.t("profiles.genders.#{a.user.profile.gender}"),
a.user.accepted_applications_count(@event).to_s,
a.user.rejected_applications_count(@event).to_s,
I18n.t("application_status.#{a.status}"),
a.user.profile.address,
a.motivation
)
a.application_notes.each do |note|
Expand Down

0 comments on commit 2a94f7c

Please sign in to comment.