Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/mailers/submission_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def failed(submission, error)
@submission = submission
@error = error
mail(to: User.where(admin: true).map(&:email),
subject: 'QuickSubmit: failure')
subject: 'Public Access QuickSubmit: failure')
end
end
27 changes: 17 additions & 10 deletions app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ class Submission < ActiveRecord::Base
serialize :funders, JSON
before_create :generate_uuid

SUBMITTABLE_FUNDERS = ['Department of Agriculture (USDA)',
'Department of Defense (DoD)',
'Department of Energy (DOE)',
'Department of Homeland Security (DHS)',
'Department of Labor',
'Department of Transportation (DOT)',
'Environmental Protection Agency (EPA)',
'National Aeronautics and Space Administration (NASA)',
'National Institutes of Health (NIH)',
'National Ocean and Atmospheric Administration (NOAA)',
'National Science Foundation (NSF)',
'US Geological Survey (USGS)'].freeze

UI_ONLY_FUNDERS = ['Other'].freeze

# Ensures submitted funders are allowed
def funders_are_valid
return unless funders.present?
Expand Down Expand Up @@ -110,19 +125,11 @@ def valid_funders

# Funders we want to display in the UI and also include in {Mets}
def submittable_funders
['Department of Defense (DoD)',
'Department of Energy (DOE)',
'Department of Transportation (DOT)',
'National Aeronautics and Space Administration (NASA)',
'National Institutes of Health (NIH)',
'National Center for Atmospheric Research (NCAR)',
'National Ocean and Atmospheric Administration (NOAA)',
'National Science Foundation (NSF)',
'United States Department of Agriculture (USDA)']
SUBMITTABLE_FUNDERS
end

# Funders we want to display in the UI, but not include in {Mets}
def ui_only_funders
['Other']
UI_ONLY_FUNDERS
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="//libraries.mit.edu"><img src="<%= asset_path 'logo-black.png' %>" alt="MIT Libraries" width="111" height="47"></a>
<a class="navbar-text h1" href="/">QuickSubmit</a>
<a class="navbar-text h1" href="/">Public Access QuickSubmit</a>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li><%= link_to "New Submission", new_submission_path %></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>MIT DSpace Quick Submit Submissions</h1>
<h1>Public Access QuickSubmit Submissions</h1>

View:
<%= link_to('All', submissions_path, class: 'btn btn-default') %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/submissions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>MIT DSpace Quick Submit</h1>
<h1>Public Access QuickSubmit</h1>

<%= bootstrap_form_for(@submission,
html: { class: 'submissionUpload',
Expand All @@ -18,7 +18,7 @@
<%= f.select :funders,
options_for_select(@submission.valid_funders, @submission.funders),
{ include_hidden: false, help: 'Multiple funder selections are allowed' },
{ multiple: true, size: 10 } %>
{ multiple: true, size: 13 } %>

<%= f.file_field :documents, multiple: true,
help: 'Drag and Drop files or click "Choose Files"' %>
Expand Down
2 changes: 1 addition & 1 deletion test/mailers/submission_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ class SubmissionMailerTest < ActionMailer::TestCase
assert_equal(0, email.body.parts.length)
assert_equal(['some_from@example.com'], email.from)
assert_equal(['xyz789@example.com'], email.to)
assert_equal('QuickSubmit: failure', email.subject)
assert_equal('Public Access QuickSubmit: failure', email.subject)
end
end