Skip to content

Commit 12b8bdc

Browse files
WRSAT-188 Create School Screen (#74)
1 parent e1b981d commit 12b8bdc

File tree

15 files changed

+94
-8
lines changed

15 files changed

+94
-8
lines changed

app/assets/stylesheets/application.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ main {
3131
background-color: #FFFFFF;
3232
}
3333

34+
.notice.teal {
35+
color: #034E46;
36+
border: 2px solid #034E46;
37+
background-color: #EBFFFA;
38+
border-radius: 10px;
39+
}
40+
3441
.progress-bar {
3542
color: $color-teal;
3643
text-align: center;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class IsStudentController < QuestionController
2+
include WrExemptionsConcern
3+
4+
def self.attributes_edited
5+
[:is_student]
6+
end
7+
end

app/controllers/navigation/screener_navigation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ScreenerNavigation < ControllerNavigation::ControllerNavigation
1212
ControllerNavigation::NavigationStep.new(HasUnemploymentBenefitsController),
1313
ControllerNavigation::NavigationStep.new(DisabilityBenefitsController),
1414
ControllerNavigation::NavigationStep.new(CommunityServiceController),
15+
ControllerNavigation::NavigationStep.new(IsStudentController),
1516
ControllerNavigation::NavigationStep.new(PersonalSituationsMilestoneController),
1617
ControllerNavigation::NavigationStep.new(BasicInfoMilestoneController),
1718
ControllerNavigation::NavigationStep.new(PersonalInformationController),

app/models/screener.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Screener < ApplicationRecord
1919
enum :receiving_benefits_insurance_payments, {unfilled: 0, yes: 1, no: 2}, prefix: true
2020
enum :receiving_benefits_other, {unfilled: 0, yes: 1, no: 2}, prefix: true
2121
enum :receiving_benefits_none, {unfilled: 0, yes: 1, no: 2}, prefix: true
22+
enum :is_student, {unfilled: 0, yes: 1, no: 2}, prefix: true
2223
attr_writer :birth_date_year, :birth_date_month, :birth_date_day
2324
attr_writer :pregnancy_due_date_year, :pregnancy_due_date_month, :pregnancy_due_date_day
2425
normalizes :phone_number, with: ->(value) { Phonelib.parse(value, "US").national }
@@ -75,6 +76,10 @@ class Screener < ApplicationRecord
7576
validates :receiving_benefits_write_in, absence: true, if: -> { receiving_benefits_other_no? }
7677
end
7778

79+
with_context :is_student do
80+
validates :is_student, inclusion: {in: %w[yes no], message: I18n.t("validations.must_answer_yes_or_no")}
81+
end
82+
7883
with_context :email do
7984
validates :email, "valid_email_2/email": true, confirmation: true
8085
end

app/views/american_indian/edit.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h1 class="h2"><%= content_for(:question_title) %></h1>
44

5-
<div class="notice">
5+
<div class="notice teal">
66
<div class="media-box">
77
<div class="media-box__media media--icon">
88
<i class="icon-help"></i>
@@ -16,4 +16,3 @@
1616
<%= form_with model: @model, url: { action: :update }, data: { turbo: false }, local: true, method: "put", builder: Cfa::Styleguide::CfaFormBuilder do |f| %>
1717
<%= render "shared/yes_no_buttons", form: f, model_name: @model.class.name.downcase, column: "is_american_indian" %>
1818
<% end %>
19-

app/views/caring_for_someone/edit.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<p><%= t("views.caring_for_someone.edit.help_text_html") %></p>
66

7-
<div class="notice">
7+
<div class="notice teal">
88
<div class="media-box">
99
<div class="media-box__media media--icon">
1010
<i class="icon-help"></i>
@@ -24,4 +24,3 @@
2424

2525
<%= f.submit t("general.continue"), class: "button button--primary" %>
2626
<% end %>
27-

app/views/has_child/edit.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h1 class="h2"><%= content_for(:question_title) %></h1>
44

5-
<div class="notice">
5+
<div class="notice teal">
66
<div class="media-box">
77
<div class="media-box__media media--icon">
88
<i class="icon-help"></i>
@@ -16,4 +16,3 @@
1616
<%= form_with model: @model, url: { action: :update }, data: { turbo: false }, local: true, method: "put", builder: Cfa::Styleguide::CfaFormBuilder do |f| %>
1717
<%= render "shared/yes_no_buttons", form: f, model_name: @model.class.name.downcase, column: "has_child" %>
1818
<% end %>
19-

app/views/is_student/edit.html.erb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<% content_for :question_title, t("views.is_student.edit.title") %>
2+
3+
<h1 class="h2"><%= content_for(:question_title) %></h1>
4+
5+
<div class="notice teal">
6+
<div class="media-box">
7+
<div class="media-box__media media--icon">
8+
<i class="icon-help"></i>
9+
</div>
10+
<div class="media-box__content">
11+
<%= t("views.is_student.edit.help_text") %>
12+
</div>
13+
</div>
14+
</div>
15+
16+
<%= form_with model: @model, url: { action: :update }, data: { turbo: false }, local: true, method: "put", builder: Cfa::Styleguide::CfaFormBuilder do |f| %>
17+
<%= render "shared/yes_no_buttons", form: f, model_name: @model.class.name.downcase, column: "is_student" %>
18+
<% end %>

config/locales/en.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ en:
6868
pregnancy_due_date_help_text: You can estimate or skip this if you don’t know.
6969
pregnancy_due_date_label: When is the baby due?
7070
title: Are you pregnant?
71+
is_student:
72+
edit:
73+
help_text: Your school defines what it means to be at least "half-time" based on how many classes you are taking. Ask your college, university, or school for your status.
74+
title: Do you go to school full-time, or at least half-time?
7175
landing_page:
7276
fill_out_form: Fill out the form
7377
index:

config/locales/es.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ es:
6868
pregnancy_due_date_help_text: Puede estimarlo o saltarse esta pregunta si no lo sabe.
6969
pregnancy_due_date_label: "¿Para qué fecha se espera el nacimiento del bebé?"
7070
title: "¿Está en embarazo?"
71+
is_student:
72+
edit:
73+
help_text: Cada escuela define qué significa ser estudiante de “medio tiempo” basado en cuántas clases está tomando. Pregunte en su universidad, colegio o escuela cuál es su estatus.
74+
title: "¿Asiste a la escuela a tiempo completo o al menos medio tiempo?"
7175
landing_page:
7276
fill_out_form: Complete el formulario
7377
index:

0 commit comments

Comments
 (0)