Skip to content

Commit

Permalink
Merge pull request #942 from uktrade/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
rafa-garcia authored Oct 25, 2024
2 parents f0144dc + 9c63289 commit 2260492
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 25 deletions.
7 changes: 7 additions & 0 deletions app/views/application/ping.xml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<pingdom_http_custom_check>
<status><%= @status %></status>
<response_time><%= (Time.now - request.env[:timestamp]).in_milliseconds.round(3) %></response_time>
</pingdom_http_custom_check>


6 changes: 3 additions & 3 deletions app/views/layouts/admin.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!!!
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-GB">
/[if IE 9] <html class="no-js lt-ie10" lang="en-GB">
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-gb">
/[if IE 9] <html class="no-js lt-ie10" lang="en-gb">
/[if gt IE 9]
%html.no-js{:lang => "en-GB"}
%html.no-js{:lang => "en-gb"}
%head
%title= "#{t('organisation.name')} - Opportunities"
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/admin_transformed.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang='en-GB'>
<html lang='en-gb'>
<head>
<title><%= t('organisation.name') %> - Admin</title>
<%= csrf_meta_tags %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!!!
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-GB">
/[if IE 9] <html class="no-js lt-ie10" lang="en-GB">
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-gb">
/[if IE 9] <html class="no-js lt-ie10" lang="en-gb">
/[if gt IE 9]
%html.no-js{:lang => "en-GB"}
%html.no-js{:lang => "en-gb"}
/ <![endif]
%head
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/enquiries.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<% @page_type = 'EnquiriesPage' %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<% @page_type = 'FormPage' %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/general.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<title><%= t('site_name') %></title>
<%= csrf_meta_tags %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/help.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang='en-GB'>
<html lang='en-gb'>
<head>
<title><%= t('organisation.name') %> - Guidance</title>
<%= csrf_meta_tags %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/help_article.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang='en-GB'>
<html lang='en-gb'>
<head>
<%= content_for?(:content) ? yield(:content) : yield %>
<title><%= t('organisation.name') %> - <%= @article.title %></title>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/help_article_print.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang='en-GB'>
<html lang='en-gb'>
<head>
<%= content_for?(:content) ? yield(:content) : yield %>
<title><%= t('organisation.name') %> - <%= @article.title %></title>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/landing.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<% @page_type = 'LandingPage' %>

<head>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/notification.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<% @page_type = 'NotificationPage' %>

<head>
Expand Down
4 changes: 1 addition & 3 deletions app/views/layouts/opportunity.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<% @page_type = 'OpportunityPage' %>

<title><%= @opportunity.title %> - <%= t('site_name') %> - great.gov.uk</title>
<%= csrf_meta_tags %>
<%= canonical_tag opportunities_url %>
<%= hreflang_tags opportunity_url %>
<%= render partial: 'includes/transformation_head_tags' %>
<%= render partial: 'includes/transformation_styles' %>
<%= render partial: 'includes/transformation_scripts' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/results.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<% @page_type = 'SearchResultsPage' %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/opportunities/index.atom.builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
atom_feed(schema_date: 2016, language: 'en-GB', root_url: @query.feed_root_url) do |feed|
atom_feed(schema_date: 2016, language: 'en-gb', root_url: @query.feed_root_url) do |feed|
feed.title t('site_name')
feed.subtitle 'The demand is out there. You could be too.'
feed.updated(@query.feed_updated_at) if @query.feed_updated_at
Expand Down
2 changes: 1 addition & 1 deletion app/views/poc/layouts/domestic.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<title><%= t('site_name') %></title>
<%= csrf_meta_tags %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/poc/layouts/form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<title><%= t('site_name') %></title>
<%= csrf_meta_tags %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/poc/layouts/international.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en-GB">
<html lang="en-gb">
<head>
<title><%= t('organisation.name') %></title>
<%= csrf_meta_tags %>
Expand Down
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative 'boot'
require_relative '../lib/rack_x_robots_tag'
require_relative '../lib/append_timestamp'
require_relative '../lib/formatters/asim_formatter'

require 'rails/all'
Expand Down Expand Up @@ -49,6 +50,9 @@ class Application < Rails::Application
# No indexing (if env.DISALLOW_ALL_WEB_CRAWLERS)
config.middleware.use Rack::XRobotsTag

# Add timestamp to request
config.middleware.use AppendTimestamp

# Use Sidekiq to process jobs from ActiveJob
config.active_job.queue_adapter = :sidekiq

Expand Down
5 changes: 3 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
get 'check' => 'application#check'
get 'data_sync_check' => 'data_sync#check'
get 'api_check' => 'application#api_check'
get "robots.txt" => "robots_txts#show"
get 'robots.txt' => 'robots_txts#show'
get '/pingdom/ping' => 'application#ping'

devise_for :users, module: 'users', skip: :sessions

Expand Down Expand Up @@ -182,7 +183,7 @@
get 'check' => 'application#check'
get 'data_sync_check' => 'application#data_sync_check'
get 'api_check' => 'application#api_check'
get "robots.txt" => "robots_txts#show"
get 'robots.txt' => 'robots_txts#show'

# devise_for :users, module: 'users', skip: :sessions

Expand Down
10 changes: 10 additions & 0 deletions lib/append_timestamp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AppendTimestamp
def initialize(app)
@app = app
end

def call(env)
env[:timestamp] = Time.now
@app.call(env)
end
end

0 comments on commit 2260492

Please sign in to comment.