hydra-editor 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +51 -0
- data/Rakefile +57 -0
- data/app/assets/javascripts/hydra-editor/editMetadata.js +4 -0
- data/app/assets/javascripts/hydra-editor/hydra-editor.js +2 -0
- data/app/assets/javascripts/hydra-editor/multiForm.js +58 -0
- data/app/assets/stylesheets/hydra-editor/application.css +13 -0
- data/app/assets/stylesheets/hydra-editor/hydra-editor.css +6 -0
- data/app/controllers/concerns/records_controller_behavior.rb +75 -0
- data/app/controllers/records_controller.rb +3 -0
- data/app/helpers/concerns/records_helper_behavior.rb +59 -0
- data/app/helpers/records_helper.rb +3 -0
- data/app/views/records/_edit_field.html.erb +15 -0
- data/app/views/records/_form.html.erb +16 -0
- data/app/views/records/choose_type.html.erb +8 -0
- data/app/views/records/edit.html.erb +3 -0
- data/app/views/records/edit_fields/_default.html.erb +10 -0
- data/app/views/records/edit_fields/_suffix.html.erb +6 -0
- data/app/views/records/new.html.erb +2 -0
- data/config/routes.rb +4 -0
- data/lib/hydra-editor.rb +12 -0
- data/lib/hydra_editor/engine.rb +8 -0
- data/lib/hydra_editor/version.rb +3 -0
- data/lib/tasks/hydra-editor_tasks.rake +4 -0
- data/spec/controllers/records_controller_spec.rb +101 -0
- data/spec/dummy/Gemfile +16 -0
- data/spec/dummy/Gemfile.lock +246 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/blacklight/bg.png +0 -0
- data/spec/dummy/app/assets/images/blacklight/border.png +0 -0
- data/spec/dummy/app/assets/images/blacklight/bul_sq_gry.gif +0 -0
- data/spec/dummy/app/assets/images/blacklight/checkmark.gif +0 -0
- data/spec/dummy/app/assets/images/blacklight/logo.png +0 -0
- data/spec/dummy/app/assets/images/blacklight/magnifying_glass.gif +0 -0
- data/spec/dummy/app/assets/images/blacklight/remove.gif +0 -0
- data/spec/dummy/app/assets/images/blacklight/separator.gif +0 -0
- data/spec/dummy/app/assets/images/blacklight/start_over.gif +0 -0
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +18 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/assets/stylesheets/blacklight.css.scss +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +10 -0
- data/spec/dummy/app/controllers/catalog_controller.rb +170 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/solr_document.rb +33 -0
- data/spec/dummy/app/models/user.rb +22 -0
- data/spec/dummy/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/dummy/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/dummy/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/dummy/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/dummy/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
- data/spec/dummy/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/SolrMarc/config-test.properties +37 -0
- data/spec/dummy/config/SolrMarc/config.properties +37 -0
- data/spec/dummy/config/SolrMarc/index.properties +97 -0
- data/spec/dummy/config/SolrMarc/index_scripts/dewey.bsh +47 -0
- data/spec/dummy/config/SolrMarc/index_scripts/format.bsh +126 -0
- data/spec/dummy/config/SolrMarc/translation_maps/README_MAPS +1 -0
- data/spec/dummy/config/SolrMarc/translation_maps/callnumber_map.properties +407 -0
- data/spec/dummy/config/SolrMarc/translation_maps/composition_era_map.properties +56 -0
- data/spec/dummy/config/SolrMarc/translation_maps/country_map.properties +379 -0
- data/spec/dummy/config/SolrMarc/translation_maps/format_map.properties +50 -0
- data/spec/dummy/config/SolrMarc/translation_maps/instrument_map.properties +101 -0
- data/spec/dummy/config/SolrMarc/translation_maps/language_map.properties +490 -0
- data/spec/dummy/config/application.rb +66 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/fedora.yml +14 -0
- data/spec/dummy/config/initializers/action_dispatch_http_upload_monkey_patch.rb +12 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +240 -0
- data/spec/dummy/config/initializers/hydra_config.rb +28 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +12 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/jetty.yml +5 -0
- data/spec/dummy/config/locales/devise.en.yml +59 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/role_map_cucumber.yml +10 -0
- data/spec/dummy/config/role_map_development.yml +12 -0
- data/spec/dummy/config/role_map_production.yml +2 -0
- data/spec/dummy/config/role_map_test.yml +15 -0
- data/spec/dummy/config/routes.rb +66 -0
- data/spec/dummy/config/solr.yml +10 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20130415215624_devise_create_users.rb +46 -0
- data/spec/dummy/db/migrate/20130415215633_create_searches.rb +16 -0
- data/spec/dummy/db/migrate/20130415215634_create_bookmarks.rb +18 -0
- data/spec/dummy/db/migrate/20130415215635_remove_editable_fields_from_bookmarks.rb +12 -0
- data/spec/dummy/db/migrate/20130415215636_add_user_types_to_bookmarks_searches.rb +16 -0
- data/spec/dummy/db/schema.rb +53 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/doc/README_FOR_APP +2 -0
- data/spec/dummy/fedora_conf/conf/development/fedora.fcfg +953 -0
- data/spec/dummy/fedora_conf/conf/test/fedora.fcfg +953 -0
- data/spec/dummy/lib/generators/test_app_generator.rb +26 -0
- data/spec/dummy/log/development.log +78 -0
- data/spec/dummy/log/test.log +2372 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/index.html +241 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/solr_conf/conf/schema.xml +433 -0
- data/spec/dummy/solr_conf/conf/solrconfig.xml +158 -0
- data/spec/dummy/solr_conf/solr.xml +35 -0
- data/spec/dummy/test/performance/browsing_test.rb +12 -0
- data/spec/dummy/test/test_helper.rb +13 -0
- data/spec/factories/users.rb +13 -0
- data/spec/helpers/records_helper_spec.rb +20 -0
- data/spec/models/bookmark_spec.rb +7 -0
- data/spec/spec_helper.rb +23 -0
- data/spec/support/Gemfile +12 -0
- data/spec/support/audio.rb +18 -0
- data/spec/support/dummy_generator.rb +26 -0
- data/spec/support/lib/generators/test_app_generator.rb +26 -0
- metadata +410 -0
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//
|
16
|
+
// Required by Blacklight
|
17
|
+
//= require blacklight/blacklight
|
18
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
# Adds a few additional behaviors into the application controller
|
3
|
+
include Blacklight::Controller
|
4
|
+
# Please be sure to impelement current_user and user_session. Blacklight depends on
|
5
|
+
# these methods in order to perform user specific actions.
|
6
|
+
|
7
|
+
layout 'blacklight'
|
8
|
+
|
9
|
+
protect_from_forgery
|
10
|
+
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'blacklight/catalog'
|
3
|
+
|
4
|
+
class CatalogController < ApplicationController
|
5
|
+
|
6
|
+
include Blacklight::Catalog
|
7
|
+
include Hydra::Controller::ControllerBehavior
|
8
|
+
# These before_filters apply the hydra access controls
|
9
|
+
before_filter :enforce_show_permissions, :only=>:show
|
10
|
+
# This applies appropriate access controls to all solr queries
|
11
|
+
CatalogController.solr_search_params_logic += [:add_access_controls_to_solr_params]
|
12
|
+
# This filters out objects that you want to exclude from search results, like FileAssets
|
13
|
+
CatalogController.solr_search_params_logic += [:exclude_unwanted_models]
|
14
|
+
|
15
|
+
|
16
|
+
configure_blacklight do |config|
|
17
|
+
config.default_solr_params = {
|
18
|
+
:qt => 'search',
|
19
|
+
:rows => 10
|
20
|
+
}
|
21
|
+
|
22
|
+
# solr field configuration for search results/index views
|
23
|
+
config.index.show_link = 'title_tesim'
|
24
|
+
config.index.record_tsim_type = 'has_model_ssim'
|
25
|
+
|
26
|
+
# solr field configuration for document/show views
|
27
|
+
config.show.html_title = 'title_tesim'
|
28
|
+
config.show.heading = 'title_tesim'
|
29
|
+
config.show.display_type = 'has_model_ssim'
|
30
|
+
|
31
|
+
# solr fields that will be treated as facets by the blacklight application
|
32
|
+
# The ordering of the field names is the order of the display
|
33
|
+
#
|
34
|
+
# Setting a limit will trigger Blacklight's 'more' facet values link.
|
35
|
+
# * If left unset, then all facet values returned by solr will be displayed.
|
36
|
+
# * If set to an integer, then "f.somefield.facet.limit" will be added to
|
37
|
+
# solr request, with actual solr request being +1 your configured limit --
|
38
|
+
# you configure the number of items you actually want _tsimed_ in a page.
|
39
|
+
# * If set to 'true', then no additional parameters will be sent to solr,
|
40
|
+
# but any 'sniffed' request limit parameters will be used for paging, with
|
41
|
+
# paging at requested limit -1. Can sniff from facet.limit or
|
42
|
+
# f.specific_field.facet.limit solr request params. This 'true' config
|
43
|
+
# can be used if you set limits in :default_solr_params, or as defaults
|
44
|
+
# on the solr side in the request handler itself. Request handler defaults
|
45
|
+
# sniffing requires solr requests to be made with "echoParams=all", for
|
46
|
+
# app code to actually have it echo'd back to see it.
|
47
|
+
#
|
48
|
+
# :show may be set to false if you don't want the facet to be drawn in the
|
49
|
+
# facet bar
|
50
|
+
config.add_facet_field solr_name('object_type', :facetable), :label => 'Format'
|
51
|
+
config.add_facet_field solr_name('pub_date', :facetable), :label => 'Publication Year'
|
52
|
+
config.add_facet_field solr_name('subject_topic', :facetable), :label => 'Topic', :limit => 20
|
53
|
+
config.add_facet_field solr_name('language', :facetable), :label => 'Language', :limit => true
|
54
|
+
config.add_facet_field solr_name('lc1_letter', :facetable), :label => 'Call Number'
|
55
|
+
config.add_facet_field solr_name('subject_geo', :facetable), :label => 'Region'
|
56
|
+
config.add_facet_field solr_name('subject_era', :facetable), :label => 'Era'
|
57
|
+
|
58
|
+
# Have BL send all facet field names to Solr, which has been the default
|
59
|
+
# previously. Simply remove these lines if you'd rather use Solr request
|
60
|
+
# handler defaults, or have no facets.
|
61
|
+
config.default_solr_params[:'facet.field'] = config.facet_fields.keys
|
62
|
+
#use this instead if you don't want to query facets marked :show=>false
|
63
|
+
#config.default_solr_params[:'facet.field'] = config.facet_fields.select{ |k, v| v[:show] != false}.keys
|
64
|
+
|
65
|
+
|
66
|
+
# solr fields to be displayed in the index (search results) view
|
67
|
+
# The ordering of the field names is the order of the display
|
68
|
+
config.add_index_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
69
|
+
config.add_index_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
70
|
+
config.add_index_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
71
|
+
config.add_index_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
72
|
+
config.add_index_field solr_name('format', :symbol), :label => 'Format:'
|
73
|
+
config.add_index_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
|
74
|
+
config.add_index_field solr_name('published', :stored_searchable, type: :string), :label => 'Published:'
|
75
|
+
config.add_index_field solr_name('published_vern', :stored_searchable, type: :string), :label => 'Published:'
|
76
|
+
config.add_index_field solr_name('lc_callnum', :stored_searchable, type: :string), :label => 'Call number:'
|
77
|
+
|
78
|
+
# solr fields to be displayed in the show (single result) view
|
79
|
+
# The ordering of the field names is the order of the display
|
80
|
+
config.add_show_field solr_name('title', :stored_searchable, type: :string), :label => 'Title:'
|
81
|
+
config.add_show_field solr_name('title_vern', :stored_searchable, type: :string), :label => 'Title:'
|
82
|
+
config.add_show_field solr_name('subtitle', :stored_searchable, type: :string), :label => 'Subtitle:'
|
83
|
+
config.add_show_field solr_name('subtitle_vern', :stored_searchable, type: :string), :label => 'Subtitle:'
|
84
|
+
config.add_show_field solr_name('author', :stored_searchable, type: :string), :label => 'Author:'
|
85
|
+
config.add_show_field solr_name('author_vern', :stored_searchable, type: :string), :label => 'Author:'
|
86
|
+
config.add_show_field solr_name('format', :symbol), :label => 'Format:'
|
87
|
+
config.add_show_field solr_name('url_fulltext_tsim', :stored_searchable, type: :string), :label => 'URL:'
|
88
|
+
config.add_show_field solr_name('url_suppl_tsim', :stored_searchable, type: :string), :label => 'More Information:'
|
89
|
+
config.add_show_field solr_name('language', :stored_searchable, type: :string), :label => 'Language:'
|
90
|
+
config.add_show_field solr_name('published', :stored_searchable, type: :string), :label => 'Published:'
|
91
|
+
config.add_show_field solr_name('published_vern', :stored_searchable, type: :string), :label => 'Published:'
|
92
|
+
config.add_show_field solr_name('lc_callnum', :stored_searchable, type: :string), :label => 'Call number:'
|
93
|
+
config.add_show_field solr_name('isbn', :stored_searchable, type: :string), :label => 'ISBN:'
|
94
|
+
|
95
|
+
# "fielded" search configuration. Used by pulldown among other places.
|
96
|
+
# For supported keys in hash, see rdoc for Blacklight::SearchFields
|
97
|
+
#
|
98
|
+
# Search fields will inherit the :qt solr request handler from
|
99
|
+
# config[:default_solr_parameters], OR can specify a different one
|
100
|
+
# with a :qt key/value. Below examples inherit, except for subject
|
101
|
+
# that specifies the same :qt as default for our own internal
|
102
|
+
# testing purposes.
|
103
|
+
#
|
104
|
+
# The :key is what will be used to identify this BL search field internally,
|
105
|
+
# as well as in URLs -- so changing it after deployment may break bookmarked
|
106
|
+
# urls. A display label will be automatically calculated from the :key,
|
107
|
+
# or can be specified manually to be different.
|
108
|
+
|
109
|
+
# This one uses all the defaults set by the solr request handler. Which
|
110
|
+
# solr request handler? The one set in config[:default_solr_parameters][:qt],
|
111
|
+
# since we aren't specifying it otherwise.
|
112
|
+
|
113
|
+
config.add_search_field 'all_fields', :label => 'All Fields'
|
114
|
+
|
115
|
+
|
116
|
+
# Now we see how to over-ride Solr request handler defaults, in this
|
117
|
+
# case for a BL "search field", which is really a dismax aggregate
|
118
|
+
# of Solr search fields.
|
119
|
+
|
120
|
+
config.add_search_field('title') do |field|
|
121
|
+
# solr_parameters hash are sent to Solr as ordinary url query params.
|
122
|
+
field.solr_parameters = { :'spellcheck.dictionary' => 'title' }
|
123
|
+
|
124
|
+
# :solr_local_parameters will be sent using Solr LocalParams
|
125
|
+
# syntax, as eg {! qf=$title_qf }. This is neccesary to use
|
126
|
+
# Solr parameter de-referencing like $title_qf.
|
127
|
+
# See: http://wiki.apache.org/solr/LocalParams
|
128
|
+
field.solr_local_parameters = {
|
129
|
+
:qf => '$title_qf',
|
130
|
+
:pf => '$title_pf'
|
131
|
+
}
|
132
|
+
end
|
133
|
+
|
134
|
+
config.add_search_field('author') do |field|
|
135
|
+
field.solr_parameters = { :'spellcheck.dictionary' => 'author' }
|
136
|
+
field.solr_local_parameters = {
|
137
|
+
:qf => '$author_qf',
|
138
|
+
:pf => '$author_pf'
|
139
|
+
}
|
140
|
+
end
|
141
|
+
|
142
|
+
# Specifying a :qt only to show it's possible, and so our internal automated
|
143
|
+
# tests can test it. In this case it's the same as
|
144
|
+
# config[:default_solr_parameters][:qt], so isn't actually neccesary.
|
145
|
+
config.add_search_field('subject') do |field|
|
146
|
+
field.solr_parameters = { :'spellcheck.dictionary' => 'subject' }
|
147
|
+
field.qt = 'search'
|
148
|
+
field.solr_local_parameters = {
|
149
|
+
:qf => '$subject_qf',
|
150
|
+
:pf => '$subject_pf'
|
151
|
+
}
|
152
|
+
end
|
153
|
+
|
154
|
+
# "sort results by" select (pulldown)
|
155
|
+
# label in pulldown is followed by the name of the SOLR field to sort by and
|
156
|
+
# whether the sort is ascending or descending (it must be asc or desc
|
157
|
+
# except in the relevancy case).
|
158
|
+
config.add_sort_field 'score desc, pub_date_dtsi desc, title_tesi asc', :label => 'relevance'
|
159
|
+
config.add_sort_field 'pub_date_dtsi desc, title_tesi asc', :label => 'year'
|
160
|
+
config.add_sort_field 'author_tesi asc, title_tesi asc', :label => 'author'
|
161
|
+
config.add_sort_field 'title_tesi asc, pub_date_dtsi desc', :label => 'title'
|
162
|
+
|
163
|
+
# If there are more than this many search results, no spelling ("did you
|
164
|
+
# mean") suggestion is offered.
|
165
|
+
config.spell_max = 5
|
166
|
+
end
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class SolrDocument
|
3
|
+
|
4
|
+
include Blacklight::Solr::Document
|
5
|
+
|
6
|
+
# self.unique_key = 'id'
|
7
|
+
|
8
|
+
# The following shows how to setup this blacklight document to display marc documents
|
9
|
+
extension_parameters[:marc_source_field] = :marc_display
|
10
|
+
extension_parameters[:marc_format_type] = :marcxml
|
11
|
+
use_extension( Blacklight::Solr::Document::Marc) do |document|
|
12
|
+
document.key?( :marc_display )
|
13
|
+
end
|
14
|
+
|
15
|
+
# Email uses the semantic field mappings below to generate the body of an email.
|
16
|
+
SolrDocument.use_extension( Blacklight::Solr::Document::Email )
|
17
|
+
|
18
|
+
# SMS uses the semantic field mappings below to generate the body of an SMS email.
|
19
|
+
SolrDocument.use_extension( Blacklight::Solr::Document::Sms )
|
20
|
+
|
21
|
+
# DublinCore uses the semantic field mappings below to assemble an OAI-compliant Dublin Core document
|
22
|
+
# Semantic mappings of solr stored fields. Fields may be multi or
|
23
|
+
# single valued. See Blacklight::Solr::Document::ExtendableClassMethods#field_semantics
|
24
|
+
# and Blacklight::Solr::Document#to_semantic_values
|
25
|
+
# Recommendation: Use field names from Dublin Core
|
26
|
+
use_extension( Blacklight::Solr::Document::DublinCore)
|
27
|
+
field_semantics.merge!(
|
28
|
+
:title => "title_display",
|
29
|
+
:author => "author_display",
|
30
|
+
:language => "language_facet",
|
31
|
+
:format => "format"
|
32
|
+
)
|
33
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
# Connects this user object to Hydra behaviors.
|
3
|
+
include Hydra::User
|
4
|
+
# Connects this user object to Blacklights Bookmarks.
|
5
|
+
include Blacklight::User
|
6
|
+
# Include default devise modules. Others available are:
|
7
|
+
# :token_authenticatable, :confirmable,
|
8
|
+
# :lockable, :timeoutable and :omniauthable
|
9
|
+
devise :database_authenticatable, :registerable,
|
10
|
+
:recoverable, :rememberable, :trackable, :validatable
|
11
|
+
|
12
|
+
# Setup accessible (or protected) attributes for your model
|
13
|
+
attr_accessible :email, :password, :password_confirmation, :remember_me
|
14
|
+
# attr_accessible :title, :body
|
15
|
+
|
16
|
+
# Method added by Blacklight; Blacklight uses #to_s on your
|
17
|
+
# user class to get a user-displayable login/identifier for
|
18
|
+
# the account.
|
19
|
+
def to_s
|
20
|
+
email
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email, :autofocus => true %></div>
|
8
|
+
|
9
|
+
<div><%= f.submit "Resend confirmation instructions" %></div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<div><%= f.label :password, "New password" %><br />
|
8
|
+
<%= f.password_field :password, :autofocus => true %></div>
|
9
|
+
|
10
|
+
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
|
11
|
+
<%= f.password_field :password_confirmation %></div>
|
12
|
+
|
13
|
+
<div><%= f.submit "Change my password" %></div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email, :autofocus => true %></div>
|
8
|
+
|
9
|
+
<div><%= f.submit "Send me reset password instructions" %></div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email, :autofocus => true %></div>
|
8
|
+
|
9
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
10
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
14
|
+
<%= f.password_field :password, :autocomplete => "off" %></div>
|
15
|
+
|
16
|
+
<div><%= f.label :password_confirmation %><br />
|
17
|
+
<%= f.password_field :password_confirmation %></div>
|
18
|
+
|
19
|
+
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
20
|
+
<%= f.password_field :current_password %></div>
|
21
|
+
|
22
|
+
<div><%= f.submit "Update" %></div>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<h3>Cancel my account</h3>
|
26
|
+
|
27
|
+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
|
28
|
+
|
29
|
+
<%= link_to "Back", :back %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h2>Sign up</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div><%= f.label :email %><br />
|
7
|
+
<%= f.email_field :email, :autofocus => true %></div>
|
8
|
+
|
9
|
+
<div><%= f.label :password %><br />
|
10
|
+
<%= f.password_field :password %></div>
|
11
|
+
|
12
|
+
<div><%= f.label :password_confirmation %><br />
|
13
|
+
<%= f.password_field :password_confirmation %></div>
|
14
|
+
|
15
|
+
<div><%= f.submit "Sign up" %></div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
4
|
+
<div><%= f.label :email %><br />
|
5
|
+
<%= f.email_field :email, :autofocus => true %></div>
|
6
|
+
|
7
|
+
<div><%= f.label :password %><br />
|
8
|
+
<%= f.password_field :password %></div>
|
9
|
+
|
10
|
+
<% if devise_mapping.rememberable? -%>
|
11
|
+
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
<div><%= f.submit "Sign in" %></div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= render "devise/shared/links" %>
|