generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fworks): crud of framework entities
- Loading branch information
Showing
28 changed files
with
310 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
class Frameworks::ApplicationController < ApplicationController | ||
include SupportAgents | ||
before_action { Current.actor = current_agent } | ||
before_action :set_back_url | ||
|
||
private | ||
|
||
def authorize_agent_scope = :access_frameworks_portal? | ||
def portal_namespace = :frameworks | ||
|
||
def set_back_url | ||
@back_url = back_link_param | ||
@back_url = back_link_param if back_link_param.present? | ||
end | ||
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 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 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,53 @@ | ||
<%= f.govuk_fieldset legend: { text: 'Basic Details' } do %> | ||
<%= f.govuk_text_field :name %> | ||
<%= f.govuk_text_field :short_name, width: "one-third", label: { text: "Abbreviated name" } %> | ||
<%= f.govuk_text_field :url, label: { text: "Providers URL" } %> | ||
<%= f.govuk_text_field :reference, width: "one-third", label: { text: "Providers reference" } %> | ||
<% end %> | ||
|
||
<div data-controller="select-option-filter" data-select-option-filter-param-name-value="providerId"> | ||
<%= f.govuk_select :provider_id, @providers.map {|provider| [provider.short_name, provider.id] }, | ||
"data-select-option-filter-target" => "input", | ||
options: { include_blank: "Select a provider" }, | ||
label: { text: "Provider" } %> | ||
|
||
<%= f.govuk_select :provider_contact_id, @provider_contacts.map {|contact| [contact.display_name, contact.id, { "data-provider-id" => contact.provider_id }] }, | ||
"data-select-option-filter-target" => "output", | ||
options: { include_blank: "Select a contact" }, | ||
label: { text: "Provider contact" } %> | ||
</div> | ||
|
||
<%= f.govuk_fieldset legend: { text: 'Availability' } do %> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-one-half" id="dfe-start-date"> | ||
<%= f.govuk_date_field :dfe_start_date, legend: { size: "s", text: "DfE start date", class: "" } %> | ||
</div> | ||
<div class="govuk-grid-column-one-half" id="dfe-end-date"> | ||
<%= f.govuk_date_field :dfe_end_date, legend: { size: "s", text: "DfE end date", class: "" } %> | ||
</div> | ||
</div> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-one-half" id="provider-start-date"> | ||
<%= f.govuk_date_field :provider_start_date, legend: { size: "s", text: "Provider start date" } %> | ||
</div> | ||
<div class="govuk-grid-column-one-half" id="provider-end-date"> | ||
<%= f.govuk_date_field :provider_end_date, legend: { size: "s", text: "Provider end date" } %> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<%= f.govuk_fieldset legend: { text: 'Other' } do %> | ||
<% dps_options = [[true, 'Yes'], [false, 'No']] %> | ||
<%= f.govuk_collection_radio_buttons :dps, dps_options, :first, :last, inline: true, legend: { size: 's', text: 'Is this framework a DPS (Dynamic purchasing system)?' } %> | ||
|
||
<% lot_options = [['single', 'Single-lot'], ['multi', 'Multi-lot']] %> | ||
<%= f.govuk_collection_radio_buttons :lot, lot_options, :first, :last, inline: true, legend: { size: 's', text: 'Is this framework a single or multi lot?' } %> | ||
|
||
<% status_options = Frameworks::Framework.statuses.map {|status, id| [status, status.humanize] } %> | ||
<%= f.govuk_collection_radio_buttons :status, status_options, :first, :last, legend: { size: 's', text: 'Approval Status' } %> | ||
<% end %> | ||
|
||
<div class="govuk-button-group flex-align-center"> | ||
<%= f.govuk_submit submit %> | ||
<%= link_to "Cancel", @framework, class: "govuk-link govuk-link--no-visited-state" %> | ||
</div> |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%= content_for :title, "GHBS | Frameworks | Edit Framework" %> | ||
|
||
<%= turbo_frame_tag dom_id(@framework) do %> | ||
|
||
<span class="govuk-caption-l">Edit Framework</span> | ||
<h1 class="govuk-heading-l"><%= @framework.name %></h2> | ||
|
||
<div class="govuk-!-width-two-thirds"> | ||
<%= form_for @framework do |f| %> | ||
<%= render "frameworks/frameworks/form", f:, submit: "Save changes" %> | ||
<% end %> | ||
</div> | ||
|
||
<% 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 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= f.govuk_text_field :name %> | ||
<%= f.govuk_text_field :email %> | ||
<%= f.govuk_text_field :phone %> | ||
|
||
<%= f.govuk_select :provider_id, @providers.map {|provider| [provider.short_name, provider.id] }, | ||
options: { include_blank: "Select a provider" }, | ||
label: { text: "Provider" } %> | ||
|
||
<div class="govuk-button-group flex-align-center"> | ||
<%= f.govuk_submit submit %> | ||
<%= link_to "Cancel", @provider_contact, class: "govuk-link govuk-link--no-visited-state" %> | ||
</div> |
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
Oops, something went wrong.