Skip to content

Commit ab5ce51

Browse files
committed
Fix styling
1 parent 5f53590 commit ab5ce51

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

app/assets/stylesheets/application.css

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ input[type="radio"] {
7777
align-items: center;
7878
}
7979

80+
.survey-date {
81+
text-align: center;
82+
font-size: 2rem;
83+
}
84+
85+
.survey-radio-group {
86+
padding: 0px 5rem;
87+
display: flex;
88+
justify-content: space-between;
89+
align-items: center;
90+
}
91+
92+
.survey-radio-group label {
93+
display: none;
94+
}
95+
8096
.question-selection-group {
8197
border: 0px var(--secondary-color) solid;
8298
background-color: var(--fill-color-2);
@@ -86,6 +102,12 @@ input[type="radio"] {
86102
box-shadow: 0px 4px 8px rgba(127, 124, 175, 0.8);
87103
}
88104

105+
.question-selection-group label {
106+
font-size: 2rem;
107+
margin-left: 1rem;
108+
margin-right: 1rem;
109+
}
110+
89111
.under-radio {
90112
padding: 0px 3rem;
91113
/*width: 100%;*/
@@ -98,15 +120,16 @@ input[type="radio"] {
98120
color: var(--fill-color-1);
99121
}
100122

101-
.button_action {
123+
.button-action {
102124
display: flex;
103125
align-items: center;
104126
justify-content: center;
105127
}
106128

107-
.button_action button {
129+
.button-action input {
108130
font-size: 4rem;
109131
padding: 1rem;
132+
margin: 2rem;
110133
border-radius: 1rem;
111134
}
112135

app/services/survey_generator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def self.create_intake_survey_for_user(user)
1818
# TODO: Will need to decide once we get 'finalized' questions which ones we want to be on the intake survey
1919
# For now, I'm just gonna grab all of them
2020
Question.each do |question|
21-
Answer.create!(question_id: question.id, survey: survey)
21+
# Answer.create!(question_id: question.id, survey: survey)
22+
Answer.create!(question_id: question.id, survey: survey, question_text: question.text)
2223
end
2324
end
2425
end

app/views/survey/show.html.erb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
<%= render "survey_header" %>
22
<%= form_with model: @survey do |f| %>
3-
<%= "Survey Questions #{@survey.created_at.strftime("%b %d, %Y")}" %>
3+
<div class="survey-date"><%= "Survey Questions #{@survey.created_at.strftime("%b %d, %Y")}" %></div>
44
<%= f.fields_for :answers do |answer_f| %>
55
<div class="question-selection-group">
66
<%= answer_f.hidden_field :id %>
77
<%= answer_f.label :answer, answer_f.object.question_text %>
88
<div class="survey-radio-group">
99
<%= answer_f.collection_radio_buttons :answer,
1010
[
11-
["Strongly Disagree", 1],
11+
['&nbsp;'.html_safe, 1],
1212
['&nbsp;'.html_safe, 2],
1313
['&nbsp;'.html_safe, 3],
1414
['&nbsp;'.html_safe, 4],
15-
["Strongly Agree", 5]
15+
['&nbsp;'.html_safe, 5]
1616
],
1717
:last,
1818
:first
1919
%>
2020
</div>
21+
<div class="under-radio">
22+
<div>Strongly Disagree</div>
23+
<div>Strongly Agree</div>
24+
</div>
2125
</div>
2226
<% end %>
23-
<%= f.submit "Submit Survey" %>
27+
<div class="button-action">
28+
<%= f.submit "Submit Survey" %>
29+
</div>
2430
<% end %>

0 commit comments

Comments
 (0)