Skip to content

Commit

Permalink
Add hints to new site form inputs
Browse files Browse the repository at this point in the history
This copies the guidance fro Transition Config over to the new site form.

This will need later refinement.
  • Loading branch information
jkempster34 committed Sep 8, 2023
1 parent a682856 commit 12d54d7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
40 changes: 27 additions & 13 deletions app/views/sites/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,32 @@

<div class="form-group">
<%= form.label :abbr %>
<%= form.text_field :abbr, class: "form-control" %>
<%= form.text_field :abbr, class: "form-control", aria: { describedby: "abbr-help" } %>
<small id="abbr-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.abbr") %></small>
</div>

<div class="form-group">
<%= form.label :tna_timestamp %>
<%= form.text_field :tna_timestamp, class: "form-control" %>
<%= form.text_field :tna_timestamp, class: "form-control", aria: { describedby: "tna-timestamp-help" } %>
<small id="tna-timestamp-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.tna_timestamp").html_safe %></small>
</div>

<div class="form-group">
<%= form.label :homepage %>
<%= form.text_field :homepage, class: "form-control" %>
<%= form.text_field :homepage, class: "form-control", aria: { describedby: "homepage-help" } %>
<small id="homepage-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.homepage") %></small>
</div>

<div class="form-group">
<%= form.label :hostname %>
<%= form.text_field :hostname, class: "form-control" %>
<%= form.text_field :hostname, class: "form-control", aria: { describedby: "hostname-help" } %>
<small id="hostname-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.hostname") %></small>
</div>

<div class="form-group">
<%= form.label :homepage_title %>
<%= form.text_field :homepage_title, class: "form-control" %>
<%= form.text_field :homepage_title, class: "form-control", aria: { describedby: "homepage-title-help" } %>
<small id="homepage-title-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.homepage_title") %></small>
</div>

<div class="form-group">
Expand All @@ -43,27 +48,31 @@
:id,
:title,
{},
{ multiple: true, class: "form-control" }
{ multiple: true, class: "form-control", aria: { describedby: "extra-organisations-help" } }
%>
<small id="extra-organisations-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.extra_organisations") %></small>
</div>

<div class="form-group">
<%= form.label :homepage_furl %>
<%= form.text_field :homepage_furl, class: "form-control" %>
<%= form.text_field :homepage_furl, class: "form-control", aria: { describedby: "homepage-furl-help" } %>
<small id="homepage-furl-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.homepage_furl") %></small>
</div>

<div class="form-group">
<%= form.label :global_type %>
<%= form.collection_radio_buttons :global_type,
Site::GLOBAL_TYPES,
:to_s,
:humanize do |button| %>
:humanize,
aria: { describedby: "global-type-help" } do |button| %>
<div class="radio">
<%= button.label do %>
<%= button.radio_button + button.text %>
<% end %>
</div>
<% end %>
<small id="global-type-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.global_type") %></small>
</div>

<div class="form-group">
Expand All @@ -73,31 +82,36 @@

<div class="form-group">
<%= form.label :query_params %>
<%= form.text_field :query_params, class: "form-control" %>
<%= form.text_field :query_params, class: "form-control", aria: { describedby: "query-params-help" } %>
<small id="query-params-help" class="form-text text-muted row"><%= I18n.t("activemodel.hint.site_form.query_params") %></small>
</div>

<div class="form-group">
<div class="form-check">
<%= form.label :global_redirect_append_path %>
<%= form.check_box :global_redirect_append_path %>
<%= form.check_box :global_redirect_append_path, aria: { describedby: "global-redirect-append-path-help" } %>
<small id="global-redirect-append-path-help" class="form-text text-muted row"><%= I18n.t("activemodel.hint.site_form.global_redirect_append_path") %></small>
</div>

<div class="form-group">
<%= form.label :special_redirect_strategy %>
<%= form.collection_radio_buttons :special_redirect_strategy,
Site::SPECIAL_REDIRECT_STRATEGY_TYPES,
:to_s,
:humanize do |button| %>
:humanize,
aria: { describedby: "special-redirect-strategy-help" } do |button| %>
<div class="radio">
<%= button.label do %>
<%= button.radio_button + button.text %>
<% end %>
</div>
<% end %>
<small id="special-redirect-strategy-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.special_redirect_strategy") %></small>
</div>

<div class="form-group">
<%= form.label :aliases %>
<%= form.text_area :aliases, class: "form-control" %>
<%= form.text_area :aliases, class: "form-control", aria: { describedby: "aliases-help" } %>
<small id="aliases-help" class="form-text text-muted"><%= I18n.t("activemodel.hint.site_form.aliases") %></small>
</div>

<%= form.submit 'Save', class: 'add-top-margin btn btn-success' %>
Expand Down
15 changes: 15 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ en:
query_params: Query params (Optional)
special_redirect_strategy: Special redirect strategy (Optional)
aliases: Aliases (Optional)
hint:
site_form:
abbr: This is the owning organisation abbreviation followed by the abbreviated site name, separated by an underscore. For example, the "Obesity West Midlands" site which is owned by Public Health England would be "phe_obesitywm"
host: This is the primary hostname for the site. For example, "www.example.com".
tna_timestamp: This is the last good capture from the <a href="https://www.nationalarchives.gov.uk/webarchive/" class="govuk-link">UK Government Web Archives</a>. For example, "20131002172858". If the site has not been crawled by the National Archives, set a stub timestamp "20201010101010".
homepage: This is the URL for the new site.
hostname: This is the primary hostname for the site.
homepage_title: This is the title for 404/410 pages, it defaults to the organisation title. It should fit into the sentence "Visit the new [title] site at [full URL or homepage]"
extra_organisations: These are the additional organisations which own this site. They are used for access control in Transition.
homepage_furl: This is the friendly URL displayed on 404/410 pages. It should redirect to the homepage. It doesn't need to include 'http' or 'https'.
global_type: This sets a global redirect or archive for all paths. If "Redirect", all site URLs will redirect to the Global new URL. If "Archive", all site URLs will show a page saying the site has been archived.
query_params: A significant querystring parameter is one which on the old website changes the content in a meaningful way - which we might therefore need to map to a different place. Query string parameters should be specified in lowercase; uppercase parameters will not be preserved during canonicalisation. Enter as a colon-separated list.
global_redirect_append_path: Should the path the user supplied be appended to the URL for the global redirect?
special_redirect_strategy: When the transition is partial, some tools or content will be left behind and managed by the previous supplier. If "Via aka", the supplier is redirecting some paths to our aka domain. If "supplier", the supplier is managing redirects to gov.uk. No traffic comes through Bouncer for this site.
aliases: This is a list of alias domains. Enter as a comma-separated list.
mappings:
success:
all_created: '%{created}%{tagged_with}'
Expand Down

0 comments on commit 12d54d7

Please sign in to comment.