-
Notifications
You must be signed in to change notification settings - Fork 265
Add Rails examples for the components #3538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frankieroberto
wants to merge
28
commits into
alphagov:main
Choose a base branch
from
x-govuk:rails-examples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
8e73db4
Add initial Rails examples
frankieroberto 10a556d
Add Rails button examples
peteryates 286fab1
Add Rails example for cookie banner
frankieroberto aba3aa6
Add Rails code for warning text
frankieroberto 91139d8
Merge branch 'main' into rails-examples
frankieroberto 9a3f821
Update helper methods
frankieroberto c9f93f7
Add skip link rails example
frankieroberto eefd0ca
Add textarea examples
frankieroberto 28e8022
Add link to GOV.UK Components for Ruby on Rails
frankieroberto b758f07
Update content
frankieroberto 380e651
Merge remote-tracking branch 'upstream/main' into rails-examples
frankieroberto 861381d
Add phase banner Rails examples
frankieroberto 96d25d8
Add Rails examples for tags
frankieroberto 1e4d74d
Add examples for accordion
frankieroberto b507aed
Use ERb highlighter
frankieroberto fa4ba71
Add character count examples
frankieroberto 371cd55
Add checkboxes
frankieroberto 2c75560
Merge remote-tracking branch 'upstream/main' into rails-examples
frankieroberto f209c55
Add date input examples
frankieroberto 772d3d8
More examples
frankieroberto 82cbc01
More examples
frankieroberto 308c8dd
More examples
frankieroberto 86ea4d9
More examples
frankieroberto beb8a6f
Style lint
frankieroberto 31f9d23
Fix indenting
frankieroberto c1e9f11
Update links to Rails components
frankieroberto 5e2898a
Merge remote-tracking branch 'upstream/main' into rails-examples
frankieroberto 6c3523c
Add Service navigation examples
frankieroberto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <%= govuk_accordion do |accordion| | ||
| accordion.with_section(heading_text: "Writing well for the web") { | ||
| tag.p("This is the content for Writing well for the web.") | ||
| } | ||
| accordion.with_section(heading_text: "Writing well for specialists") { | ||
| tag.p("This is the content for Writing well for specialists.") | ||
| } | ||
| accordion.with_section(heading_text: "Know your audience") { | ||
| tag.p("This is the content for Know your audience.") | ||
| } | ||
| accordion.with_section(heading_text: "How people read") { | ||
| tag.p("This is the content for How people read.") | ||
| } | ||
| end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| <%= govuk_accordion do |accordion| end %> | ||
| <%= accordion.with_section(heading_text: "Understanding agile project management", summary_text: "Introductions, methods, core features.") do %> | ||
| <ul class="govuk-list"> | ||
| <li> | ||
| <a class="govuk-link" href="#">Agile and government services: an introduction</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Agile methods: an introduction</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Core principles of agile</a> | ||
| </li> | ||
| </ul> | ||
| <% end %> | ||
| <%= accordion.with_section(heading_text: "Working with agile methods", summary_text: "Workspaces, tools and techniques, user stories, planning.") do %> | ||
| <ul class="govuk-list"> | ||
| <li> | ||
| <a class="govuk-link" href="#">Creating an agile working environment</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Agile tools and techniques</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Set up a team wall</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Writing user stories</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Planning in agile</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Deciding on priorities</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Developing a roadmap</a> | ||
| </li> | ||
| </ul> | ||
| <% end %> | ||
| <%= accordion.with_section(heading_text: "Governing agile services", summary_text: "Principles, measuring progress, spending money.") do %> | ||
| <ul class="govuk-list"> | ||
| <li> | ||
| <a class="govuk-link" href="#">Governance principles for agile service delivery</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Measuring and reporting progress</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Spend controls: check if you need approval to spend money on a service</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Spend controls: apply for approval to spend money on a service</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Spend controls: the new pipeline process</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Working across organisational boundaries</a> | ||
| </li> | ||
| </ul> | ||
| <% end %> | ||
| <%= accordion.with_section(heading_text: "Phases of an agile project", summary_text: "Discovery, alpha, beta, live and retirement.") do %> | ||
| <ul class="govuk-list"> | ||
| <li> | ||
| <a class="govuk-link" href="#">How the discovery phase works</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">How the alpha phase works</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">How the beta phase works</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">How the live phase works</a> | ||
| </li> | ||
| <li> | ||
| <a class="govuk-link" href="#">Retiring your service</a> | ||
| </li> | ||
| </ul> | ||
| <% end %> | ||
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= govuk_back_link(href: "#", text: "Back") %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= govuk_back_link(href: "#", text: "Back", inverse: true) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <%= govuk_breadcrumbs(breadcrumbs: { | ||
| "Home" => "#", | ||
| "Environment" => "#", | ||
| "Rural and countryside" => "#", | ||
| "Rural development and land management" => "#", | ||
| "Economic growth in rural areas" => "#" | ||
| }, collapse_on_mobile: true) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <%= govuk_breadcrumbs(breadcrumbs: { | ||
| "Home" => "#", | ||
| "Passports, travel and living abroad" => "#", | ||
| "Travel abroad" => "#" | ||
| }) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <%= govuk_breadcrumbs(breadcrumbs: { | ||
| "Home" => "#", | ||
| "Passports, travel and living abroad" => "#", | ||
| "Travel abroad" => "#" | ||
| }, inverse: true) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <%= form.govuk_submit("Continue") do %> | ||
| <%= govuk_link_to("Cancel", "#") %> | ||
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= form.govuk_submit("Save and continue") %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= form.govuk_submit("Disabled button", disabled: true) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= form.govuk_submit("Create an account", inverse: true) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= form.govuk_submit("Confirm and send") %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <%= form.govuk_submit("Continue") do %> | ||
| <%= form.govuk_submit("Save as draft", secondary: true) %> | ||
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <%= form.govuk_submit("Find address", secondary: true) %> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peteryates @paulrobertlloyd this seemed like the simplest way to work out which page to link to - but open to other ideas!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends how far you want to go with this, but you could create 2 arrays, one for components, and one for form elements, then cycle through them:
(Top of my head coding, may need tweaking). This way, you only need to update each array and 2 URL paths should any of those aspects change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's slightly more complicated as some of the components have the prefix
/building-blocks/or/helpers/or/introduction/, plus there's a few mismatches (fieldsetvsfieldsets) - but something like this could work!I was initially going to just link to either of the 2 homepages – but I think direct linking to the relevant pages is valuable?
Not sure where we'd link for any Rails examples for the patterns though... Some of the styles (eg Links) need doing too.