Skip to content

Commit

Permalink
Contact page: Fix h1 heading
Browse files Browse the repository at this point in the history
h1 heading now properly renders with the Restroom listing's name,
when requesting contact from an existing restroom page.

(Translating this heading with one translation string won't work,
because dynamic Ruby content won't render properly
in a translation string.
In this case, the dynamic content is the name of the Restroom entry.)
  • Loading branch information
DeeDeeG committed Jan 15, 2018
1 parent dd0a1f1 commit 1c6ef8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/views/contacts/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
- if @contact.restroom_name.present?
%h1= t('.request-edit')
- titlestring = t('.request-edit-for')
- titlestring << " "
- titlestring << @contact.restroom_name
- titlestring << " "
- titlestring << t('.restroom')
%h1= titlestring
- else
%h1= t('.contact-title')
= simple_form_for @contact, html: {class: 'form-vertical headroom'} do |f|
Expand Down
3 changes: 2 additions & 1 deletion config/locales/contacts.en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
en:
contacts:
new:
request-edit: 'Request Edit for #{@contact.restroom_name} Restroom'
request-edit-for: 'Request Edit for'
restroom: 'Restroom'
contact-title: 'Contact'
leave-this-field-blank: 'Leave this field blank!'

0 comments on commit 1c6ef8f

Please sign in to comment.