Skip to content

Commit

Permalink
Merge pull request #2711 from alphagov/fields-of-operation
Browse files Browse the repository at this point in the history
Add rendering for fields of operation
  • Loading branch information
BeckaL authored Mar 14, 2023
2 parents 63cad1e + 9901d46 commit cdecb33
Show file tree
Hide file tree
Showing 71 changed files with 203 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Not all schemas that this app can handle are rendered by it in production.
| Detailed guide | [View on GOV.UK](https://www.gov.uk/guidance/waste-exemption-nwfd-2-temporary-storage-at-the-place-of-production--2) | Migrated |
| Document collection | [View on GOV.UK](https://www.gov.uk/government/collections/statutory-guidance-schools) | Migrated |
| Fatality notice | [View on GOV.UK](https://www.gov.uk/government/fatalities/corporal-lee-churcher-dies-in-iraq) | Migrated |
| Fields of operation | [View on Gov.UK](https://www.gov.uk/government/fields-of-operation) | Migrated |
| Help page | [View on GOV.UK](https://www.gov.uk/help/about-govuk) | Migrated |
| HTML Publication | [View on GOV.UK](https://www.gov.uk/government/publications/budget-2016-documents/budget-2016)| Migrated |
| Guide | [View on GOV.UK](https://www.gov.uk/log-in-register-hmrc-online-services)| Migrated |
Expand Down
14 changes: 14 additions & 0 deletions app/presenters/fields_of_operation_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class FieldsOfOperationPresenter < ContentItemPresenter
include ContentItem::TitleAndContext

def fields_of_operation
content_item.dig("links", "fields_of_operation").map { |field| [field["title"], field["base_path"]] }
end

def title_and_context
super.tap do |t|
t[:context] = I18n.t("fields_of_operation.context")
t.delete(:average_title_length)
end
end
end
16 changes: 16 additions & 0 deletions app/views/content_items/fields_of_operation.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<ul class="govuk-list">
<% @content_item.fields_of_operation.each do |name, path| %>
<%= link_to name, path, class: "govuk-link" %>
<hr class="govuk-section-break govuk-section-break--visible govuk-!-margin-top-2 govuk-!-margin-bottom-2">
<% end %>
</ul>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ ar:
alt_text: شعار وزارة الدفاع
field_of_operation: ساحة العمليات
operations_in: العمليات الدائرة في %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ az:
alt_text: Müdafiə nazirliyinin emblemi
field_of_operation: Əməliyyat sahəsi
operations_in: "%{location}-də olan əməliyyatlar"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ be:
alt_text: Герб Міністэрства абароны
field_of_operation: Сфера дзейнасці
operations_in: Дзейнасць у %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ bg:
alt_text: Герб на Министерството на отбраната
field_of_operation: Област на действие
operations_in: Операции в %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ bn:
alt_text: প্রতিরক্ষা মন্ত্রণালয়ের ক্রেস্ট
field_of_operation: কার্যক্রমের ক্ষেত্র
operations_in: "%{location}-এ পরিচালনা"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ cs:
alt_text: Ministerstvo obrany
field_of_operation: Oblast provozu
operations_in: Operace v %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ cy:
alt_text: Arwyddlun y Weinyddiaeth Amddiffyn
field_of_operation: Maes gweithredu
operations_in: Gweithrediadau yn %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ da:
alt_text: Forsvarsministeriets kam
field_of_operation: Operationsområde
operations_in: Handlinger i %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ de:
alt_text: Wappen des Verteidigungsministeriums
field_of_operation: Tätigkeitsbereich
operations_in: Tätigkeiten in %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ dr:
alt_text: وزارت دفاع
field_of_operation: ساحهء عملیات
operations_in: عملیات در%{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ el:
alt_text: Οικόσημο Υπουργείου Άμυνας
field_of_operation: Πεδίο λειτουργίας
operations_in: Λειτουργίες στην τοποθεσία %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ en:
alt_text: Ministry of Defence crest
field_of_operation: Field of operation
operations_in: Operations in %{location}
fields_of_operation:
context: British fatalities
get_involved:
civil_service: Civil Service
civil_service_quarterly: Civil Service Quarterly
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ es-419:
alt_text: Escudo del Ministerio de Defensa
field_of_operation: Campo de operación
operations_in: Operaciones en %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ es:
alt_text: Escudo del Ministerio de Defensa
field_of_operation: Campo de operación
operations_in: Operaciones en %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ et:
alt_text: Kaitseministeeriumi teadus- ja tehnikauuringute komitee
field_of_operation: Tegevusvaldkond
operations_in: Toimingud asukohas %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ fa:
alt_text: تاج وزارت دفاع
field_of_operation: زمینه فعالیت
operations_in: فعالیت در %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ fi:
alt_text: Puolustusministeriön vaakuna
field_of_operation: Toiminta -alue
operations_in: Toiminnot paikassa %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ fr:
alt_text: Emblème du ministère de la défense
field_of_operation: Champ d'opération
operations_in: Opérations à %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/gd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ gd:
alt_text: Suaitheantas rialtais Chónaidhme
field_of_operation: Réimse oibríochta
operations_in: Idirbhearta I %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ gu:
alt_text: સંરક્ષણ મંત્રાલય ક્રેસ્ટ
field_of_operation: કામગીરીનું ક્ષેત્ર
operations_in: "%{location} માં સંચાલનો"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ he:
alt_text: סמל משרד הביטחון
field_of_operation: תחום הפעולה
operations_in: פעולות ב- %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ hi:
alt_text: रक्षा मंत्रालय का क्रेस्ट
field_of_operation: संचालन का क्षेत्र
operations_in: "%{location} में संचालन"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ hr:
alt_text: Grb Ministarstva obrane
field_of_operation: Područje djelovanja
operations_in: Operacije u %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ hu:
alt_text: A Védelmi Minisztérium címere
field_of_operation: Működési terület
operations_in: 'Tevékenységek itt: %{location}'
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ hy:
alt_text: Պաշտպանության նախարարության զինանշան
field_of_operation: Գործունեության ոլորտ
operations_in: Գործունեություն % {location}-ում
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ id:
alt_text: Lambang Kementerian Pertahanan
field_of_operation: Bidang operasi
operations_in: Operasi di %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ is:
alt_text: Skjaldarmerki Varnarmálaráðuneytisins
field_of_operation: Starfsvið
operations_in: Starfsemi á %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ it:
alt_text: Stemma del Ministero della Difesa
field_of_operation: Campo operativo
operations_in: Operazioni in %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ ja:
alt_text: 国防省の紋章
field_of_operation: 運用分野
operations_in: "%{location} での操作"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ ka:
alt_text: თავდაცვის სამინისტრო
field_of_operation: ოპერაციის სფერო
operations_in: ოპერაციები %{location}-ში
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/kk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ kk:
alt_text: Қорғаныс министрлігінің елтаңбасы
field_of_operation: Жұмыс аймағы
operations_in: "%{location} орнындағы жұмыстар"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ ko:
alt_text: 국방부 문장
field_of_operation: 운영 현장
operations_in: "%{Location} 내 운영"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/lt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ lt:
alt_text: Apsaugos ministerijos herbas
field_of_operation: Veiklos sritis
operations_in: Veikla vykdoma %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/lv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ lv:
alt_text: Aizsardzības ministrijas ģerbonis
field_of_operation: Darbības joma
operations_in: 'Darbības šeit: %{location}'
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ ms:
alt_text: Lambang Kementerian Pertahanan
field_of_operation: Medan operasi
operations_in: Operasi di %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/mt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ mt:
alt_text: Il-Ministeru tad-Difiża
field_of_operation: Qasam tal-operazzjoni
operations_in: Operazzjonijiet fil- %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ne.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ ne:
alt_text: रक्षा मन्त्रालय क्रेस्ट
field_of_operation: सञ्चालन क्षेत्र
operations_in: "%{location} मा सञ्चालन"
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ nl:
alt_text: Wapen van het ministerie van Defensie
field_of_operation: Gebied van operatie
operations_in: Operaties in %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/no.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@
alt_text: Forsvarsdepartementets crest
field_of_operation: Operasjonsfelt
operations_in: Operasjoner i %{location}
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/pa-pk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ pa-pk:
alt_text: وزارتِ دفاع کریسٹ
field_of_operation: عمل کرن دا حلقہ
operations_in: ایندے بارے عمل {location}%
fields_of_operation:
context:
get_involved:
civil_service:
civil_service_quarterly:
Expand Down
Loading

0 comments on commit cdecb33

Please sign in to comment.