Browse Source

Added contact forms to error pages

development
Godwin 8 years ago
parent
commit
32a0f02db2
  1. 3
      app/views/application/404.html.haml
  2. 4
      app/views/application/500.html.haml
  3. 4
      app/views/application/_contact.html.haml
  4. 5
      app/views/application/locale_not_available.html.haml
  5. 1
      app/views/application/permission_denied.html.haml
  6. 11
      config/locales/en.yml

3
app/views/application/404.html.haml

@ -1,4 +1,5 @@
= render :partial => 'application/header', :locals => {:image_file => nil} = render :partial => 'application/header', :locals => {:image_file => nil}
= row do = row do
= columns(medium: 12) do = columns(medium: 12) do
= paragraph(_'error.404.description', :p) %p= _'error.404.description', :p
= render 'contact', cancel_btn: false, contact_reason: :website

4
app/views/application/500.html.haml

@ -1,4 +1,6 @@
= render :partial => 'application/header', :locals => {:image_file => 'parts.jpg'} = render :partial => 'application/header', :locals => {:image_file => 'parts.jpg'}
= row do = row do
= columns(medium: 12) do = columns(medium: 12) do
= paragraph(_'error.500.description', :p) %p= _'error.500.description', :p
= render 'contact', cancel_btn: false, contact_reason: :website

4
app/views/application/_contact.html.haml

@ -1,5 +1,9 @@
- contact_reason ||= nil
= form_tag contact_send_path, class: 'contact-form' do = form_tag contact_send_path, class: 'contact-form' do
= emailfield :email, nil, big: true, required: true unless logged_in? = emailfield :email, nil, big: true, required: true unless logged_in?
- if contact_reason.present?
= hidden_field_tag :reason, contact_reason
- else
= contact_reason_select = contact_reason_select
= textfield :subject, nil, required: true, big: true = textfield :subject, nil, required: true, big: true
= textarea :message, nil, required: true, plain: true = textarea :message, nil, required: true, plain: true

5
app/views/application/locale_not_available.html.haml

@ -1,10 +1,13 @@
= render :partial => 'application/header', :locals => {:image_file => 'runes.jpg'} = render :partial => 'application/header', :locals => {:image_file => 'runes.jpg'}
= row do = row do
= columns(medium: 12) do = columns(medium: 12) do
= paragraph(_'error.locale_not_available.description', :p, @main_title_vars) %p= _'error.locale_not_available.description', :p, @main_title_vars
%ul.locales %ul.locales
- @alt_lang_urls.each do |locale, url| - @alt_lang_urls.each do |locale, url|
%li %li
- locale_translation = language(locale, true) - locale_translation = language(locale, true)
%a.button{href: url, lang: locale} %a.button{href: url, lang: locale}
=_'translate.content.change_locale', "Read in #{locale_translation}", vars: {language: locale_translation}, locale: locale =_'translate.content.change_locale', "Read in #{locale_translation}", vars: {language: locale_translation}, locale: locale
%h2= _'error.locale_not_available.volunteer.title'
%p= _'error.locale_not_available.volunteer.description'
= render 'contact', cancel_btn: false, contact_reason: :website

1
app/views/application/permission_denied.html.haml

@ -7,3 +7,4 @@
= columns do = columns do
%h2=_'error.403.title','Sorry, you currently don\'t have access to this page' %h2=_'error.403.title','Sorry, you currently don\'t have access to this page'
%p=_'error.403.description', :p %p=_'error.403.description', :p
= render 'contact', cancel_btn: false, contact_reason: :website

11
config/locales/en.yml

@ -5855,19 +5855,20 @@ en:
Translate: Edit %{language} version Translate: Edit %{language} version
error: error:
'403': '403':
description: You do not currently have sufficient permissions to access this page. If you believe this is an error, please contact us or file an issue. description: You do not currently have sufficient permissions to access this page. If you believe this is an error, please contact us.
title: You do not have access to this page title: You do not have access to this page
'404': '404':
description: Sorry, we couldn't find the page you were looking for. If you really description: The page you are looking for could not be found. If you think this was in error, please contact us.
believe that it should exist please contact admin@bikebike.org or file an
issue on github: https://github.com/bikebike/BikeBike/issues
title: '404: This page doesn''t exist' title: '404: This page doesn''t exist'
locale_not_available: locale_not_available:
description: This site has yet to be translated into %{language}. We are actively looking for volunteers who can translate existing copy and new copy as we add new features. If you think you can help, please contact us! description: This site has yet to be translated into %{language}. We are actively looking for volunteers who can translate existing copy and new copy as we add new features. If you think you can help, please contact us!
title: '404: %{language} Translations Missing' title: '404: %{language} Translations Missing'
volunteer:
title: Can you help us translate?
description: 'If you can help us translate this or any other language, please let us know by contacting us using the form below:'
'500': '500':
title: There is a problem title: There is a problem
description: 'An error has occurred, details about the error have been sent to our development team. In addition, you may contact us or report an issue.' description: 'An error has occurred, details about the error have been sent to our development team. In addition, you may contact us using the form below to let us better understand what happened and how you were affected.'
roles: roles:
workshops: workshops:
facilitator: facilitator:

Loading…
Cancel
Save