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 {
counter-reset: question;
float: left;
width: 66%;
form {
margin-left: 2.3em;
position: relative;
&::before {
content: counter(question) ") ";
content: counter(question) ') ';
counter-increment: question;
font-size: 1.25em;
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 {
@media screen and (min-width: 768px) {

View File

@ -19,6 +19,8 @@ module Admin
@candidate = Candidate.find_by(test_hash: params[:test_hash])
@quiz = @candidate.my_quiz
@status = QuizStatus.new(@candidate)
@comments = QuizComment.includes(:user).where(test_hash: @candidate.test_hash).order(:created_at)
@comment = QuizComment.new
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,42 +2,50 @@
content_for :title, "Quiz Review - Skills Assessment Admin"
%>
<main class="summary_tpl admin-review">
<h2 class="prft-heading">Quiz Review</h2>
<div class="summary_tpl">
<div class="admin-review">
<h2 class="prft-heading">Quiz Review</h2>
<div class="review_meta">
<div>
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
<div class="review_meta">
<div>
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
</div>
<div><%= render partial: 'voting' %></div>
</div>
<div><%= render partial: 'voting' %></div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
</div>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<fieldset disabled class="answer-block">
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
</div>
</article>
<% end #form_tag %>
<% end #questions loop %>
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button>
<% end %>
</div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
</div>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<fieldset disabled class="answer-block">
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
</div>
</article>
<% end #form_tag %>
<% end #questions loop %>
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button>
<% end %>
</main>
<div class="review-comments">
<h2 class="prft-heading">Comments</h2>
<%= render partial: 'comment', collection: @comments %>
<div><%= render partial: 'comment_form' %></div>
</div>
</div>