Skip to content

Commit

Permalink
Works now in the reset task, with MODS being displayed. TODO: Proper …
Browse files Browse the repository at this point in the history
…layout for title.
  • Loading branch information
dgcliff committed Jan 3, 2024
1 parent 2dffc0f commit 30b1f5b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.22
2.3.23
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ GEM
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
atlas_rb (0.0.27)
atlas_rb (0.0.31)
faraday (~> 2.7)
faraday-multipart (~> 1)
attr_json (1.4.0)
Expand Down Expand Up @@ -153,7 +153,7 @@ GEM
railties (>= 5.0.0)
faker (3.0.0)
i18n (>= 1.8.11, < 2)
faraday (2.7.12)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

class WorksController < ApplicationController
def show
@work = Work.find(params[:id])
# @work = Work.find(params[:id])
@work = AtlasRb::Work.find(params[:id])
@mods = AtlasRb::Work.mods(params[:id])
end

def new
Expand Down
3 changes: 3 additions & 0 deletions app/models/work.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Work
include ActiveModel::API
end
23 changes: 12 additions & 11 deletions app/views/works/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
- content_for(:container_header) do
= breadcrumbs

= render partial: "shared/mods", locals: {resource: @work}
-# = render partial: "shared/mods", locals: {resource: @work}
= @mods.html_safe

- @work.children.each do |c|
= "#{c.type} - #{c.children.count}"
%ul
- c.children.each do |b|
%li
= b.file_identifiers.inspect
%br
-# - @work.children.each do |c|
-# = "#{c.type} - #{c.children.count}"
-# %ul
-# - c.children.each do |b|
-# %li
-# = b.file_identifiers.inspect
-# %br
%br
-# %br
%pre
= JSON.pretty_generate(JSON.parse(@work.mods.to_json))
-# %pre
-# = JSON.pretty_generate(JSON.parse(@work.mods.to_json))
4 changes: 2 additions & 2 deletions lib/tasks/reset.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace :reset do
collection = AtlasRb::Collection.create(community['id'])['collection']
AtlasRb::Community.update(collection['id'], '/home/cerberus/web/spec/fixtures/files/collection-mods.xml')

# work = AtlasRb::Work.create(collection['id'])['work']
# AtlasRb::Community.update(work['id'], '/home/cerberus/web/spec/fixtures/files/work-mods.xml')
work = AtlasRb::Work.create(collection['id'])['work']
AtlasRb::Community.update(work['id'], '/home/cerberus/web/spec/fixtures/files/work-mods.xml')
end

desc 'Clean solr and dbs'
Expand Down

0 comments on commit 30b1f5b

Please sign in to comment.