ld4l_virtual_collection 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +34 -0
- data/.travis.yml +14 -0
- data/CHANGES.md +12 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +14 -0
- data/README.md +128 -0
- data/Rakefile +34 -0
- data/app/assets/images/ld4l_virtual_collection/loading_spinner.gif +0 -0
- data/app/assets/javascripts/ld4l_virtual_collection/application.js +19 -0
- data/app/assets/javascripts/ld4l_virtual_collection/collections.js +2 -0
- data/app/assets/javascripts/ld4l_virtual_collection/items.js +2 -0
- data/app/assets/stylesheets/ld4l_virtual_collection/_bootstrap-custom.scss +50 -0
- data/app/assets/stylesheets/ld4l_virtual_collection/application.css.scss +22 -0
- data/app/assets/stylesheets/ld4l_virtual_collection/collections.css.scss +4 -0
- data/app/assets/stylesheets/ld4l_virtual_collection/items.css.scss +4 -0
- data/app/assets/stylesheets/ld4l_virtual_collection/my_virtual_collections.css.scss +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/ld4l_virtual_collection/application_controller.rb +9 -0
- data/app/controllers/ld4l_virtual_collection/collections_controller.rb +101 -0
- data/app/controllers/ld4l_virtual_collection/items_controller.rb +94 -0
- data/app/controllers/ld4l_virtual_collection/my_virtual_collections_controller.rb +189 -0
- data/app/controllers/ld4l_virtual_collection/notes_controller.rb +84 -0
- data/app/controllers/ld4l_virtual_collection/tags_controller.rb +105 -0
- data/app/helpers/ld4l_virtual_collection/application_helper.rb +4 -0
- data/app/helpers/ld4l_virtual_collection/collections_helper.rb +4 -0
- data/app/helpers/ld4l_virtual_collection/items_helper.rb +4 -0
- data/app/models/ld4l_virtual_collection/collection.rb +47 -0
- data/app/models/ld4l_virtual_collection/item.rb +50 -0
- data/app/models/ld4l_virtual_collection/note.rb +52 -0
- data/app/models/ld4l_virtual_collection/tag.rb +94 -0
- data/app/views/layouts/ld4l_virtual_collection/application.html.erb +14 -0
- data/app/views/ld4l_virtual_collection/collections/_form.html.erb +28 -0
- data/app/views/ld4l_virtual_collection/collections/edit.html.erb +13 -0
- data/app/views/ld4l_virtual_collection/collections/index.html.erb +30 -0
- data/app/views/ld4l_virtual_collection/collections/new.html.erb +12 -0
- data/app/views/ld4l_virtual_collection/collections/show.html.erb +43 -0
- data/app/views/ld4l_virtual_collection/items/_collection_info.html.erb +14 -0
- data/app/views/ld4l_virtual_collection/items/_form.html.erb +25 -0
- data/app/views/ld4l_virtual_collection/items/edit.html.erb +14 -0
- data/app/views/ld4l_virtual_collection/items/index.html.erb +24 -0
- data/app/views/ld4l_virtual_collection/items/new.html.erb +14 -0
- data/app/views/ld4l_virtual_collection/items/show.html.erb +23 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_collection_lists.html.erb +82 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_edit_collection_modal.html.erb +20 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_form_collection.html.erb +51 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_form_collection_item.html.erb +48 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_form_collection_items_query.html.erb +37 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_form_item_note.html.erb +31 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_form_item_tag.html.erb +30 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_modals.html.erb +8 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_new_collection_item_modal.html.erb +20 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_new_collection_items_by_query_modal.html.erb +20 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_new_collection_modal.html.erb +20 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_header.html.erb +17 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_items.html.erb +121 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_range.html.erb +44 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/edit_collection_modal.js.erb +1 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/index.html.erb +4 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/new_collection_item_modal.js.erb +1 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/new_collection_items_by_query_modal.js.erb +1 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/new_collection_modal.js.erb +1 -0
- data/app/views/ld4l_virtual_collection/my_virtual_collections/show.html.erb +14 -0
- data/bin/rails +12 -0
- data/config/routes.rb +16 -0
- data/ld4l_virtual_collection.gemspec +50 -0
- data/lib/ld4l_virtual_collection.rb +34 -0
- data/lib/ld4l_virtual_collection/configuration.rb +86 -0
- data/lib/ld4l_virtual_collection/engine.rb +23 -0
- data/lib/ld4l_virtual_collection/version.rb +3 -0
- data/lib/tasks/ld4l_virtual_collection_tasks.rake +4 -0
- data/test/controllers/ld4l_virtual_collection/collections_controller_test.rb +51 -0
- data/test/controllers/ld4l_virtual_collection/items_controller_test.rb +51 -0
- data/test/controllers/ld4l_virtual_collection/my_virtual_collections_controller_test.rb +51 -0
- data/test/controllers/ld4l_virtual_collection/virtual_collections_controller_test.rb +51 -0
- data/test/dummy/Gemfile +20 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +78 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/rdf_repositories.rb +32 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/ld4l_virtual_collection/collections.yml +11 -0
- data/test/fixtures/ld4l_virtual_collection/items.yml +11 -0
- data/test/fixtures/ld4l_virtual_collection/my_virtual_collections.yml +11 -0
- data/test/fixtures/ld4l_virtual_collection/virtual_collections.yml +9 -0
- data/test/helpers/ld4l_virtual_collection/collections_helper_test.rb +6 -0
- data/test/helpers/ld4l_virtual_collection/items_helper_test.rb +6 -0
- data/test/helpers/ld4l_virtual_collection/my_virtual_collections_helper_test.rb +6 -0
- data/test/helpers/ld4l_virtual_collection/virtual_collections_helper_test.rb +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/ld4l_virtual_collection_test.rb +7 -0
- data/test/models/ld4l_virtual_collection/collection_test.rb +9 -0
- data/test/models/ld4l_virtual_collection/item_test.rb +9 -0
- data/test/models/ld4l_virtual_collection/my_virtual_collection_test.rb +9 -0
- data/test/models/ld4l_virtual_collection/virtual_collection_test.rb +9 -0
- data/test/test_helper.rb +17 -0
- metadata +544 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= form_tag( item_tags_path(item_id), method: form_method, id: form_id, class: form_class ) do %>
|
2
|
+
|
3
|
+
<% if @tag.errors.any? %>
|
4
|
+
<div id="error_explanation">
|
5
|
+
<h2><%= pluralize(tag.errors.count, "error") %> prohibited this tag from being saved:</h2>
|
6
|
+
|
7
|
+
<ul>
|
8
|
+
<% @tag.errors.full_messages.each do |message| %>
|
9
|
+
<li><%= message %></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= hidden_field( :tag, :old_tags, :value => tag_values ) %>
|
16
|
+
<%= hidden_field( :tag, :collection_id, :value => collection_id ) %>
|
17
|
+
<%= hidden_field( :tag, :item_id, :value => item_id ) %>
|
18
|
+
|
19
|
+
<div class="field new_tag_field">
|
20
|
+
<%= label_tag("new_tags_#{count}", "Tags:") %>
|
21
|
+
<%= text_field "tag", "new_tags", :id => "new_tags_#{count}", "size" => 80, "value" => tag_values %>
|
22
|
+
</div>
|
23
|
+
<p class="field_instructions">NOTE: Separate tags with semicolons.</p>
|
24
|
+
<div class="form-footer">
|
25
|
+
<button id="reset-tags-btn_<%=count%>" class="link_style_button" type="button"
|
26
|
+
onclick="$('#new_tags_<%=count%>').val('<%=tag_values%>');">Reset</button>
|
27
|
+
<button id="set-tags-btn_<%=count%>" class="link_style_button" type="submit"
|
28
|
+
onclick="document.getElementById('cl_loading_spinner').style.visibility = 'visible';">Set Tags</button>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div id="new-collection-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="new-collection-label" aria-hidden="true"></div>
|
2
|
+
|
3
|
+
<div id="edit-collection-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="edit-collection-label" aria-hidden="true"></div>
|
4
|
+
|
5
|
+
<div id="new-collection-item-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="new-collection-item-label" aria-hidden="true"></div>
|
6
|
+
|
7
|
+
<div id="new-collection-items-by-query-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="new-collection-items-by-query-label" aria-hidden="true"></div>
|
8
|
+
|
data/app/views/ld4l_virtual_collection/my_virtual_collections/_new_collection_item_modal.html.erb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="modal-dialog">
|
2
|
+
<div class="modal-content">
|
3
|
+
<div class="modal-header">
|
4
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
5
|
+
<h3 id="new-collection-item-label">New Item</h3>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<%=
|
9
|
+
render :partial => 'form_collection_item',
|
10
|
+
:locals => {
|
11
|
+
:form_controller => 'items',
|
12
|
+
:form_action => 'create',
|
13
|
+
:form_class => 'new_item',
|
14
|
+
:form_id => 'new_item',
|
15
|
+
:form_method => 'post',
|
16
|
+
:modal_id => 'new-collection-item-modal' }
|
17
|
+
%>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="modal-dialog">
|
2
|
+
<div class="modal-content">
|
3
|
+
<div class="modal-header">
|
4
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
5
|
+
<h3 id="new-collection-items-by-query-label">New Item</h3>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<%=
|
9
|
+
render :partial => 'form_collection_items_query',
|
10
|
+
:locals => {
|
11
|
+
:form_controller => 'item',
|
12
|
+
:form_action => 'create',
|
13
|
+
:form_class => 'new_items_by_query',
|
14
|
+
:form_id => 'new_items_by_query',
|
15
|
+
:form_method => 'post',
|
16
|
+
:modal_id => 'new-collection-items_by_query-modal' }
|
17
|
+
%>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="modal-dialog">
|
2
|
+
<div class="modal-content">
|
3
|
+
<div class="modal-header">
|
4
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
5
|
+
<h3 id="new-collection-label">New Collection</h3>
|
6
|
+
</div>
|
7
|
+
<div class="modal-body">
|
8
|
+
<%=
|
9
|
+
render :partial => 'form_collection',
|
10
|
+
:locals => {
|
11
|
+
:form_controller => 'collections',
|
12
|
+
:form_action => 'create',
|
13
|
+
:form_class => 'new_collection',
|
14
|
+
:form_id => 'new_collection',
|
15
|
+
:form_method => 'post',
|
16
|
+
:modal_id => 'new-collection-modal' }
|
17
|
+
%>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_header.html.erb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="well clearfix virtual-collection-header-title">
|
2
|
+
<div class="row_fluid">
|
3
|
+
<h2><%= @collection.title if @collection %></h2>
|
4
|
+
<div class="add-uri">
|
5
|
+
<%= link_to content_tag(:i, '', :class => "fa fa-plus-circle"), new_collection_item_modal_path(@collection.id.to_s),
|
6
|
+
{:remote => true, 'data-toggle' => "modal", 'data-target' => '#new-collection-item-modal' } %>
|
7
|
+
<%= link_to "Add External Resource", new_collection_item_modal_path(@collection.id.to_s),
|
8
|
+
{:remote => true, 'data-toggle' => "modal", 'data-target' => '#new-collection-item-modal' } %>
|
9
|
+
</div>
|
10
|
+
<div class="add-by-query">
|
11
|
+
<%= link_to content_tag(:i, '', :class => "fa fa-plus-circle"), new_collection_item_modal_path(@collection.id.to_s),
|
12
|
+
{:remote => true, 'data-toggle' => "modal", 'data-target' => '#new-collection-item-modal' } %>
|
13
|
+
<%= link_to "Add By Query", new_collection_item_modal_path(@collection.id.to_s),
|
14
|
+
{:remote => true, 'data-toggle' => "modal", 'data-target' => '#new-collection-item-modal' } %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_items.html.erb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
<div id="documents">
|
2
|
+
|
3
|
+
<%
|
4
|
+
count = @first_idx
|
5
|
+
|
6
|
+
@items.each do |item|
|
7
|
+
item_metadata = item[:metadata]
|
8
|
+
item_proxy_resource = item[:proxy]
|
9
|
+
item_proxy_for = item[:proxy_for]
|
10
|
+
item_note = item[:note]
|
11
|
+
item_tag = item[:tag]
|
12
|
+
item_tags = item[:tags]
|
13
|
+
item_title = item_metadata.title
|
14
|
+
item_title = item_metadata.uri unless item_title && item_title.size > 0
|
15
|
+
|
16
|
+
if item_metadata.is_book?
|
17
|
+
doc_class = 'blacklight-book'
|
18
|
+
icon = 'fa fa-book'
|
19
|
+
elsif item_metadata.is_video?
|
20
|
+
doc_class = 'blacklight-video'
|
21
|
+
icon = 'fa fa-film'
|
22
|
+
elsif item_metadata.is_music?
|
23
|
+
doc_class = 'blacklight-musical-recording'
|
24
|
+
icon = 'fa fa-music'
|
25
|
+
else
|
26
|
+
doc_class = ''
|
27
|
+
icon = ''
|
28
|
+
end
|
29
|
+
%>
|
30
|
+
<div class="document <%= doc_class %> clearfix" data-bibid="<%= item_metadata.local_id %>">
|
31
|
+
<div class="iconcover bookcover" id="OCLC:<%= item_metadata.oclc_id %>" data-oclc="<%= item_metadata.oclc_id %>">
|
32
|
+
<img class="img-polaroid" src="/assets/cornell/layout/placeholder-item-a090c5301bffac37449f945ee8060d06.png" alt="">
|
33
|
+
<i class="<%= icon %>"></i>
|
34
|
+
</div>
|
35
|
+
<div class="document-data">
|
36
|
+
<div class="remove-item">
|
37
|
+
<%= link_to 'Remove', collection_item_path(@collection.id,item_proxy_resource.id), method: :delete, data: { confirm: 'Are you sure?' } %>
|
38
|
+
</div>
|
39
|
+
<h2 class="blacklight-title_display">
|
40
|
+
<%= count %>.
|
41
|
+
<a href="<%= item_proxy_for %>" data-counter="6"><%= item_title %></a>
|
42
|
+
<span class="blacklight-pub_date_display"><%= item_metadata.pub_date %></span>
|
43
|
+
</h2>
|
44
|
+
<span class="blacklight-title_uniform_display"></span>
|
45
|
+
<div class="data-block">
|
46
|
+
<span class="blacklight-author_display"><%= item_metadata.author %></span>
|
47
|
+
<span class="format">
|
48
|
+
<i class="<%= icon %>"></i>
|
49
|
+
Book
|
50
|
+
</span>
|
51
|
+
<span class="blacklight-pub_info_display"><%= item_metadata.pub_info %></span>
|
52
|
+
<span class="blacklight-language_display"><%= item_metadata.language %></span>
|
53
|
+
<span class="blacklight-edition_display"><%= item_metadata.edition %></span>
|
54
|
+
</div>
|
55
|
+
<div class="data-block">
|
56
|
+
<span class="blacklight-source_display">Source: <%= item_metadata.source %></span>
|
57
|
+
</div>
|
58
|
+
<%- if item_metadata.local_id && item_metadata.local_id.size > 0 %>
|
59
|
+
<%-
|
60
|
+
# <div id="blacklight-avail-<%= item_metadata.local_id % >" class="status">
|
61
|
+
# <i class="fa fa-clock-o" title="Available by request"></i>
|
62
|
+
# <span class="location"><%= item_metadata.local_location % ></span>
|
63
|
+
# <span class="callnumber"><%= item_metadata.local_callnumber % ></span>
|
64
|
+
# </div>
|
65
|
+
# <abbr class="unapi-id" title="<%= item_metadata.local_id % >"></abbr>
|
66
|
+
%>
|
67
|
+
|
68
|
+
<div class="item-notes-and-tags">
|
69
|
+
<a data-toggle="collapse" href="#collapse_<%=count%>" aria-expanded="false" aria-controls="collapse_<%=count%>">
|
70
|
+
Show/Hide Notes and Tags
|
71
|
+
</a>
|
72
|
+
<div class="collapse" id="collapse_<%=count%>">
|
73
|
+
<div class="well">
|
74
|
+
<div class="item-note">
|
75
|
+
<%=
|
76
|
+
@note = item_note
|
77
|
+
render :partial => 'form_item_note',
|
78
|
+
:locals => {
|
79
|
+
:form_controller => 'notes',
|
80
|
+
:form_action => 'update',
|
81
|
+
:form_class => 'update_note',
|
82
|
+
:form_id => "update_note_#{count}",
|
83
|
+
:form_method => 'patch',
|
84
|
+
:note_div => "collapse_#{count}",
|
85
|
+
:collection_id => @collection.id,
|
86
|
+
:item_id => item_proxy_resource.id,
|
87
|
+
:count => count }
|
88
|
+
%>
|
89
|
+
</div>
|
90
|
+
<hr>
|
91
|
+
<div class="item-tags">
|
92
|
+
<%=
|
93
|
+
@tag = item_tag
|
94
|
+
render :partial => 'form_item_tag',
|
95
|
+
:locals => {
|
96
|
+
:form_controller => 'tags',
|
97
|
+
:form_action => 'manage_all',
|
98
|
+
:form_class => 'manage_tags',
|
99
|
+
:form_id => "manage_tags_#{count}",
|
100
|
+
:form_method => 'patch',
|
101
|
+
:collection_id => @collection.id,
|
102
|
+
:item_id => item_proxy_resource.id,
|
103
|
+
:count => count,
|
104
|
+
:tag_values => item_tags }
|
105
|
+
%>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<%- end %>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<%
|
117
|
+
count += 1
|
118
|
+
break if count > 20
|
119
|
+
end
|
120
|
+
%>
|
121
|
+
</div>
|
data/app/views/ld4l_virtual_collection/my_virtual_collections/_selected_collection_range.html.erb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
<div id="sortAndPerPage" class="clearfix">
|
2
|
+
<div class="page_links">
|
3
|
+
« Previous |
|
4
|
+
<span class="page_entries">
|
5
|
+
<strong><%= @first_idx %></strong>
|
6
|
+
-
|
7
|
+
<strong><%= @last_idx %></strong>
|
8
|
+
of
|
9
|
+
<strong><%= @num_items %></strong>
|
10
|
+
| Next »
|
11
|
+
</span>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="search-widgets pull-right"><div id="sort-dropdown" class="btn-group">
|
15
|
+
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
16
|
+
Sort by relevance <span class="caret"></span>
|
17
|
+
</button>
|
18
|
+
|
19
|
+
<ul class="dropdown-menu" role="menu">
|
20
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=score+desc%2C+pub_date_sort+desc%2C+title_sort+asc">relevance</a></li>
|
21
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=pub_date_sort+desc%2C+title_sort+asc">year descending</a></li>
|
22
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=pub_date_sort+asc%2C+title_sort+asc">year ascending</a></li>
|
23
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=author_sort+asc%2C+title_sort+asc">author A-Z</a></li>
|
24
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=author_sort+desc%2C+title_sort+asc">author Z-A</a></li>
|
25
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=title_sort+asc%2C+pub_date_sort+desc">title A-Z</a></li>
|
26
|
+
<li><a href="/?q=archery&search_field=all_fields&sort=title_sort+desc%2C+pub_date_sort+desc">title Z-A</a></li>
|
27
|
+
</ul>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<span class="sr-only">Number of results to display per page</span>
|
31
|
+
<div id="per_page-dropdown" class="btn-group">
|
32
|
+
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
33
|
+
20 per page <span class="caret"></span>
|
34
|
+
</button>
|
35
|
+
<ul class="dropdown-menu" role="menu">
|
36
|
+
<li><a href="/?per_page=10&q=archery&search_field=all_fields">10<span class="hide-text"> per page</span></a></li>
|
37
|
+
<li><a href="/?per_page=20&q=archery&search_field=all_fields">20<span class="hide-text"> per page</span></a></li>
|
38
|
+
<li><a href="/?per_page=50&q=archery&search_field=all_fields">50<span class="hide-text"> per page</span></a></li>
|
39
|
+
<li><a href="/?per_page=100&q=archery&search_field=all_fields">100<span class="hide-text"> per page</span></a></li>
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
</div>
|
44
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#edit-collection-modal").html("<%= escape_javascript(render 'edit_collection_modal') %>");
|
data/app/views/ld4l_virtual_collection/my_virtual_collections/new_collection_item_modal.js.erb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
$("#new-collection-item-modal").html("<%= escape_javascript(render 'new_collection_item_modal') %>");
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#new-collection-items-by-query-modal").html("<%= escape_javascript(render 'new_collection_items_by_query_modal') %>");
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#new-collection-modal").html("<%= escape_javascript(render 'new_collection_modal') %>");
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="row">
|
2
|
+
|
3
|
+
<%= render 'collection_lists' %>
|
4
|
+
|
5
|
+
<div class="col-sm-9 main-text">
|
6
|
+
<%= render 'selected_collection_header' %>
|
7
|
+
<% if @items && @items.size > 0 %>
|
8
|
+
<%= render 'selected_collection_range' %>
|
9
|
+
<%= render 'selected_collection_items' %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<%= render 'modals' %>
|
14
|
+
</div>
|
data/bin/rails
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
3
|
+
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/ld4l_virtual_collection/engine', __FILE__)
|
6
|
+
|
7
|
+
# Set up gems listed in the Gemfile.
|
8
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
9
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
10
|
+
|
11
|
+
require 'rails/all'
|
12
|
+
require 'rails/engine/commands'
|
data/config/routes.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Ld4lVirtualCollection::Engine.routes.draw do
|
2
|
+
|
3
|
+
get "my_virtual_collections/new_collection_modal" => 'my_virtual_collections#new_collection_modal', :as => :new_collection_modal
|
4
|
+
get "my_virtual_collections/edit_collection_modal/:id" => 'my_virtual_collections#edit_collection_modal', :as => :edit_collection_modal
|
5
|
+
get "my_virtual_collections/new_collection_item_modal/:id" => 'my_virtual_collections#new_collection_item_modal', :as => :new_collection_item_modal
|
6
|
+
get "my_virtual_collections/new_collection_items_by_query_modal/:id" => 'my_virtual_collections#new_collection_items_by_query_modal', :as => :new_collection_items_by_query_modal
|
7
|
+
resources :my_virtual_collections
|
8
|
+
|
9
|
+
patch "item/:id/tags/" => 'tags#manage_all', :as => :item_tags
|
10
|
+
resources :collections do
|
11
|
+
resources :items do
|
12
|
+
resources :notes, shallow: true
|
13
|
+
resources :tags, shallow: true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
|
3
|
+
# Maintain your gem's version:
|
4
|
+
require "ld4l_virtual_collection/version"
|
5
|
+
|
6
|
+
# Describe your gem and declare its dependencies:
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "ld4l_virtual_collection"
|
9
|
+
s.version = Ld4lVirtualCollection::VERSION
|
10
|
+
s.authors = ["E. Lynette Rayle"]
|
11
|
+
s.email = ["elr37@cornell.edu"]
|
12
|
+
s.homepage = "https://github.com/elrayle/ld4l_virtual_collection"
|
13
|
+
s.summary = "Rails engine for Virtual Collection UI"
|
14
|
+
s.description = "Rails engine for Virtual Collection UI"
|
15
|
+
s.license = "APACHE2"
|
16
|
+
s.required_ruby_version = '>= 2.2.0'
|
17
|
+
|
18
|
+
s.files = `git ls-files -z`.split("\x0")
|
19
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
20
|
+
|
21
|
+
s.add_dependency 'rails', '4.2.1'
|
22
|
+
s.add_dependency 'sass-rails', '~> 4.0'
|
23
|
+
|
24
|
+
s.add_dependency 'rdf', '~> 1.99'
|
25
|
+
s.add_dependency 'active-triples'
|
26
|
+
s.add_dependency 'active_triples-local_name'
|
27
|
+
|
28
|
+
s.add_dependency 'ld4l-works_rdf'
|
29
|
+
s.add_dependency 'ld4l-ore_rdf'
|
30
|
+
s.add_dependency 'ld4l-open_annotation_rdf'
|
31
|
+
s.add_dependency 'ld4l-foaf_rdf'
|
32
|
+
s.add_dependency 'doubly_linked_list', '~> 0.0'
|
33
|
+
|
34
|
+
s.add_dependency 'jquery-rails'
|
35
|
+
s.add_dependency 'bootstrap-sass', '~> 3.3.4.1'
|
36
|
+
s.add_dependency 'font-awesome-rails'
|
37
|
+
|
38
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
39
|
+
s.add_dependency 'turbolinks'
|
40
|
+
|
41
|
+
s.add_development_dependency 'sqlite3'
|
42
|
+
|
43
|
+
s.add_development_dependency 'pry'
|
44
|
+
s.add_development_dependency 'pry-byebug'
|
45
|
+
s.add_development_dependency 'rdoc'
|
46
|
+
s.add_development_dependency 'rspec'
|
47
|
+
s.add_development_dependency 'coveralls'
|
48
|
+
s.add_development_dependency 'guard-rspec'
|
49
|
+
s.add_development_dependency 'webmock'
|
50
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rdf'
|
2
|
+
require 'active_triples'
|
3
|
+
require 'active_triples/local_name'
|
4
|
+
require 'linkeddata'
|
5
|
+
require 'ld4l/foaf_rdf'
|
6
|
+
require 'ld4l/ore_rdf'
|
7
|
+
require 'ld4l/open_annotation_rdf'
|
8
|
+
require "ld4l_virtual_collection/engine"
|
9
|
+
require 'ld4l_virtual_collection/configuration'
|
10
|
+
require 'jquery-rails'
|
11
|
+
require 'turbolinks'
|
12
|
+
require 'bootstrap-sass'
|
13
|
+
|
14
|
+
|
15
|
+
module Ld4lVirtualCollection
|
16
|
+
class Engine < ::Rails::Engine
|
17
|
+
|
18
|
+
isolate_namespace Ld4lVirtualCollection
|
19
|
+
|
20
|
+
# -----------------------------------------
|
21
|
+
# Default configurations
|
22
|
+
# -----------------------------------------
|
23
|
+
# triplestore configuration
|
24
|
+
config.triplestore = ActiveSupport::OrderedOptions.new
|
25
|
+
config.triplestore.default_repository = 'sqlite3:db/vc_triplestore.sqlite'
|
26
|
+
|
27
|
+
# URI generation configuration
|
28
|
+
config.urigenerator = ActiveSupport::OrderedOptions.new
|
29
|
+
config.urigenerator.base_uri = 'http://localhost/triples-dev/'
|
30
|
+
config.urigenerator.bibliographic_base_uri = 'http://localhost/bibref/'
|
31
|
+
config.urigenerator.person_base_uri = 'http://localhost/individual/'
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|