Skip to content

Commit

Permalink
fix up step 5
Browse files Browse the repository at this point in the history
  • Loading branch information
dereke committed Apr 16, 2021
1 parent 4ef7963 commit 88ff970
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/controllers/initiatives_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def initiative_params
:publication_status,
:consent_to_share_email,
:consent_to_share_phone,
:specialist_advice,
:related_initiatives,
:administrative_notes,
images: [],
Expand Down
15 changes: 7 additions & 8 deletions app/views/initiatives/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@
<% content_for :page_javascript do %>
<%= javascript_packs_with_chunks_tag 'initiative_toggle_group', 'data-turbolinks-track': 'reload' %>
<% end %>
<h2 class="u-mb">Groups</h2>

<%= f.form_field :lead_group_id do %>
<%= f.label :lead_group_id %>
<%= f.label :lead_group_id, 'Select' %>
<div class="Hint">You can create a new one if your group isn’t listed</div>
<%= f.select :lead_group_id do %>
<option value="">Please select a group</option>
<%=options_for_select(groups, initiative.lead_group&.id) %>
Expand All @@ -161,14 +161,14 @@
</div>
<% end %>

<%= f.form_field :partner_groups_role do %>
<%= f.label :partner_groups_role %>
<%= f.text_field :partner_groups_role %>
<%= f.form_field :specialist_advice do %>
<%= f.label :specialist_advice, 'Have you had any specialist advice on this project?' %>
<%= f.text_area :specialist_advice, placeholder: "For example: 'Stroud Valleys Project provided saplings and advice on tree planting'" %>
<% end %>

<%= f.form_field :related_initiatives do %>
<%= f.label :related_initiatives %>
<%= f.text_area :related_initiatives, placeholder: 'Enter the names of any related initiatives here' %>
<%= f.label :related_initiatives, 'Have you collaborated with other local projects to get going?' %>
<%= f.text_area :related_initiatives, placeholder: 'Enter the details of any related initiative' %>
<% end %>
<% end %>

Expand All @@ -177,7 +177,6 @@
<%= javascript_packs_with_chunks_tag 'initiative_solution_picker', 'data-turbolinks-track': 'reload' %>
<script type="text/json" id="taxonomy_hierarchy_json"><%=taxonomy_hierarchy_json.html_safe%></script>
<% end %>
<h2 class="u-mb">Solutions</h2>

<%= f.form_field :solution do %>
<%= f.label 'What categories does your project relate to?' %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddSpecialistAdviceToInitiatives < ActiveRecord::Migration[6.0]
def change
add_column :initiatives, :specialist_advice, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_04_16_134738) do
ActiveRecord::Schema.define(version: 2021_04_16_144942) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -149,6 +149,7 @@
t.string "publication_status"
t.string "carbon_saving_strategy"
t.boolean "consent_to_share_phone"
t.string "specialist_advice"
t.index ["lead_group_id"], name: "index_initiatives_on_lead_group_id"
t.index ["owner_id"], name: "index_initiatives_on_owner_id"
t.index ["parish_id"], name: "index_initiatives_on_parish_id"
Expand Down
1 change: 1 addition & 0 deletions frontend/styles/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@import "./components/explore";
@import "./components/header";
@import "./components/help";
@import "./components/hint";
@import "./components/initiative";
@import "./components/footer";
@import "./components/form-field";
Expand Down
13 changes: 13 additions & 0 deletions frontend/styles/components/form-field.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ textarea.FormField-input {
color: green;
}

.FormField select {
background-color: white;
border: 1px solid var(--FormField-input-borderColor);
border-radius: 5px;
padding: 10px;
width: 100%;

&:focus {
border-color: var(--FormField-borderColorFocus);
outline: none;
}
}

@keyframes blinker {

50% {
Expand Down
3 changes: 3 additions & 0 deletions frontend/styles/components/hint.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Hint {
color: #737373;
}

0 comments on commit 88ff970

Please sign in to comment.