Skip to content
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

[SPIKE] Use Simple Form to build GOV.UK Frontend-ready forms #336

Closed
wants to merge 4 commits into from

Conversation

tijmenb
Copy link
Contributor

@tijmenb tijmenb commented May 23, 2018

This builds on top of #331.

Simple Form allows you to build forms using a simple DSL:

<%= simple_form_for @user do |f| %>
  <%= f.input :username %>
  <%= f.input :password %>
  <%= f.button :submit %>
<% end %>

We are already using Simple Form in contacts admin and content tagger. We also have a standard configuration for Simple Form in govuk_admin_template.

This PR attempts to create a configuration file that uses GOV.UK Frontend. If it works, it will allow developers to forms with the correct markup without knowing anything about GOV.UK Frontend. Existing forms in content tagger might even be converted to use the new styling simply by switching out the config.

Things that "just work"

  • Text input
  • Textarea
  • Submit button
  • Select box
  • Single check box (boolean)
  • List of checkboxes
  • List of radio buttons
  • Hints

Things that don't work yet

  • Errors (still to do)
  • The Date input component
  • Fieldset & legend for the radio & select boxes
  • General spacing
  • Avoid having to @extend the checkbox & radio classes

Screenshot

https://govuk-publishing-compon-pr-336.herokuapp.com/admin/form

screenshot-2018-5-30 welcome to gov uk

https://trello.com/c/1S9peN8b/62-spike-a-layout-system-for-admin-apps

@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-336 May 23, 2018 09:17 Inactive
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-336 May 29, 2018 12:25 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant