summaryrefslogtreecommitdiff
path: root/app/views/layouts/errors.html.haml
blob: 57260ccedea4d9e10d989af2b4672823527c6825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
!!! 5
%html{ lang: "en" }
  %head
    %meta{ :content => "width=device-width, initial-scale=1, maximum-scale=1", :name => "viewport" }
    %title= yield(:title)
    %style
      = Rails.application.assets_manifest.find_sources('errors.css').first.to_s.html_safe
  %body
    .page-container
      = yield
    = javascript_tag do
      :plain
        (function(){
          var goBackElement = document.querySelector('.js-go-back');

          if (goBackElement && history.length > 1) {
            goBackElement.removeAttribute('hidden');

            goBackElement.querySelector('button').addEventListener('click', function() {
              history.back();
            });
          }

          // We do not have rails_ujs here, so we're manually making a link trigger a form submit.
          document.getElementById('sign_out_link').addEventListener('click', function(e) {
            e.preventDefault();
            document.getElementById('sign_out_form').submit();
          });
        }());