scratched in view partials
This commit is contained in:
parent
9c2b53aa79
commit
17d62131c9
@ -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) {
|
||||
|
@ -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
|
||||
|
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,7 +2,8 @@
|
||||
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>
|
||||
|
||||
<div class="review_meta">
|
||||
@ -40,4 +41,11 @@
|
||||
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
|
||||
<button>Back to list</button>
|
||||
<% 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>
|
||||
|
Loading…
Reference in New Issue
Block a user