-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:GSA/Challenge_platform into 298/eval…
…uation-routes-and-controller * 'dev' of github.com:GSA/Challenge_platform: (46 commits) add margin make available evaluator name bold styling minutiae available evaluators styling test for empty list update spec warning messages codeclimate caught my merge conflict resolution error update disabled checkbox state update spec refactor Submission#available_evaluators method random ids on comment form more tests testing recused unassigned buttons and links codeclimactic code climate from flash.now to flash rubocop -A ...
- Loading branch information
Showing
14 changed files
with
320 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<div class="usa-accordion"> | ||
<% rand = SecureRandom.hex(8) %> | ||
<h2 class="usa-accordion__heading" id="<%= "#{rand}-accordion-heading" %>"> | ||
<button | ||
type="button" | ||
class="usa-accordion__button display-flex flex-justify icon-white" | ||
aria-expanded="true" | ||
aria-controls="<%= rand %>" | ||
> | ||
<div>Assigned Evaluators</div> | ||
</button> | ||
</h2> | ||
|
||
<div class="usa-accordion__content" id="<%= rand %>"> | ||
<% assigned_evaluators = @submission.evaluators.where("evaluator_submission_assignments.status" => ["assigned", "recused"]) %> | ||
<% if assigned_evaluators.any? %> | ||
<table class="usa-table usa-table--stacked-header usa-table--borderless gray-header"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Evaluator name</th> | ||
<th scope="col">Evaluation Status</th> | ||
<th scope="col">Score</th> | ||
<th scope="col" aria-label="Actions"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% assigned_evaluators.each do |evaluator| %> | ||
<tr data-evaluator-id="<%= evaluator.id %>" data-evaluator-type="user"> | ||
<th scope="row" data-label="Evaluator name" class="text-top"> | ||
<span class="text-bold text-ls-1 line-height-sans-4"><%= "#{evaluator.first_name} #{evaluator.last_name}" %></span> | ||
</th> | ||
<td data-label="Evaluation Status" class="text-top"></td> | ||
<td data-label="Score" class="text-top"></td> | ||
<td data-label=""> | ||
<div class="display-flex flex-no-wrap grid-row"> | ||
<% assignment = evaluator.evaluator_submission_assignments.where(submission_id: @submission.id).first %> | ||
<%= form_with url: phase_evaluator_submission_assignment_path(@submission.phase, assignment.id), method: "PATCH" do |f| %> | ||
<%= f.hidden_field :phase_id, value: @submission.phase.id %> | ||
<%= f.hidden_field :status, value: assignment.recused? ? "recused_unassigned" : "unassigned" %> | ||
<%= f.submit "Unassign", class: "usa-button usa-button--outline font-body-2xs" %> | ||
<% end %> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<div class="usa-alert usa-alert--warning"> | ||
<div class="usa-alert__body"> | ||
<p class="usa-alert__text font-body-2xs"> | ||
You currently do not have any evaluators assigned to this submission. Please use the section below to review and assign available evaluators. | ||
</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<div class="usa-accordion"> | ||
<% rand = SecureRandom.hex(8) %> | ||
<h2 class="usa-accordion__heading" id="<%= "#{rand}-accordion-heading" %>"> | ||
<button | ||
type="button" | ||
class="usa-accordion__button display-flex flex-justify icon-white" | ||
aria-expanded="true" | ||
aria-controls="<%= rand %>" | ||
> | ||
<div>Available Evaluators</div> | ||
</button> | ||
</h2> | ||
|
||
<div class="usa-accordion__content bg-base-lighter width-full" id="<%= rand %>"> | ||
<% if @submission.available_evaluators.any? %> | ||
<% @submission.available_evaluators.each_with_index do |evaluator, i| %> | ||
<div class="display-flex flex-justify margin-y-1"> | ||
<div style="word-break: break-all"> | ||
<span class="text-bold"><%= "#{evaluator.first_name} #{evaluator.last_name}" %></span><br/> | ||
<%= evaluator.email %> | ||
</div> | ||
<div class="margin-left-05"> | ||
<% assignment = evaluator.evaluator_submission_assignments.where(submission_id: @submission.id).first %> | ||
<% if assignment %> | ||
<%= form_with url: phase_evaluator_submission_assignment_path(@submission.phase, assignment.id), method: "PATCH" do |f| %> | ||
<%= f.hidden_field :phase_id, value: @submission.phase.id %> | ||
<%= f.hidden_field :status, value: "assigned" %> | ||
<%= f.submit "Reassign", class: "usa-button font-body-2xs margin-top-1" %> | ||
<% end %> | ||
<% else %> | ||
<%= form_with url: phase_evaluator_submission_assignments_path(@submission.phase) do |f| %> | ||
<%= f.hidden_field :evaluator_id, value: evaluator.id %> | ||
<%= f.hidden_field :submission_id, value: @submission.id %> | ||
<%= f.submit "Assign", class: "usa-button font-body-2xs margin-top-1" %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% if i < @submission.available_evaluators.length - 1 %> | ||
<hr/> | ||
<% end %> | ||
<% end %> | ||
<% else %> | ||
<div class="usa-alert usa-alert--warning"> | ||
<div class="usa-alert__body"> | ||
<p class="usa-alert__text font-body-2xs"> | ||
There are no evaluators available for this submission. Please visit Evaluation Panel section to manage your list of available evaluators. | ||
</p> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<div data-controller="submission-details"> | ||
<% rand = SecureRandom.hex(8) %> | ||
<%= form_with(model: @submission, url: submission_path(@submission), class: "maxw-mobile-lg") do |form| %> | ||
<div class="usa-checkbox" id="eligible-for-evaluation"> | ||
<input | ||
class="usa-checkbox__input usa-checkbox__input--tile" | ||
type="checkbox" | ||
id="<%= "#{rand}-judging-status-selected" %>" | ||
value="selected" | ||
<%= "disabled" if @submission.evaluators_assigned? %> | ||
<%= "checked" if @submission.judging_status.in?(["selected", "winner"]) %> | ||
data-action="change->submission-details#eligibleCheck" | ||
data-submission-details-target="eligibleCheckbox" | ||
/> | ||
<label class="usa-checkbox__label" for="<%= "#{rand}-judging-status-selected" %>" | ||
>This submission is eligible for evaluation. | ||
<span class="usa-checkbox__label-description" | ||
>Check the box if the submission is pre-screened and is eligible for the evaluation process.</span | ||
></label | ||
> | ||
</div> | ||
<div class="usa-checkbox" id="selected-to-advance"> | ||
<input | ||
class="usa-checkbox__input usa-checkbox__input--tile" | ||
id="<%= "#{rand}-judging-status-winner" %>" | ||
type="checkbox" | ||
<%= "disabled" if @submission.evaluations_missing_or_incomplete? %> | ||
<%= "checked" if @submission.judging_status == "winner" %> | ||
data-action="change->submission-details#selectedCheck" | ||
data-submission-details-target="winnerCheckbox" | ||
/> | ||
<label class="usa-checkbox__label" for="<%= "#{rand}-judging-status-winner" %>" | ||
>This submission is selected to advance. | ||
<span class="usa-checkbox__label-description" | ||
>Check the box to select this submission to advance or for award after all evaluations are completed.</span | ||
></label | ||
> | ||
</div> | ||
<input | ||
id="judging-status-hidden" | ||
type="hidden" | ||
name="submission[judging_status]" | ||
data-submission-details-target="judgingStatusHidden" | ||
/> | ||
<div class="usa-form-group"> | ||
<%= form.label :comments, "Comments and notes:", class: "usa-label", for: "#{rand}-comments" %> | ||
<%= form.text_area :comments, class: "usa-textarea", default: @submission.comments, id: "#{rand}-comments" %> | ||
</div> | ||
<button type="submit" name="commit" class="usa-button font-body-2xs text-no-wrap margin-y-2"> | ||
Save | ||
</button> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,4 @@ | ||
<div data-controller="submission-details"> | ||
<% rand = SecureRandom.hex(8) %> | ||
<%= form_with(model: @submission, url: submission_path(@submission), class: "maxw-mobile-lg") do |form| %> | ||
<div class="usa-checkbox" id="eligible-for-evaluation"> | ||
<input | ||
class="usa-checkbox__input usa-checkbox__input--tile" | ||
type="checkbox" | ||
id="<%= "#{rand}-judging-status-selected" %>" | ||
value="selected" | ||
<%= if @submission.judging_status == "winner" then "disabled" end %> | ||
<%= "checked" if @submission.judging_status.in?(["selected", "winner"]) %> | ||
data-action="change->submission-details#eligibleCheck" | ||
data-submission-details-target="eligibleCheckbox" | ||
/> | ||
<label class="usa-checkbox__label" for="<%= "#{rand}-judging-status-selected" %>" | ||
>This submission is eligible for evaluation. | ||
<span class="usa-checkbox__label-description" | ||
>Check the box if the submission is pre-screened and is eligible for the evaluation process.</span | ||
></label | ||
> | ||
</div> | ||
<div class="usa-checkbox" id="selected-to-advance"> | ||
<input | ||
class="usa-checkbox__input usa-checkbox__input--tile" | ||
id="<%= "#{rand}-judging-status-winner" %>" | ||
type="checkbox" | ||
<%= "disabled" unless @submission.judging_status.in?(["selected", "winner"]) %> | ||
<%= "checked" if @submission.judging_status == "winner" %> | ||
data-action="change->submission-details#selectedCheck" | ||
data-submission-details-target="winnerCheckbox" | ||
/> | ||
<label class="usa-checkbox__label" for="<%= "#{rand}-judging-status-winner" %>" | ||
>This submission is selected to advance. | ||
<span class="usa-checkbox__label-description" | ||
>Check the box to select this submission to advance or for award after all evaluations are completed.</span | ||
></label | ||
> | ||
</div> | ||
<input | ||
id="judging-status-hidden" | ||
type="hidden" | ||
name="submission[judging_status]" | ||
data-submission-details-target="judgingStatusHidden" | ||
/> | ||
<div class="usa-form-group"> | ||
<%= form.label :comments, "Comments and notes:", class: "usa-label" %> | ||
<%= form.text_area :comments, class: "usa-textarea", default: @submission.comments %> | ||
</div> | ||
<button type="submit" name="commit" class="usa-button font-body-2xs text-no-wrap margin-y-2"> | ||
Save | ||
</button> | ||
<% end %> | ||
</div> | ||
<%= render partial: 'details_form' %> | ||
<% if @submission.judging_status.in?(["selected", "winner"]) %> | ||
<%= render partial: 'submission_evaluation' %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h2>Submission Evaluation</h2> | ||
<% if @submission.phase.evaluation_form.nil? %> | ||
<%= render 'shared/alert_error', alert_heading: t('alerts.no_evaluation_form.heading'), alert_text: t('alerts.no_evaluation_form.text') %> | ||
<% else %> | ||
<%= render partial: 'assigned_evaluators' %> | ||
<%= render partial: 'available_evaluators' %> | ||
<div class="display-flex flex-justify-end"> | ||
<%= link_to "Manage Evaluators", phase_evaluators_path(@submission.phase), class: "margin-y-1" %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.