scratched in view partials

This commit is contained in:
Mark Moser 2017-02-10 15:46:43 -06:00
parent 9c2b53aa79
commit 17d62131c9
5 changed files with 80 additions and 35 deletions

View File

@ -1,12 +1,14 @@
.admin-review { .admin-review {
counter-reset: question; counter-reset: question;
float: left;
width: 66%;
form { form {
margin-left: 2.3em; margin-left: 2.3em;
position: relative; position: relative;
&::before { &::before {
content: counter(question) ") "; content: counter(question) ') ';
counter-increment: question; counter-increment: question;
font-size: 1.25em; font-size: 1.25em;
left: -1.8em; left: -1.8em;
@ -17,6 +19,27 @@
} }
.review-comments {
float: right;
padding-left: 30px;
width: 33%;
.comment-message {
margin-right: 5px;
}
.comment-author {
font-size: 0.85em;
font-weight: 700;
margin-bottom: 30px;
text-align: right;
&:before {
content: '- ';
}
}
}
.review_meta { .review_meta {
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {

View File

@ -19,6 +19,8 @@ module Admin
@candidate = Candidate.find_by(test_hash: params[:test_hash]) @candidate = Candidate.find_by(test_hash: params[:test_hash])
@quiz = @candidate.my_quiz @quiz = @candidate.my_quiz
@status = QuizStatus.new(@candidate) @status = QuizStatus.new(@candidate)
@comments = QuizComment.includes(:user).where(test_hash: @candidate.test_hash).order(:created_at)
@comment = QuizComment.new
end end
end end
end end

View File

@ -0,0 +1,2 @@
<div class="comment-message"><%= comment.message %></div>
<div class="comment-author"><%= comment.user.name %></div>

View File

@ -0,0 +1,10 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: @comment } %>
<%= form_for @comment, url: "#", method: :post do |form| %>
<div class="form-group">
<%= form.label :message, "Comment" %>
<%= form.text_area :message %>
</div>
<%= submit_tag "Save Comment" %>
<% end %>

View File

@ -2,7 +2,8 @@
content_for :title, "Quiz Review - Skills Assessment Admin" content_for :title, "Quiz Review - Skills Assessment Admin"
%> %>
<main class="summary_tpl admin-review"> <div class="summary_tpl">
<div class="admin-review">
<h2 class="prft-heading">Quiz Review</h2> <h2 class="prft-heading">Quiz Review</h2>
<div class="review_meta"> <div class="review_meta">
@ -40,4 +41,11 @@
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %> <%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button> <button>Back to list</button>
<% end %> <% end %>
</main> </div>
<div class="review-comments">
<h2 class="prft-heading">Comments</h2>
<%= render partial: 'comment', collection: @comments %>
<div><%= render partial: 'comment_form' %></div>
</div>
</div>