scratched in view partials
This commit is contained in:
parent
9c2b53aa79
commit
17d62131c9
@ -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) {
|
||||||
|
@ -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
|
||||||
|
2
app/views/admin/result/_comment.html.erb
Normal file
2
app/views/admin/result/_comment.html.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<div class="comment-message"><%= comment.message %></div>
|
||||||
|
<div class="comment-author"><%= comment.user.name %></div>
|
10
app/views/admin/result/_comment_form.html.erb
Normal file
10
app/views/admin/result/_comment_form.html.erb
Normal 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 %>
|
@ -2,42 +2,50 @@
|
|||||||
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">
|
||||||
<h2 class="prft-heading">Quiz Review</h2>
|
<div class="admin-review">
|
||||||
|
<h2 class="prft-heading">Quiz Review</h2>
|
||||||
|
|
||||||
<div class="review_meta">
|
<div class="review_meta">
|
||||||
<div>
|
<div>
|
||||||
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
|
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
|
||||||
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
|
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
|
||||||
<strong>Client/Project:</strong> <%= @candidate.project %><br />
|
<strong>Client/Project:</strong> <%= @candidate.project %><br />
|
||||||
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
|
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div><%= render partial: 'voting' %></div>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
<% @quiz.each do |question| %>
|
<div class="review-comments">
|
||||||
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
|
<h2 class="prft-heading">Comments</h2>
|
||||||
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
|
<%= render partial: 'comment', collection: @comments %>
|
||||||
<div class="question-heading">
|
<div><%= render partial: 'comment_form' %></div>
|
||||||
<div class="question-title">
|
</div>
|
||||||
<h3><%= question.question %></h3>
|
</div>
|
||||||
</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>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user