artk 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/app/controllers/artk/application_controller.rb +1 -0
- data/app/controllers/artk/components_controller.rb +14 -9
- data/app/controllers/artk/resources_controller.rb +15 -13
- data/app/models/artk/resource.rb +2 -2
- data/app/views/artk/components/index.html.erb +0 -0
- data/app/views/artk/components/show.html.erb +0 -0
- data/app/views/artk/resources/index.html.erb +0 -0
- data/app/views/artk/resources/show.html.erb +0 -0
- data/app/views/layouts/{artk/application.html.erb → artk.html.erb} +0 -0
- data/lib/artk/version.rb +1 -1
- metadata +10 -24
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDE3MGM0Mjc4NzFkOTc1NTk5ZTNhZWRmODkzN2ExNWEzZTMxMGY5OQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGMyZWRmMDk0OTY1YzMwY2M2YjU3ZTkzYmE1NTIwYmM3MmQ2ZGM0Mg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MzQ4YTBiYjlmMjcxYmQ5MDZhYjFjNGNkYjY2NGI1MzE2YzJkNzJkNjY3ODUz
|
10
|
+
ZjgxNjkzNGE2ZDEyZTZkNGIyOGMwOTM2NTNlZjdkYzE2Y2ZjZDZjNzdlMjQy
|
11
|
+
N2NkMzQ2MmRkMzQzMWY3NmVlOGIwMzdjOWNjN2NiZGM0Njc1ODk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NDA1YWMwYWZlNGE4ZWJmZmY4ZWM1NmExNjIyOTA1OTc2MmY3ODRiYTIwZTNi
|
14
|
+
NWExZmM1YzkzNTE3YjM4YzA5ZmExYzhjMWQzZjVjZDQ0ODMyYTY5MTIyZmQ5
|
15
|
+
Njg5MWU1MDc2YmUwZmRmNTk0MWI4OWU0YzliZjMwZTI2Y2IyZGI=
|
@@ -3,19 +3,24 @@ class ComponentsController < Artk::ApplicationController
|
|
3
3
|
|
4
4
|
def index
|
5
5
|
@results = Resource.find_by_ead_id(params[:resource_id]).all_series.collect { |s| s.pid_and_title }
|
6
|
-
|
7
|
-
format.html { render :layout => false, :text => @results.to_json }
|
8
|
-
format.json { render :layout => false, :text => @results.to_json }
|
9
|
-
format.js { render :layout => false, :text => @results.to_json }
|
10
|
-
end
|
6
|
+
return_response
|
11
7
|
end
|
12
8
|
|
13
9
|
def show
|
14
10
|
@results = Resource.find_by_ead_id(params[:resource_id]).component(params[:id])
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
return_response
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def return_response
|
17
|
+
if request.xhr?
|
18
|
+
render :layout => false, :text => @results.to_json
|
19
|
+
else
|
20
|
+
respond_to do |format|
|
21
|
+
format.html
|
22
|
+
format.json { render :layout => false, :text => @results.to_json }
|
23
|
+
end
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
@@ -3,25 +3,16 @@ class ResourcesController < Artk::ApplicationController
|
|
3
3
|
|
4
4
|
def index
|
5
5
|
@results = return_resource_results.collect { |fa| fa.pid_and_title }
|
6
|
-
|
7
|
-
format.html { render :layout => false, :text => @results.to_json }
|
8
|
-
format.json { render :layout => false, :text => @results.to_json }
|
9
|
-
format.js { render :layout => false, :text => @results.to_json }
|
10
|
-
end
|
6
|
+
return_response
|
11
7
|
end
|
12
8
|
|
13
9
|
def show
|
14
|
-
@
|
15
|
-
if @
|
10
|
+
@results = Resource.find_by_ead_id(params[:id])
|
11
|
+
if @results.nil?
|
16
12
|
redirect_to :status => 404
|
17
13
|
else
|
18
|
-
|
19
|
-
format.html { render :layout => false, :text => @resource.to_json }
|
20
|
-
format.json { render :layout => false, :text => @resource.to_json }
|
21
|
-
format.js { render :layout => false, :text => @resource.to_json }
|
22
|
-
end
|
14
|
+
return_response
|
23
15
|
end
|
24
|
-
|
25
16
|
end
|
26
17
|
|
27
18
|
private
|
@@ -34,5 +25,16 @@ class ResourcesController < Artk::ApplicationController
|
|
34
25
|
end
|
35
26
|
end
|
36
27
|
|
28
|
+
def return_response
|
29
|
+
if request.xhr?
|
30
|
+
render :layout => false, :text => @results.to_json
|
31
|
+
else
|
32
|
+
respond_to do |format|
|
33
|
+
format.html
|
34
|
+
format.json { render :layout => false, :text => @results.to_json }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
37
39
|
end
|
38
40
|
end
|
data/app/models/artk/resource.rb
CHANGED
@@ -12,7 +12,7 @@ class Resource < Artk::Base
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.finding_aids
|
15
|
-
self.where('eadFaUniqueIdentifier != "" and findingAidTitle !=""')
|
15
|
+
self.where('eadFaUniqueIdentifier != "" and findingAidTitle !=""').order("findingAidTitle")
|
16
16
|
end
|
17
17
|
|
18
18
|
# TODO: sanitize params?
|
@@ -37,7 +37,7 @@ class Resource < Artk::Base
|
|
37
37
|
fifth = fourth.collect { |r| retrieve_additional_series(r) }.flatten unless fourth.empty?
|
38
38
|
sixth = fifth.collect { |r| retrieve_additional_series(r) }.flatten unless fifth.empty?
|
39
39
|
|
40
|
-
return first + second + third + fourth + fifth + sixth
|
40
|
+
return (first + second + third + fourth + fifth + sixth).sort
|
41
41
|
end
|
42
42
|
|
43
43
|
# Returns a single Artk::Component for a given ref id
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/artk/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Adam Wead
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: sqlite3
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: mysql2
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec-rails
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: debugger
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>='
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>='
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -109,7 +98,11 @@ files:
|
|
109
98
|
- app/models/artk/base.rb
|
110
99
|
- app/models/artk/component.rb
|
111
100
|
- app/models/artk/resource.rb
|
112
|
-
- app/views/
|
101
|
+
- app/views/artk/components/index.html.erb
|
102
|
+
- app/views/artk/components/show.html.erb
|
103
|
+
- app/views/artk/resources/index.html.erb
|
104
|
+
- app/views/artk/resources/show.html.erb
|
105
|
+
- app/views/layouts/artk.html.erb
|
113
106
|
- config/routes.rb
|
114
107
|
- lib/artk/engine.rb
|
115
108
|
- lib/artk/version.rb
|
@@ -121,32 +114,25 @@ files:
|
|
121
114
|
homepage: https://github.com/awead/artk
|
122
115
|
licenses:
|
123
116
|
- Apache-2
|
117
|
+
metadata: {}
|
124
118
|
post_install_message:
|
125
119
|
rdoc_options: []
|
126
120
|
require_paths:
|
127
121
|
- lib
|
128
122
|
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
123
|
requirements:
|
131
124
|
- - ! '>='
|
132
125
|
- !ruby/object:Gem::Version
|
133
126
|
version: '0'
|
134
|
-
segments:
|
135
|
-
- 0
|
136
|
-
hash: -1506618296910395185
|
137
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
128
|
requirements:
|
140
129
|
- - ! '>='
|
141
130
|
- !ruby/object:Gem::Version
|
142
131
|
version: '0'
|
143
|
-
segments:
|
144
|
-
- 0
|
145
|
-
hash: -1506618296910395185
|
146
132
|
requirements: []
|
147
133
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.8
|
134
|
+
rubygems_version: 2.1.8
|
149
135
|
signing_key:
|
150
|
-
specification_version:
|
136
|
+
specification_version: 4
|
151
137
|
summary: Provides a Rails interface to Archivist's Toolkit
|
152
138
|
test_files: []
|