-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from GSA/80_submission_detail
[80] Submission Detail Page
- Loading branch information
Showing
30 changed files
with
366 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,9 @@ | |
/node_modules | ||
/coverage/ | ||
/vars.*.yml | ||
|
||
# dev env configuration files | ||
.direnv/ | ||
.vscode/ | ||
.yarn/ | ||
.yarnrc |
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 was deleted.
Oops, something went wrong.
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
class PhasesController < ApplicationController | ||
before_action -> { authorize_user('challenge_manager') } | ||
before_action :set_phase, except: [:index] | ||
|
||
def index | ||
@challenges = current_user.challenge_manager_challenges | ||
end | ||
|
||
def submissions | ||
@submissions = @phase.submissions | ||
end | ||
|
||
private | ||
|
||
def set_phase | ||
@phase = Phase.where(challenge: current_user.challenge_manager_challenges).find(params[:id]) | ||
@challenge = @phase.challenge | ||
end | ||
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,28 @@ | ||
# frozen_string_literal: true | ||
|
||
class SubmissionsController < ApplicationController | ||
before_action -> { authorize_user('challenge_manager') } | ||
before_action :set_submission, only: [:show, :update] | ||
|
||
def show; end | ||
|
||
def update | ||
if @submission.update!(submission_params) | ||
flash.now[:success] = I18n.t("comments_saved") | ||
render :show, submission: @submission | ||
else | ||
render :show, status: :unprocessable_entity, submission: @submission | ||
end | ||
end | ||
|
||
private | ||
|
||
def submission_params | ||
params.require(:submission).permit(:comments) | ||
end | ||
|
||
# User access enforced by role | ||
def set_submission | ||
@submission = Submission.by_user(current_user).find(params[:id]) | ||
end | ||
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 was deleted.
Oops, something went wrong.
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
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
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
<%= form_with(model: @submission, url: submission_path(@submission), class: "width-mobile-lg") do |form| %> | ||
<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 %> |
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,23 @@ | ||
<h3>Brief Description:</h3> | ||
<p class="text-normal"><%= @submission.brief_description %></p> | ||
|
||
<h3>Description:</h3> | ||
<p class="text-normal"><%= @submission.description %></p> | ||
|
||
<h3>External URL:</h3> | ||
<a href=<%= @submission.external_url %>><%= @submission.external_url %></a> | ||
|
||
<h3>Status:</h3> | ||
<p class="text-normal"><%= @submission.status.capitalize %></p> | ||
|
||
<h3>Submitter:</h3> | ||
<p class="text-normal"><%= @submission.submitter.email %></p> | ||
|
||
<h3>Last Updated Date:</h3> | ||
<p class="text-normal"><%= @submission.updated_at %></p> | ||
|
||
<h3>Submission ID:</h3> | ||
<p class="text-normal"><%= @submission.id %></p> | ||
|
||
<h3>Title:</h3> | ||
<p class="text-normal"><%= @submission.title %></p> |
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,5 @@ | ||
<h1>Submission ID <%= @submission.id %></h1> | ||
<p class="text-normal">View submission information and assign evaluators to evaluate the submission.</p> | ||
|
||
<%= render partial: "submission_materials" %> | ||
<%= render partial: "comment_form" %> |
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,5 @@ | ||
class AddCommentsToSubmissions < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :submissions, :comments, :text, limit: 3000, null: true | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
association :manager, factory: :user | ||
|
||
title { Faker::Lorem.sentence } | ||
status { "draft" } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.