Skip to content
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 Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

gem 'administrate', '~> 0.19.0'
gem 'administrate', '~> 0.20.0'
gem 'aws-sdk-rails'
gem 'aws-sdk-s3'
gem 'aws-sdk-sqs'
Expand Down
133 changes: 54 additions & 79 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,76 +89,51 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
administrate (0.19.0)
actionpack (>= 5.0)
actionview (>= 5.0)
activerecord (>= 5.0)
jquery-rails (>= 4.0)
kaminari (>= 1.0)
administrate (0.20.1)
actionpack (>= 6.0, < 8.0)
actionview (>= 6.0, < 8.0)
activerecord (>= 6.0, < 8.0)
jquery-rails (~> 4.6.0)
kaminari (~> 1.2.2)
sassc-rails (~> 2.1)
selectize-rails (~> 0.6)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ansi (1.5.0)
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.1020.0)
aws-record (2.13.2)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
aws-sdk-core (3.214.0)
aws-eventstream (1.3.1)
aws-partitions (1.1055.0)
aws-sdk-core (3.219.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
jmespath (~> 1, >= 1.6.1)
aws-sdk-dynamodb (1.132.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (1.99.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sdk-rails (4.1.0)
actionmailbox (>= 7.0.0)
aws-record (~> 2)
aws-sdk-s3 (~> 1, >= 1.123.0)
aws-sdk-ses (~> 1, >= 1.50.0)
aws-sdk-sesv2 (~> 1, >= 1.34.0)
aws-sdk-sns (~> 1, >= 1.61.0)
aws-sdk-sqs (~> 1, >= 1.56.0)
aws-sessionstore-dynamodb (~> 2)
concurrent-ruby (~> 1.3, >= 1.3.1)
railties (>= 7.0.0)
aws-sdk-s3 (1.176.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-rails (5.1.0)
aws-sdk-core (~> 3)
railties (>= 7.1.0)
aws-sdk-s3 (1.182.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-ses (1.78.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-sesv2 (1.67.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-sns (1.92.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-sqs (1.89.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-sqs (1.93.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sessionstore-dynamodb (2.2.0)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
rack (>= 2, < 4)
rack-session (>= 1, < 3)
aws-sigv4 (1.10.1)
aws-sigv4 (1.11.0)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt (3.1.20)
benchmark (0.4.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindex (0.8.1)
bootsnap (1.18.4)
msgpack (~> 1.2)
builder (3.3.0)
bullet (8.0.0)
bullet (8.0.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
Expand Down Expand Up @@ -192,14 +167,14 @@ GEM
responders
warden (~> 1.2.3)
docile (1.4.1)
dotenv (3.1.4)
dotenv-rails (3.1.4)
dotenv (= 3.1.4)
dotenv (3.1.7)
dotenv-rails (3.1.7)
dotenv (= 3.1.7)
railties (>= 6.1)
drb (2.2.1)
erubi (1.13.1)
execjs (2.10.0)
ffi (1.17.0)
ffi (1.17.1)
flipflop (2.8.0)
activesupport (>= 4.0)
terminal-table (>= 1.8)
Expand All @@ -218,7 +193,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.9.0)
json (2.10.1)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -231,16 +206,17 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.3)
language_server-protocol (3.17.0.4)
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.2)
logger (1.6.6)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
Expand All @@ -254,10 +230,9 @@ GEM
net-imap
net-pop
net-smtp
marc (1.2.0)
marc (1.3.0)
nokogiri (~> 1.0)
rexml
scrub_rb (>= 1.0.1, < 2)
unf
marcel (1.0.4)
matrix (0.4.2)
mini_mime (1.1.5)
Expand Down Expand Up @@ -298,7 +273,7 @@ GEM
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
parser (3.3.7.1)
ast (~> 2.4.1)
racc
pg (1.5.9)
Expand All @@ -309,7 +284,7 @@ GEM
date
stringio
public_suffix (6.0.1)
puma (6.5.0)
puma (6.6.0)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.11)
Expand Down Expand Up @@ -344,7 +319,7 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-mermaid_erd (0.5.0)
rails-mermaid_erd (0.6.0)
rails (>= 5.2)
railties (7.1.5.1)
actionpack (= 7.1.5.1)
Expand All @@ -361,37 +336,39 @@ GEM
ffi (~> 1.0)
rdoc (6.12.0)
psych (>= 4.0.0)
regexp_parser (2.9.3)
regexp_parser (2.10.0)
reline (0.6.0)
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.9)
rubocop (1.69.1)
rexml (3.4.1)
rubocop (1.73.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.2)
rubocop-ast (1.38.1)
parser (>= 3.3.1.0)
rubocop-rails (2.27.0)
rubocop-rails (2.30.2)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (1.13.0)
ruby-saml (1.17.0)
nokogiri (>= 1.13.10)
rexml
rubyzip (2.3.2)
rubyzip (2.4.1)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand All @@ -402,21 +379,20 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (5.4.0)
scout_apm (5.6.1)
parser
scrub_rb (1.0.1)
securerandom (0.4.1)
selectize-rails (0.12.6)
selenium-webdriver (4.27.0)
selenium-webdriver (4.29.1)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.22.0)
sentry-rails (5.22.4)
railties (>= 5.0)
sentry-ruby (~> 5.22.0)
sentry-ruby (5.22.0)
sentry-ruby (~> 5.22.4)
sentry-ruby (5.22.4)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
simple_form (5.3.1)
Expand Down Expand Up @@ -446,12 +422,11 @@ GEM
terser (1.2.5)
execjs (>= 0.3.0, < 3)
thor (1.3.2)
tilt (2.4.0)
tilt (2.6.0)
timecop (0.9.10)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.2.0)
unicode-display_width (2.6.0)
uniform_notifier (1.16.0)
warden (1.2.9)
Expand All @@ -476,7 +451,7 @@ PLATFORMS
ruby

DEPENDENCIES
administrate (~> 0.19.0)
administrate (~> 0.20.0)
annotate
aws-sdk-rails
aws-sdk-s3
Expand Down
4 changes: 0 additions & 4 deletions app/assets/stylesheets/administrate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
}
}

.new-hold-button {
margin-left: 2rem;
}

.new-submitter-button {
margin-top: 1rem;
}
Expand Down
55 changes: 34 additions & 21 deletions app/views/admin/holds/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and renders all form fields for a resource's editable attributes.
<%= t(
"administrate.form.errors",
pluralized_errors: pluralize(page.resource.errors.count, t("administrate.form.error")),
resource_name: display_resource_name(page.resource_name).singularize
resource_name: display_resource_name(page.resource_name, singular: true)
) %>
</h2>

Expand All @@ -33,34 +33,47 @@ and renders all form fields for a resource's editable attributes.
</div>
<% end %>

<% page.attributes.each do |attribute| -%>
<% if params[:thesis_id] && attribute.name == 'thesis' %>
<div class="panel">
<%= hidden_field_tag 'hold[thesis_id]', params[:thesis_id] %>
<div class="panel-heading">Thesis info</div>
<div class="panel-body">
<ul class="list-unbulleted">
<li>Title: <%= attribute.data.title %></li>
<li>Author(s): <%= attribute.data.users.map { |author| author.name }.join("; ") %></li>
<li>Degree(s): <%= attribute.data.degrees.map { |degree| degree.name_dw }.join("; ") %></li>
<li>Degree date: <%= attribute.data.grad_date %></li>
</ul>
</div>
</div>
<% else %>
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requireness(attribute) %>">
<% if attribute.name == 'dates_thesis_files_received' %>
<% page.attributes(controller.action_name).each do |title, attributes| -%>
<fieldset class="<%= "field-unit--nested" if title.present? %>">
<% if title.present? %>
<legend><%= t "helpers.label.#{f.object_name}.#{title}", default: title %></legend>
<% end %>
<% attributes.each do |attribute| %>

<% if params[:thesis_id] && attribute.name == 'thesis' %>
<div class="panel">
<%= hidden_field_tag 'hold[thesis_id]', params[:thesis_id] %>
<div class="panel-heading">Thesis info</div>
<div class="panel-body">
<ul class="list-unbulleted">
<li>Title: <%= attribute.data.title %></li>
<li>Author(s): <%= attribute.data.users.map { |author| author.name }.join("; ") %></li>
<li>Degree(s): <%= attribute.data.degrees.map { |degree| degree.name_dw }.join("; ") %></li>
<li>Degree date: <%= attribute.data.grad_date %></li>
</ul>
</div>
</div>
<% elsif attribute.name == 'dates_thesis_files_received'%>
<div class="field-unit__label">
<label for="hold_dates_files_received">Dates thesis files received</label>
</div>
<div class="field-unit__field">
<input type="text" id="hold_dates_files_received" value="<%= attribute.data %>" readonly>
</div>
<% else %>
<%= render_field attribute, f: f %>
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requireness(attribute) %>">
<%= render_field attribute, f: f %>

<% hint_key = "administrate.field_hints.#{page.resource_name}.#{attribute.name}" %>
<% if I18n.exists?(hint_key) -%>
<div class="field-unit__hint">
<%= I18n.t(hint_key) %>
</div>
<% end -%>
</div>
<% end %>
</div>
<% end %>
<% end %>
</fieldset>
<% end %>

<div class="form-actions">
Expand Down
Loading