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
3 changes: 2 additions & 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.20.0'
gem 'administrate', '~> 1.0.0'
gem 'aws-sdk-rails'
gem 'aws-sdk-s3'
gem 'aws-sdk-sqs'
Expand All @@ -17,6 +17,7 @@ gem 'csv'
gem 'delayed_job_active_record'
gem 'devise'
gem 'flipflop'
gem 'jquery-rails'
gem 'json'
gem 'kaminari'
gem 'lograge'
Expand Down
24 changes: 11 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,11 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.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)
administrate (1.0.0)
actionpack (>= 6.0, < 9.0)
actionview (>= 6.0, < 9.0)
activerecord (>= 6.0, < 9.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)
Expand Down Expand Up @@ -178,7 +175,7 @@ GEM
erb (6.0.1)
erubi (1.13.1)
execjs (2.10.0)
ffi (1.17.1)
ffi (1.17.3)
flipflop (2.8.0)
activesupport (>= 4.0)
terminal-table (>= 1.8)
Expand All @@ -195,7 +192,7 @@ GEM
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
jquery-rails (4.6.0)
jquery-rails (4.6.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand Down Expand Up @@ -397,7 +394,6 @@ GEM
scout_apm (6.0.2)
parser
securerandom (0.4.1)
selectize-rails (0.12.6)
selenium-webdriver (4.39.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand All @@ -422,8 +418,9 @@ GEM
simplecov_json_formatter (0.1.4)
skylight (7.0.0)
activesupport (>= 7.1.0)
sprockets (4.2.1)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
Expand All @@ -437,7 +434,7 @@ GEM
terser (1.2.6)
execjs (>= 0.3.0, < 3)
thor (1.5.0)
tilt (2.6.0)
tilt (2.7.0)
timecop (0.9.10)
timeout (0.6.0)
tsort (0.2.0)
Expand Down Expand Up @@ -473,7 +470,7 @@ PLATFORMS
ruby

DEPENDENCIES
administrate (~> 0.20.0)
administrate (~> 1.0.0)
annotate
aws-sdk-rails
aws-sdk-s3
Expand All @@ -491,6 +488,7 @@ DEPENDENCIES
devise
dotenv-rails
flipflop
jquery-rails
json
kaminari
letter_opener
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/holds/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and renders all form fields for a resource's editable attributes.
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form
%>

<%= form_for([namespace, page.resource], html: { class: "form" }) do |f| %>
<%= form_with(model: page.resource, url: [namespace, page.resource], scope: page.resource, local: true, class: "form") do |f| %>
<% if page.resource.errors.any? %>
<div id="error_explanation">
<h2>
Expand Down
64 changes: 39 additions & 25 deletions app/views/admin/theses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,69 @@ as well as a link to its edit page.
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show
%>

<% content_for(:title) { t("administrate.actions.show_resource", name: page.resource.title) } %>
<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %>
<% content_for(:custom_stylesheets) { stylesheet_link_tag "administrate" } %>

<header class="main-content__header">
<h1 class="main-content__page-title">
<%= content_for(:title) %>
</h1>

<%= content_for(:header_middle) %>

<div>
<%= link_to(
t("administrate.actions.edit_resource", name: page.resource.title),
t("administrate.actions.edit_resource", name: page.page_title),
[:edit, namespace, page.resource],
class: "button",
) if accessible_action?(page.resource, :edit) %>
<%= link_to(

<%= button_to(
t("administrate.actions.destroy"),
[namespace, page.resource],
class: "button button--danger",
method: :delete,
data: { confirm: t("administrate.actions.confirm") }
data: { turbo_confirm: t("administrate.actions.confirm") }
) if accessible_action?(page.resource, :destroy) %>
<%= link_to(
t("administrate.actions.new_resource", name: 'hold'),
[:new, namespace, :hold, {thesis_id: page.resource.id}],
class: "button",
) if accessible_action?('hold', :new) %>
</div>

<%= content_for(:header_last) %>
</header>

<section class="main-content__body">
<dl>
<% page.attributes.each do |title, attributes| %>
<fieldset class="<%= "field-unit--nested" if title.present? %>">
<% if title.present? %>
<legend><%= t "helpers.label.#{page.resource_name}.#{title}", default: title %></legend>
<% end %>
<%= content_for(:before_main) %>

<% if content_for?(:main) %>
<%= content_for(:main) %>
<% else %>
<section class="main-content__body">
<dl>
<% page.attributes.each do |title, attributes| %>
<fieldset class="<%= "field-unit--nested" if title.present? %>">
<% if title.present? %>
<legend><%= t "helpers.label.#{page.resource_name}.#{title}", default: title %></legend>
<% end %>

<% attributes.each do |attribute| %>
<dt class="attribute-label" id="<%= attribute.name %>">
<%= t(
"helpers.label.#{resource_name}.#{attribute.name}",
default: page.resource.class.human_attribute_name(attribute.name),
) %>
</dt>

<% attributes.each do |attribute| %>
<dt class="attribute-label" id="<%= attribute.name %>">
<%= t(
"helpers.label.#{resource_name}.#{attribute.name}",
default: page.resource.class.human_attribute_name(attribute.name),
) %>
</dt>
<dd class="attribute-data attribute-data--<%=attribute.html_class%>">
<%= render_field attribute, page: page %>
</dd>
<% end %>
</fieldset>
<% end %>
</dl>
</section>
<% end %>

<dd class="attribute-data attribute-data--<%=attribute.html_class%>"
><%= render_field attribute, page: page %></dd>
<% end %>
</fieldset>
<% end %>
</dl>
</section>
<%= content_for(:after_main) %>
2 changes: 1 addition & 1 deletion app/views/layouts/admin/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ By default, it renders:
<%= content_for(:title) %> - <%= application_title %>
</title>
<%= render "stylesheet" %>
<%= stylesheet_link_tag "administrate" %>
<%= stylesheet_link_tag "administrate", data: { turbo_track: "reload" } %>
<%= csrf_meta_tags %>
<%= csp_meta_tag if defined?(csp_meta_tag) %>
</head>
Expand Down