-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This simplifies the form usage in the app. - Use Simple form instead of Formtastic. The govuk_admin_template gem already has a Simple form config, which uses bootstrap. This means we can remove the `formtastic-bootstrap` gem as well. - Remove the typeahead. This is only used by the form to submit new deployments, and that happens so seldomly that it's not worth having the JS dependencies for that. - Remove the date picker. This is also just used by the deployment form. By removing it we get rid of a whole range of dependencies. Updating to simple form prepares this app for the new GOV.UK Frontend based layout (#228). https://trello.com/c/09fVPrRN
- Loading branch information
Showing
21 changed files
with
41 additions
and
226 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
//= require jquery_nested_form | ||
//= require jquery.tablesorter.min | ||
//= require jquery.autogrowtextarea | ||
//= require moment | ||
//= require bootstrap-datetimepicker | ||
//= require typeahead.bundle.min | ||
//= require_tree . |
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -1,18 +1,9 @@ | ||
<div class="well"> | ||
<%= semantic_form_for @application do |f| %> | ||
<%= f.semantic_errors %> | ||
<%= f.inputs do %> | ||
<%= f.input :name, label: "Name", input_html: { class: 'input-md-6' } %> | ||
<%= f.input :repo, label: "GitHub repository path", hint: "eg alphagov/publisher", input_html: { class: 'input-md-6' } %> | ||
<%= f.input :domain, label: "GitHub domain", hint: "eg github.digital.cabinet-office.gov.uk", input_html: { class: 'input-md-6' } %> | ||
<%= f.input :shortname, label: "Short name", hint: "for use in graphite metrics, eg whitehall", | ||
input_html: { placeholder: @application.fallback_shortname, class: 'input-md-6' } %> | ||
<%= f.input :archived, label: "Archived?" %> | ||
<% end %> | ||
<hr/> | ||
<%= f.actions do %> | ||
<%= f.action :submit, :as => :button, button_html: { class: 'btn btn-success' } %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<%= simple_form_for @application do |f| %> | ||
<%= f.input :name, label: "Name", input_html: { class: 'form-control input-md-6' } %> | ||
<%= f.input :repo, label: "GitHub repository path", hint: "eg alphagov/publisher", input_html: { class: 'form-control input-md-6' } %> | ||
<%= f.input :domain, label: "GitHub domain", hint: "eg github.digital.cabinet-office.gov.uk", input_html: { class: 'form-control input-md-6' } %> | ||
<%= f.input :shortname, label: "Short name", hint: "for use in graphite metrics, eg whitehall", | ||
input_html: { placeholder: @application.fallback_shortname, class: 'form-control input-md-6' } %> | ||
<%= f.input :archived, label: "Archived?" %> | ||
<%= f.button :submit, class: 'btn btn-success' %> | ||
<% end %> |
This file contains 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 |
---|---|---|
@@ -1,20 +1,16 @@ | ||
<% content_for :page_title, "Manually record a deployment" %> | ||
|
||
<h1>Manually record a deployment</h1> | ||
<p class="lead">All deployments should be automatically recorded from a push notification, but if that fails, use this form.</p> | ||
|
||
<div class="well"> | ||
<%= semantic_form_for @deployment do |f| %> | ||
<%= f.inputs do %> | ||
<%= f.input :application_id, as: :select, input_html: { class: "input-md-4" }, collection: options_from_collection_for_select(Application.all, 'id', 'name', f.object.application_id) %> | ||
<p class="lead"> | ||
All deployments should be automatically recorded from a push notification, | ||
but if that fails, use this form. | ||
</p> | ||
|
||
<%= f.input :environment, required: "required", input_html: { class: "environment-typeahead input-md-4" }%> | ||
<%= f.input :version, required: "required", input_html: { class: "version-typeahead input-md-4" } %> | ||
<%= f.input :created_at, label: "Deployed at", as: "js_datetime_picker", wrapper_options: { class: 'date input-md-4', 'data-date-format' => 'DD/MM/YYYY HH:mm', id: 'datetimepicker1' }, append: content_tag(:span, '', class: "glyphicon glyphicon-calendar") %> | ||
<% end %> | ||
<%= f.submit class: "btn btn-success" %> | ||
<% end %> | ||
</div> | ||
<%= simple_form_for @deployment do |f| %> | ||
<%= f.input :application_id, as: :select, collection: Application.all %> | ||
<%= f.input :environment, required: "required", input_html: { class: "form-control" }%> | ||
<%= f.input :version, required: "required", input_html: { class: "form-control" } %> | ||
<%= f.input :created_at, label: "Deployed at" %> | ||
<%= f.submit class: "btn btn-success" %> | ||
<% end %> |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 @@ | ||
SimpleForm.setup do |config| | ||
GovukAdminTemplate.setup_simple_form(config) | ||
end |
This file contains 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 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 was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.