html review: round 1

This commit is contained in:
Mark Moser 2017-04-17 14:50:32 -05:00
parent 2730ca10c8
commit 4d71ac7166
7 changed files with 28 additions and 16 deletions

View File

@ -36,9 +36,9 @@
</aside> </aside>
<% end %> <% end %>
<footer role="contentinfo"> <footer>
<div><%= yield(:footer_title) %></div> <div><%= yield(:footer_title) %></div>
<div><%= image_tag("perficientdigital.png", alt:"Perficient Digital") %></div> <%= image_tag("perficientdigital.png", alt:"Perficient Digital") %>
</footer> </footer>
<!--[if ! lte IE 8]><!--> <!--[if ! lte IE 8]><!-->

View File

@ -3,6 +3,9 @@
<label for="answer_answer">Enter answer here</label> <label for="answer_answer">Enter answer here</label>
<%= text_area_tag 'answer[answer]', answer_string, {rows: 10, data: { last: answer_string } } %> <%= text_area_tag 'answer[answer]', answer_string, {rows: 10, data: { last: answer_string } } %>
<div class="<%= params[:action] == 'summary' ? 'hidden' : '' %>">Characters remaining: <span></span></div> <div class="<%= params[:action] == 'summary' ? 'hidden' : '' %>">
Max 1000 characters.
(provide warning when reaching the limit)
</div>
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %> <%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>

View File

@ -7,8 +7,13 @@
<%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, id: 'answer-form', data: {qid: @question.question_id}}) do |form| %> <%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, id: 'answer-form', data: {qid: @question.question_id}}) do |form| %>
<div><%= @question.question %></div> <h1><%= @question.question %></h1>
<%= image_tag @question.attachment if @question.attachment.present? %>
<% if @question.attachment.present? %>
<figure>
<%= image_tag @question.attachment%>
</figure>
<% end %>
<%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %> <%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %>

View File

@ -19,18 +19,22 @@
<%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: ""}) do |form| %> <%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: ""}) do |form| %>
<h2><%= question.question %></h2> <h2><%= question.question %></h2>
<div> <% if question.attachment.present? %>
<%= link_to('Edit', question_path(question.question_id)) %> <figure>
<button>Save</button> <%= image_tag question.attachment %>
<button>Cancel</button> </figure>
</div> <% end %>
<%= image_tag question.attachment if question.attachment.present? %>
<fieldset disabled> <fieldset disabled>
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %> <%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
</fieldset> </fieldset>
<ul class="summary-question-controls">
<li><%= link_to('Edit', question_path(question.question_id)) %></li>
<li><button>Save</button></li>
<li><button>Cancel</button></li>
</ul>
<%= hidden_field_tag 'answer[question_id]', question.question_id %> <%= hidden_field_tag 'answer[question_id]', question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', question.answer_id %> <%= hidden_field_tag 'answer[answer_id]', question.answer_id %>
<%= hidden_field_tag 'submit', true %> <%= hidden_field_tag 'submit', true %>

View File

@ -7,7 +7,7 @@ class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
get question_path questions(:fed6) get question_path questions(:fed6)
assert_response :success assert_response :success
assert_select 'div', questions(:fed6).question assert_select 'h1', questions(:fed6).question
assert_select "img[src=\"#{questions(:fed6).attachment}\"]" assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
end end

View File

@ -7,7 +7,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get question_path get question_path
assert_response :success assert_response :success
assert_select 'div', questions(:fed1).question assert_select 'h1', questions(:fed1).question
end end
test "should load the summary" do test "should load the summary" do
@ -24,7 +24,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get question_path(question.id) get question_path(question.id)
assert_response :success assert_response :success
assert_select 'div', question.question assert_select 'h1', question.question
end end
test 'juan should be on summary with 80% complete' do test 'juan should be on summary with 80% complete' do

View File

@ -8,7 +8,7 @@ class QuestionLiveCoderTest < ActionDispatch::IntegrationTest
get question_path(question.id) get question_path(question.id)
assert_response :success assert_response :success
assert_select 'div', question.question assert_select 'h1', question.question
end end
test "should load seed data into live coder" do test "should load seed data into live coder" do