-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[129, 60, 130] Evaluation Form Model, Migration, CRUD, Responsive List View #169
Changes from 1 commit
ee43b42
e6aa0cf
ef3b045
6cde22a
326ebff
ddacefa
0c4410d
58d2753
4f58427
69ff7f5
ba4816a
5affe56
b09a273
d2af7e9
0cd1d6e
b3b04d5
551ceba
aef614a
3c33990
a527388
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module EvaluationFormsHelper | ||
def status_colors | ||
{ | ||
draft: "FireBrick", | ||
ready: "DarkGoldenRod", | ||
published: "green" | ||
} | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<table class="usa-table usa-table--stacked-header width-full"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Form Title</th> | ||
<th scope="col">Assigned to Challenge</th> | ||
<th scope="col">Status</th> | ||
<th scope="col"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @evaluation_forms.each do |evaluation_form| %> | ||
<tr> | ||
<th data-label="Form Title" scope="row"> | ||
<%= link_to evaluation_form do %> | ||
<%= evaluation_form.title %> | ||
<% end %> | ||
</th> | ||
<td data-label="Assigned to Challenge"> | ||
<%= evaluation_form.challenge.title %> | ||
</td> | ||
<td data-label="Status"> | ||
<span style="<%="color: #{status_colors[evaluation_form.status.to_sym]}"%>"> | ||
<%= evaluation_form.status.capitalize %> | ||
</span> | ||
</td> | ||
<td> | ||
<div class="display-flex flex-wrap width-full grid-row grid-gap-1"> | ||
<%= button_to "Edit", edit_evaluation_form_path(evaluation_form), method: :get, class: "usa-button width-full", form: {class: "grid-col-4"} %> | ||
<%= button_to "Clone", evaluation_forms_clone_path, method: :post, params: {evaluation_form: evaluation_form}, class: "usa-button width-full", style: "background-color: #4d8055", form: {class: "grid-col-4"} %> | ||
<%= button_to "Delete", evaluation_form, method: :delete, class: "usa-button usa-button--secondary width-full padding-x-1", form: {class: "grid-col-4"} %> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
<div class="usa-card__container col-md-6"> | ||
<div class="usa-card__body"> | ||
<h1>Evaluation Forms</h1> | ||
<div class="usa-card__body"> | ||
<h1>Evaluation Forms</h1> | ||
<div class="display-flex flex-wrap tablet:flex-justify width-full"> | ||
<span class="text-base margin-bottom-1">Manage existing evaluation forms and create new evaluation forms.</span> | ||
|
||
<div id="evaluation_forms"> | ||
<% @evaluation_forms.each do |evaluation_form| %> | ||
<%= render evaluation_form %> | ||
<p> | ||
<%= link_to "Show this evaluation form", evaluation_form %> | ||
</p> | ||
<% end %> | ||
</div> | ||
<%= link_to new_evaluation_form_path, class: "width-full tablet:width-auto" do %> | ||
<button class="usa-button font-body-2xs text-no-wrap" style="background-color: #4d8055"> | ||
<%= image_tag( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's avoid hard coding styles, especially for colors, and use a class such as |
||
"images/usa-icons/content_copy.svg", | ||
class: "usa-icon icon-white", | ||
alt: "evaluation forms" | ||
)%> | ||
Create New Evaluation Form | ||
</button> | ||
<% end %> | ||
</div> | ||
|
||
<%= link_to "New evaluation form", new_evaluation_form_path %> | ||
</div> | ||
</div> | ||
<% if @evaluation_forms.empty? %> | ||
<div class="text-base align-center text-center"> | ||
<p>You currently do not have any evaluation forms.</p> | ||
<p>Please create an evaluation form for your challenge before it is published.</p> | ||
</div> | ||
<% else %> | ||
<%= render partial: "table", locals: { evaluation_forms: @evaluation_forms } %> | ||
<% end %> | ||
|
||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
resources :evaluations, only: [:index] | ||
resources :evaluation_forms | ||
post '/evaluation_forms/clone', to: 'evaluation_forms#create_from_existing' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's remove the custom route for now |
||
resources :manage_submissions, only: [:index] | ||
|
||
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these stauts_colors aren't needed anymore, but if we do they should be matching the figma values, e.g. the green is
#4d8055