From cba304a078e050cab5d7a41dc04f89ebb0b9d66c Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Mon, 18 Jan 2016 13:02:20 -0600 Subject: [PATCH 001/204] Completed non-responsive WUSTL theme. --- Gemfile | 2 + Gemfile.lock | 3 + app/assets/images/header-shield.svg | 1 + .../images/wustl-4-color-rev-shield.svg | 225 ++++++++++++++++++ app/assets/stylesheets/application.scss | 3 +- app/assets/stylesheets/wustl.scss | 201 ++++++++++++++++ app/views/shared/_brand_bar.html.erb | 20 ++ app/views/shared/_footer.html.erb | 71 ++++++ app/views/shared/_header.html.erb | 13 + app/views/shared/_product_bar.html.erb | 5 + app/views/shared/_title_bar.html.erb | 26 +- config/fedora.yml | 6 +- config/initializers/devise.rb | 2 +- config/locales/en.yml | 2 + 14 files changed, 559 insertions(+), 21 deletions(-) create mode 100644 app/assets/images/header-shield.svg create mode 100644 app/assets/images/wustl-4-color-rev-shield.svg create mode 100644 app/assets/stylesheets/wustl.scss create mode 100644 app/views/shared/_brand_bar.html.erb create mode 100644 app/views/shared/_footer.html.erb create mode 100644 app/views/shared/_header.html.erb create mode 100644 app/views/shared/_product_bar.html.erb diff --git a/Gemfile b/Gemfile index dd23da6..c0514d7 100644 --- a/Gemfile +++ b/Gemfile @@ -71,3 +71,5 @@ gem 'rsolr', '~> 1.0.6' gem 'devise' gem 'devise_ldap_authenticatable' gem 'devise-guests', '~> 0.3' + +gem 'font-awesome-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 8f76fdd..5a17314 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -177,6 +177,8 @@ GEM faraday (0.9.2) multipart-post (>= 1.2, < 3) ffi (1.9.10) + font-awesome-rails (4.5.0.0) + railties (>= 3.2, < 5.0) globalid (0.3.6) activesupport (>= 4.1.0) haml (4.0.7) @@ -569,6 +571,7 @@ DEPENDENCIES devise-guests (~> 0.3) devise_ldap_authenticatable factory_girl_rails + font-awesome-rails hydra-file_characterization (= 0.3.3) jbuilder (~> 2.0) jettywrapper diff --git a/app/assets/images/header-shield.svg b/app/assets/images/header-shield.svg new file mode 100644 index 0000000..68cefad --- /dev/null +++ b/app/assets/images/header-shield.svg @@ -0,0 +1 @@ + diff --git a/app/assets/images/wustl-4-color-rev-shield.svg b/app/assets/images/wustl-4-color-rev-shield.svg new file mode 100644 index 0000000..28a7210 --- /dev/null +++ b/app/assets/images/wustl-4-color-rev-shield.svg @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 82b5b05..99a0847 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -15,8 +15,9 @@ *= require_self */ - @import 'curation_concerns/curation_concerns'; @import 'openseadragon/openseadragon'; @import 'tei_viewer'; @import 'video'; +@import 'font-awesome'; +@import 'wustl'; diff --git a/app/assets/stylesheets/wustl.scss b/app/assets/stylesheets/wustl.scss new file mode 100644 index 0000000..745086f --- /dev/null +++ b/app/assets/stylesheets/wustl.scss @@ -0,0 +1,201 @@ +body { + padding: 0px; + font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; + h1, h2, h3, h4, h5, h6 { + font-family: 'Libre Baskerville', 'Times New Roman', serif; + } + header#banner hgroup { + div#brand-bar-wrapper { + background-color: #a51417; + background-image: none; + border-bottom: none; + border-top: #62121b 5px solid; + padding: 0px 0px 5px 0px; + margin: 0px; + div.container { + margin: auto; + max-width: 940px; + padding: 0px; + div#brand-bar { + max-width: 940px; + margin: auto; + div#university { + margin: 0px; + padding: 0px; + } + div#division { + margin: 0px; + padding: 0px; + } + } + } + } + div#product-bar-wrapper { + border: none; + div.container { + position: relative; + background: transparent url(image-path('header-shield.svg')) scroll left center no-repeat; + padding: 0px 70px; + max-width: 940px; + right: 70px; + div#product-bar { + height: 135px; + line-height: 135px; + margin: auto; + font-family: 'Libre Baskerville', 'Times New Roman', serif; + font-size: 50px; + a { + color: #000; + } + } + } + } + div#title-bar-wrapper { + padding: 5px 0px; + background-color: #555; + background-image: none; + border: 0; + margin: 0; + div.container { + margin: auto; + padding: 0px; + max-width: 940px; + div#title-bar { + max-width: 940px; + margin: auto; + div#site-search { + margin: 0px; + padding: 0px; + form { + margin: 0px; + padding: 0px; + } + } + nav#site-actions { + padding: 0px; + margin: 0px; + } + } + } + } + } + div#main { + max-width: 940px; + margin: auto; + padding: 0px; + } + footer#footer { + h3 { + margin-top: 0px; + } + color: #fff; + text-align: left; + padding: 0px; + margin: 20px 0px 0px 0px; + font-size: .866667em; + a.fa-icon { + display: inline-block; + height: 40px; + width: 40px; + text-align: center; + font-size: 16px; + line-height: 40px; + text-decoration: none; + span.screenreader-fallback-text { + position: absolute; + height: 1px; + width: 1px; + overflow: hidden; + } + } + div#footer-top-wrapper { + position: relative; + background-color: #555; + padding: 40px 0px 45px 0px; + div#footer-top { + margin: auto; + max-width: 940px; + div.col-md-3 { + padding: 0px 0px 0px 20px; + h3 { + font-size: 20px; + } + ul { + padding: 0px; + li { + list-style-type: none; + margin-bottom: 0.5em; + } + } + div.social { + text-align: right; + margin-top: 19px; + a { + border: 1px solid #777; + } + a:hover { + background-color: #a51417; + border: 1px solid #a51417; + } + } + a img { + max-width: 100%; + } + } + div.col-md-3:first-of-type { + padding-left: 0px; + } + } + } + div#footer-top-wrapper:after { + content: ''; + position: absolute; + top: -5px; + left: 50%; + z-index: 22; + margin-left: -6px; + width: 0; + height: 0; + border-right: 6px solid transparent; + border-bottom: 5px solid #555; + border-left: 6px solid transparent; + } + div#footer-bottom-wrapper { + background-color: #a51417; + border-top: 5px solid #721218; + div#footer-bottom { + margin: auto; + padding: 10px 0px; + max-width: 940px; + div.copyright { + font-size: 12px; + min-height: 40px; + line-height: 40px; + padding: 0px; + margin: 0px; + } + div.back-to-top { + text-align: right; + padding: 0px; + a.back-to-top { + font-size: 13px; + margin-right: 10px; + } + a.fa-icon { + box-shadow: inset 0px 0px 0px 1px #b5202a; + } + a.fa-icon:hover { + background-color: rgba(255, 255, 255, 0.15); + } + } + } + } + a { + color: #fff; + text-decoration: underline; + } + a:hover { + text-decoration: none; + } + } +} diff --git a/app/views/shared/_brand_bar.html.erb b/app/views/shared/_brand_bar.html.erb new file mode 100644 index 0000000..23975d6 --- /dev/null +++ b/app/views/shared/_brand_bar.html.erb @@ -0,0 +1,20 @@ +
+ +
diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb new file mode 100644 index 0000000..09ce2b4 --- /dev/null +++ b/app/views/shared/_footer.html.erb @@ -0,0 +1,71 @@ + diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb new file mode 100644 index 0000000..1b8ceee --- /dev/null +++ b/app/views/shared/_header.html.erb @@ -0,0 +1,13 @@ + diff --git a/app/views/shared/_product_bar.html.erb b/app/views/shared/_product_bar.html.erb new file mode 100644 index 0000000..ac1a661 --- /dev/null +++ b/app/views/shared/_product_bar.html.erb @@ -0,0 +1,5 @@ +
+ +
diff --git a/app/views/shared/_title_bar.html.erb b/app/views/shared/_title_bar.html.erb index 506afdb..7a05043 100644 --- a/app/views/shared/_title_bar.html.erb +++ b/app/views/shared/_title_bar.html.erb @@ -1,16 +1,10 @@ -
-
- - -
-

<%= link_to t('curation_concerns.product_name'), main_app.root_path, id: 'home-link' %>

-
- - -
-
- +
+
+ + +
+
diff --git a/config/fedora.yml b/config/fedora.yml index c108513..2ca21c2 100644 --- a/config/fedora.yml +++ b/config/fedora.yml @@ -1,15 +1,15 @@ development: user: fedoraAdmin password: fedoraAdmin - url: http://127.0.0.1:8983/fedora/rest + url: http://127.0.0.1:8080/fedora/rest base_path: /dev test: user: fedoraAdmin password: fedoraAdmin - url: http://localhost:8983/fedora/rest + url: http://127.0.0.1:8080/fedora/rest base_path: /test production: user: fedoraAdmin password: fedoraAdmin - url: http://127.0.0.1:8983/fedora/rest + url: http://127.0.0.1:8080/fedora/rest base_path: /prod diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index be567b2..8d903fa 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -9,7 +9,7 @@ # config.ldap_check_group_membership = false # config.ldap_check_group_membership_without_admin = false # config.ldap_check_attributes = false - # config.ldap_use_admin_to_bind = false + config.ldap_use_admin_to_bind = true # config.ldap_ad_group_check = false # The secret key used by Devise. Devise uses this key to generate diff --git a/config/locales/en.yml b/config/locales/en.yml index 05d5e3e..5c6c2a5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -37,3 +37,5 @@ en: admin_set: update: "Update Metadata" create: "Create" + curation_concerns: + product_name: "Digital Gateway" From 03022f3de5c44dd9d061022b96e246d84befbfe3 Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Mon, 18 Jan 2016 14:16:59 -0600 Subject: [PATCH 002/204] Added replacement localization for 'Your Institution' text on home page. --- config/locales/en.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5c6c2a5..b81c98c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -39,3 +39,5 @@ en: create: "Create" curation_concerns: product_name: "Digital Gateway" + institution: + name: "Washington University" From ecd245a488043c21a7a0d286da8077ff298b4984 Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Mon, 18 Jan 2016 14:17:58 -0600 Subject: [PATCH 003/204] Corrected 'Popular Links' hrefs in footer. --- app/views/shared/_footer.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index 09ce2b4..98fc523 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -35,12 +35,12 @@

Popular Links

From 155f80933a380c4310e5002978b99d8ddcb124a4 Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Mon, 18 Jan 2016 14:21:04 -0600 Subject: [PATCH 004/204] Corrected indentation which caused a yml format error resulting in inappropriate text within header. --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index b81c98c..7f7cd6f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -40,4 +40,4 @@ en: curation_concerns: product_name: "Digital Gateway" institution: - name: "Washington University" + name: "Washington University" From ae7ae03ac50c0e52071eff57d2e8d673a4d1d62a Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Tue, 19 Jan 2016 13:04:41 -0600 Subject: [PATCH 005/204] Changed git repo from curationexperts to our fork within wulib-wustl-edu. --- config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index c9bb445..aade1bd 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,7 +2,7 @@ lock '3.4.0' set :application, 'goldenseal' -set :repo_url, 'https://github.com/curationexperts/goldenseal.git' +set :repo_url, 'https://github.com/wulib-wustl-edu/goldenseal.git' set :passenger_restart_with_touch, true ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp set :deploy_to, '/opt/goldenseal' From 22399bd3cb1ab10f6095e58d884bc3f45c0a94ed Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Tue, 19 Jan 2016 13:05:17 -0600 Subject: [PATCH 006/204] Changed server url to our default production server address. --- config/deploy/production.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/deploy/production.rb b/config/deploy/production.rb index a66a65c..f727fdc 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,3 +1,8 @@ +set :stage, :production +set :rails_env, 'production' +set :branch, ENV['BRANCH'] || 'master' +server 'prod-goldenseal.wulib.wustl.edu', user: 'deploy', roles: [:web, :app, :db, :resque_pool] + # server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. From 88b6834aedc6d63598f9054027913481f4a5d1fe Mon Sep 17 00:00:00 2001 From: "P. Kieran Etienne" Date: Tue, 19 Jan 2016 14:06:13 -0600 Subject: [PATCH 007/204] Corrected subject librarian link in footer. --- app/views/shared/_footer.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index 98fc523..0540201 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -34,13 +34,13 @@ From 4d7d565de912779246288f09fe1b176d6e88a738 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 24 Jan 2018 14:12:38 -0800 Subject: [PATCH 008/204] dockerize --- .env | 14 ++++++++++ Dockerfile | 10 +++++++ Dockerfile.base | 63 +++++++++++++++++++++++++++++++++++++++++++++ Gemfile.lock | 4 +-- docker-compose.yml | 26 +++++++++++++++++++ ops/deploy.retry | 1 + ops/deploy.yml | 14 ++++++++++ ops/env.conf | 22 ++++++++++++++++ ops/hosts | 29 +++++++++++++++++++++ ops/jetty.sh | 6 +++++ ops/nginx.sh | 27 +++++++++++++++++++ ops/provision.retry | 1 + ops/provision.yml | 14 ++++++++++ ops/redis.sh | 6 +++++ ops/webapp.conf | 15 +++++++++++ ops/worker.sh | 6 +++++ 16 files changed, 256 insertions(+), 2 deletions(-) create mode 100644 .env create mode 100644 Dockerfile create mode 100644 Dockerfile.base create mode 100644 docker-compose.yml create mode 100644 ops/deploy.retry create mode 100644 ops/deploy.yml create mode 100644 ops/env.conf create mode 100644 ops/hosts create mode 100644 ops/jetty.sh create mode 100755 ops/nginx.sh create mode 100644 ops/provision.retry create mode 100644 ops/provision.yml create mode 100644 ops/redis.sh create mode 100644 ops/webapp.conf create mode 100644 ops/worker.sh diff --git a/.env b/.env new file mode 100644 index 0000000..d33e39d --- /dev/null +++ b/.env @@ -0,0 +1,14 @@ +DOCKER_PORT=8000:80 +#SOLR_URL=http://solr:8983/solr/blacklight-core +#POSTGRES_DB=goldenseal +#POSTGRES_USER=postgres +#POSTGRES_PASSWORD=DatabaseFTW +#POSTGRES_HOST=postgres +TEST_DB=goldenseal_test +REGISTRY_HOST=registry.gitlab.com +REGISTRY_URI=/notch8/washington-goldenseal +SITE_URI=web.goldenseal.staging.notch8network.com +DEPLOY_HOOK=CHANGEME +TAG=dev +VIRTUAL_PORT=80 +PASSENGER_APP_ENV=development diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3233ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM registry.gitlab.com/notch8/washington-goldenseal/base:latest + +ADD https://time.is/just build-time +COPY ops/webapp.conf /etc/nginx/sites-enabled/webapp.conf +COPY ops/env.conf /etc/nginx/main.d/env.conf + +COPY . $APP_HOME +RUN bundle check || bundle install + +CMD ["/sbin/my_init"] \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 0000000..80750ce --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1,63 @@ +FROM phusion/passenger-ruby23:0.9.27 + +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ + apt-get install -y software-properties-common && \ + apt-add-repository -y ppa:ansible/ansible && \ + add-apt-repository -y ppa:webupd8team/java && \ + apt-get update -qq && \ + apt-get install -y build-essential nodejs yarn pv ansible libsasl2-dev libpq-dev postgresql-client \ + oracle-java8-installer zip unzip imagemagick tzdata redis-server && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + yarn config set no-progress && \ + yarn config set silent + +ENV JAVA_HOME /usr/lib/jvm/java-8-oracle + + +RUN rm /etc/nginx/sites-enabled/default +COPY ops/webapp.conf /etc/nginx/sites-enabled/webapp.conf +COPY ops/env.conf /etc/nginx/main.d/env.conf + +ENV APP_HOME /home/app/webapp +RUN mkdir $APP_HOME +WORKDIR $APP_HOME + +ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \ + BUNDLE_JOBS=4 + +ADD Gemfile* $APP_HOME/ +RUN bundle check || bundle install +#RUN yarn install + +RUN touch /var/log/worker.log && chmod 666 /var/log/worker.log +RUN mkdir /etc/service/worker +ADD ops/worker.sh /etc/service/worker/run +RUN chmod +x /etc/service/worker/run + +RUN mkdir /etc/service/redis +ADD ops/redis.sh /etc/service/redis/run +RUN chmod +x /etc/service/redis/run + + +COPY . $APP_HOME +RUN chown -R app $APP_HOME + +RUN /sbin/setuser app ./bin/setup && \ + /sbin/setuser app rake jetty:clean && \ + /sbin/setuser app rake curation_concerns:jetty:config +RUN touch /var/log/jetty.log && chmod 666 /var/log/jetty.log +RUN mkdir /etc/service/jetty +ADD ops/jetty.sh /etc/service/jetty/run +RUN chmod +x /etc/service/jetty/run + + +# Asset complie and migrate if prod, otherwise just start nginx +ADD ops/nginx.sh /etc/service/nginx/run +RUN chmod +x /etc/service/nginx/run +RUN rm -f /etc/service/nginx/down + +CMD ["/sbin/my_init"] \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 8f76fdd..9b11c1f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -416,7 +416,7 @@ GEM rdf (~> 1.1, >= 1.1.10) rdf-xsd (1.99.0) rdf (~> 1.99) - rdoc (4.2.0) + rdoc (4.3.0) redis (3.2.2) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) @@ -593,4 +593,4 @@ DEPENDENCIES uglifier (>= 1.3.0) BUNDLED WITH - 1.11.2 + 1.16.0 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ae0026b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: '2' +services: + base: + build: + context: ./ + dockerfile: Dockerfile.base + image: "${REGISTRY_HOST}${REGISTRY_URI}/base:latest" + env_file: + - .env + + web: + build: + context: ./ + dockerfile: Dockerfile + image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG}" + volumes: + - .:/home/app/webapp + env_file: + - .env + # Keep the stdin open, so we can attach to our app container's process + # and do things such as byebug, etc: + stdin_open: true + # Enable sending signals (CTRL+C, CTRL+P + CTRL+Q) into the container: + tty: true + ports: + - "8080:80" diff --git a/ops/deploy.retry b/ops/deploy.retry new file mode 100644 index 0000000..78a257a --- /dev/null +++ b/ops/deploy.retry @@ -0,0 +1 @@ +staging.CHANGEME diff --git a/ops/deploy.yml b/ops/deploy.yml new file mode 100644 index 0000000..99e84c2 --- /dev/null +++ b/ops/deploy.yml @@ -0,0 +1,14 @@ +--- +- name: Deploy + hosts: all + gather_facts: False + tasks: + - name: deploy app + delegate_to: 127.0.0.1 + uri: + url: "{{ deploy_url }}" + method: POST + return_content: yes + body: { "push_data": { "tag": "{{ tag }}" }, "repository": { "repo_name":"registry.gitlab.com/notch8/ror-site/{{ app_name | regex_replace('-staging', '') }}" }} + body_format: json + status_code: 200 diff --git a/ops/env.conf b/ops/env.conf new file mode 100644 index 0000000..78983ca --- /dev/null +++ b/ops/env.conf @@ -0,0 +1,22 @@ +env BUILD_DIR; +env ELASTICSEARCH_URL; +env MYSQL_DATABASE; +env MYSQL_HOST; +env MYSQL_PASSWORD; +env MYSQL_USER; +env PASSENGER_APP_ENV; +env RAILS_LOG_TO_STDOUT; +env REGISTRY_HOST; +env REGISTRY_URI; +env SECRET_KEY_BASE; +env SITE_URI; +env TAG; +env TEST_DB; +env VIRTUAL_PORT; +env FACEBOOK_APP_ID; +env FACEBOOK_SECRET; +env GOOGLE_OAUTH2_CLIENT_ID; +env GOOGLE_OAUTH2_CLIENT_SECRET; +env STRIPE_PLATFORM_CLIENT_ID; +env STRIPE_SECRET_KEY; +env STRIPE_PUBLISHABLE_KEY; diff --git a/ops/hosts b/ops/hosts new file mode 100644 index 0000000..1fa0184 --- /dev/null +++ b/ops/hosts @@ -0,0 +1,29 @@ +[staging] +staging.tilma ansible_user=centos + +[production] +tilma ansible_user=ubuntu + +[servers:children] +staging +production + +[servers:vars] +registry_host=registry.gitlab.com +compose_dir=/var/www +project_name=ror-site + +[staging:vars] +tag=staging-latest +rancher_env=glass-canvas +deploy_env=staging +deploy_url=https://rancher.notch8.com/v1-webhooks/endpoint?key=6mNqSnMDJSR0KphZvEYbNhJ1jFwfKYChZv4bWFZs&projectId=1a17575 +app_name=tilma-staging + +[production:vars] +tag=production-latest +rancher_env=glass-canvas +environment=production +deploy_env=production +deploy_url=https://rancher.notch8.com/v1-webhooks/endpoint?key=uo55jpIzYTMpZ4VctNFmL02yyW9D1d0ZLeA66nwa&projectId=1a17575 +app_name=tilma \ No newline at end of file diff --git a/ops/jetty.sh b/ops/jetty.sh new file mode 100644 index 0000000..f1edc87 --- /dev/null +++ b/ops/jetty.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# `/sbin/setuser memcache` runs the given command as the user `memcache`. +# If you omit that part, the command will be run as root. + +exec /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && rake jetty:start >>/var/log/jetty.log 2>&1' diff --git a/ops/nginx.sh b/ops/nginx.sh new file mode 100755 index 0000000..5998164 --- /dev/null +++ b/ops/nginx.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +if [[ ! -e /var/log/nginx/error.log ]]; then + # The Nginx log forwarder might be sleeping and waiting + # until the error log becomes available. We restart it in + # 1 second so that it picks up the new log file quickly. + (sleep 1 && sv restart /etc/service/nginx-log-forwarder) +fi + +if [ -z $PASSENGER_APP_ENV ] +then + export PASSENGER_APP_ENV=development +fi + +if [[ $PASSENGER_APP_ENV == "production" ]] +then + /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && whenever --update-crontab' +fi + +if [[ $PASSENGER_APP_ENV == "production" ]] || [[ $PASSENGER_APP_ENV == "staging" ]] +then + # TODO bad node module + rm -f /home/app/refinerycms-forms/app/javascript/glassformvalidations/node_modules/jquery-mask-plugin/deploy.rb + /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && bundle exec rake db:migrate' +fi + +exec /usr/sbin/nginx diff --git a/ops/provision.retry b/ops/provision.retry new file mode 100644 index 0000000..339f8b1 --- /dev/null +++ b/ops/provision.retry @@ -0,0 +1 @@ +tilma diff --git a/ops/provision.yml b/ops/provision.yml new file mode 100644 index 0000000..a42580e --- /dev/null +++ b/ops/provision.yml @@ -0,0 +1,14 @@ +--- +- name: Provision + hosts: all + gather_facts: False + tasks: + - name: Provision via rancher + shell: "cd .. && rancher up -p -d -u -s {{ app_name }} -f docker-compose.{{ deploy_env }}.yml -e .env.{{ app_name | regex_replace('-staging', '') }}.{{ deploy_env }}" + register: result + delegate_to: 127.0.0.1 + environment: + APP_NAME: "{{ app_name | regex_replace('-staging', '') }}" + TAG: "{{ tag }}" + RANCHER_ENVIRONMENT: "{{ rancher_env }}" + - debug: var=result.stdout_lines diff --git a/ops/redis.sh b/ops/redis.sh new file mode 100644 index 0000000..83efb2f --- /dev/null +++ b/ops/redis.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# `/sbin/setuser memcache` runs the given command as the user `memcache`. +# If you omit that part, the command will be run as root. + +exec redis-server diff --git a/ops/webapp.conf b/ops/webapp.conf new file mode 100644 index 0000000..dd739d9 --- /dev/null +++ b/ops/webapp.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name _; + root /home/app/webapp/public; + client_body_in_file_only clean; + client_body_buffer_size 32K; + + client_max_body_size 0; + + sendfile on; + send_timeout 300s; + # The following deploys your Ruby/Python/Node.js/Meteor app on Passenger. + passenger_enabled on; + passenger_user app; +} diff --git a/ops/worker.sh b/ops/worker.sh new file mode 100644 index 0000000..8779d5f --- /dev/null +++ b/ops/worker.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# `/sbin/setuser memcache` runs the given command as the user `memcache`. +# If you omit that part, the command will be run as root. + +exec /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && QUEUE=* VERBOSE=1 rake resque:work >>/var/log/worker.log 2>&1' From e33f84e6675453e477b4c0de927df07b3bc5e5f9 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 24 Jan 2018 14:46:08 -0800 Subject: [PATCH 009/204] small build fix --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index e3233ca..afef94d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,6 @@ COPY ops/env.conf /etc/nginx/main.d/env.conf COPY . $APP_HOME RUN bundle check || bundle install +RUN /sbin/setuser app ./bin/setup CMD ["/sbin/my_init"] \ No newline at end of file From 2d6bb804793c181ec48420d7f26185d0fedf4eff Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Wed, 24 Jan 2018 15:13:48 -0800 Subject: [PATCH 010/204] updated to docker files to get database config to load --- Dockerfile | 3 ++- ops/nginx.sh | 11 +++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index afef94d..ae0afb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ COPY ops/env.conf /etc/nginx/main.d/env.conf COPY . $APP_HOME RUN bundle check || bundle install -RUN /sbin/setuser app ./bin/setup + +ADD ops/nginx.sh /etc/service/nginx/run CMD ["/sbin/my_init"] \ No newline at end of file diff --git a/ops/nginx.sh b/ops/nginx.sh index 5998164..1dd8080 100755 --- a/ops/nginx.sh +++ b/ops/nginx.sh @@ -7,21 +7,16 @@ if [[ ! -e /var/log/nginx/error.log ]]; then (sleep 1 && sv restart /etc/service/nginx-log-forwarder) fi +/sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && ./bin/setup' + if [ -z $PASSENGER_APP_ENV ] then export PASSENGER_APP_ENV=development fi -if [[ $PASSENGER_APP_ENV == "production" ]] -then - /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && whenever --update-crontab' -fi - if [[ $PASSENGER_APP_ENV == "production" ]] || [[ $PASSENGER_APP_ENV == "staging" ]] then - # TODO bad node module - rm -f /home/app/refinerycms-forms/app/javascript/glassformvalidations/node_modules/jquery-mask-plugin/deploy.rb - /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && bundle exec rake db:migrate' + /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && bundle exec rake db:migrate' fi exec /usr/sbin/nginx From 2441ff784fba0ac72e0f41030ab8b2d2d6c237aa Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 24 Jan 2018 15:53:20 -0800 Subject: [PATCH 011/204] more build optimization --- Dockerfile | 2 -- Dockerfile.base | 10 +++++----- bin/setup | 23 ++++++++++++++++++++++- ops/nginx.sh | 7 +++++-- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae0afb5..e3233ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,4 @@ COPY ops/env.conf /etc/nginx/main.d/env.conf COPY . $APP_HOME RUN bundle check || bundle install -ADD ops/nginx.sh /etc/service/nginx/run - CMD ["/sbin/my_init"] \ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base index 80750ce..771a9ae 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -29,17 +29,17 @@ WORKDIR $APP_HOME ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \ BUNDLE_JOBS=4 -ADD Gemfile* $APP_HOME/ +COPY Gemfile* $APP_HOME/ RUN bundle check || bundle install #RUN yarn install RUN touch /var/log/worker.log && chmod 666 /var/log/worker.log RUN mkdir /etc/service/worker -ADD ops/worker.sh /etc/service/worker/run +COPY ops/worker.sh /etc/service/worker/run RUN chmod +x /etc/service/worker/run RUN mkdir /etc/service/redis -ADD ops/redis.sh /etc/service/redis/run +COPY ops/redis.sh /etc/service/redis/run RUN chmod +x /etc/service/redis/run @@ -51,12 +51,12 @@ RUN /sbin/setuser app ./bin/setup && \ /sbin/setuser app rake curation_concerns:jetty:config RUN touch /var/log/jetty.log && chmod 666 /var/log/jetty.log RUN mkdir /etc/service/jetty -ADD ops/jetty.sh /etc/service/jetty/run +COPY ops/jetty.sh /etc/service/jetty/run RUN chmod +x /etc/service/jetty/run # Asset complie and migrate if prod, otherwise just start nginx -ADD ops/nginx.sh /etc/service/nginx/run +COPY ops/nginx.sh /etc/service/nginx/run RUN chmod +x /etc/service/nginx/run RUN rm -f /etc/service/nginx/down diff --git a/bin/setup b/bin/setup index 2bf7d4a..2fd33f7 100755 --- a/bin/setup +++ b/bin/setup @@ -4,14 +4,17 @@ require 'pathname' # path to your application root. APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) -Dir.chdir APP_ROOT do + +def bundle # This script is a starting point to setup your application. # Add necessary setup steps to this file: puts "== Installing dependencies ==" system "gem install bundler --conservative" system "bundle check || bundle install" +end +def copy_configs puts "\n== Copying sample files ==" unless File.exist?("config/database.yml") system "cp config/database.yml.template config/database.yml" @@ -23,14 +26,32 @@ Dir.chdir APP_ROOT do system "cp config/resque-pool.yml.template config/resque-pool.yml" system "cp config/ldap.yml.template config/ldap.yml" end +end +def prep_db puts "\n== Preparing database ==" system "bin/rake db:setup" +end +def remove_logs puts "\n== Removing old logs and tempfiles ==" system "rm -f log/*" system "rm -rf tmp/cache" +end +def restart puts "\n== Restarting application server ==" system "touch tmp/restart.txt" end + +Dir.chdir APP_ROOT do + if ARGV[0] && ARGV[0].length > 1 + send(ARGV[0]) + else + bundle + copy_configs + prep_db + remove_logs + restart + end +end diff --git a/ops/nginx.sh b/ops/nginx.sh index 1dd8080..5741aba 100755 --- a/ops/nginx.sh +++ b/ops/nginx.sh @@ -7,13 +7,16 @@ if [[ ! -e /var/log/nginx/error.log ]]; then (sleep 1 && sv restart /etc/service/nginx-log-forwarder) fi -/sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && ./bin/setup' - if [ -z $PASSENGER_APP_ENV ] then export PASSENGER_APP_ENV=development fi +if [[ $PASSENGER_APP_ENV == "development" ]] +then + /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && ./bin/setup copy_configs' +fi + if [[ $PASSENGER_APP_ENV == "production" ]] || [[ $PASSENGER_APP_ENV == "staging" ]] then /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && bundle exec rake db:migrate' From aaa89355abff38804c3261c293feb6f66edeeb17 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 25 Jan 2018 09:49:43 -0800 Subject: [PATCH 012/204] working on ldap --- .env | 4 ++++ config/ldap.yml.template | 12 ++++++------ docker-compose.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.env b/.env index d33e39d..19709f1 100644 --- a/.env +++ b/.env @@ -12,3 +12,7 @@ DEPLOY_HOOK=CHANGEME TAG=dev VIRTUAL_PORT=80 PASSENGER_APP_ENV=development +LDAP_ORGANISATION=Notch8 +LDAP_DOMAIN=notch8.com +LDAP_ADMIN_PASSWORD=admin_password +PHPLDAPADMIN_LDAP_HOSTS=ldap \ No newline at end of file diff --git a/config/ldap.yml.template b/config/ldap.yml.template index f1aa0b9..65f9114 100644 --- a/config/ldap.yml.template +++ b/config/ldap.yml.template @@ -1,13 +1,13 @@ ## Environment default: &default attribute: uid - base: ou=people,dc=dce,dc=com - group_base: ou=groups,dc=dce,dc=com + base: ou=people,dc=notch8,dc=com + group_base: ou=groups,dc=notch8,dc=com development: - host: ldap.curationexperts.com + host: ldap port: 389 - admin_user: cn=admin,dc=test,dc=com + admin_user: cn=admin,dc=notch8,dc=com admin_password: admin_password ssl: false <<: *default @@ -15,7 +15,7 @@ development: test: host: ldap.curationexperts.com port: 3389 - admin_user: cn=admin,dc=test,dc=com + admin_user: cn=admin,dc=notch8,dc=com admin_password: admin_password ssl: simple_tls <<: *default @@ -23,7 +23,7 @@ test: production: host: ldap.curationexperts.com port: 636 - admin_user: cn=admin,dc=test,dc=com + admin_user: cn=admin,dc=notch8,dc=com admin_password: admin_password ssl: start_tls <<: *default diff --git a/docker-compose.yml b/docker-compose.yml index ae0026b..c43f50f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,3 +24,29 @@ services: tty: true ports: - "8080:80" + depends_on: + - ldap + + ldap: + image: osixia/openldap + env_file: + - .env + volumes: + - 'ldap:/var/lib/ldap' + - 'slapd:/etc/ldap/slapd.d' + ports: + - '389:389' + + ldapadmin: + image: osixia/phpldapadmin + env_file: + - .env + ports: + - 6080:80 + - 6443:443 + depends_on: + - ldap + +volumes: + ldap: + slapd: From 1ac9a3615045f650572d7e6bd23076d1663839f7 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 25 Jan 2018 10:07:42 -0800 Subject: [PATCH 013/204] added google tag manager --- app/views/layouts/_google_analytics.html.erb | 7 +++++++ app/views/layouts/_google_analytics_body.html.erb | 4 ++++ app/views/layouts/application.html.erb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 app/views/layouts/_google_analytics.html.erb create mode 100644 app/views/layouts/_google_analytics_body.html.erb diff --git a/app/views/layouts/_google_analytics.html.erb b/app/views/layouts/_google_analytics.html.erb new file mode 100644 index 0000000..7c62075 --- /dev/null +++ b/app/views/layouts/_google_analytics.html.erb @@ -0,0 +1,7 @@ + + + diff --git a/app/views/layouts/_google_analytics_body.html.erb b/app/views/layouts/_google_analytics_body.html.erb new file mode 100644 index 0000000..3577f0b --- /dev/null +++ b/app/views/layouts/_google_analytics_body.html.erb @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a123b41..7f2650b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,12 +1,15 @@ + <%= render :partial => 'layouts/google_analytics' if Rails.env == 'production' %> + Goldenseal <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> + <%= render :partial => 'layouts/google_analytics_body' if Rails.env == 'production' %> <%= yield %> From 5d12279936dd2f6010811a2e61d2909cfbc49430 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 25 Jan 2018 12:16:57 -0800 Subject: [PATCH 014/204] revert ldap config, update fedora back to 8983 --- config/fedora.yml | 6 +++--- config/ldap.yml.template | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/fedora.yml b/config/fedora.yml index 2ca21c2..06b563b 100644 --- a/config/fedora.yml +++ b/config/fedora.yml @@ -1,15 +1,15 @@ development: user: fedoraAdmin password: fedoraAdmin - url: http://127.0.0.1:8080/fedora/rest + url: http://127.0.0.1:8983/fedora/rest base_path: /dev test: user: fedoraAdmin password: fedoraAdmin - url: http://127.0.0.1:8080/fedora/rest + url: http://127.0.0.1:8983/fedora/rest base_path: /test production: user: fedoraAdmin password: fedoraAdmin - url: http://127.0.0.1:8080/fedora/rest + url: http://127.0.0.1:8983/fedora/rest base_path: /prod diff --git a/config/ldap.yml.template b/config/ldap.yml.template index 65f9114..f1aa0b9 100644 --- a/config/ldap.yml.template +++ b/config/ldap.yml.template @@ -1,13 +1,13 @@ ## Environment default: &default attribute: uid - base: ou=people,dc=notch8,dc=com - group_base: ou=groups,dc=notch8,dc=com + base: ou=people,dc=dce,dc=com + group_base: ou=groups,dc=dce,dc=com development: - host: ldap + host: ldap.curationexperts.com port: 389 - admin_user: cn=admin,dc=notch8,dc=com + admin_user: cn=admin,dc=test,dc=com admin_password: admin_password ssl: false <<: *default @@ -15,7 +15,7 @@ development: test: host: ldap.curationexperts.com port: 3389 - admin_user: cn=admin,dc=notch8,dc=com + admin_user: cn=admin,dc=test,dc=com admin_password: admin_password ssl: simple_tls <<: *default @@ -23,7 +23,7 @@ test: production: host: ldap.curationexperts.com port: 636 - admin_user: cn=admin,dc=notch8,dc=com + admin_user: cn=admin,dc=test,dc=com admin_password: admin_password ssl: start_tls <<: *default From 48d23b6978b3c85492724f3a8e18f1e42e4137c5 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 25 Jan 2018 13:00:18 -0800 Subject: [PATCH 015/204] formatting --- app/views/layouts/_google_analytics.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_google_analytics.html.erb b/app/views/layouts/_google_analytics.html.erb index 7c62075..6fd1d2c 100644 --- a/app/views/layouts/_google_analytics.html.erb +++ b/app/views/layouts/_google_analytics.html.erb @@ -4,4 +4,4 @@ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-MP5DXX7'); - + \ No newline at end of file From 1d28e868f519830ab22b554adf39f8e72cc65091 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Mon, 5 Feb 2018 16:16:42 -0800 Subject: [PATCH 016/204] ability to skip ldap if needed for local dev --- .env | 5 +---- app/controllers/application_controller.rb | 8 ++++++++ app/models/user.rb | 9 ++++++++- db/seeds.rb | 2 ++ docker-compose.yml | 10 ---------- ops/env.conf | 1 + 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.env b/.env index 19709f1..a09cdcf 100644 --- a/.env +++ b/.env @@ -12,7 +12,4 @@ DEPLOY_HOOK=CHANGEME TAG=dev VIRTUAL_PORT=80 PASSENGER_APP_ENV=development -LDAP_ORGANISATION=Notch8 -LDAP_DOMAIN=notch8.com -LDAP_ADMIN_PASSWORD=admin_password -PHPLDAPADMIN_LDAP_HOSTS=ldap \ No newline at end of file +SKIP_LDAP=true \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cd917f0..9a91ff0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,12 @@ class ApplicationController < ActionController::Base + before_action :fake_sign_in + + def fake_sign_in + if Rails.env.development? && ENV['SKIP_LDAP'] + sign_in(:user, User.first) + end + end + rescue_from DeviseLdapAuthenticatable::LdapException do |exception| render text: exception, status: 500 end diff --git a/app/models/user.rb b/app/models/user.rb index 646f414..9faa0a4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,7 +12,14 @@ class User < ActiveRecord::Base devise :ldap_authenticatable, :rememberable, :trackable # Fetch groups from LDAP. Must come after `devise` call. - include WithLdapGroups + if ENV['SKIP_LDAP'] && Rails.env.development? + def group_list + ['admin'] + end + else + include WithLdapGroups + end + # Method added by Blacklight; Blacklight uses #to_s on your # user class to get a user-displayable login/identifier for diff --git a/db/seeds.rb b/db/seeds.rb index 4edb1e8..cc709d7 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,5 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +User.where(username: 'test').first_or_create diff --git a/docker-compose.yml b/docker-compose.yml index c43f50f..c788897 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,16 +37,6 @@ services: ports: - '389:389' - ldapadmin: - image: osixia/phpldapadmin - env_file: - - .env - ports: - - 6080:80 - - 6443:443 - depends_on: - - ldap - volumes: ldap: slapd: diff --git a/ops/env.conf b/ops/env.conf index 78983ca..2688622 100644 --- a/ops/env.conf +++ b/ops/env.conf @@ -20,3 +20,4 @@ env GOOGLE_OAUTH2_CLIENT_SECRET; env STRIPE_PLATFORM_CLIENT_ID; env STRIPE_SECRET_KEY; env STRIPE_PUBLISHABLE_KEY; +env SKIP_LDAP; \ No newline at end of file From 3cfcb729bb612992c18ff5127ef8a978b7f9222c Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 8 Feb 2018 10:45:49 -0800 Subject: [PATCH 017/204] updates ldap workaround, and enables solr --- .env | 4 ++-- app/models/user.rb | 2 +- config/application.rb | 1 + docker-compose.yml | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env b/.env index a09cdcf..c22a7e2 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ DOCKER_PORT=8000:80 -#SOLR_URL=http://solr:8983/solr/blacklight-core +SOLR_URL=http://localhost:8983/solr/development #POSTGRES_DB=goldenseal #POSTGRES_USER=postgres #POSTGRES_PASSWORD=DatabaseFTW @@ -12,4 +12,4 @@ DEPLOY_HOOK=CHANGEME TAG=dev VIRTUAL_PORT=80 PASSENGER_APP_ENV=development -SKIP_LDAP=true \ No newline at end of file +SKIP_LDAP=true diff --git a/app/models/user.rb b/app/models/user.rb index 9faa0a4..7c680c3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,7 +13,7 @@ class User < ActiveRecord::Base # Fetch groups from LDAP. Must come after `devise` call. if ENV['SKIP_LDAP'] && Rails.env.development? - def group_list + def groups ['admin'] end else diff --git a/config/application.rb b/config/application.rb index d22f3a5..5a18ef5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -29,3 +29,4 @@ class Application < Rails::Application config.active_job.queue_adapter = :resque end end + diff --git a/docker-compose.yml b/docker-compose.yml index c788897..a40244c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: tty: true ports: - "8080:80" + - "3000:3000" depends_on: - ldap From d663d0769a2f682a38f3d83c1a6b1b05d88e2420 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 12 Feb 2018 09:59:54 -0800 Subject: [PATCH 018/204] added downloadable flag to video model --- app/models/video.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/video.rb b/app/models/video.rb index 5c6fba2..b00b049 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -10,6 +10,10 @@ class Video < ActiveFedora::Base include WithTEI + property :downloadable, predicate: ::RDF::Value, multiple: false do |index| + index.as :stored_searchable + end + def self.indexer BaseWorkIndexer end From 750e6bb4c718437be5360d07a92df0d3c8a042ab Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 12 Feb 2018 10:01:11 -0800 Subject: [PATCH 019/204] added config to minterstate file for development --- config/initializers/curation_concerns.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/initializers/curation_concerns.rb b/config/initializers/curation_concerns.rb index a383224..5ed0b9b 100644 --- a/config/initializers/curation_concerns.rb +++ b/config/initializers/curation_concerns.rb @@ -99,7 +99,11 @@ # config.noid_template = ".reeddeeddk" # Store identifier minter's state in a file for later replayability - config.minter_statefile = '/opt/goldenseal/shared/minter-state' if Rails.env.production? + if Rails.env.production? + config.minter_statefile = '/opt/goldenseal/shared/minter-state' + else + config.minter_statefile = './tmp/minter-state' + end # Specify the prefix for Redis keys: # config.redis_namespace = "curation_concerns" From a8214bb68b6b9c39497c57c7d693a207ffc538b6 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 13 Feb 2018 15:36:59 -0800 Subject: [PATCH 020/204] WIP - downloadable checkbox on form, added to show page, conditional to show button --- app/controllers/catalog_controller.rb | 11 ++++++++++ .../curation_concerns/videos_controller.rb | 6 ++++-- app/forms/curation_concerns/video_form.rb | 1 + app/models/solr_document.rb | 4 ++++ app/models/video.rb | 2 +- app/presenters/video_presenter.rb | 5 +++++ .../base/_attribute_rows.html.erb | 3 +++ .../_form_additional_information.html.erb | 4 +++- .../base/_representative_media.html.erb | 1 + .../file_sets/_actions.html.erb | 20 +++++++++++++++++++ 10 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 app/presenters/video_presenter.rb create mode 100644 app/views/curation_concerns/file_sets/_actions.html.erb diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 1f42e27..3825adc 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -29,6 +29,7 @@ def self.search_config # solr field configuration for document/show views # config.show.title_field = solr_name("title", :stored_searchable) # config.show.display_type_field = solr_name("has_model", :symbol) + config.show.downloadable_field = solr_name("downloadable", :stored_searchable) # solr fields that will be treated as facets by the blacklight application # The ordering of the field names is the order of the display @@ -64,6 +65,7 @@ def self.search_config config.add_index_field 'rights_label_ss', label: 'Content License' config.add_index_field solr_name('human_readable_type', :stored_searchable) config.add_index_field solr_name('format', :stored_searchable) + config.add_index_field solr_name('downloadable', :stored_searchable) # "fielded" search configuration. Used by pulldown among other places. # For supported keys in hash, see rdoc for Blacklight::SearchFields @@ -238,6 +240,15 @@ def self.search_config } end + # config.add_search_field('downloadable') do |field| + # field.include_in_simple_select = false + # solr_name = 'downloadable' + # field.solr_local_parameters = { + # qf: solr_name, + # pf: solr_name + # } + # end + # "sort results by" select (pulldown) # label in pulldown is followed by the name of the SOLR field to sort by and # whether the sort is ascending or descending (it must be asc or desc diff --git a/app/controllers/curation_concerns/videos_controller.rb b/app/controllers/curation_concerns/videos_controller.rb index 012cecd..bd0c7b0 100644 --- a/app/controllers/curation_concerns/videos_controller.rb +++ b/app/controllers/curation_concerns/videos_controller.rb @@ -1,12 +1,14 @@ class CurationConcerns::VideosController < ApplicationController include CurationConcerns::CurationConcernController - + include AttachFiles before_filter :add_attachments_to_files, only: :create set_curation_concern_type Video def show_presenter - ::WorkShowPresenter + ::VideoPresenter end + + delegate :downloadable, to: :solr_document end diff --git a/app/forms/curation_concerns/video_form.rb b/app/forms/curation_concerns/video_form.rb index c928277..3576f83 100644 --- a/app/forms/curation_concerns/video_form.rb +++ b/app/forms/curation_concerns/video_form.rb @@ -1,5 +1,6 @@ module CurationConcerns class VideoForm < TeiForm self.model_class = ::Video + self.terms += [:downloadable] end end diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 7ca159e..f352dc9 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -70,4 +70,8 @@ def thumbnail_id def on_campus? read_groups.include? OnCampusAccess::OnCampus end + + def downloadable + self[Solrizer.solr_name('downloadable')] + end end diff --git a/app/models/video.rb b/app/models/video.rb index b00b049..9040e4b 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -10,7 +10,7 @@ class Video < ActiveFedora::Base include WithTEI - property :downloadable, predicate: ::RDF::Value, multiple: false do |index| + property :downloadable, predicate: ::RDF::Vocab::DC.Policy, multiple: false do |index| index.as :stored_searchable end diff --git a/app/presenters/video_presenter.rb b/app/presenters/video_presenter.rb new file mode 100644 index 0000000..f94b4c2 --- /dev/null +++ b/app/presenters/video_presenter.rb @@ -0,0 +1,5 @@ +class VideoPresenter < WorkShowPresenter + include DisplayFields + + delegate :downloadable, to: :solr_document +end diff --git a/app/views/curation_concerns/base/_attribute_rows.html.erb b/app/views/curation_concerns/base/_attribute_rows.html.erb index 4e4f2cc..25a5bf3 100644 --- a/app/views/curation_concerns/base/_attribute_rows.html.erb +++ b/app/views/curation_concerns/base/_attribute_rows.html.erb @@ -20,4 +20,7 @@ <%= @presenter.attribute_to_html(:mime_type) %> <%= @presenter.attribute_to_html(:filename) %> <%= @presenter.attribute_to_html(:admin_set) %> + <%= @presenter.attribute_to_html(:downloadable) %> + +

I am the attribute rows page

diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index 3d674ac..30a58b8 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -14,5 +14,7 @@ <%= f.input :note, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> - <%= f.input :date_issued, wrapper: :inline, input_html: { value: f.object.date_issued, class: 'datepicker' } %> + <%= f.check_box :downloadable, as: :boolean, input_html: { class: 'form-control' } %> Downloadable + <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> +

I am the form additional information page

diff --git a/app/views/curation_concerns/base/_representative_media.html.erb b/app/views/curation_concerns/base/_representative_media.html.erb index 10d86ba..ab21639 100644 --- a/app/views/curation_concerns/base/_representative_media.html.erb +++ b/app/views/curation_concerns/base/_representative_media.html.erb @@ -2,3 +2,4 @@ <%# AdminSetPresenter doesn't have tei_id %> <%= media_display fs, transcript_id: work.try(:tei_id) %> <% end %> +

I am representative media page

diff --git a/app/views/curation_concerns/file_sets/_actions.html.erb b/app/views/curation_concerns/file_sets/_actions.html.erb new file mode 100644 index 0000000..284a459 --- /dev/null +++ b/app/views/curation_concerns/file_sets/_actions.html.erb @@ -0,0 +1,20 @@ +<% if can?(:edit, file_set.id) %> + <%= link_to( 'Edit', edit_polymorphic_path([main_app, file_set]), + { class: 'btn btn-default', title: "Edit #{file_set}" }) %> + <%= link_to( 'Rollback', main_app.versions_curation_concerns_file_set_path(file_set), + { class: 'btn btn-default', title: "Rollback to previous version" }) %> +<% end %> +<% if can?(:destroy, file_set.id) %> + <%= link_to( 'Delete', polymorphic_path([main_app, file_set]), + class: 'btn btn-default', method: :delete, title: "Delete #{file_set}", + data: {confirm: "Deleting #{file_set} from #{application_name} is permanent. Click OK to delete this from #{application_name}, or Cancel to cancel this operation"} + )%> +<% end %> +<% if can?(:read, file_set.id) %> + <% if @presenter.downloadable.include?("1") %> +

HIDE FOR DOWNLOADABLE FALSE

+

<%= @presenter.downloadable %>

+ <%= link_to 'Download', main_app.download_path(file_set), + class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> + <% end %> +<% end %> \ No newline at end of file From 4f33069c13f8cb7a16c9487a687b23530c93c9f7 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 13 Feb 2018 16:06:01 -0800 Subject: [PATCH 021/204] remove some extra placeholder text used for dev help --- app/views/curation_concerns/base/_attribute_rows.html.erb | 2 -- .../base/_form_additional_information.html.erb | 4 ++-- .../curation_concerns/base/_representative_media.html.erb | 7 ++++--- app/views/curation_concerns/file_sets/_actions.html.erb | 4 +--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/views/curation_concerns/base/_attribute_rows.html.erb b/app/views/curation_concerns/base/_attribute_rows.html.erb index 25a5bf3..2fca40b 100644 --- a/app/views/curation_concerns/base/_attribute_rows.html.erb +++ b/app/views/curation_concerns/base/_attribute_rows.html.erb @@ -22,5 +22,3 @@ <%= @presenter.attribute_to_html(:admin_set) %> <%= @presenter.attribute_to_html(:downloadable) %> -

I am the attribute rows page

- diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index 30a58b8..135c777 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -14,7 +14,7 @@ <%= f.input :note, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> - <%= f.check_box :downloadable, as: :boolean, input_html: { class: 'form-control' } %> Downloadable + <%= f.check_box :downloadable, as: :boolean, checked_value: true, unchecked_value: false, input_html: { class: 'form-control' } %> Downloadable <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> -

I am the form additional information page

+ diff --git a/app/views/curation_concerns/base/_representative_media.html.erb b/app/views/curation_concerns/base/_representative_media.html.erb index ab21639..1528e28 100644 --- a/app/views/curation_concerns/base/_representative_media.html.erb +++ b/app/views/curation_concerns/base/_representative_media.html.erb @@ -1,5 +1,6 @@ <% if work.representative_id.present? && (fs = ::FileSet.load_instance_from_solr(work.representative_id)) %> - <%# AdminSetPresenter doesn't have tei_id %> - <%= media_display fs, transcript_id: work.try(:tei_id) %> + <% if work.downloadable.present? && work.downloadable.include?("1") %> + <%# AdminSetPresenter doesn't have tei_id %> + <%= media_display fs, transcript_id: work.try(:tei_id) %> + <% end %> <% end %> -

I am representative media page

diff --git a/app/views/curation_concerns/file_sets/_actions.html.erb b/app/views/curation_concerns/file_sets/_actions.html.erb index 284a459..6379139 100644 --- a/app/views/curation_concerns/file_sets/_actions.html.erb +++ b/app/views/curation_concerns/file_sets/_actions.html.erb @@ -11,9 +11,7 @@ )%> <% end %> <% if can?(:read, file_set.id) %> - <% if @presenter.downloadable.include?("1") %> -

HIDE FOR DOWNLOADABLE FALSE

-

<%= @presenter.downloadable %>

+ <% if @presenter.downloadable && @presenter.downloadable.include?("1") %> <%= link_to 'Download', main_app.download_path(file_set), class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> <% end %> From 5d7a7892840a85ab19e8492a703142bb49eacb68 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 13 Feb 2018 16:43:44 -0800 Subject: [PATCH 022/204] updated downloadable label for search results page --- app/controllers/catalog_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 3825adc..315c590 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -65,7 +65,7 @@ def self.search_config config.add_index_field 'rights_label_ss', label: 'Content License' config.add_index_field solr_name('human_readable_type', :stored_searchable) config.add_index_field solr_name('format', :stored_searchable) - config.add_index_field solr_name('downloadable', :stored_searchable) + config.add_index_field solr_name('downloadable', :stored_searchable), label: 'Downloadable' # "fielded" search configuration. Used by pulldown among other places. # For supported keys in hash, see rdoc for Blacklight::SearchFields From 4ab7ba5cc025d949a859a900febe29eda83da776 Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Wed, 14 Feb 2018 21:30:34 -0800 Subject: [PATCH 023/204] adds link to advanced search, and gets advanced search rendering --- .../advanced_controller.rb | 23 +++++++++++++++++++ app/views/shared/_site_search.html.erb | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/controllers/blacklight_advanced_search/advanced_controller.rb diff --git a/app/controllers/blacklight_advanced_search/advanced_controller.rb b/app/controllers/blacklight_advanced_search/advanced_controller.rb new file mode 100644 index 0000000..7a5d638 --- /dev/null +++ b/app/controllers/blacklight_advanced_search/advanced_controller.rb @@ -0,0 +1,23 @@ +class BlacklightAdvancedSearch::AdvancedController < CatalogController + include Hydra::Controller::SearchBuilder + + def index + unless request.method==:post + @response = get_advanced_search_facets + end + end + + protected + def get_advanced_search_facets + # We want to find the facets available for the current search, but: + # * IGNORING current query (add in facets_for_advanced_search_form filter) + # * IGNORING current advanced search facets (remove add_advanced_search_to_solr filter) + response, _ = search_results(params, search_params_logic) do |search_builder| + search_builder.except(:add_advanced_search_to_solr).append(:facets_for_advanced_search_form) + search_builder.current_ability = current_ability + search_builder + end + + return response + end +end diff --git a/app/views/shared/_site_search.html.erb b/app/views/shared/_site_search.html.erb index e5cad1e..f39420a 100644 --- a/app/views/shared/_site_search.html.erb +++ b/app/views/shared/_site_search.html.erb @@ -10,8 +10,9 @@ <%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %> <%= text_field_tag(:q, params[:q], class: "q search-query form-control", id: "catalog_search", placeholder: t('curation_concerns.search.form.q.placeholder'), tabindex: "1", type: "search") %> - + <%= link_to_unless_current "Advanced", advanced_search_path %> <% end %> From f81a4d06c037794452452db1aba180347736e59b Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Wed, 14 Feb 2018 21:37:56 -0800 Subject: [PATCH 024/204] adds advanced search views --- .../advanced/_advanced_search_facets.html.erb | 16 +++++++ ..._advanced_search_facets_as_select.html.erb | 30 +++++++++++++ .../advanced/_advanced_search_fields.html.erb | 8 ++++ .../advanced/_advanced_search_form.html.erb | 43 +++++++++++++++++++ .../advanced/_advanced_search_help.html.erb | 24 +++++++++++ .../_advanced_search_submit_btns.html.erb | 12 ++++++ app/views/advanced/_facet_limit.html.erb | 15 +++++++ app/views/advanced/index.html.erb | 21 +++++++++ 8 files changed, 169 insertions(+) create mode 100644 app/views/advanced/_advanced_search_facets.html.erb create mode 100644 app/views/advanced/_advanced_search_facets_as_select.html.erb create mode 100644 app/views/advanced/_advanced_search_fields.html.erb create mode 100644 app/views/advanced/_advanced_search_form.html.erb create mode 100644 app/views/advanced/_advanced_search_help.html.erb create mode 100644 app/views/advanced/_advanced_search_submit_btns.html.erb create mode 100644 app/views/advanced/_facet_limit.html.erb create mode 100644 app/views/advanced/index.html.erb diff --git a/app/views/advanced/_advanced_search_facets.html.erb b/app/views/advanced/_advanced_search_facets.html.erb new file mode 100644 index 0000000..2eb47f0 --- /dev/null +++ b/app/views/advanced/_advanced_search_facets.html.erb @@ -0,0 +1,16 @@ +<%# used to render facets with checkboxes on advanced search form, + we pretty much just use the built-in blacklight render_facet_partials + helper. + + But we've provided a local override of the _facet_limit + partial in our own `views/advanced/_facet_limit.html.erb`, + that is written to include checkboxes for form selection. + + This is the default display of facets, but you can + also choose to use _advanced_search_facets_as_select, + for a chosen.js-compatible multi-select. +%> + +
+ <%= render_facet_partials facet_field_names %> +
diff --git a/app/views/advanced/_advanced_search_facets_as_select.html.erb b/app/views/advanced/_advanced_search_facets_as_select.html.erb new file mode 100644 index 0000000..6c3380e --- /dev/null +++ b/app/views/advanced/_advanced_search_facets_as_select.html.erb @@ -0,0 +1,30 @@ +<%# alternate version of facets on form that renders using multi-select. + Has to copy and paste more code from blacklight than default, making + it somewhat more fragile. + + Logic taken from facets_helper_behavior.rb, #render_facet_partials and + #render_facet_limit. +%> + +<% facets_from_request(facet_field_names).each do |display_facet| %> + <% if should_render_facet?(display_facet) %> +
+ <%= label_tag display_facet.name.parameterize, :class => "col-sm-3 control-label" do %> + <%= facet_field_label(display_facet.name) %> + <% end %> + +
+ <%= content_tag(:select, :multiple => true, + :name => "f_inclusive[#{display_facet.name}][]", + :id => display_facet.name.parameterize, + :class => "form-control advanced-search-facet-select") do %> + <% display_facet.items.each do |facet_item| %> + <%= content_tag :option, :value => facet_item.value, :selected => facet_value_checked?(display_facet.name, facet_item.value) do %> + <%= facet_item.label %>  (<%= number_with_delimiter facet_item.hits %>) + <% end %> + <% end %> + <% end %> +
+
+ <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/advanced/_advanced_search_fields.html.erb b/app/views/advanced/_advanced_search_fields.html.erb new file mode 100644 index 0000000..eec867b --- /dev/null +++ b/app/views/advanced/_advanced_search_fields.html.erb @@ -0,0 +1,8 @@ +<%- search_fields_for_advanced_search.each do |key, field_def| -%> +
+ <%= label_tag key, "#{field_def.label }", :class => "col-sm-3 control-label" %> +
+ <%= text_field_tag key, label_tag_default_for(key), :class => 'form-control' %> +
+
+<%- end -%> diff --git a/app/views/advanced/_advanced_search_form.html.erb b/app/views/advanced/_advanced_search_form.html.erb new file mode 100644 index 0000000..a14374f --- /dev/null +++ b/app/views/advanced/_advanced_search_form.html.erb @@ -0,0 +1,43 @@ + <% unless (search_context_str = render_search_to_s( advanced_search_context)).blank? %> +
+

<%= t 'blacklight_advanced_search.form.search_context' %>

+ <%= search_context_str %> +
+ <% end %> + +<%= form_tag catalog_index_path, :class => 'advanced form-horizontal', :method => :get do %> + + <%= render_hash_as_hidden_fields(params_for_search(advanced_search_context, {})) %> + +
+ +
+

+ <%= t('blacklight_advanced_search.form.query_criteria_heading_html', :select_menu => select_menu_for_field_operator ) %> +

+ + +
+ +
+

<%= t('blacklight_advanced_search.form.limit_criteria_heading_html')%>

+ +
+ <% if blacklight_config.try(:advanced_search).try {|h| h[:form_facet_partial] } %> + <%= render blacklight_config.advanced_search[:form_facet_partial] %> + <% else %> + <%= render 'advanced_search_facets' %> + <% end %> +
+
+
+ +
+ +
+ <%= render 'advanced_search_submit_btns' %> +
+ +<% end %> diff --git a/app/views/advanced/_advanced_search_help.html.erb b/app/views/advanced/_advanced_search_help.html.erb new file mode 100644 index 0000000..1b93a2c --- /dev/null +++ b/app/views/advanced/_advanced_search_help.html.erb @@ -0,0 +1,24 @@ +
+
Search tips
+
+
    +
  • Select "match all" to require all fields. +
  • + +
  • Select "match any" to find at least one field. +
  • + +
  • Combine keywords and attributes to find specific items. +
  • + +
  • Use quotation marks to search as a phrase. + +
  • Use "+" before a term to make it required. (Otherwise results matching only some of your terms may be included).
  • + +
  • Use "-" before a word or phrase to exclude. + +
  • Use "OR", "AND", and "NOT" to create complex boolean logic. You can use parentheses in your complex expressions.
  • +
  • Truncation and wildcards are not supported - word-stemming is done automatically.
  • +
+
+
\ No newline at end of file diff --git a/app/views/advanced/_advanced_search_submit_btns.html.erb b/app/views/advanced/_advanced_search_submit_btns.html.erb new file mode 100644 index 0000000..31e8880 --- /dev/null +++ b/app/views/advanced/_advanced_search_submit_btns.html.erb @@ -0,0 +1,12 @@ +
+ <%= label_tag(:sort, t('blacklight_advanced_search.form.sort_label'), :class => "control-label") %> + + <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort])), :class => "form-control sort-select") %> + <%= hidden_field_tag(:search_field, blacklight_config.advanced_search[:url_key]) %> +
+ +
+ <%= link_to t('blacklight_advanced_search.form.start_over'), advanced_search_path, :class =>"btn btn-default advanced-search-start-over" %> + + <%= submit_tag t('blacklight_advanced_search.form.search_btn'), :class=>'btn btn-primary advanced-search-submit', :id => "advanced-search-submit" %> +
\ No newline at end of file diff --git a/app/views/advanced/_facet_limit.html.erb b/app/views/advanced/_facet_limit.html.erb new file mode 100644 index 0000000..1834a87 --- /dev/null +++ b/app/views/advanced/_facet_limit.html.erb @@ -0,0 +1,15 @@ +
    + <% display_facet.items.each do |item| -%> +
  • + + <%= check_box_tag "f_inclusive[#{solr_field}][]", item.value.to_sym, facet_value_checked?(solr_field, item.value), :id => "f_inclusive_#{solr_field}_#{item.value.parameterize}"%> + + + + <%= label_tag "f_inclusive_#{solr_field}_#{item.value.parameterize}" do %> + <%= render_facet_value(solr_field, item, :suppress_link => true) %> + <% end %> + +
  • + <% end -%> +
\ No newline at end of file diff --git a/app/views/advanced/index.html.erb b/app/views/advanced/index.html.erb new file mode 100644 index 0000000..e7d482b --- /dev/null +++ b/app/views/advanced/index.html.erb @@ -0,0 +1,21 @@ +<% @page_title = "More Search Options - #{application_name}" %> + +
+ +

+ <%= t('blacklight_advanced_search.form.title') %> + <%= link_to t('blacklight_advanced_search.form.start_over'), advanced_search_path, :class =>"btn btn-default pull-right advanced-search-start-over" %> +

+ +
+ +
+ <%= render 'advanced_search_form' %> +
+
+ <%= render "advanced_search_help" %> +
+ +
+ +
\ No newline at end of file From e6c74603abf5c9f4885d15e55946cbf2eafd0017 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 15 Feb 2018 10:49:13 -0800 Subject: [PATCH 025/204] added download toggle for videos in collection --- .../collections_controller_behavior.rb | 108 ++++++++++++++++++ app/views/collections/_show_actions.html.erb | 12 ++ config/routes.rb | 3 + 3 files changed, 123 insertions(+) create mode 100644 app/controllers/curation_concerns/collections_controller_behavior.rb create mode 100644 app/views/collections/_show_actions.html.erb diff --git a/app/controllers/curation_concerns/collections_controller_behavior.rb b/app/controllers/curation_concerns/collections_controller_behavior.rb new file mode 100644 index 0000000..a81b5eb --- /dev/null +++ b/app/controllers/curation_concerns/collections_controller_behavior.rb @@ -0,0 +1,108 @@ +module CurationConcerns + module CollectionsControllerBehavior + extend ActiveSupport::Concern + include Hydra::CollectionsControllerBehavior + include Hydra::Controller::SearchBuilder + + included do + before_action :filter_docs_with_read_access!, except: [:show, :enable_downloads, :disable_downloads] + self.search_params_logic += [:add_access_controls_to_solr_params, :add_advanced_parse_q_to_solr] + layout 'curation_concerns/1_column' + skip_load_and_authorize_resource only: [:show, :enable_downloads, :disable_downloads] + end + + def new + super + form + end + + def edit + super + form + end + + def show + presenter + super + end + + # overriding the method in Hydra::Collections so the search builder can find the collection + def collection + action_name == 'show' ? @presenter : @collection + end + + def enable_downloads + collection = Collection.find(params[:id]) + toggle_downloadable(collection, "1") + redirect_to collection_path(collection), notice: 'Collection was successfully updated.' + end + + def disable_downloads + collection = Collection.find(params[:id]) + toggle_downloadable(collection, "0") + redirect_to collection_path(collection), notice: 'Collection was successfully updated.' + end + + protected + + def toggle_downloadable(collection, value) + authorize! :edit, collection + videos = collection.works.select{ |work| work.class == Video } + videos.each do |video| + actor = CurationConcerns::CurationConcern.actor(video, current_user, { downloadable: value }) + actor.update + end + end + + def filter_docs_with_read_access! + super + flash.delete(:notice) if flash.notice == 'Select something first' + end + + def presenter + @presenter ||= begin + _, document_list = search_results(params, self.class.search_params_logic + [:find_one]) + curation_concern = document_list.first + raise CanCan::AccessDenied unless curation_concern + presenter_class.new(curation_concern, current_ability) + end + end + + def presenter_class + CurationConcerns::CollectionPresenter + end + + def collection_member_search_builder_class + CurationConcerns::SearchBuilder + end + + def collection_params + form_class.model_attributes(params[:collection]) + end + + def query_collection_members + params[:q] = params[:cq] + super + end + + def after_destroy(id) + respond_to do |format| + format.html { redirect_to collections_path, notice: 'Collection was successfully deleted.' } + format.json { render json: { id: id }, status: :destroyed, location: @collection } + end + end + + def form + @form ||= form_class.new(@collection) + end + + def form_class + CurationConcerns::Forms::CollectionEditForm + end + + # Include 'catalog' and 'curation_concerns/base' in the search path for views + def _prefixes + @_prefixes ||= super + ['catalog', 'curation_concerns/base'] + end + end +end diff --git a/app/views/collections/_show_actions.html.erb b/app/views/collections/_show_actions.html.erb new file mode 100644 index 0000000..2b5724f --- /dev/null +++ b/app/views/collections/_show_actions.html.erb @@ -0,0 +1,12 @@ + +

this is collection actions partial

+<% if can? :edit, @presenter.id %> +

Actions

+

+ <%= link_to "Edit", collections.edit_collection_path, class: 'btn btn-default' %>    + <%= link_to "Add files from your dashboard", search_path_for_my_works, class: 'btn btn-default' %>   + <%= link_to "Enable Downloads for all items", enable_downloads_path(@presenter), class: 'btn btn-default' %>   + <%= link_to "Disable Downloads for all items", disable_downloads_path(@presenter), class: 'btn btn-default' %> + +

+<%end %> diff --git a/config/routes.rb b/config/routes.rb index bcad15b..dc2750c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,4 +25,7 @@ constraints resque_web_constraint do mount ResqueWeb::Engine => "/resque" end + + get 'collections/:id/enable_downloads' => 'collections#enable_downloads', as: :enable_downloads + get 'collections/:id/disable_downloads' => 'collections#disable_downloads', as: :disable_downloads end From f9c74acae9f582c413cb73f486fa9bf87cc58ce7 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 15 Feb 2018 10:49:57 -0800 Subject: [PATCH 026/204] removed helper notice --- app/views/collections/_show_actions.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/collections/_show_actions.html.erb b/app/views/collections/_show_actions.html.erb index 2b5724f..38f747e 100644 --- a/app/views/collections/_show_actions.html.erb +++ b/app/views/collections/_show_actions.html.erb @@ -1,5 +1,4 @@ -

this is collection actions partial

<% if can? :edit, @presenter.id %>

Actions

From e943bf28450c646a01c6c20528e2a7f71746b8f8 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 15 Feb 2018 11:11:26 -0800 Subject: [PATCH 027/204] moved location of downloadable checkbox and aded new label --- .../base/_form_additional_information.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index 135c777..d7fceaa 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -14,7 +14,8 @@ <%= f.input :note, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> - <%= f.check_box :downloadable, as: :boolean, checked_value: true, unchecked_value: false, input_html: { class: 'form-control' } %> Downloadable <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> + <%= f.check_box :downloadable, as: :boolean, checked_value: true, unchecked_value: false, input_html: { class: 'form-control' } %> Make Downloadable + From 746d16bd824d5a746e869ecb05463c5ca071c410 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 15 Feb 2018 13:06:38 -0800 Subject: [PATCH 028/204] fixing labels and form field --- app/views/curation_concerns/base/_attribute_rows.html.erb | 2 +- .../base/_form_additional_information.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/curation_concerns/base/_attribute_rows.html.erb b/app/views/curation_concerns/base/_attribute_rows.html.erb index 2fca40b..e16c239 100644 --- a/app/views/curation_concerns/base/_attribute_rows.html.erb +++ b/app/views/curation_concerns/base/_attribute_rows.html.erb @@ -20,5 +20,5 @@ <%= @presenter.attribute_to_html(:mime_type) %> <%= @presenter.attribute_to_html(:filename) %> <%= @presenter.attribute_to_html(:admin_set) %> - <%= @presenter.attribute_to_html(:downloadable) %> + <%= @presenter.attribute_to_html(:downloadable, label: 'Download enabled') %> diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index d7fceaa..e0bee1e 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -15,7 +15,7 @@ <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> - <%= f.check_box :downloadable, as: :boolean, checked_value: true, unchecked_value: false, input_html: { class: 'form-control' } %> Make Downloadable + <%= f.check_box :downloadable, as: :boolean, checked_value: "1", unchecked_value: "0", input_html: { class: 'form-control' } %>  Enable Video Downloads From f6183c147b0303c6d765c361a78c5bc897f423f3 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 19 Feb 2018 09:28:17 -0800 Subject: [PATCH 029/204] updated attribute rows to show true or false instead of 1 or 0 --- .../base/_attribute_partial.html.erb | 38 +++++++++++++++++++ .../base/_attribute_rows.html.erb | 8 +++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 app/views/curation_concerns/base/_attribute_partial.html.erb diff --git a/app/views/curation_concerns/base/_attribute_partial.html.erb b/app/views/curation_concerns/base/_attribute_partial.html.erb new file mode 100644 index 0000000..adf5103 --- /dev/null +++ b/app/views/curation_concerns/base/_attribute_partial.html.erb @@ -0,0 +1,38 @@ +<% is_not_faceted = false unless defined?(is_not_faceted) %> +<% if value.present? %> + + <%= name %> + +

    +
  • + + <% if value.is_a?(Array) %> + + <% if is_not_faceted %> + <% value.each do |e| %> + <% if e == '1' %> + <%= sanitize('true', tags: %w[a], attributes: %w[href target]) %> + <% elsif e == '0' %> + <%= sanitize('false', tags: %w[a], attributes: %w[href target]) %> + <% else %> + <%= sanitize(e, tags: %w[a], attributes: %w[href target]) %> + <% end %> + <% end %> + <% else %> + <% value.each do |e| %> + <%= e %> + <% end %> + <% end %> + + <% else %> + <% if is_not_faceted %> + <%= sanitize(value, tags: %w[a], attributes: %w[href target]) %> + <% else %> + <%= value %> + <% end %> + <% end %> +
  • +
+ + +<% end %> diff --git a/app/views/curation_concerns/base/_attribute_rows.html.erb b/app/views/curation_concerns/base/_attribute_rows.html.erb index e16c239..3275c2a 100644 --- a/app/views/curation_concerns/base/_attribute_rows.html.erb +++ b/app/views/curation_concerns/base/_attribute_rows.html.erb @@ -1,3 +1,5 @@ + + <%= @presenter.attribute_to_html(:description) %> <%= @presenter.attribute_to_html(:subject, catalog_search_link: true) %> <%= @presenter.attribute_to_html(:creator, catalog_search_link: true ) %> @@ -20,5 +22,9 @@ <%= @presenter.attribute_to_html(:mime_type) %> <%= @presenter.attribute_to_html(:filename) %> <%= @presenter.attribute_to_html(:admin_set) %> - <%= @presenter.attribute_to_html(:downloadable, label: 'Download enabled') %> + + <% + attrs = attributes_hash = @presenter.solr_document.response['response']['docs'].first + %> + <%= render partial: 'attribute_partial', locals: { name: 'Download enabled', value: attrs['downloadable_tesim'], is_not_faceted: true } %> From e37c8e29251c4a2842e6ab9570904bcc218bd4c0 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 19 Feb 2018 12:24:26 -0800 Subject: [PATCH 030/204] updated to store boolean --- app/models/solr_document.rb | 2 +- app/models/video.rb | 4 ++++ app/views/curation_concerns/base/_attribute_rows.html.erb | 7 ++----- .../base/_form_additional_information.html.erb | 2 +- .../curation_concerns/base/_representative_media.html.erb | 2 +- app/views/curation_concerns/file_sets/_actions.html.erb | 8 +++----- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index f352dc9..1bb7333 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -72,6 +72,6 @@ def on_campus? end def downloadable - self[Solrizer.solr_name('downloadable')] + self['downloadable_bsi'] end end diff --git a/app/models/video.rb b/app/models/video.rb index 9040e4b..3be8d2f 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -14,6 +14,10 @@ class Video < ActiveFedora::Base index.as :stored_searchable end + def downloadable= value + super value.to_s.downcase == "true" + end + def self.indexer BaseWorkIndexer end diff --git a/app/views/curation_concerns/base/_attribute_rows.html.erb b/app/views/curation_concerns/base/_attribute_rows.html.erb index 3275c2a..4c72165 100644 --- a/app/views/curation_concerns/base/_attribute_rows.html.erb +++ b/app/views/curation_concerns/base/_attribute_rows.html.erb @@ -1,5 +1,4 @@ - <%= @presenter.attribute_to_html(:description) %> <%= @presenter.attribute_to_html(:subject, catalog_search_link: true) %> <%= @presenter.attribute_to_html(:creator, catalog_search_link: true ) %> @@ -22,9 +21,7 @@ <%= @presenter.attribute_to_html(:mime_type) %> <%= @presenter.attribute_to_html(:filename) %> <%= @presenter.attribute_to_html(:admin_set) %> + <%= @presenter.attribute_to_html(:downloadable, include_empty: true) %> - <% - attrs = attributes_hash = @presenter.solr_document.response['response']['docs'].first - %> - <%= render partial: 'attribute_partial', locals: { name: 'Download enabled', value: attrs['downloadable_tesim'], is_not_faceted: true } %> + diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index e0bee1e..9c587db 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -15,7 +15,7 @@ <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> - <%= f.check_box :downloadable, as: :boolean, checked_value: "1", unchecked_value: "0", input_html: { class: 'form-control' } %>  Enable Video Downloads + <%= f.check_box :downloadable, { input_html: { class: 'form-control' }}, 'true', 'false' %>  Enable Video Downloads diff --git a/app/views/curation_concerns/base/_representative_media.html.erb b/app/views/curation_concerns/base/_representative_media.html.erb index 1528e28..8db7297 100644 --- a/app/views/curation_concerns/base/_representative_media.html.erb +++ b/app/views/curation_concerns/base/_representative_media.html.erb @@ -1,5 +1,5 @@ <% if work.representative_id.present? && (fs = ::FileSet.load_instance_from_solr(work.representative_id)) %> - <% if work.downloadable.present? && work.downloadable.include?("1") %> + <% if work.downloadable.present? && work.downloadable == true %> <%# AdminSetPresenter doesn't have tei_id %> <%= media_display fs, transcript_id: work.try(:tei_id) %> <% end %> diff --git a/app/views/curation_concerns/file_sets/_actions.html.erb b/app/views/curation_concerns/file_sets/_actions.html.erb index 6379139..3642ecc 100644 --- a/app/views/curation_concerns/file_sets/_actions.html.erb +++ b/app/views/curation_concerns/file_sets/_actions.html.erb @@ -10,9 +10,7 @@ data: {confirm: "Deleting #{file_set} from #{application_name} is permanent. Click OK to delete this from #{application_name}, or Cancel to cancel this operation"} )%> <% end %> -<% if can?(:read, file_set.id) %> - <% if @presenter.downloadable && @presenter.downloadable.include?("1") %> - <%= link_to 'Download', main_app.download_path(file_set), - class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> - <% end %> +<% if can?(:read, file_set.id) && @presenter.downloadable %> + <%= link_to 'Download', main_app.download_path(file_set), + class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> <% end %> \ No newline at end of file From 936c936757c28eb73bef0fb310f36dd33d32c65a Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 19 Feb 2018 12:42:11 -0800 Subject: [PATCH 031/204] updated search results index --- app/controllers/catalog_controller.rb | 20 +++++++++---------- .../collections_controller_behavior.rb | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 315c590..127ed98 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -29,7 +29,7 @@ def self.search_config # solr field configuration for document/show views # config.show.title_field = solr_name("title", :stored_searchable) # config.show.display_type_field = solr_name("has_model", :symbol) - config.show.downloadable_field = solr_name("downloadable", :stored_searchable) + config.show.downloadable_field = solr_name("downloadable_bsi", :stored_searchable) # solr fields that will be treated as facets by the blacklight application # The ordering of the field names is the order of the display @@ -65,7 +65,7 @@ def self.search_config config.add_index_field 'rights_label_ss', label: 'Content License' config.add_index_field solr_name('human_readable_type', :stored_searchable) config.add_index_field solr_name('format', :stored_searchable) - config.add_index_field solr_name('downloadable', :stored_searchable), label: 'Downloadable' + config.add_index_field solr_name('downloadable_bsi', :stored_searchable), label: 'Download Enabled' # "fielded" search configuration. Used by pulldown among other places. # For supported keys in hash, see rdoc for Blacklight::SearchFields @@ -240,14 +240,14 @@ def self.search_config } end - # config.add_search_field('downloadable') do |field| - # field.include_in_simple_select = false - # solr_name = 'downloadable' - # field.solr_local_parameters = { - # qf: solr_name, - # pf: solr_name - # } - # end + config.add_search_field('downloadable') do |field| + field.include_in_simple_select = false + solr_name = 'downloadable_bsi' + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end # "sort results by" select (pulldown) # label in pulldown is followed by the name of the SOLR field to sort by and diff --git a/app/controllers/curation_concerns/collections_controller_behavior.rb b/app/controllers/curation_concerns/collections_controller_behavior.rb index a81b5eb..571d53c 100644 --- a/app/controllers/curation_concerns/collections_controller_behavior.rb +++ b/app/controllers/curation_concerns/collections_controller_behavior.rb @@ -33,13 +33,13 @@ def collection def enable_downloads collection = Collection.find(params[:id]) - toggle_downloadable(collection, "1") + toggle_downloadable(collection, true) redirect_to collection_path(collection), notice: 'Collection was successfully updated.' end def disable_downloads collection = Collection.find(params[:id]) - toggle_downloadable(collection, "0") + toggle_downloadable(collection, false) redirect_to collection_path(collection), notice: 'Collection was successfully updated.' end From 90ae068fe426a6ffc7a8fcf5337cec5e5f796f64 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 19 Feb 2018 14:56:35 -0800 Subject: [PATCH 032/204] check for non-video items to still have download button --- app/views/curation_concerns/file_sets/_actions.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/curation_concerns/file_sets/_actions.html.erb b/app/views/curation_concerns/file_sets/_actions.html.erb index 3642ecc..486a67a 100644 --- a/app/views/curation_concerns/file_sets/_actions.html.erb +++ b/app/views/curation_concerns/file_sets/_actions.html.erb @@ -10,7 +10,9 @@ data: {confirm: "Deleting #{file_set} from #{application_name} is permanent. Click OK to delete this from #{application_name}, or Cancel to cancel this operation"} )%> <% end %> -<% if can?(:read, file_set.id) && @presenter.downloadable %> - <%= link_to 'Download', main_app.download_path(file_set), +<% if can?(:read, file_set.id) %> + <% if @presenter.human_readable_type != "Video" || (@presenter.human_readable_type == "Video" && @presenter.downloadable) %> + <%= link_to 'Download', main_app.download_path(file_set), class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> + <% end %> <% end %> \ No newline at end of file From 4351adca4239db6932a62b3e72708105617e3eab Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 20 Feb 2018 18:04:07 -0800 Subject: [PATCH 033/204] styled advanced search page --- app/assets/stylesheets/wustl.scss | 40 ++++++++++++++++++- app/controllers/catalog_controller.rb | 10 ++++- .../advanced/_advanced_search_form.html.erb | 16 +++++--- .../advanced/_advanced_search_help.html.erb | 40 +++++++++---------- .../_advanced_search_submit_btns.html.erb | 9 +++-- app/views/advanced/index.html.erb | 9 +++-- app/views/shared/_site_search.html.erb | 2 +- 7 files changed, 89 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/wustl.scss b/app/assets/stylesheets/wustl.scss index 745086f..01d859a 100644 --- a/app/assets/stylesheets/wustl.scss +++ b/app/assets/stylesheets/wustl.scss @@ -197,5 +197,43 @@ body { a:hover { text-decoration: none; } - } + + } + span.label-and-count>label { + display: inline; + font-weight: normal; + overflow: hidden; + } + + span.facet-count { + float: right; + } + + .facet-values .facet-label { + padding-left: 5px !important; + text-indent: 0 !important; + display:inline; + } + .submit-buttons { + padding-top: 30px; + } + ul.advanced-help { + padding-left: 20px; + } + .advanced-help-panel { + background-color: #eee; + padding: 10px; + } + h3.limit-criteria-heading, h3.query-criteria-heading { + margin-top: 0; + font-size: 20px; + } + h5.panel-title a { + color: #002b5b + } + .sort-submit-buttons { + border-top: 1px solid #eeeeee; + } } + + diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 1f42e27..6529270 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -32,7 +32,7 @@ def self.search_config # solr fields that will be treated as facets by the blacklight application # The ordering of the field names is the order of the display - config.add_facet_field solr_name('human_readable_type', :facetable) + config.add_facet_field solr_name('human_readable_type', :facetable), label: "Item Type" config.add_facet_field solr_name('creator', :facetable), limit: 5 config.add_facet_field solr_name('tag', :facetable), limit: 10 config.add_facet_field solr_name('subject', :facetable), limit: 10 @@ -62,7 +62,7 @@ def self.search_config config.add_index_field modified_field, helper_method: :formatted_time, label: 'Date Modified' config.add_index_field 'date_issued_dtsi', helper_method: :formatted_time, label: 'Date Issued' config.add_index_field 'rights_label_ss', label: 'Content License' - config.add_index_field solr_name('human_readable_type', :stored_searchable) + config.add_index_field solr_name('human_readable_type', :stored_searchable), label: 'Item Type' config.add_index_field solr_name('format', :stored_searchable) # "fielded" search configuration. Used by pulldown among other places. @@ -113,6 +113,7 @@ def self.search_config end config.add_search_field('creator') do |field| + field.include_in_advanced_search = false solr_name = solr_name('creator', :stored_searchable, type: :string) field.solr_local_parameters = { qf: solr_name, @@ -130,6 +131,7 @@ def self.search_config end config.add_search_field('publisher') do |field| + field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('publisher', :stored_searchable, type: :string) field.solr_local_parameters = { @@ -157,6 +159,7 @@ def self.search_config end config.add_search_field('subject') do |field| + field.include_in_advanced_search = false solr_name = solr_name('subject', :stored_searchable, type: :string) field.solr_local_parameters = { qf: solr_name, @@ -165,6 +168,7 @@ def self.search_config end config.add_search_field('language') do |field| + field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('language', :stored_searchable, type: :string) field.solr_local_parameters = { @@ -174,6 +178,8 @@ def self.search_config end config.add_search_field('human_readable_type') do |field| + field.label = "Item Type" + # field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('human_readable_type', :stored_searchable, type: :string) field.solr_local_parameters = { diff --git a/app/views/advanced/_advanced_search_form.html.erb b/app/views/advanced/_advanced_search_form.html.erb index a14374f..af2c385 100644 --- a/app/views/advanced/_advanced_search_form.html.erb +++ b/app/views/advanced/_advanced_search_form.html.erb @@ -10,7 +10,7 @@ <%= render_hash_as_hidden_fields(params_for_search(advanced_search_context, {})) %>
- +

<%= t('blacklight_advanced_search.form.query_criteria_heading_html', :select_menu => select_menu_for_field_operator ) %> @@ -21,6 +21,8 @@

+
+

<%= t('blacklight_advanced_search.form.limit_criteria_heading_html')%>

@@ -32,12 +34,14 @@ <% end %>
+ -
- -
- <%= render 'advanced_search_submit_btns' %> +
+ +
+ <%= render 'advanced_search_submit_btns' %> +
+
- <% end %> diff --git a/app/views/advanced/_advanced_search_help.html.erb b/app/views/advanced/_advanced_search_help.html.erb index 1b93a2c..64c1349 100644 --- a/app/views/advanced/_advanced_search_help.html.erb +++ b/app/views/advanced/_advanced_search_help.html.erb @@ -1,24 +1,24 @@ -
-
Search tips
-
-
    -
  • Select "match all" to require all fields. -
  • +
    +

    Search tips

    + +
      +
    • Select "match all" to require all fields. +
    • -
    • Select "match any" to find at least one field. -
    • +
    • Select "match any" to find at least one field. +
    • -
    • Combine keywords and attributes to find specific items. -
    • +
    • Combine keywords and attributes to find specific items. +
    • -
    • Use quotation marks to search as a phrase. - -
    • Use "+" before a term to make it required. (Otherwise results matching only some of your terms may be included).
    • - -
    • Use "-" before a word or phrase to exclude. +
    • Use quotation marks to search as a phrase. + +
    • Use "+" before a term to make it required. (Otherwise results matching only some of your terms may be included).
    • + +
    • Use "-" before a word or phrase to exclude. -
    • Use "OR", "AND", and "NOT" to create complex boolean logic. You can use parentheses in your complex expressions.
    • -
    • Truncation and wildcards are not supported - word-stemming is done automatically.
    • -
    -
    -
\ No newline at end of file +
  • Use "OR", "AND", and "NOT" to create complex boolean logic. You can use parentheses in your complex expressions.
  • +
  • Truncation and wildcards are not supported - word-stemming is done automatically.
  • + +
    + \ No newline at end of file diff --git a/app/views/advanced/_advanced_search_submit_btns.html.erb b/app/views/advanced/_advanced_search_submit_btns.html.erb index 31e8880..a622865 100644 --- a/app/views/advanced/_advanced_search_submit_btns.html.erb +++ b/app/views/advanced/_advanced_search_submit_btns.html.erb @@ -1,12 +1,15 @@ -
    +
    + +
    <%= label_tag(:sort, t('blacklight_advanced_search.form.sort_label'), :class => "control-label") %> <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort])), :class => "form-control sort-select") %> <%= hidden_field_tag(:search_field, blacklight_config.advanced_search[:url_key]) %>
    -
    +
    <%= link_to t('blacklight_advanced_search.form.start_over'), advanced_search_path, :class =>"btn btn-default advanced-search-start-over" %> <%= submit_tag t('blacklight_advanced_search.form.search_btn'), :class=>'btn btn-primary advanced-search-submit', :id => "advanced-search-submit" %> -
    \ No newline at end of file +
    +
    \ No newline at end of file diff --git a/app/views/advanced/index.html.erb b/app/views/advanced/index.html.erb index e7d482b..7948457 100644 --- a/app/views/advanced/index.html.erb +++ b/app/views/advanced/index.html.erb @@ -8,13 +8,14 @@
    +
    + <%= render "advanced_search_help" %> +
    -
    +
    <%= render 'advanced_search_form' %>
    -
    - <%= render "advanced_search_help" %> -
    +
    diff --git a/app/views/shared/_site_search.html.erb b/app/views/shared/_site_search.html.erb index f39420a..2f332ae 100644 --- a/app/views/shared/_site_search.html.erb +++ b/app/views/shared/_site_search.html.erb @@ -13,6 +13,6 @@ - <%= link_to_unless_current "Advanced", advanced_search_path %> + <%= link_to_unless_current "Advanced Search", advanced_search_path, :class => "btn btn-primary" %> <% end %> From 8746c56148674584f30a6369d85345a57a25b43c Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Wed, 21 Feb 2018 12:28:53 -0800 Subject: [PATCH 034/204] added collection params to advanced search when in a collection --- app/helpers/application_helper.rb | 9 +++++++++ app/views/shared/_site_search.html.erb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c4d2b97..6737294 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,4 +17,13 @@ def index_description(options) result end end + + def advanced_search_params + + if params.keys.include?('f') && params['f'].keys.include?('admin_set_ssi') + { f: { admin_set_ssi: params['f']['admin_set_ssi']} } + else + {} + end + end end diff --git a/app/views/shared/_site_search.html.erb b/app/views/shared/_site_search.html.erb index 2f332ae..c843bf0 100644 --- a/app/views/shared/_site_search.html.erb +++ b/app/views/shared/_site_search.html.erb @@ -13,6 +13,6 @@ - <%= link_to_unless_current "Advanced Search", advanced_search_path, :class => "btn btn-primary" %> + <%= link_to_unless_current "Advanced Search", main_app.advanced_search_path(advanced_search_params), :class => "btn btn-primary" %> <% end %> From e9f24254a6ad157b8fe3dcf9d39d0bc5e7544c71 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Wed, 21 Feb 2018 12:40:57 -0800 Subject: [PATCH 035/204] added inclusive to advanced search params --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6737294..b10e5e3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,7 +21,7 @@ def index_description(options) def advanced_search_params if params.keys.include?('f') && params['f'].keys.include?('admin_set_ssi') - { f: { admin_set_ssi: params['f']['admin_set_ssi']} } + { f_inclusive: { admin_set_ssi: params['f']['admin_set_ssi']} } else {} end From 6adecaa61a4c82376fa9b6027d7b1944a4ff4eb5 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 21 Feb 2018 17:48:26 -0800 Subject: [PATCH 036/204] ci work --- .env | 16 ++++----- .gitlab-ci.yml | 76 +++++++++++++++++++++++++++++++++++++++++++ docker-compose.ci.yml | 21 ++++++++++++ 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 docker-compose.ci.yml diff --git a/.env b/.env index c22a7e2..a578710 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ -DOCKER_PORT=8000:80 -SOLR_URL=http://localhost:8983/solr/development #POSTGRES_DB=goldenseal -#POSTGRES_USER=postgres -#POSTGRES_PASSWORD=DatabaseFTW #POSTGRES_HOST=postgres -TEST_DB=goldenseal_test +#POSTGRES_PASSWORD=DatabaseFTW +#POSTGRES_USER=postgres +DEPLOY_HOOK=CHANGEME +DOCKER_PORT=8000:80 +PASSENGER_APP_ENV=development REGISTRY_HOST=registry.gitlab.com REGISTRY_URI=/notch8/washington-goldenseal SITE_URI=web.goldenseal.staging.notch8network.com -DEPLOY_HOOK=CHANGEME +SKIP_LDAP=true +SOLR_URL=http://localhost:8983/solr/development TAG=dev +TEST_DB=goldenseal_test VIRTUAL_PORT=80 -PASSENGER_APP_ENV=development -SKIP_LDAP=true diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f9cd09b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,76 @@ +image: docker:17.04 +services: + - docker:dind + +stages: + - build + - review + +variables: + DOCKER_DRIVER: overlay + DOCKER_PORT: 80 + PASSENGER_APP_ENV: development + RAILS_ENV: development + REGISTRY_HOST: registry.gitlab.com + REGISTRY_URI: /notch8/washington-goldenseal + TEST_DB: test + SECRET_KEY_BASE: 729ac8fd6f2ad97b45d9bdf6cbc6a83e01c53fcc0e7b3c2afac1dfb2906deccfd39b83e534938d4e2729e3787a72043794eb045568f089efddce51c17cc4160d + SKIP_LDAP: true + +build: + stage: build + script: + - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" + variables: + GIT_STRATEGY: fetch + tags: + - docker + +#test: +# stage: test +# image: $CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG +# script: +# - cd /home/app/webapp && bundle exec rake db:create spec +# tags: +# - docker +# variables: +# GIT_STRATEGY: none +# RAILS_ENV: test +# PASSENGER_APP_ENV: test +review: + stage: review + type: deploy + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + url: http://web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + on_stop: stop_review + only: + - branches + except: + - master + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - export TAG=$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + - export SITE_URI=web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + - ./rancher-v0.4.1/rancher up -p -d -u -c -s $TAG -f docker-compose.ci.yml + variables: + GIT_STRATEGY: fetch + tags: + - docker +stop_review: + stage: review + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - ./rancher-v0.4.1/rancher rm $CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + variables: + GIT_STRATEGY: none + when: manual + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + action: stop diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml new file mode 100644 index 0000000..720ce28 --- /dev/null +++ b/docker-compose.ci.yml @@ -0,0 +1,21 @@ +version: '2' +services: + web: + image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG}" + environment: + - DOCKER_PORT + - PASSENGER_APP_ENV + - RAILS_ENV + - REGISTRY_HOST + - REGISTRY_URI + - TEST_DB + - SECRET_KEY_BASE + - SKIP_LDAP + #command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake db:load db:migrate assets:precompile && chown -R app /home/app/webapp && /sbin/my_init" + ports: + - "80" + labels: + rap.host: web.${TAG}.staging.notch8network.com + rap.le_host: web.${TAG}.staging.notch8network.com + rap.le_test: true + io.rancher.container.pull_image: always From 534477a6d613c9d07738fef80993181780f8397b Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 21 Feb 2018 17:52:46 -0800 Subject: [PATCH 037/204] ci work --- .gitlab-ci.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9cd09b..e35a8f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ variables: REGISTRY_URI: /notch8/washington-goldenseal TEST_DB: test SECRET_KEY_BASE: 729ac8fd6f2ad97b45d9bdf6cbc6a83e01c53fcc0e7b3c2afac1dfb2906deccfd39b83e534938d4e2729e3787a72043794eb045568f089efddce51c17cc4160d - SKIP_LDAP: true + SKIP_LDAP: 'true' build: stage: build @@ -28,17 +28,6 @@ build: tags: - docker -#test: -# stage: test -# image: $CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG -# script: -# - cd /home/app/webapp && bundle exec rake db:create spec -# tags: -# - docker -# variables: -# GIT_STRATEGY: none -# RAILS_ENV: test -# PASSENGER_APP_ENV: test review: stage: review type: deploy @@ -61,6 +50,7 @@ review: GIT_STRATEGY: fetch tags: - docker + stop_review: stage: review script: From fc2667de27cccc0b83f31ee9dcf6f0ad301df7e2 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 21 Feb 2018 17:48:26 -0800 Subject: [PATCH 038/204] ci work --- .env | 16 ++++----- .gitlab-ci.yml | 76 +++++++++++++++++++++++++++++++++++++++++++ docker-compose.ci.yml | 21 ++++++++++++ 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 docker-compose.ci.yml diff --git a/.env b/.env index c22a7e2..a578710 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ -DOCKER_PORT=8000:80 -SOLR_URL=http://localhost:8983/solr/development #POSTGRES_DB=goldenseal -#POSTGRES_USER=postgres -#POSTGRES_PASSWORD=DatabaseFTW #POSTGRES_HOST=postgres -TEST_DB=goldenseal_test +#POSTGRES_PASSWORD=DatabaseFTW +#POSTGRES_USER=postgres +DEPLOY_HOOK=CHANGEME +DOCKER_PORT=8000:80 +PASSENGER_APP_ENV=development REGISTRY_HOST=registry.gitlab.com REGISTRY_URI=/notch8/washington-goldenseal SITE_URI=web.goldenseal.staging.notch8network.com -DEPLOY_HOOK=CHANGEME +SKIP_LDAP=true +SOLR_URL=http://localhost:8983/solr/development TAG=dev +TEST_DB=goldenseal_test VIRTUAL_PORT=80 -PASSENGER_APP_ENV=development -SKIP_LDAP=true diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f9cd09b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,76 @@ +image: docker:17.04 +services: + - docker:dind + +stages: + - build + - review + +variables: + DOCKER_DRIVER: overlay + DOCKER_PORT: 80 + PASSENGER_APP_ENV: development + RAILS_ENV: development + REGISTRY_HOST: registry.gitlab.com + REGISTRY_URI: /notch8/washington-goldenseal + TEST_DB: test + SECRET_KEY_BASE: 729ac8fd6f2ad97b45d9bdf6cbc6a83e01c53fcc0e7b3c2afac1dfb2906deccfd39b83e534938d4e2729e3787a72043794eb045568f089efddce51c17cc4160d + SKIP_LDAP: true + +build: + stage: build + script: + - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" + variables: + GIT_STRATEGY: fetch + tags: + - docker + +#test: +# stage: test +# image: $CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG +# script: +# - cd /home/app/webapp && bundle exec rake db:create spec +# tags: +# - docker +# variables: +# GIT_STRATEGY: none +# RAILS_ENV: test +# PASSENGER_APP_ENV: test +review: + stage: review + type: deploy + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + url: http://web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + on_stop: stop_review + only: + - branches + except: + - master + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - export TAG=$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + - export SITE_URI=web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + - ./rancher-v0.4.1/rancher up -p -d -u -c -s $TAG -f docker-compose.ci.yml + variables: + GIT_STRATEGY: fetch + tags: + - docker +stop_review: + stage: review + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - ./rancher-v0.4.1/rancher rm $CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + variables: + GIT_STRATEGY: none + when: manual + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + action: stop diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml new file mode 100644 index 0000000..720ce28 --- /dev/null +++ b/docker-compose.ci.yml @@ -0,0 +1,21 @@ +version: '2' +services: + web: + image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG}" + environment: + - DOCKER_PORT + - PASSENGER_APP_ENV + - RAILS_ENV + - REGISTRY_HOST + - REGISTRY_URI + - TEST_DB + - SECRET_KEY_BASE + - SKIP_LDAP + #command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake db:load db:migrate assets:precompile && chown -R app /home/app/webapp && /sbin/my_init" + ports: + - "80" + labels: + rap.host: web.${TAG}.staging.notch8network.com + rap.le_host: web.${TAG}.staging.notch8network.com + rap.le_test: true + io.rancher.container.pull_image: always From d1b5f983c601ce6e052463f970979ffbf1581ed7 Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Wed, 21 Feb 2018 17:52:46 -0800 Subject: [PATCH 039/204] ci work --- .gitlab-ci.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f9cd09b..e35a8f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ variables: REGISTRY_URI: /notch8/washington-goldenseal TEST_DB: test SECRET_KEY_BASE: 729ac8fd6f2ad97b45d9bdf6cbc6a83e01c53fcc0e7b3c2afac1dfb2906deccfd39b83e534938d4e2729e3787a72043794eb045568f089efddce51c17cc4160d - SKIP_LDAP: true + SKIP_LDAP: 'true' build: stage: build @@ -28,17 +28,6 @@ build: tags: - docker -#test: -# stage: test -# image: $CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG -# script: -# - cd /home/app/webapp && bundle exec rake db:create spec -# tags: -# - docker -# variables: -# GIT_STRATEGY: none -# RAILS_ENV: test -# PASSENGER_APP_ENV: test review: stage: review type: deploy @@ -61,6 +50,7 @@ review: GIT_STRATEGY: fetch tags: - docker + stop_review: stage: review script: From d33875797b69b60da3c13c19ea352281efe2f75c Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 22 Feb 2018 14:31:01 -0800 Subject: [PATCH 040/204] add file upload to staging instances --- docker-compose.ci.yml | 2 +- lib/tasks/ci.rake | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 720ce28..392632d 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -11,7 +11,7 @@ services: - TEST_DB - SECRET_KEY_BASE - SKIP_LDAP - #command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake db:load db:migrate assets:precompile && chown -R app /home/app/webapp && /sbin/my_init" + command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake ci:load_sample && /sbin/my_init" ports: - "80" labels: diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 0794740..8cc13ac 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -1,10 +1,20 @@ -require 'jettywrapper' +#require 'jettywrapper' -desc "Run the ci build" -task ci: ['jetty:clean', 'jetty:config'] do - jetty_params = Jettywrapper.load_config - Jettywrapper.wrap(jetty_params) do - # run the tests - Rake::Task["spec"].invoke +#desc "Run the ci build" +#task ci: ['jetty:clean', 'jetty:config'] do +# jetty_params = Jettywrapper.load_config +# Jettywrapper.wrap(jetty_params) do +# # run the tests +# Rake::Task["spec"].invoke +# end +#end +namespace :ci do + desc 'loads some sample data for review branches' + task :load_sample do + sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz' + sh('tar zxfv sample-assets.tgz') + sh('script/import -t text -p sample-assets/text') + sh('script/import -t video -p sample-assets/video') + sh('script/import -t image -p sample-assets/image') end end From 8c7eb83e116a3638ed33b07e34f007356e60309b Mon Sep 17 00:00:00 2001 From: Rob Kaufman Date: Thu, 22 Feb 2018 15:34:57 -0800 Subject: [PATCH 041/204] missing close --- lib/tasks/ci.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 8cc13ac..4db9754 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -11,7 +11,7 @@ namespace :ci do desc 'loads some sample data for review branches' task :load_sample do - sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz' + sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz') sh('tar zxfv sample-assets.tgz') sh('script/import -t text -p sample-assets/text') sh('script/import -t video -p sample-assets/video') From 23f6747b5a301e6d7418334747f62c56ed8f92cf Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 26 Feb 2018 15:34:04 -0800 Subject: [PATCH 042/204] added text content search to advanced and general search --- app/controllers/catalog_controller.rb | 13 +++++++- app/helpers/application_helper.rb | 1 - app/indexers/text_indexer.rb | 44 +++++++++++++++------------ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 6529270..9f738b0 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -6,6 +6,7 @@ def self.search_config contributor_tesim description_tesim subject_tesim + tei_json_tesim id )) end @@ -82,7 +83,7 @@ def self.search_config # This one uses all the defaults set by the solr request handler. Which # solr request handler? The one set in config[:default_solr_parameters][:qt], # since we aren't specifying it otherwise. - config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: false) + config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: true) # Now we see how to over-ride Solr request handler defaults, in this # case for a BL "search field", which is really a dismax aggregate @@ -244,6 +245,16 @@ def self.search_config } end + config.add_search_field('tei_json') do |field| + # field.include_in_simple_select = false + field.label = 'Content' + solr_name = 'tei_json_tesim' + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + # "sort results by" select (pulldown) # label in pulldown is followed by the name of the SOLR field to sort by and # whether the sort is ascending or descending (it must be asc or desc diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b10e5e3..934d643 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -19,7 +19,6 @@ def index_description(options) end def advanced_search_params - if params.keys.include?('f') && params['f'].keys.include?('admin_set_ssi') { f_inclusive: { admin_set_ssi: params['f']['admin_set_ssi']} } else diff --git a/app/indexers/text_indexer.rb b/app/indexers/text_indexer.rb index 63f3533..7c8111d 100644 --- a/app/indexers/text_indexer.rb +++ b/app/indexers/text_indexer.rb @@ -1,23 +1,27 @@ class TextIndexer < BaseWorkIndexer - TEI_JSON = 'tei_json_ss' + TEI_JSON = 'tei_json_tesim' - # def generate_solr_document - # super do |solr_doc| - # solr_doc[TEI_JSON] = tei_to_json if object.tei - # end - # end - # - # def tei_to_json - # as_json = tei_as_json - # return unless as_json - # JSON.generate(as_json) - # end - # - # def tei_as_json - # # OPTIMIZE: this could be indexed on the FileSet which - # # so that every index call wouldn't have to load the tei file. - # tei = object.tei.original_file.try(:content) - # return unless tei - # TEIConverter.new(tei, object).as_json - # end + def generate_solr_document + super do |solr_doc| + puts(ActionView::Base.full_sanitizer.sanitize(tei)) + solr_doc[TEI_JSON] = ActionView::Base.full_sanitizer.sanitize(tei) if object.tei + end + end + + def tei_to_json + as_json = tei_as_json + return unless as_json + JSON.generate(as_json) + end + + def tei + @tei ||= object.tei.original_file.try(:content) + end + + def tei_as_json + # OPTIMIZE: this could be indexed on the FileSet which + # so that every index call wouldn't have to load the tei file. + return unless tei + TEIConverter.new(tei, object).as_json + end end From 4687c2dbb6b09b3f7218ca7e2315e14c455d50ec Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Mon, 26 Feb 2018 15:36:16 -0800 Subject: [PATCH 043/204] removed all fields from advanced search --- app/controllers/catalog_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 9f738b0..bef63d4 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -83,7 +83,7 @@ def self.search_config # This one uses all the defaults set by the solr request handler. Which # solr request handler? The one set in config[:default_solr_parameters][:qt], # since we aren't specifying it otherwise. - config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: true) + config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: false) # Now we see how to over-ride Solr request handler defaults, in this # case for a BL "search field", which is really a dismax aggregate From d1785ff8fc541d91903cd861b6dacad215eed35a Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 27 Feb 2018 18:03:09 +0000 Subject: [PATCH 044/204] 634221 advanced search --- .env | 16 ++--- .gitlab-ci.yml | 66 +++++++++++++++++++ app/assets/stylesheets/wustl.scss | 40 ++++++++++- .../advanced_controller.rb | 23 +++++++ app/controllers/catalog_controller.rb | 21 +++++- app/helpers/application_helper.rb | 8 +++ app/indexers/text_indexer.rb | 44 +++++++------ .../advanced/_advanced_search_facets.html.erb | 16 +++++ ..._advanced_search_facets_as_select.html.erb | 30 +++++++++ .../advanced/_advanced_search_fields.html.erb | 8 +++ .../advanced/_advanced_search_form.html.erb | 47 +++++++++++++ .../advanced/_advanced_search_help.html.erb | 24 +++++++ .../_advanced_search_submit_btns.html.erb | 15 +++++ app/views/advanced/_facet_limit.html.erb | 15 +++++ app/views/advanced/index.html.erb | 22 +++++++ app/views/shared/_site_search.html.erb | 3 +- docker-compose.ci.yml | 21 ++++++ lib/tasks/ci.rake | 24 +++++-- 18 files changed, 404 insertions(+), 39 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 app/controllers/blacklight_advanced_search/advanced_controller.rb create mode 100644 app/views/advanced/_advanced_search_facets.html.erb create mode 100644 app/views/advanced/_advanced_search_facets_as_select.html.erb create mode 100644 app/views/advanced/_advanced_search_fields.html.erb create mode 100644 app/views/advanced/_advanced_search_form.html.erb create mode 100644 app/views/advanced/_advanced_search_help.html.erb create mode 100644 app/views/advanced/_advanced_search_submit_btns.html.erb create mode 100644 app/views/advanced/_facet_limit.html.erb create mode 100644 app/views/advanced/index.html.erb create mode 100644 docker-compose.ci.yml diff --git a/.env b/.env index c22a7e2..a578710 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ -DOCKER_PORT=8000:80 -SOLR_URL=http://localhost:8983/solr/development #POSTGRES_DB=goldenseal -#POSTGRES_USER=postgres -#POSTGRES_PASSWORD=DatabaseFTW #POSTGRES_HOST=postgres -TEST_DB=goldenseal_test +#POSTGRES_PASSWORD=DatabaseFTW +#POSTGRES_USER=postgres +DEPLOY_HOOK=CHANGEME +DOCKER_PORT=8000:80 +PASSENGER_APP_ENV=development REGISTRY_HOST=registry.gitlab.com REGISTRY_URI=/notch8/washington-goldenseal SITE_URI=web.goldenseal.staging.notch8network.com -DEPLOY_HOOK=CHANGEME +SKIP_LDAP=true +SOLR_URL=http://localhost:8983/solr/development TAG=dev +TEST_DB=goldenseal_test VIRTUAL_PORT=80 -PASSENGER_APP_ENV=development -SKIP_LDAP=true diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e35a8f6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,66 @@ +image: docker:17.04 +services: + - docker:dind + +stages: + - build + - review + +variables: + DOCKER_DRIVER: overlay + DOCKER_PORT: 80 + PASSENGER_APP_ENV: development + RAILS_ENV: development + REGISTRY_HOST: registry.gitlab.com + REGISTRY_URI: /notch8/washington-goldenseal + TEST_DB: test + SECRET_KEY_BASE: 729ac8fd6f2ad97b45d9bdf6cbc6a83e01c53fcc0e7b3c2afac1dfb2906deccfd39b83e534938d4e2729e3787a72043794eb045568f089efddce51c17cc4160d + SKIP_LDAP: 'true' + +build: + stage: build + script: + - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY + - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" . + - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG" + variables: + GIT_STRATEGY: fetch + tags: + - docker + +review: + stage: review + type: deploy + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + url: http://web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + on_stop: stop_review + only: + - branches + except: + - master + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - export TAG=$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + - export SITE_URI=web.$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG.staging.notch8network.com + - ./rancher-v0.4.1/rancher up -p -d -u -c -s $TAG -f docker-compose.ci.yml + variables: + GIT_STRATEGY: fetch + tags: + - docker + +stop_review: + stage: review + script: + - wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz + - tar zxfv rancher-linux-amd64-v0.4.1.tar.gz + - export RANCHER_ENVIRONMENT=staging + - ./rancher-v0.4.1/rancher rm $CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + variables: + GIT_STRATEGY: none + when: manual + environment: + name: review/$CI_PROJECT_NAME-$CI_BUILD_REF_SLUG + action: stop diff --git a/app/assets/stylesheets/wustl.scss b/app/assets/stylesheets/wustl.scss index 745086f..01d859a 100644 --- a/app/assets/stylesheets/wustl.scss +++ b/app/assets/stylesheets/wustl.scss @@ -197,5 +197,43 @@ body { a:hover { text-decoration: none; } - } + + } + span.label-and-count>label { + display: inline; + font-weight: normal; + overflow: hidden; + } + + span.facet-count { + float: right; + } + + .facet-values .facet-label { + padding-left: 5px !important; + text-indent: 0 !important; + display:inline; + } + .submit-buttons { + padding-top: 30px; + } + ul.advanced-help { + padding-left: 20px; + } + .advanced-help-panel { + background-color: #eee; + padding: 10px; + } + h3.limit-criteria-heading, h3.query-criteria-heading { + margin-top: 0; + font-size: 20px; + } + h5.panel-title a { + color: #002b5b + } + .sort-submit-buttons { + border-top: 1px solid #eeeeee; + } } + + diff --git a/app/controllers/blacklight_advanced_search/advanced_controller.rb b/app/controllers/blacklight_advanced_search/advanced_controller.rb new file mode 100644 index 0000000..7a5d638 --- /dev/null +++ b/app/controllers/blacklight_advanced_search/advanced_controller.rb @@ -0,0 +1,23 @@ +class BlacklightAdvancedSearch::AdvancedController < CatalogController + include Hydra::Controller::SearchBuilder + + def index + unless request.method==:post + @response = get_advanced_search_facets + end + end + + protected + def get_advanced_search_facets + # We want to find the facets available for the current search, but: + # * IGNORING current query (add in facets_for_advanced_search_form filter) + # * IGNORING current advanced search facets (remove add_advanced_search_to_solr filter) + response, _ = search_results(params, search_params_logic) do |search_builder| + search_builder.except(:add_advanced_search_to_solr).append(:facets_for_advanced_search_form) + search_builder.current_ability = current_ability + search_builder + end + + return response + end +end diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 1f42e27..bef63d4 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -6,6 +6,7 @@ def self.search_config contributor_tesim description_tesim subject_tesim + tei_json_tesim id )) end @@ -32,7 +33,7 @@ def self.search_config # solr fields that will be treated as facets by the blacklight application # The ordering of the field names is the order of the display - config.add_facet_field solr_name('human_readable_type', :facetable) + config.add_facet_field solr_name('human_readable_type', :facetable), label: "Item Type" config.add_facet_field solr_name('creator', :facetable), limit: 5 config.add_facet_field solr_name('tag', :facetable), limit: 10 config.add_facet_field solr_name('subject', :facetable), limit: 10 @@ -62,7 +63,7 @@ def self.search_config config.add_index_field modified_field, helper_method: :formatted_time, label: 'Date Modified' config.add_index_field 'date_issued_dtsi', helper_method: :formatted_time, label: 'Date Issued' config.add_index_field 'rights_label_ss', label: 'Content License' - config.add_index_field solr_name('human_readable_type', :stored_searchable) + config.add_index_field solr_name('human_readable_type', :stored_searchable), label: 'Item Type' config.add_index_field solr_name('format', :stored_searchable) # "fielded" search configuration. Used by pulldown among other places. @@ -113,6 +114,7 @@ def self.search_config end config.add_search_field('creator') do |field| + field.include_in_advanced_search = false solr_name = solr_name('creator', :stored_searchable, type: :string) field.solr_local_parameters = { qf: solr_name, @@ -130,6 +132,7 @@ def self.search_config end config.add_search_field('publisher') do |field| + field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('publisher', :stored_searchable, type: :string) field.solr_local_parameters = { @@ -157,6 +160,7 @@ def self.search_config end config.add_search_field('subject') do |field| + field.include_in_advanced_search = false solr_name = solr_name('subject', :stored_searchable, type: :string) field.solr_local_parameters = { qf: solr_name, @@ -165,6 +169,7 @@ def self.search_config end config.add_search_field('language') do |field| + field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('language', :stored_searchable, type: :string) field.solr_local_parameters = { @@ -174,6 +179,8 @@ def self.search_config end config.add_search_field('human_readable_type') do |field| + field.label = "Item Type" + # field.include_in_advanced_search = false field.include_in_simple_select = false solr_name = solr_name('human_readable_type', :stored_searchable, type: :string) field.solr_local_parameters = { @@ -238,6 +245,16 @@ def self.search_config } end + config.add_search_field('tei_json') do |field| + # field.include_in_simple_select = false + field.label = 'Content' + solr_name = 'tei_json_tesim' + field.solr_local_parameters = { + qf: solr_name, + pf: solr_name + } + end + # "sort results by" select (pulldown) # label in pulldown is followed by the name of the SOLR field to sort by and # whether the sort is ascending or descending (it must be asc or desc diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c4d2b97..934d643 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,4 +17,12 @@ def index_description(options) result end end + + def advanced_search_params + if params.keys.include?('f') && params['f'].keys.include?('admin_set_ssi') + { f_inclusive: { admin_set_ssi: params['f']['admin_set_ssi']} } + else + {} + end + end end diff --git a/app/indexers/text_indexer.rb b/app/indexers/text_indexer.rb index 63f3533..7c8111d 100644 --- a/app/indexers/text_indexer.rb +++ b/app/indexers/text_indexer.rb @@ -1,23 +1,27 @@ class TextIndexer < BaseWorkIndexer - TEI_JSON = 'tei_json_ss' + TEI_JSON = 'tei_json_tesim' - # def generate_solr_document - # super do |solr_doc| - # solr_doc[TEI_JSON] = tei_to_json if object.tei - # end - # end - # - # def tei_to_json - # as_json = tei_as_json - # return unless as_json - # JSON.generate(as_json) - # end - # - # def tei_as_json - # # OPTIMIZE: this could be indexed on the FileSet which - # # so that every index call wouldn't have to load the tei file. - # tei = object.tei.original_file.try(:content) - # return unless tei - # TEIConverter.new(tei, object).as_json - # end + def generate_solr_document + super do |solr_doc| + puts(ActionView::Base.full_sanitizer.sanitize(tei)) + solr_doc[TEI_JSON] = ActionView::Base.full_sanitizer.sanitize(tei) if object.tei + end + end + + def tei_to_json + as_json = tei_as_json + return unless as_json + JSON.generate(as_json) + end + + def tei + @tei ||= object.tei.original_file.try(:content) + end + + def tei_as_json + # OPTIMIZE: this could be indexed on the FileSet which + # so that every index call wouldn't have to load the tei file. + return unless tei + TEIConverter.new(tei, object).as_json + end end diff --git a/app/views/advanced/_advanced_search_facets.html.erb b/app/views/advanced/_advanced_search_facets.html.erb new file mode 100644 index 0000000..2eb47f0 --- /dev/null +++ b/app/views/advanced/_advanced_search_facets.html.erb @@ -0,0 +1,16 @@ +<%# used to render facets with checkboxes on advanced search form, + we pretty much just use the built-in blacklight render_facet_partials + helper. + + But we've provided a local override of the _facet_limit + partial in our own `views/advanced/_facet_limit.html.erb`, + that is written to include checkboxes for form selection. + + This is the default display of facets, but you can + also choose to use _advanced_search_facets_as_select, + for a chosen.js-compatible multi-select. +%> + +
    + <%= render_facet_partials facet_field_names %> +
    diff --git a/app/views/advanced/_advanced_search_facets_as_select.html.erb b/app/views/advanced/_advanced_search_facets_as_select.html.erb new file mode 100644 index 0000000..6c3380e --- /dev/null +++ b/app/views/advanced/_advanced_search_facets_as_select.html.erb @@ -0,0 +1,30 @@ +<%# alternate version of facets on form that renders using multi-select. + Has to copy and paste more code from blacklight than default, making + it somewhat more fragile. + + Logic taken from facets_helper_behavior.rb, #render_facet_partials and + #render_facet_limit. +%> + +<% facets_from_request(facet_field_names).each do |display_facet| %> + <% if should_render_facet?(display_facet) %> +
    + <%= label_tag display_facet.name.parameterize, :class => "col-sm-3 control-label" do %> + <%= facet_field_label(display_facet.name) %> + <% end %> + +
    + <%= content_tag(:select, :multiple => true, + :name => "f_inclusive[#{display_facet.name}][]", + :id => display_facet.name.parameterize, + :class => "form-control advanced-search-facet-select") do %> + <% display_facet.items.each do |facet_item| %> + <%= content_tag :option, :value => facet_item.value, :selected => facet_value_checked?(display_facet.name, facet_item.value) do %> + <%= facet_item.label %>  (<%= number_with_delimiter facet_item.hits %>) + <% end %> + <% end %> + <% end %> +
    +
    + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/advanced/_advanced_search_fields.html.erb b/app/views/advanced/_advanced_search_fields.html.erb new file mode 100644 index 0000000..eec867b --- /dev/null +++ b/app/views/advanced/_advanced_search_fields.html.erb @@ -0,0 +1,8 @@ +<%- search_fields_for_advanced_search.each do |key, field_def| -%> +
    + <%= label_tag key, "#{field_def.label }", :class => "col-sm-3 control-label" %> +
    + <%= text_field_tag key, label_tag_default_for(key), :class => 'form-control' %> +
    +
    +<%- end -%> diff --git a/app/views/advanced/_advanced_search_form.html.erb b/app/views/advanced/_advanced_search_form.html.erb new file mode 100644 index 0000000..af2c385 --- /dev/null +++ b/app/views/advanced/_advanced_search_form.html.erb @@ -0,0 +1,47 @@ + <% unless (search_context_str = render_search_to_s( advanced_search_context)).blank? %> +
    +

    <%= t 'blacklight_advanced_search.form.search_context' %>

    + <%= search_context_str %> +
    + <% end %> + +<%= form_tag catalog_index_path, :class => 'advanced form-horizontal', :method => :get do %> + + <%= render_hash_as_hidden_fields(params_for_search(advanced_search_context, {})) %> + +
    +
    +
    +

    + <%= t('blacklight_advanced_search.form.query_criteria_heading_html', :select_menu => select_menu_for_field_operator ) %> +

    + + +
    + +
    +
    +
    +

    <%= t('blacklight_advanced_search.form.limit_criteria_heading_html')%>

    + +
    + <% if blacklight_config.try(:advanced_search).try {|h| h[:form_facet_partial] } %> + <%= render blacklight_config.advanced_search[:form_facet_partial] %> + <% else %> + <%= render 'advanced_search_facets' %> + <% end %> +
    +
    +
    +
    +
    +
    + +
    + <%= render 'advanced_search_submit_btns' %> +
    + +
    +<% end %> diff --git a/app/views/advanced/_advanced_search_help.html.erb b/app/views/advanced/_advanced_search_help.html.erb new file mode 100644 index 0000000..64c1349 --- /dev/null +++ b/app/views/advanced/_advanced_search_help.html.erb @@ -0,0 +1,24 @@ +
    +

    Search tips

    + +
      +
    • Select "match all" to require all fields. +
    • + +
    • Select "match any" to find at least one field. +
    • + +
    • Combine keywords and attributes to find specific items. +
    • + +
    • Use quotation marks to search as a phrase. + +
    • Use "+" before a term to make it required. (Otherwise results matching only some of your terms may be included).
    • + +
    • Use "-" before a word or phrase to exclude. + +
    • Use "OR", "AND", and "NOT" to create complex boolean logic. You can use parentheses in your complex expressions.
    • +
    • Truncation and wildcards are not supported - word-stemming is done automatically.
    • +
    +
    + \ No newline at end of file diff --git a/app/views/advanced/_advanced_search_submit_btns.html.erb b/app/views/advanced/_advanced_search_submit_btns.html.erb new file mode 100644 index 0000000..a622865 --- /dev/null +++ b/app/views/advanced/_advanced_search_submit_btns.html.erb @@ -0,0 +1,15 @@ +
    + +
    + <%= label_tag(:sort, t('blacklight_advanced_search.form.sort_label'), :class => "control-label") %> + + <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort])), :class => "form-control sort-select") %> + <%= hidden_field_tag(:search_field, blacklight_config.advanced_search[:url_key]) %> +
    + +
    + <%= link_to t('blacklight_advanced_search.form.start_over'), advanced_search_path, :class =>"btn btn-default advanced-search-start-over" %> + + <%= submit_tag t('blacklight_advanced_search.form.search_btn'), :class=>'btn btn-primary advanced-search-submit', :id => "advanced-search-submit" %> +
    +
    \ No newline at end of file diff --git a/app/views/advanced/_facet_limit.html.erb b/app/views/advanced/_facet_limit.html.erb new file mode 100644 index 0000000..1834a87 --- /dev/null +++ b/app/views/advanced/_facet_limit.html.erb @@ -0,0 +1,15 @@ +
      + <% display_facet.items.each do |item| -%> +
    • + + <%= check_box_tag "f_inclusive[#{solr_field}][]", item.value.to_sym, facet_value_checked?(solr_field, item.value), :id => "f_inclusive_#{solr_field}_#{item.value.parameterize}"%> + + + + <%= label_tag "f_inclusive_#{solr_field}_#{item.value.parameterize}" do %> + <%= render_facet_value(solr_field, item, :suppress_link => true) %> + <% end %> + +
    • + <% end -%> +
    \ No newline at end of file diff --git a/app/views/advanced/index.html.erb b/app/views/advanced/index.html.erb new file mode 100644 index 0000000..7948457 --- /dev/null +++ b/app/views/advanced/index.html.erb @@ -0,0 +1,22 @@ +<% @page_title = "More Search Options - #{application_name}" %> + +
    + +

    + <%= t('blacklight_advanced_search.form.title') %> + <%= link_to t('blacklight_advanced_search.form.start_over'), advanced_search_path, :class =>"btn btn-default pull-right advanced-search-start-over" %> +

    + +
    +
    + <%= render "advanced_search_help" %> +
    + +
    + <%= render 'advanced_search_form' %> +
    + + +
    + +
    \ No newline at end of file diff --git a/app/views/shared/_site_search.html.erb b/app/views/shared/_site_search.html.erb index e5cad1e..c843bf0 100644 --- a/app/views/shared/_site_search.html.erb +++ b/app/views/shared/_site_search.html.erb @@ -10,8 +10,9 @@ <%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %> <%= text_field_tag(:q, params[:q], class: "q search-query form-control", id: "catalog_search", placeholder: t('curation_concerns.search.form.q.placeholder'), tabindex: "1", type: "search") %> - + <%= link_to_unless_current "Advanced Search", main_app.advanced_search_path(advanced_search_params), :class => "btn btn-primary" %> <% end %> diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml new file mode 100644 index 0000000..392632d --- /dev/null +++ b/docker-compose.ci.yml @@ -0,0 +1,21 @@ +version: '2' +services: + web: + image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG}" + environment: + - DOCKER_PORT + - PASSENGER_APP_ENV + - RAILS_ENV + - REGISTRY_HOST + - REGISTRY_URI + - TEST_DB + - SECRET_KEY_BASE + - SKIP_LDAP + command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake ci:load_sample && /sbin/my_init" + ports: + - "80" + labels: + rap.host: web.${TAG}.staging.notch8network.com + rap.le_host: web.${TAG}.staging.notch8network.com + rap.le_test: true + io.rancher.container.pull_image: always diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 0794740..4db9754 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -1,10 +1,20 @@ -require 'jettywrapper' +#require 'jettywrapper' -desc "Run the ci build" -task ci: ['jetty:clean', 'jetty:config'] do - jetty_params = Jettywrapper.load_config - Jettywrapper.wrap(jetty_params) do - # run the tests - Rake::Task["spec"].invoke +#desc "Run the ci build" +#task ci: ['jetty:clean', 'jetty:config'] do +# jetty_params = Jettywrapper.load_config +# Jettywrapper.wrap(jetty_params) do +# # run the tests +# Rake::Task["spec"].invoke +# end +#end +namespace :ci do + desc 'loads some sample data for review branches' + task :load_sample do + sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz') + sh('tar zxfv sample-assets.tgz') + sh('script/import -t text -p sample-assets/text') + sh('script/import -t video -p sample-assets/video') + sh('script/import -t image -p sample-assets/image') end end From efd1ccd6b464fd7e958131fa6db2573ae16b8ec8 Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Tue, 27 Feb 2018 15:20:50 -0800 Subject: [PATCH 045/204] updates readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1b43a76..8520e34 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,8 @@ We have tested Goldenseal with the following versions of its dependencies: ## Importing Records ### Importing records with TEI or VRA files +NOTE: This happens automatically on staging servers + TEI files can be parsed to create Audio, Video, or Text records. VRA records can be parsed to produce Image records. The instructions are basically the same either way. * Create a directory and add all the TEI (or VRA) files to that directory. From 05406f7ebbe32e131e982659fb4eebcdac010a6f Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 27 Feb 2018 16:41:24 -0800 Subject: [PATCH 046/204] download flag on audio, image and text files --- .../curation_concerns/audios_controller.rb | 4 +++- .../curation_concerns/images_controller.rb | 4 +++- .../curation_concerns/texts_controller.rb | 2 ++ app/forms/curation_concerns/audio_form.rb | 1 + app/forms/curation_concerns/image_form.rb | 1 + app/forms/curation_concerns/text_form.rb | 1 + app/models/audio.rb | 8 ++++++++ app/models/image.rb | 8 ++++++++ app/models/text.rb | 8 ++++++++ app/presenters/audio_presenter.rb | 5 +++++ app/presenters/image_presenter.rb | 5 +++++ app/presenters/text_presenter.rb | 2 ++ app/presenters/work_show_presenter.rb | 2 ++ .../_form_additional_information.html.erb | 2 +- .../curation_concerns/file_sets/show.html.erb | 20 +++++++++++++++++++ 15 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 app/presenters/audio_presenter.rb create mode 100644 app/presenters/image_presenter.rb create mode 100644 app/views/curation_concerns/file_sets/show.html.erb diff --git a/app/controllers/curation_concerns/audios_controller.rb b/app/controllers/curation_concerns/audios_controller.rb index 0451dbd..945b264 100644 --- a/app/controllers/curation_concerns/audios_controller.rb +++ b/app/controllers/curation_concerns/audios_controller.rb @@ -10,6 +10,8 @@ class CurationConcerns::AudiosController < ApplicationController set_curation_concern_type Audio def show_presenter - ::WorkShowPresenter + ::AudioPresenter end + + delegate :downloadable, to: :solr_document end diff --git a/app/controllers/curation_concerns/images_controller.rb b/app/controllers/curation_concerns/images_controller.rb index 99429d3..8289ae4 100644 --- a/app/controllers/curation_concerns/images_controller.rb +++ b/app/controllers/curation_concerns/images_controller.rb @@ -3,6 +3,8 @@ class CurationConcerns::ImagesController < ApplicationController set_curation_concern_type Image def show_presenter - ::WorkShowPresenter + ::ImagePresenter end + + delegate :downloadable, to: :solr_document end diff --git a/app/controllers/curation_concerns/texts_controller.rb b/app/controllers/curation_concerns/texts_controller.rb index 1e4f45a..34304fd 100644 --- a/app/controllers/curation_concerns/texts_controller.rb +++ b/app/controllers/curation_concerns/texts_controller.rb @@ -14,4 +14,6 @@ class CurationConcerns::TextsController < ApplicationController def show_presenter TextPresenter end + + delegate :downloadable, to: :solr_document end diff --git a/app/forms/curation_concerns/audio_form.rb b/app/forms/curation_concerns/audio_form.rb index 98ff59e..b607028 100644 --- a/app/forms/curation_concerns/audio_form.rb +++ b/app/forms/curation_concerns/audio_form.rb @@ -1,5 +1,6 @@ module CurationConcerns class AudioForm < TeiForm self.model_class = ::Audio + self.terms += [:downloadable] end end diff --git a/app/forms/curation_concerns/image_form.rb b/app/forms/curation_concerns/image_form.rb index ef7ecb7..adeaf95 100644 --- a/app/forms/curation_concerns/image_form.rb +++ b/app/forms/curation_concerns/image_form.rb @@ -1,5 +1,6 @@ module CurationConcerns class ImageForm < CommonForm self.model_class = ::Image + self.terms += [:downloadable] end end diff --git a/app/forms/curation_concerns/text_form.rb b/app/forms/curation_concerns/text_form.rb index 5f3126d..4a6d788 100644 --- a/app/forms/curation_concerns/text_form.rb +++ b/app/forms/curation_concerns/text_form.rb @@ -1,6 +1,7 @@ module CurationConcerns class TextForm < TeiForm self.model_class = ::Text + self.terms += [:downloadable] end end diff --git a/app/models/audio.rb b/app/models/audio.rb index 41bc1e2..1f7f99e 100644 --- a/app/models/audio.rb +++ b/app/models/audio.rb @@ -13,4 +13,12 @@ class Audio < ActiveFedora::Base def self.indexer BaseWorkIndexer end + + property :downloadable, predicate: ::RDF::Vocab::DC.Policy, multiple: false do |index| + index.as :stored_searchable + end + + def downloadable= value + super value.to_s.downcase == "true" + end end diff --git a/app/models/image.rb b/app/models/image.rb index 77c50fa..9dd49bf 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -11,4 +11,12 @@ class Image < ActiveFedora::Base def self.indexer ImageIndexer end + + property :downloadable, predicate: ::RDF::Vocab::DC.Policy, multiple: false do |index| + index.as :stored_searchable + end + + def downloadable= value + super value.to_s.downcase == "true" + end end diff --git a/app/models/text.rb b/app/models/text.rb index c2d50c8..76849dd 100644 --- a/app/models/text.rb +++ b/app/models/text.rb @@ -20,6 +20,14 @@ def self.indexer TextIndexer end + property :downloadable, predicate: ::RDF::Vocab::DC.Policy, multiple: false do |index| + index.as :stored_searchable + end + + def downloadable= value + super value.to_s.downcase == "true" + end + private def filenames_to_filesets @filenames_to_filesets ||= begin diff --git a/app/presenters/audio_presenter.rb b/app/presenters/audio_presenter.rb new file mode 100644 index 0000000..263b6a8 --- /dev/null +++ b/app/presenters/audio_presenter.rb @@ -0,0 +1,5 @@ +class AudioPresenter < WorkShowPresenter + include DisplayFields + + delegate :downloadable, to: :solr_document +end diff --git a/app/presenters/image_presenter.rb b/app/presenters/image_presenter.rb new file mode 100644 index 0000000..7f256fc --- /dev/null +++ b/app/presenters/image_presenter.rb @@ -0,0 +1,5 @@ +class ImagePresenter < WorkShowPresenter + include DisplayFields + + delegate :downloadable, to: :solr_document +end diff --git a/app/presenters/text_presenter.rb b/app/presenters/text_presenter.rb index ef59acd..8eee2cb 100644 --- a/app/presenters/text_presenter.rb +++ b/app/presenters/text_presenter.rb @@ -9,4 +9,6 @@ def tei? def tei_as_json @json ||= TeiForText.new(solr_document.to_model).to_json end + + delegate :downloadable, to: :solr_document end diff --git a/app/presenters/work_show_presenter.rb b/app/presenters/work_show_presenter.rb index 02f19c5..44d39c1 100644 --- a/app/presenters/work_show_presenter.rb +++ b/app/presenters/work_show_presenter.rb @@ -28,4 +28,6 @@ def admin_set_id def admin_set_path Rails.application.routes.url_helpers.admin_set_path(admin_set_id) end + + delegate :downloadable, to: :solr_document end diff --git a/app/views/curation_concerns/base/_form_additional_information.html.erb b/app/views/curation_concerns/base/_form_additional_information.html.erb index 9c587db..6bd3761 100644 --- a/app/views/curation_concerns/base/_form_additional_information.html.erb +++ b/app/views/curation_concerns/base/_form_additional_information.html.erb @@ -15,7 +15,7 @@ <%= f.input :description_standard, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :publication_place, as: :multi_value, input_html: { class: 'form-control' } %> <%= f.input :date_issued, input_html: { value: f.object.date_issued, class: 'datepicker' } %> - <%= f.check_box :downloadable, { input_html: { class: 'form-control' }}, 'true', 'false' %>  Enable Video Downloads + <%= f.check_box :downloadable, { input_html: { class: 'form-control' }}, 'true', 'false' %>  Enable Downloads diff --git a/app/views/curation_concerns/file_sets/show.html.erb b/app/views/curation_concerns/file_sets/show.html.erb new file mode 100644 index 0000000..9c219c9 --- /dev/null +++ b/app/views/curation_concerns/file_sets/show.html.erb @@ -0,0 +1,20 @@ +<% provide :page_title, @presenter.page_title %> +<% provide :page_header do %> +

    File Details <%= @presenter.title %>

    +<% end %> +<% if @presenter.downloadable %> + <%= media_display @presenter %> +<% end %> + +<%= render "attributes", curation_concern: @presenter %> + +
    + <% if @presenter.downloadable %> + <%= link_to "Download this File", main_app.download_path(@presenter), class: 'btn btn-default' %> + <% end %> + <% if can? :edit, @presenter.id %> + <%= link_to "Edit this File", edit_polymorphic_path([main_app, @presenter]), class: 'btn btn-default' %> + <% end %> + + <%= link_to "Back to #{parent.human_readable_type}", parent_path(parent), class: 'btn btn-default' %> +
    From 40e453534d90c752fcd700373f6b6307536bdab8 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Tue, 27 Feb 2018 18:14:14 -0800 Subject: [PATCH 047/204] added bulk downlowdable actions to other file types --- .../collections_controller_behavior.rb | 28 ++++++++++++----- .../curation_concerns/file_sets_controller.rb | 2 ++ app/presenters/file_set_presenter.rb | 2 ++ app/views/collections/_show_actions.html.erb | 30 +++++++++++++++---- .../file_sets/_actions.html.erb | 2 +- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/app/controllers/curation_concerns/collections_controller_behavior.rb b/app/controllers/curation_concerns/collections_controller_behavior.rb index 571d53c..494cfba 100644 --- a/app/controllers/curation_concerns/collections_controller_behavior.rb +++ b/app/controllers/curation_concerns/collections_controller_behavior.rb @@ -32,24 +32,38 @@ def collection end def enable_downloads + file_type = params[:file_type] collection = Collection.find(params[:id]) - toggle_downloadable(collection, true) + toggle_downloadable(collection, true, file_type) redirect_to collection_path(collection), notice: 'Collection was successfully updated.' end def disable_downloads + file_type = params[:file_type] collection = Collection.find(params[:id]) - toggle_downloadable(collection, false) + toggle_downloadable(collection, false, file_type) redirect_to collection_path(collection), notice: 'Collection was successfully updated.' end protected - def toggle_downloadable(collection, value) - authorize! :edit, collection - videos = collection.works.select{ |work| work.class == Video } - videos.each do |video| - actor = CurationConcerns::CurationConcern.actor(video, current_user, { downloadable: value }) + def toggle_downloadable(collection, value, file_type) + authorize! :edit, collection + case file_type + when 'video' + works = collection.works.select{ |work| work.class == Video } + when 'text' + works = collection.works.select{ |work| work.class == Text } + when 'audio' + works = collection.works.select{ |work| work.class == Audio } + when 'image' + works = collection.works.select{ |work| work.class == Image } + when 'all' + works = collection.works + end + + works.each do |work| + actor = CurationConcerns::CurationConcern.actor(work, current_user, { downloadable: value }) actor.update end end diff --git a/app/controllers/curation_concerns/file_sets_controller.rb b/app/controllers/curation_concerns/file_sets_controller.rb index 177de8e..2f53373 100644 --- a/app/controllers/curation_concerns/file_sets_controller.rb +++ b/app/controllers/curation_concerns/file_sets_controller.rb @@ -24,5 +24,7 @@ def render_vtt fail ActiveFedora::ObjectNotFoundError end end + + delegate :downloadable, to: :solr_document end end diff --git a/app/presenters/file_set_presenter.rb b/app/presenters/file_set_presenter.rb index 341ff0c..4c60b18 100644 --- a/app/presenters/file_set_presenter.rb +++ b/app/presenters/file_set_presenter.rb @@ -2,4 +2,6 @@ class FileSetPresenter < CurationConcerns::FileSetPresenter def permission_badge_class ::PermissionBadge end + + delegate :downloadable, to: :solr_document end diff --git a/app/views/collections/_show_actions.html.erb b/app/views/collections/_show_actions.html.erb index 38f747e..1ff5898 100644 --- a/app/views/collections/_show_actions.html.erb +++ b/app/views/collections/_show_actions.html.erb @@ -1,11 +1,31 @@ <% if can? :edit, @presenter.id %>

    Actions

    -

    +

    <%= link_to "Edit", collections.edit_collection_path, class: 'btn btn-default' %>    <%= link_to "Add files from your dashboard", search_path_for_my_works, class: 'btn btn-default' %>   - <%= link_to "Enable Downloads for all items", enable_downloads_path(@presenter), class: 'btn btn-default' %>   - <%= link_to "Disable Downloads for all items", disable_downloads_path(@presenter), class: 'btn btn-default' %> - -

    + + + + +
    <%end %> diff --git a/app/views/curation_concerns/file_sets/_actions.html.erb b/app/views/curation_concerns/file_sets/_actions.html.erb index 486a67a..41ccd92 100644 --- a/app/views/curation_concerns/file_sets/_actions.html.erb +++ b/app/views/curation_concerns/file_sets/_actions.html.erb @@ -11,7 +11,7 @@ )%> <% end %> <% if can?(:read, file_set.id) %> - <% if @presenter.human_readable_type != "Video" || (@presenter.human_readable_type == "Video" && @presenter.downloadable) %> + <% if @presenter.downloadable %> <%= link_to 'Download', main_app.download_path(file_set), class: 'btn btn-default', title: "Download #{file_set.to_s.inspect}", target: "_blank" %> <% end %> From 4e77201faed79bee6a5c78d0c6ad1340497942d5 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 1 Mar 2018 09:36:27 -0800 Subject: [PATCH 048/204] added if statement for tei page to only show image if there is an image --- app/views/curation_concerns/texts/_tei_viewer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/curation_concerns/texts/_tei_viewer.html.erb b/app/views/curation_concerns/texts/_tei_viewer.html.erb index 4ae37c4..04addda 100644 --- a/app/views/curation_concerns/texts/_tei_viewer.html.erb +++ b/app/views/curation_concerns/texts/_tei_viewer.html.erb @@ -16,7 +16,7 @@
    1. -
      +
    From 593bb26e8bf3c0f96fbba3c283c90d4664dca38d Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 1 Mar 2018 10:05:14 -0800 Subject: [PATCH 049/204] updates tei importer --- app/indexers/text_indexer.rb | 5 ++--- docker-compose.yml | 2 +- lib/import/common_importer.rb | 2 ++ script/import | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/indexers/text_indexer.rb b/app/indexers/text_indexer.rb index 7c8111d..6083bdf 100644 --- a/app/indexers/text_indexer.rb +++ b/app/indexers/text_indexer.rb @@ -3,8 +3,7 @@ class TextIndexer < BaseWorkIndexer def generate_solr_document super do |solr_doc| - puts(ActionView::Base.full_sanitizer.sanitize(tei)) - solr_doc[TEI_JSON] = ActionView::Base.full_sanitizer.sanitize(tei) if object.tei + solr_doc[TEI_JSON] = ActionView::Base.full_sanitizer.sanitize(tei) if tei end end @@ -15,7 +14,7 @@ def tei_to_json end def tei - @tei ||= object.tei.original_file.try(:content) + @tei ||= object.try(:tei).try(:original_file).try(:content) end def tei_as_json diff --git a/docker-compose.yml b/docker-compose.yml index a40244c..7b039ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: tty: true ports: - "8080:80" - - "3000:3000" + - "3003:3000" depends_on: - ldap diff --git a/lib/import/common_importer.rb b/lib/import/common_importer.rb index 85b81a3..f8891a6 100644 --- a/lib/import/common_importer.rb +++ b/lib/import/common_importer.rb @@ -100,6 +100,8 @@ def create_record(attributes) puts " Adding in order took %0.2fs" % time.real unless Rails.env.test? set_representative(record) record.save! + record.reload + record.update_index end def attach_files(record, metadata_file, files) diff --git a/script/import b/script/import index f5e7b37..8cf09e9 100755 --- a/script/import +++ b/script/import @@ -102,7 +102,7 @@ model = options.delete(:model).capitalize dir = options.delete(:path) puts "Import #{model} records using metadata files in: #{dir}" -puts "Starting import" +puts "Starting import with #{importer_class(model)}" importer = importer_class(model).new(dir, options) importer.run print_importer_results(importer) From 076eef45733734d4a9b5a1a289683831f33ef5a8 Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 1 Mar 2018 12:50:09 -0800 Subject: [PATCH 050/204] hide file section when download flag is set to false --- .../base/_related_files.html.erb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/views/curation_concerns/base/_related_files.html.erb diff --git a/app/views/curation_concerns/base/_related_files.html.erb b/app/views/curation_concerns/base/_related_files.html.erb new file mode 100644 index 0000000..2bcd960 --- /dev/null +++ b/app/views/curation_concerns/base/_related_files.html.erb @@ -0,0 +1,28 @@ +<% if presenter.file_presenters.present? %> + +<% elsif can? :edit, presenter.id %> +

    Files

    +

    This <%= presenter.human_readable_type %> has no files associated with it. You can add one using the "Attach a File" button below.

    +<% end %> \ No newline at end of file From f251e273d18d42737e15523491cde56f7b8ca3e7 Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 1 Mar 2018 13:36:06 -0800 Subject: [PATCH 051/204] updates ingestion for sample assets --- Dockerfile | 2 +- lib/tasks/ci.rake | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3233ca..6ef0b35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ COPY ops/env.conf /etc/nginx/main.d/env.conf COPY . $APP_HOME RUN bundle check || bundle install -CMD ["/sbin/my_init"] \ No newline at end of file +CMD ["/sbin/my_init"] diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 4db9754..95d3f56 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -11,10 +11,11 @@ namespace :ci do desc 'loads some sample data for review branches' task :load_sample do + sh('[ -e sample-assets.tgz ] && rm sample-assets.tgz') sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz') sh('tar zxfv sample-assets.tgz') - sh('script/import -t text -p sample-assets/text') - sh('script/import -t video -p sample-assets/video') - sh('script/import -t image -p sample-assets/image') + sh('su -c "script/import -t text -p sample-assets/text" app') + sh('su -c "script/import -t video -p sample-assets/video" app') + sh('su -c "script/import -t image -p sample-assets/image" app') end end From 8be12bb76c879bd0f7e51421f35e34a6056b7ceb Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 1 Mar 2018 13:36:51 -0800 Subject: [PATCH 052/204] ignore sample assets if they exist in gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f8f8453..6f571e3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ config/solr.yml config/redis.yml config/resque-pool.yml config/ldap.yml + +sample_assets +sample_assets.tgz From c7d913ef8b508ce23295844df31d3f1498c22d6f Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 1 Mar 2018 13:48:41 -0800 Subject: [PATCH 053/204] fixes asset load task --- lib/tasks/ci.rake | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 95d3f56..f4e9050 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -11,7 +11,6 @@ namespace :ci do desc 'loads some sample data for review branches' task :load_sample do - sh('[ -e sample-assets.tgz ] && rm sample-assets.tgz') sh('wget https://s3-us-west-2.amazonaws.com/washington-u/sample-assets.tgz') sh('tar zxfv sample-assets.tgz') sh('su -c "script/import -t text -p sample-assets/text" app') From 16bab4d86c4cbe11fc8d7d082a07c042d0e5c79b Mon Sep 17 00:00:00 2001 From: MATTHEW CLARK Date: Thu, 1 Mar 2018 14:08:10 -0800 Subject: [PATCH 054/204] adds seed to ci --- docker-compose.ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 392632d..f42a8f7 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -11,7 +11,7 @@ services: - TEST_DB - SECRET_KEY_BASE - SKIP_LDAP - command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake ci:load_sample && /sbin/my_init" + command: bash -c "mkdir -p /home/app/webapp/tmp && chmod -R 1777 /home/app/webapp/tmp && bundle exec rake db:seed && bundle exec rake ci:load_sample && /sbin/my_init" ports: - "80" labels: From ca0715c30925b1f6c9f773256072c172a93bb32f Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Thu, 1 Mar 2018 17:39:29 -0800 Subject: [PATCH 055/204] mobile-small size device styling for main components --- app/assets/stylesheets/wustl.scss | 55 +++++++++++++++++++++++++- app/views/layouts/boilerplate.html.erb | 25 ++++++++++++ config/locales/blacklight.en.yml | 2 +- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 app/views/layouts/boilerplate.html.erb diff --git a/app/assets/stylesheets/wustl.scss b/app/assets/stylesheets/wustl.scss index 01d859a..09dc444 100644 --- a/app/assets/stylesheets/wustl.scss +++ b/app/assets/stylesheets/wustl.scss @@ -1,5 +1,5 @@ body { - padding: 0px; + padding: 0; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; h1, h2, h3, h4, h5, h6 { font-family: 'Libre Baskerville', 'Times New Roman', serif; @@ -236,4 +236,57 @@ body { } } +@media screen and (max-width: 767px) { + body header#banner hgroup div#brand-bar-wrapper { + padding: 0 15px 5px 15px; + } + body header#banner hgroup div#product-bar-wrapper div.container { + padding:0; + right: 0; + max-width: 100%; + } + body header#banner hgroup div#product-bar-wrapper div.container div#product-bar { + font-size: 44px; + text-align: center; + } + body header#banner hgroup div#title-bar-wrapper { + padding: 10px; + } + body header#banner hgroup div#title-bar-wrapper div.container div#title-bar div#site-search form select, + body header#banner hgroup div#title-bar-wrapper div.container div#title-bar div#site-search form input { + margin-bottom: 5px; + } + body header#banner hgroup div#title-bar-wrapper div.container div#title-bar div#site-search form { + text-align: center; + margin-bottom: 5px; + } + #site-actions { + text-align: center; + } + body div#main { + padding:0 15px; + } + + body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3, + body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3:first-of-type { + padding:0 20px 20px 20px; + } + + body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3 iframe { + + } + + body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3 div.social { + text-align: center; + } + body footer#footer div#footer-bottom-wrapper div#footer-bottom { + padding: 10px 20px; + } +} + +@media screen and (min-width: 768px) { + body { + background: orange; + } +} diff --git a/app/views/layouts/boilerplate.html.erb b/app/views/layouts/boilerplate.html.erb new file mode 100644 index 0000000..c40ccd8 --- /dev/null +++ b/app/views/layouts/boilerplate.html.erb @@ -0,0 +1,25 @@ + + + + + + + <%= render :partial => 'layouts/google_analytics' if Rails.env == 'production' %> + + + + + <%= content_for?(:page_title) ? yield(:page_title) : default_page_title %> + + <%= csrf_meta_tag %> + <%= stylesheet_link_tag 'application' %> + <%= javascript_include_tag 'application' %> + + + + <%= render :partial => 'layouts/google_analytics_body' if Rails.env == 'production' %> + <%= content_for?(:body) ? yield(:body) : yield %> + + <%= render 'shared/ajax_modal' %> + + diff --git a/config/locales/blacklight.en.yml b/config/locales/blacklight.en.yml index ff834b2..6cf6017 100644 --- a/config/locales/blacklight.en.yml +++ b/config/locales/blacklight.en.yml @@ -1,3 +1,3 @@ en: blacklight: - application_name: 'Blacklight' \ No newline at end of file + application_name: 'WUSTL Goldenseal' \ No newline at end of file From 00615038f45f8f1d4e83a32163bc6c8e3951e34a Mon Sep 17 00:00:00 2001 From: Lea Ann Bradford Date: Fri, 2 Mar 2018 10:16:40 -0800 Subject: [PATCH 056/204] phone mobile styles for tei page --- app/assets/stylesheets/wustl.scss | 45 ++++++++++++++----- .../base/_related_files.html.erb | 26 +++++++++++ .../texts/_tei_viewer.html.erb | 8 ++-- 3 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 app/views/curation_concerns/base/_related_files.html.erb diff --git a/app/assets/stylesheets/wustl.scss b/app/assets/stylesheets/wustl.scss index 09dc444..586bd9d 100644 --- a/app/assets/stylesheets/wustl.scss +++ b/app/assets/stylesheets/wustl.scss @@ -246,8 +246,10 @@ body { max-width: 100%; } body header#banner hgroup div#product-bar-wrapper div.container div#product-bar { - font-size: 44px; - text-align: center; + font-size: 32px; + padding:0 20px; + height: 90px; + line-height: 100px; } body header#banner hgroup div#title-bar-wrapper { padding: 10px; @@ -257,32 +259,51 @@ body { margin-bottom: 5px; } body header#banner hgroup div#title-bar-wrapper div.container div#title-bar div#site-search form { - text-align: center; + text-align: left; margin-bottom: 5px; } #site-actions { - text-align: center; + text-align: left; } body div#main { padding:0 15px; } - + body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3, body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3:first-of-type { padding:0 20px 20px 20px; } - - body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3 iframe { - - } - body footer#footer div#footer-top-wrapper div#footer-top div.col-md-3 div.social { - text-align: center; + text-align: left; } - body footer#footer div#footer-bottom-wrapper div#footer-bottom { padding: 10px 20px; } + .row.no-neg-margin { + margin-left:0; + margin-right:0; + } + input#page-number { + display: inline-block; + width: auto; + vertical-align: middle; + } + #display-label { + display:block; + margin: 10px 0 0 0; + } + #tei-container { + margin: 10px; + } + + a.add-to-collection.btn.btn-primary { + margin-top: 16px; + } + + tr.file_set.attributes > td.thumbnail { + width: 50px; + } + } @media screen and (min-width: 768px) { diff --git a/app/views/curation_concerns/base/_related_files.html.erb b/app/views/curation_concerns/base/_related_files.html.erb new file mode 100644 index 0000000..995873c --- /dev/null +++ b/app/views/curation_concerns/base/_related_files.html.erb @@ -0,0 +1,26 @@ +<% if presenter.file_presenters.present? %> + +<% elsif can? :edit, presenter.id %> +

    Files

    +

    This <%= presenter.human_readable_type %> has no files associated with it. You can add one using the "Attach a File" button below.

    +<% end %> \ No newline at end of file diff --git a/app/views/curation_concerns/texts/_tei_viewer.html.erb b/app/views/curation_concerns/texts/_tei_viewer.html.erb index 04addda..c1f07a9 100644 --- a/app/views/curation_concerns/texts/_tei_viewer.html.erb +++ b/app/views/curation_concerns/texts/_tei_viewer.html.erb @@ -1,11 +1,11 @@ +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/shared/_breadcrumbs.html.erb b/tmp/blacklight-spotlight/app/views/shared/_breadcrumbs.html.erb new file mode 100644 index 0000000..5102b48 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_breadcrumbs.html.erb @@ -0,0 +1,7 @@ + diff --git a/tmp/blacklight-spotlight/app/views/shared/_browse_navbar.html.erb b/tmp/blacklight-spotlight/app/views/shared/_browse_navbar.html.erb new file mode 100644 index 0000000..d26d7d6 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_browse_navbar.html.erb @@ -0,0 +1,3 @@ +<% if current_exhibit.browse_categories? %> +
  • "><%= link_to navigation.label_or_default, spotlight.exhibit_browse_index_path(current_exhibit) %>
  • +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/shared/_curated_features_navbar.html.erb b/tmp/blacklight-spotlight/app/views/shared/_curated_features_navbar.html.erb new file mode 100644 index 0000000..5c3db26 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_curated_features_navbar.html.erb @@ -0,0 +1,15 @@ +<% published_top_level_feature_pages = current_exhibit.feature_pages.published.at_top_level -%> +<% if published_top_level_feature_pages.present? %> + <% if published_top_level_feature_pages.many? %> + + <% else %> +
  • "><%= link_to published_top_level_feature_pages.first.title, [spotlight, published_top_level_feature_pages.first.exhibit, published_top_level_feature_pages.first] %>
  • + <% end %> +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/shared/_exhibit_navbar.html.erb b/tmp/blacklight-spotlight/app/views/shared/_exhibit_navbar.html.erb new file mode 100644 index 0000000..a8719a2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_exhibit_navbar.html.erb @@ -0,0 +1,19 @@ + diff --git a/tmp/blacklight-spotlight/app/views/shared/_footer.html.erb b/tmp/blacklight-spotlight/app/views/shared/_footer.html.erb new file mode 100644 index 0000000..96634b6 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_footer.html.erb @@ -0,0 +1,7 @@ +
    +
    + <%= render 'shared/share_follow' %> +
    +
    + +<%= render 'shared/analytics' %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/shared/_header_navbar.html.erb b/tmp/blacklight-spotlight/app/views/shared/_header_navbar.html.erb new file mode 100644 index 0000000..78e8cd3 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_header_navbar.html.erb @@ -0,0 +1,17 @@ + diff --git a/tmp/blacklight-spotlight/app/views/shared/_masthead.html.erb b/tmp/blacklight-spotlight/app/views/shared/_masthead.html.erb new file mode 100644 index 0000000..ce86bba --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_masthead.html.erb @@ -0,0 +1,32 @@ +<%= render 'spotlight/shared/report_a_problem' if show_contact_form? %> + +
    + <% if current_masthead %> + + + <% end %> + + <%= render 'shared/exhibit_navbar' if current_exhibit && resource_masthead? %> + +
    +
    + <% if content_for? :masthead %> + <%= content_for :masthead %> + <% elsif current_exhibit %> + <%= current_exhibit.title %> + <% if current_exhibit.subtitle.present? %> + <%= current_exhibit.subtitle %> + <% end %> + <% else %> + <%= application_name %> + <% if current_site.subtitle.present? %> + <%= current_site.subtitle %> + <% end %> + <% end %> +
    +
    + + <%= render 'shared/exhibit_navbar' if current_exhibit && !resource_masthead? %> +
    + +<%= render 'shared/breadcrumbs' unless resource_masthead? %> diff --git a/tmp/blacklight-spotlight/app/views/shared/_modal.html.erb b/tmp/blacklight-spotlight/app/views/shared/_modal.html.erb new file mode 100644 index 0000000..19fb6c5 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_modal.html.erb @@ -0,0 +1,6 @@ + diff --git a/tmp/blacklight-spotlight/app/views/shared/_share_follow.html.erb b/tmp/blacklight-spotlight/app/views/shared/_share_follow.html.erb new file mode 100644 index 0000000..afcbe13 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_share_follow.html.erb @@ -0,0 +1,5 @@ +
    +
    <%= t :'.share_follow' %>
    + <%= social_share_button_tag(application_name) %> +
    + diff --git a/tmp/blacklight-spotlight/app/views/shared/_site_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/shared/_site_sidebar.html.erb new file mode 100644 index 0000000..752298f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/shared/_site_sidebar.html.erb @@ -0,0 +1,19 @@ +<% if can?(:manage, Spotlight::Site.instance) || can?(:create, Spotlight::Exhibit) %> + + + + +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact.html.erb new file mode 100644 index 0000000..77a9704 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact.html.erb @@ -0,0 +1,19 @@ +
  • +
    <%= t :drag %>
    +
    +
    + <%= f.check_box :show_in_sidebar, label: '' %> + <%= f.hidden_field :id %> + <%= f.hidden_field :weight, data: {property: "weight"} %> +
    + + <%= render partial: "contact_properties", locals: {contact: f.object} %> +
    +
    +
    + +
  • + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact_properties.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact_properties.html.erb new file mode 100644 index 0000000..a90796b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contact_properties.html.erb @@ -0,0 +1,13 @@ +<%= image_tag contact.avatar.thumb.url, class: 'contact-photo' if contact.avatar.present? %> +
    <%= contact.name %>
    +<% Spotlight::Contact.fields.each do |field, options| %> + <% if (value = contact.contact_info[field]).present? %> +
    + <% if options[:helper] %> + <%= send(options[:helper], value) %> + <% else %> + <%= value %> + <% end %> +
    + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts.html.erb new file mode 100644 index 0000000..3accd23 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts.html.erb @@ -0,0 +1,8 @@ +

    <%= t :'.header' %>

    + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts_form.html.erb new file mode 100644 index 0000000..712c820 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_contacts_form.html.erb @@ -0,0 +1,19 @@ +<%= bootstrap_form_for @exhibit, url: exhibit_contacts_path(@exhibit), + style: :horizontal, html: {class: 'exhibit-contacts'} do |f| %> +

    <%= t :".header" %>

    +

    <%= t :'.instructions' %>

    +
    +
      + <%= f.fields_for :contacts do |c| %> + <%= render partial: 'contact', locals: {f: c} %> + <% end %> +
    +
    +
    + + <%= exhibit_create_link Spotlight::Contact.new, class: "btn btn-primary" %> +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_empty.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_empty.html.erb new file mode 100644 index 0000000..23d8360 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_empty.html.erb @@ -0,0 +1,26 @@ +<% if can? :edit, @page %> +
    +

    Building this about page

    + +
      +
    1. + To add content to this page, click the Edit button above to enter Edit mode. +
    2. +
    3. + In Edit mode, click the plus sign icon to display the widget selection panel. This panel displays a range of widgets, each of which adds a different type of content to the page. +
    4. +
    5. + Select a widget to configure. Click Save changes when you're ready to add it to the page. +
    6. +
    7. + Repeat the steps above to continue adding widgets to build out the page. To work more efficiently, you can configure multiple widgets before saving the page. Use the icons in the lower right of the widget configuration panel to preview, reorder, or delete widgets. +
    8. +
    9. + Use the checkbox in the Options tab to publish or unpublish the page. +
    10. +
    11. + Visit the Spotlight <%= link_to 'documentation pages', 'https://github.com/sul-dlss/spotlight/wiki' %> to learn more about creating exhibit pages. +
    12. +
    +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_page_options.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_page_options.html.erb new file mode 100644 index 0000000..34a7405 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_page_options.html.erb @@ -0,0 +1 @@ +<%= f.check_box :published %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_sidebar.html.erb new file mode 100644 index 0000000..38cd544 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/_sidebar.html.erb @@ -0,0 +1,15 @@ +<% cache_unless current_user, [current_exhibit, @page] do %> + +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/about_pages/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/index.html.erb new file mode 100644 index 0000000..9245709 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/about_pages/index.html.erb @@ -0,0 +1,7 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= render 'order_pages' %> + <% if can? :manage, Spotlight::Contact.new(exhibit: @exhibit) %> + <%= render 'contacts_form' %> + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/admin_users/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/admin_users/index.html.erb new file mode 100644 index 0000000..d872018 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/admin_users/index.html.erb @@ -0,0 +1,57 @@ +
    + <%= page_title(t('.section'), t('.page_title')) %> + <%= bootstrap_form_for Spotlight::Engine.user_class.new, url: spotlight.admin_users_path do |f| %> +

    <%= t :'.instructions' %>

    + + + + + + + + <% @site.roles.map(&:user).each do |user| %> + + + + + <% end %> + + + + + + + + +
    <%= Spotlight::Engine.user_class.human_attribute_name(:email) %>
    + <%= user.email %> + <%= t('.pending') %> + + <%= link_to(t('.destroy'), admin_user_path(user), method: :delete, class: 'btn btn-danger pull-right') unless user == current_user %> +
    + <%= f.email_field :email, hide_label: true, data: { behavior: 'check-user-existence', 'user-exists-url': spotlight.exists_admin_users_path } %> + + +
    +
    + <%= cancel_link f.object, '#', class: 'btn btn-link', data: { behavior: 'cancel-edit' } %> + <%= f.submit t('.save'), class: 'btn btn-primary'%> +
    +
    +
    + +
    + +
    +
    + <%= link_to(t('.add'), 'javascript:;', class: 'btn btn-default', data: { behavior: 'new-user' }) %> +
    +
    + <% end %> +
    + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/appearances/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/appearances/edit.html.erb new file mode 100644 index 0000000..8ecea5c --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/appearances/edit.html.erb @@ -0,0 +1,91 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> + +<%= bootstrap_form_for @exhibit, url: spotlight.exhibit_appearance_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5', html: {data: { autocomplete_exhibit_catalog_index_path: spotlight.autocomplete_exhibit_catalog_index_path(current_exhibit, q: "%QUERY", format: "json") } } do |f| %> + <% if @exhibit.errors.any? %> +
    +

    <%= pluralize(@exhibit.errors.count, "error") %> prohibited this page from being saved:

    + +
      + <% @exhibit.errors.full_messages.each do |msg| %> +
    • <%= msg %>
    • + <% end %> +
    +
    + <% end %> +
    + +
    +
    +

    <%= t(:'.site_masthead.help') %>

    + <%= f.fields_for(:masthead, current_exhibit.masthead || current_exhibit.build_masthead) do |m| %> + <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_masthead_jcrop_options %> + <% end %> +
    + +
    +

    <%= t(:'.site_thumbnail.help') %>

    + <%= f.fields_for(:thumbnail, current_exhibit.thumbnail || current_exhibit.build_thumbnail) do |m| %> + <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_site_thumbnail_jcrop_options %> + <% end %> +
    + + +
    +
    + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +<% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/browse/_search.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/browse/_search.html.erb new file mode 100644 index 0000000..015c62e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/browse/_search.html.erb @@ -0,0 +1,15 @@ +<%= cache [@exhibit, search, search.documents.size] do %> +
    + <%= link_to spotlight.exhibit_browse_path(@exhibit, search) do %> +
    + <%= image_tag(search.thumbnail.image.thumb, class: 'img-responsive') if search.thumbnail %> +
    +

    + <%= search.title%> + <%= t :'spotlight.browse.search.item_count', count: search.documents.size %> +

    +
    +
    + <% end %> +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/browse/_search_title.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/browse/_search_title.html.erb new file mode 100644 index 0000000..661ccf8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/browse/_search_title.html.erb @@ -0,0 +1,2 @@ +<%= search.title %> +<%= t :'spotlight.browse.search.item_count', count: search.documents.size %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/browse/_sort_and_per_page.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/browse/_sort_and_per_page.html.erb new file mode 100644 index 0000000..c372065 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/browse/_sort_and_per_page.html.erb @@ -0,0 +1,7 @@ +
    +
    + <%= render :partial => 'sort_widget' %> + <%= render :partial => 'per_page_widget' %> + <%= render :partial => 'view_type_group' %> +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/browse/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/browse/index.html.erb new file mode 100644 index 0000000..824e8ef --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/browse/index.html.erb @@ -0,0 +1,8 @@ +<% set_html_page_title %> +
    +

    <%= t :'.header' %>

    + +
    + <%= render collection: @searches, partial: 'spotlight/browse/search' %> +
    +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/browse/show.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/browse/show.html.erb new file mode 100644 index 0000000..d04baf1 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/browse/show.html.erb @@ -0,0 +1,20 @@ +<% set_html_page_title @search.title %> +
    + <%= exhibit_edit_link @search, class: 'edit-button pull-right btn btn-primary' if can? :edit, @search %> + <% if resource_masthead? %> + <% content_for :masthead do %> + <%= render 'search_title', search: @search %> + <% end %> + <% else %> +

    <%= render 'search_title', search: @search %>

    + <% end %> + <% if @search.long_description.present? %> +

    <%= @search.long_description %>

    + <% end %> +
    + +
    + <%= render 'sort_and_per_page' %> + <%= render_document_index(@document_list) %> + <%= render 'results_pagination' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_header.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_header.html.erb new file mode 100644 index 0000000..2fdd313 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_header.html.erb @@ -0,0 +1,13 @@ +<% if can? :manage, Spotlight::Resource.new(exhibit: current_exhibit) %> +
    + <%= render 'reindex_progress_panel' %> +
    +
    +
    + <%= link_to t('.reindex'), reindex_all_exhibit_resources_path(current_exhibit), method: :post, class: 'btn btn-default' %> + <% if Spotlight::Engine.config.resource_partials.any? %> + <%= link_to t('.new_resource'), new_exhibit_resource_path(current_exhibit), class: 'btn btn-primary' %> + <% end %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_index_header_default.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_index_header_default.html.erb new file mode 100644 index 0000000..0ace887 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_index_header_default.html.erb @@ -0,0 +1,22 @@ +<%# header bar for doc items in index view -%> +
    + <%# main title container for doc partial view + How many bootstrap columns need to be reserved + for bookmarks control depends on size. + -%> + <% document_actions = capture do %> + <% # bookmark functions for items/docs -%> + <%= render_index_doc_actions document, wrapping_class: "index-document-functions col-sm-3 col-lg-2" %> + <% end %> + +
    "> + <% if counter = document_counter_with_offset(document_counter) %> + + <%= t('blacklight.search.documents.counter', counter: counter) %> + + <% end %> + <%= link_to_document document, document_show_link_field(document), counter: counter %> +
    + + <%= document_actions %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb new file mode 100644 index 0000000..3b0e5e7 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_admin_thumbnail_default.html.erb @@ -0,0 +1,5 @@ +<%- if has_thumbnail?(document) && tn = render_thumbnail_tag(document, {}, :counter => document_counter_with_offset(document_counter)) %> +
    + <%= tn %> +
    +<%- end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb new file mode 100644 index 0000000..0bbfe51 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb @@ -0,0 +1 @@ +<%= exhibit_edit_link document, [:edit, current_exhibit, document], class: 'pull-right btn btn-primary' if can?(:curate, current_exhibit) and !current_page? [:edit, current_exhibit, document] %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document.html.erb new file mode 100644 index 0000000..3e6cf6d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document.html.erb @@ -0,0 +1,4 @@ +<% # copied from blacklight; rails tries to render spotlight/catalog/document explicitly.. -%> +
    + <%= render_document_partials document, blacklight_config.view_config(document_index_view_type).partials, :document_counter => document_counter %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_admin_table.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_admin_table.html.erb new file mode 100644 index 0000000..ae654e2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_admin_table.html.erb @@ -0,0 +1,12 @@ +<% # container for all documents in index view -%> + + + + + + + + + + <%= render partial: 'document_row', collection: documents, as: :document %> +
    <%= t(:'spotlight.catalog.fields.title') %><%= t(:'spotlight.catalog.fields.date_added') %><%= t(:'spotlight.catalog.fields.visibility') %>
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_row.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_row.html.erb new file mode 100644 index 0000000..c5e8cc2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_row.html.erb @@ -0,0 +1,5 @@ +<% # container for a single doc -%> + + <%= render_document_partials document, blacklight_config.view_config(document_index_view_type).partials, :document_counter => document_counter %> + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_visibility_control.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_visibility_control.html.erb new file mode 100644 index 0000000..00e0432 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_document_visibility_control.html.erb @@ -0,0 +1,5 @@ +<% action = document.private?(current_exhibit) ? :make_public : :make_private %> + +<%= form_tag( exhibit_catalog_visiblity_path( current_exhibit, document ), :method => document.private?(current_exhibit) ? :put : :delete, :class => "visiblity_toggle", "data-doc-id" => document.id, :'data-present' => t('.make_private.label'), :'data-absent' => t('.make_public.label'), :'data-inprogress' => t('.inprogress.label'), :'data-label-toggle-target' => "[data-label-toggle='#{document.id}']") do %> + <%= submit_tag(t(".#{action}.button"), :id => "visibility_toggle_#{document.id.to_s.parameterize}", :class => "visibility_#{action}") %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_edit_default.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_edit_default.html.erb new file mode 100644 index 0000000..faf18f5 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_edit_default.html.erb @@ -0,0 +1,49 @@ +<%= bootstrap_form_for document, url: spotlight.exhibit_catalog_path(current_exhibit, document), html: {:'data-form-observer' => true, multipart: true} do |f| %> +
    + + <%= f.fields_for :sidecar, document.sidecar(current_exhibit) do |c| %> + <%= c.check_box :public %> + <% end %> + + <%= f.fields_for :uploaded_resource do |r| %> + <%= r.url_field :url, type: "file", help: t('.url-field.help', extensions: Spotlight::Engine.config.allowed_upload_extensions.join(' ')), label: "File" %> + <% end if document.uploaded_resource? %> + + <%= f.fields_for :sidecar, document.sidecar(current_exhibit) do |c| %> + <%= c.fields_for :data do |d| %> + <% if document.uploaded_resource? %> + <%= d.fields_for :configured_fields do |e| %> + <% Spotlight::Resources::Upload.fields(current_exhibit).each do |config| %> + <%= e.send((config.form_field_type || :text_field), config.field_name, value: (document.sidecar(current_exhibit).data["configured_fields"] || {})[config.field_name.to_s], label: uploaded_field_label(config)) %> + <% end %> + <% end %> + <% end %> + + <% current_exhibit.custom_fields.each do |field| %> +
    + <%= d.label field.field, field.label %> + <%= d.text_field_without_bootstrap field.field, value: document.sidecar(current_exhibit).data[field.field.to_s], class: 'form-control' %> + <% unless field.configured_to_display? %> +

    + <%= t(:'.blank_field_warning_html', + link: link_to(t(:'spotlight.configuration.sidebar.metadata'), spotlight.edit_exhibit_metadata_configuration_path(current_exhibit))) %> +

    + <% end %> +
    + <% end %> + <% end %> + <% end %> + + <% if can? :tag, current_exhibit %> +
    + <%= f.text_field :exhibit_tag_list, value: f.object.tags_from(current_exhibit).to_s, 'data-autocomplete_url' => exhibit_tags_path(current_exhibit, format: 'json') %> +
    + <% end %> +
    +
    + <%= cancel_link document, spotlight.exhibit_catalog_path(current_exhibit, document), class: 'btn btn-link' %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_index_compact_default.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_index_compact_default.html.erb new file mode 100644 index 0000000..d35ed50 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_index_compact_default.html.erb @@ -0,0 +1,21 @@ +<% # header bar for doc items in index view -%> + + <%= render_document_partial document, 'spotlight/catalog/admin_thumbnail', document_counter: document_counter %> + + + <%= render_document_partial document, 'admin_index_header', document_counter: document_counter %> + + + + + + <%= l Date.parse(document[blacklight_config.index.timestamp_field]) if document[blacklight_config.index.timestamp_field] %> + + + + <%= render partial: 'document_visibility_control', locals: { document: document} %> + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/_reindex_progress_panel.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_reindex_progress_panel.html.erb new file mode 100644 index 0000000..4062252 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/_reindex_progress_panel.html.erb @@ -0,0 +1,21 @@ + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/admin.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/admin.html.erb new file mode 100644 index 0000000..3dfa677 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/admin.html.erb @@ -0,0 +1,16 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + + <%= curation_page_title %> + + <%= render 'admin_header' %> + <%= render 'search_header' %> + + <%- if @response.empty? %> + <%= render "zero_results" %> + <%- else %> + <%= render_document_index %> + <%- end %> + + <%= render 'results_pagination' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/catalog/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/catalog/edit.html.erb new file mode 100644 index 0000000..7045b7b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/catalog/edit.html.erb @@ -0,0 +1,3 @@ +
    + <%= render_document_partials @document, blacklight_config.view_config(:edit).partials %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/confirmation_mailer/confirmation_instructions.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/confirmation_mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000..5dfc56b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/confirmation_mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

    <%= t(:'.welcome', email: @email) %>

    + +

    <%= t(:'.instructions') %>

    + +

    <%= link_to t(:'.confirm'), spotlight.contact_email_confirmation_url(:confirmation_token => @token) %>

    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/new.html.erb new file mode 100644 index 0000000..51be557 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/new.html.erb @@ -0,0 +1,17 @@ +
    +<%= bootstrap_form_for @contact_form, url: spotlight.exhibit_contact_form_path(current_exhibit, @contact_form), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-sm-5 col-md-5' do |f| %> +

    <%= t(:'.header') %>

    +
    + <%= f.text_field :name %> + <%= f.text_field :email %> + <%= f.text_area :message, rows: 7 %> + <%= f.hidden_field :current_url %> +
    +
    + <%= link_to t(:'helpers.action.cancel'), '#', class: 'btn btn-link', data: { 'behavior' => 'cancel-link' } %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +
    +<% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/show.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/show.html.erb new file mode 100644 index 0000000..7d69174 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/contact_forms/show.html.erb @@ -0,0 +1,4 @@ +
    <%= @contact_form.name %>
    +
    From: <%= %("#{@contact_form.name}" <#{@contact_form.email}>) %>
    + +
    <%= @contact_form.message %>
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/contacts/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/contacts/_form.html.erb new file mode 100644 index 0000000..4d14f7e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/contacts/_form.html.erb @@ -0,0 +1,23 @@ +<%= bootstrap_form_for @contact, url: @contact.new_record? ? exhibit_contacts_path(@exhibit) : [@exhibit, @contact], layout: :horizontal, label_col: 'col-sm-2', control_col: 'col-sm-10', html: {class: 'col-md-9' } do |f| %> + <%= f.text_field :name, placeholder: t(:'.name.placeholder') %> + <%= f.fields_for(:contact_info) do |contact_info| %> + <% Spotlight::Contact.fields.keys.each do |field| %> + <%= contact_info.text_field field, value: @contact.contact_info[field], placeholder: t(:".#{field}.placeholder") %> + <% end %> + <% end %> + + <%= f.file_field :avatar, data: { croppable: true, aspect_ratio: 1, box_width: 600 } %> + +
    "> +
    + <%= hidden_field_tag :contact_avatar_crop, ([@contact.avatar_crop_x.to_i, @contact.avatar_crop_y.to_i, @contact.avatar_crop_x.to_i + @contact.avatar_crop_w.to_i, @contact.avatar_crop_y.to_i + @contact.avatar_crop_h.to_i].to_json if @contact.avatar_crop_x) %> + <%= f.previewbox :avatar %> + <%= f.cropbox :avatar %> +
    +
    + +
    + <%= cancel_link @contact, exhibit_about_pages_path(@contact.exhibit), class: "btn btn-link" %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/contacts/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/contacts/edit.html.erb new file mode 100644 index 0000000..31ec33e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/contacts/edit.html.erb @@ -0,0 +1,5 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title %> + <%= render 'form' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/contacts/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/contacts/new.html.erb new file mode 100644 index 0000000..31ec33e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/contacts/new.html.erb @@ -0,0 +1,5 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title %> + <%= render 'form' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/_form.html.erb new file mode 100644 index 0000000..638a27b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/_form.html.erb @@ -0,0 +1,17 @@ +<%= bootstrap_form_for @custom_field.new_record? ? [current_exhibit, @custom_field] : [@custom_field.exhibit, @custom_field], layout: :horizontal, label_col: 'col-md-3', control_col: 'col-sm-5', html: {class: 'col-md-9', id: 'edit-search'} do |f| %> + + <%= f.text_field :label %> + <%= f.text_area :short_description %> + + <%= f.form_group :field_type, label: { text: t(:'.field_type.label') } do %> + <%= f.radio_button :field_type, "text", label: t(:'.field_type.text') %> + <%= f.radio_button :field_type, "vocab", label: t(:'.field_type.vocab') %> + <% end %> + +
    +
    + <%= link_to t(:"cancel"), edit_exhibit_metadata_configuration_path(current_exhibit), class: "btn btn-link" %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/edit.html.erb new file mode 100644 index 0000000..3271de0 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/edit.html.erb @@ -0,0 +1,5 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> + <%= render 'form' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/new.html.erb new file mode 100644 index 0000000..8d974ef --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/custom_fields/new.html.erb @@ -0,0 +1,5 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> + <%= render 'form' %> +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_analytics.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_analytics.html.erb new file mode 100644 index 0000000..4ab629f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_analytics.html.erb @@ -0,0 +1,35 @@ +<%= cache current_exhibit, expires_in: 1.hour do %> +

    <%= t :'.monthly_header' %>

    + + + <% Spotlight::Engine.config.analytics_provider.metrics.elements.each do |e| %> + + <% end %> + + + + <% Spotlight::Engine.config.analytics_provider.metrics.elements.each do |e| %> + + <% end %> + + +
    <%= current_exhibit.analytics(1.month, exhibit_root_path(current_exhibit)).send(e) %>
    <%= t(:".#{e}") %>
    + <% page_analytics = current_exhibit.page_analytics(1.month, exhibit_root_path(current_exhibit)) %> + <% unless page_analytics.empty? %> +

    <%= t :'.pages.header' %>

    + + + + + + + + <% page_analytics.each do |p| %> + + + + + <% end %> +
    <%= t(:".pagetitle") %><%= t(:".pageviews") %>
    <%= link_to p.pageTitle, p.pagePath %><%= p.pageviews %>
    + <% end %> +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page.html.erb new file mode 100644 index 0000000..8e6913e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page.html.erb @@ -0,0 +1,16 @@ + + +

    <%= page.title %>

    + + + <%= page.last_edited_by.to_s if page.last_edited_by %> + <%= l page.updated_at, format: :short %> + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page_activity.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page_activity.html.erb new file mode 100644 index 0000000..baec6f4 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_page_activity.html.erb @@ -0,0 +1,16 @@ +

    <%= t :'.header' %>

    + +<% unless @pages.empty? %> + + + + + + + + + + <%= render partial: 'page', collection: @pages %> + +
    <%= t :'.field.title' %><%= t :'.field.last_edited_by' %><%= t :'.field.updated_at' %>
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_solr_document_activity.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_solr_document_activity.html.erb new file mode 100644 index 0000000..eef4df3 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/_solr_document_activity.html.erb @@ -0,0 +1,7 @@ +

    <%= t :'.header' %>

    + +<% unless @solr_documents.empty? %> + <%= render partial: 'spotlight/catalog/document_admin_table', locals: { documents: @solr_documents } %> +<% else %> + <%= t(:'.no_documents') %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/analytics.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/analytics.html.erb new file mode 100644 index 0000000..9e6bc79 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/analytics.html.erb @@ -0,0 +1,15 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> + +
    + <%= curation_page_title %> + + <% if Spotlight::Engine.config.analytics_provider and Spotlight::Engine.config.analytics_provider.enabled? %> + <%= render 'analytics' %> + <% else %> +
    + <% unless current_user %> +

    In order to view exhibit analytics, the site administrator must configure an analytics provider.

    + <% end %> +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/dashboards/show.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/show.html.erb new file mode 100644 index 0000000..93c1325 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/dashboards/show.html.erb @@ -0,0 +1,13 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> + +
    + <%= curation_page_title %> + +
    + <%= render 'page_activity' %> +
    + +
    + <%= render 'solr_document_activity' %> +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_confirmation_status.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_confirmation_status.html.erb new file mode 100644 index 0000000..b3f59b8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_confirmation_status.html.erb @@ -0,0 +1,10 @@ +
    + <% if contact_email.confirmed? %> + <%= t('.confirmed') %> + <% elsif contact_email.recently_sent? %> + <%= t('.confirmation_sent') %> + <% else %> + <%= t('.not_validated') %> <%= link_to t('.resend'), contact_email_confirmation_path(contact_email: {email: contact_email.email}), method: :post %> + <% end %> +
    + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_contact.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_contact.html.erb new file mode 100644 index 0000000..ef5aa81 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_contact.html.erb @@ -0,0 +1,17 @@ + <%= contact.hidden_field :id %> +
    +
    + <% if contact.index == 0 %> +
    + <%= text_field_tag "#{contact.object_name}[email]", contact.object.email, class: 'exhibit-contact form-control' %> + + +
    + <% else %> + <%= text_field_tag "#{contact.object_name}[email]", contact.object.email, class: 'exhibit-contact form-control' %> + <% end %> + <% if contact.object.errors[:email].present? %> + <%=contact.object.errors[:email].join(", ".html_safe) %> + <% end %> +
    + <%= render partial: 'confirmation_status', locals: {contact_email: contact.object} unless contact.object.new_record? %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_delete.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_delete.html.erb new file mode 100644 index 0000000..b4e5568 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_delete.html.erb @@ -0,0 +1,9 @@ +
    +
    +

    <%= t(:".heading") %>

    +

    <%= t(:".warning_html", export_link: link_to(t(:'spotlight.exhibits.export.download'), spotlight.import_exhibit_path(current_exhibit))) %>

    +
    + <%= delete_link current_exhibit, class: 'btn btn-default' %> +
    +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card.html.erb new file mode 100644 index 0000000..6ccff1b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card.html.erb @@ -0,0 +1,10 @@ +
    +
    +
    + <%= render 'exhibit_card_front', exhibit: exhibit %> +
    +
    + <%= render 'exhibit_card_back', exhibit: exhibit %> +
    +
    +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_back.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_back.html.erb new file mode 100644 index 0000000..ad8c20b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_back.html.erb @@ -0,0 +1,23 @@ +

    + <%= exhibit.title %> +

    + +

    + <%= exhibit.subtitle %> +

    + +<% if exhibit.description %> +

    + <%= exhibit.description.truncate(168, omission: "") %> + <% if exhibit.description.length > 168 %> + <%= content_tag(:span,"…".html_safe, class: "visible-sm visible-md") %> + + <% end %> +

    +<% end %> + +
    + <%= link_to t(:'.visit_exhibit'), exhibit, class: "btn btn-primary", role: "button" %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_front.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_front.html.erb new file mode 100644 index 0000000..094323e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibit_card_front.html.erb @@ -0,0 +1,11 @@ +<% if exhibit.thumbnail.present? %> + <%= image_tag(exhibit.thumbnail.image.square.url) %> +<% else %> + <%= image_tag 'spotlight/default_thumbnail.jpg', class: 'default-thumbnail' %> +<% end %> + +<% unless exhibit.published? %> +
    <%= t('.unpublished') %>
    +<% end %> + +

    <%= exhibit.title %>

    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibits.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibits.html.erb new file mode 100644 index 0000000..c63e8f5 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_exhibits.html.erb @@ -0,0 +1,5 @@ +<% exhibits.each_slice(3).each do |row| %> +
    + <%= render collection: row, partial: 'exhibit_card', as: 'exhibit' %> +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_export.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_export.html.erb new file mode 100644 index 0000000..43b6703 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_export.html.erb @@ -0,0 +1,8 @@ +
    +
    +

    <%= t :'.instructions' %>

    +
    + <%= link_to t(:'.download'), get_exhibit_path(current_exhibit, format: 'json'), class: 'btn btn-primary' %> +
    +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_form.html.erb new file mode 100644 index 0000000..5a2260e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_form.html.erb @@ -0,0 +1,25 @@ +<%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10', html: {class: "row"} do |f| %> +
    + <%= f.text_field :title %> + <%= f.text_field :subtitle %> + <%= f.text_area :description %> + <%= f.text_field :tag_list, value: f.object.tag_list.to_s %> + <%= f.form_group(:contact_emails, label: { text: nil, class: nil }, help: nil) do %> + <%= f.fields_for :contact_emails do |contact| %> + <%= render partial: 'contact', locals: {contact: contact} %> + <% end %> +

    <%= t(:'.fields.contact_emails.help_block') %>

    + <% end %> + <%= f.form_group :published, label: { text: nil, class: nil }, help: nil do %> + <%= f.check_box :published, label: "" %> +

    <%= t(:'.fields.published.help_block') %>

    + <% end %> + +
    + +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_import.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_import.html.erb new file mode 100644 index 0000000..de7a173 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_import.html.erb @@ -0,0 +1,15 @@ +
    + <%= bootstrap_form_for [:import, current_exhibit], html: { class: 'clearfix', multipart: true } do |f| %> +
    +

    <%= t :'.instructions' %>

    +
    + <%= file_field_tag :file, class: 'form-control' %> +
    +
    +
    + <%= f.submit t(:'.button'), class: 'btn btn-primary' %> +
    +
    +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_initial_resources_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_initial_resources_form.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_missing_exhibits.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_missing_exhibits.html.erb new file mode 100644 index 0000000..0db5aff --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_missing_exhibits.html.erb @@ -0,0 +1,17 @@ +
    +

    Welcome to Spotlight!

    + + <% unless current_user %> +

    In order to create exhibits, you need to <%= link_to t('spotlight.header_links.login'), main_app.new_user_session_path %>

    + <% end %> + + <% if can? :create, Spotlight::Exhibit %> +

    When you're ready to begin building your exhibit, here's how to get started:

    + +
      +
    1. Visit the <%= link_to "Create Exhibit", new_exhibit_path %> page to create a new exhibit.
    2. + +
    3. Visit the Spotlight <%= link_to "documentation pages", "https://github.com/sul-dlss/spotlight/wiki" %> to learn how to add and edit feature pages, about pages, custom browse categories, and more.
    4. +
    + <% end %> +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_new_exhibit_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_new_exhibit_form.html.erb new file mode 100644 index 0000000..a370aac --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_new_exhibit_form.html.erb @@ -0,0 +1,15 @@ +<%= bootstrap_form_for @exhibit, url: ((spotlight.exhibit_path(@exhibit) if @exhibit.persisted?) || spotlight.exhibits_path), layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %> +
    + <%= f.text_field :title, label: t(:'.fields.title.label'), help: t(:'.fields.title.help_block') %> + <%= f.text_field :slug, label: t(:'.fields.slug.label'), help: t(:'.fields.slug.help_block') %> + <%= f.text_field :tag_list %> + + <%= render 'initial_resources_form', locals: { f: f } %> + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_tags.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_tags.html.erb new file mode 100644 index 0000000..3a0e7a1 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/_tags.html.erb @@ -0,0 +1,13 @@ +<% if tags.any? %> +
    +
    + +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/edit.html.erb new file mode 100644 index 0000000..f25b2ec --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/edit.html.erb @@ -0,0 +1,40 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> +
    + +
    +
    + <%= render 'form' %> +
    + <%= render 'spotlight/filters/form' if can? :edit, current_exhibit.filters.first_or_initialize %> + <%= render 'import' if can? :import, current_exhibit %> + <%= render 'export' if can? :export, current_exhibit %> + <%= render 'delete' if can? :destroy, current_exhibit %> +
    +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/index.html.erb new file mode 100644 index 0000000..039abea --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/index.html.erb @@ -0,0 +1,50 @@ +
    + <% if (current_user && current_user.exhibits.any?) || can?(:manage, Spotlight::Exhibit) %> + + <% end %> + +
    +
    + <% if @exhibits.published.none? %> + <%= render 'missing_exhibits' %> + <% else %> + <%= render 'tags', tags: @exhibits.published.all_tags %> + <%= render 'exhibits', exhibits: @published_exhibits %> + + <% if @published_exhibits.total_count > @published_exhibits.size %> + + <% end %> + <% end %> + +
    + + <% if @exhibits.unpublished.accessible_by(current_ability).any? %> +
    + <%= render 'exhibits', exhibits: @exhibits.unpublished.accessible_by(current_ability) %> +
    + <% end %> + + <% if current_user && current_user.exhibits.any? %> +
    + <%= render 'exhibits', exhibits: current_user.exhibits %> +
    + <% end %> +
    +
    + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/exhibits/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/new.html.erb new file mode 100644 index 0000000..5015ccb --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/exhibits/new.html.erb @@ -0,0 +1,8 @@ +
    +<%= page_title t(:'spotlight.sites.new.section') %> +<%= render 'new_exhibit_form' %> +
    + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_empty.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_empty.html.erb new file mode 100644 index 0000000..9f82273 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_empty.html.erb @@ -0,0 +1,26 @@ +<% if can? :edit, @page %> +
    +

    Building this feature page

    + +
      +
    1. + To add content to this page, click the Edit button above to enter Edit mode. +
    2. +
    3. + In Edit mode, click the plus sign icon to display the widget selection panel. This panel displays a range of widgets, each of which adds a different type of content to the page. +
    4. +
    5. + Select a widget to configure. Click Save changes when you're ready to add it to the page. +
    6. +
    7. + Repeat the steps above to continue adding widgets to build out the page. To work more efficiently, you can configure multiple widgets before saving the page. Use the icons in the lower right of the widget configuration panel to preview, reorder, or delete widgets. +
    8. +
    9. + Note the Options and Thumbnail tabs at the top of the page in Edit mode. Options in these tabs enable you to publish or unpublish the page, turn on or off the page sidebar, and create a thumbnail image to represent the page. +
    10. +
    11. + Visit the Spotlight <%= link_to 'documentation pages', 'https://github.com/sul-dlss/spotlight/wiki' %> to learn more about creating exhibit pages. +
    12. +
    +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_header.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_header.html.erb new file mode 100644 index 0000000..47db8fc --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_header.html.erb @@ -0,0 +1,23 @@ +<%= f.fields_for "home_page" do |p| %> + <% page = p.object %> +
    +

    <%= t('spotlight.pages.index.feature_pages.home_pages_header') %>

    +
    +
    +
    +
    + <%= p.hidden_field :id, value: page.id , class: 'form-control input-sm' %> +

    + <%= page.title %> + <%= p.hidden_field :title, value: page.title , class: 'form-control input-sm', data: {:"edit-field-target" => 'true'} %> +

    +
    + +
    +
    +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_page_options.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_page_options.html.erb new file mode 100644 index 0000000..e5c1456 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_page_options.html.erb @@ -0,0 +1,6 @@ +
    + <%= f.check_box :published %> +
    +
    + <%= f.check_box :display_sidebar?, disabled: @page.child_pages.published.present? %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_sidebar.html.erb new file mode 100644 index 0000000..9ff4892 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/feature_pages/_sidebar.html.erb @@ -0,0 +1,16 @@ +<% cache_unless current_user, [current_exhibit, @page] do %> + +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_form.html.erb new file mode 100644 index 0000000..6d4c27f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_form.html.erb @@ -0,0 +1,32 @@ +<% form_prefix = f.object_name.parameterize("_") %> +<%= field_set_tag do %> + <%= f.check_box(:display) %> +<% end if f.object.is_a? Spotlight::Masthead %> +<%= field_set_tag(t(:'.source.header')) do %> +
    + <%= f.radio_button(:source, :exhibit, label: t(:'.source.exhibit.label')) %> +
    + <%= f.hidden_field(:document_global_id) %> + <%= f.hidden_field(:remote_image_url, data: jcrop_options) %> + <%= text_field_tag(:document_title, (presenter(f.object.document).document_show_html_title if f.object.document), class: "form-control", data: {input_select_target: "##{form_prefix}_source_exhibit", masthead_typeahead: true, target_panel: "##{form_prefix}-target-panel", :'id-field' => "##{form_prefix}_document_global_id", remote_url_field: "##{form_prefix}_remote_image_url" }) %> + +

    <%= t(:'.source.exhibit.help') %>

    +
    +
    +
    + <%= f.radio_button(:source, :remote, label: t(:'.source.remote.label')) %> + <%= f.file_field_without_bootstrap(:image, data: jcrop_options.merge(input_select_target: "##{form_prefix}_source_remote")) %> +
    +<% end %> +<%= field_set_tag(t(:'.source.remote.header')) do %> +

    <%= t(:'.source.remote.help') %>

    +
    "> + <%= hidden_field_tag :"#{jcrop_options.fetch(:selector, "image")}_crop", ([f.object.image_crop_x.to_i, f.object.image_crop_y.to_i, f.object.image_crop_x.to_i + f.object.image_crop_w.to_i, f.object.image_crop_y.to_i + f.object.image_crop_h.to_i].to_json if f.object.try(:image_crop_x)) %> + <%= f.cropbox :image %> +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_upload_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_upload_form.html.erb new file mode 100644 index 0000000..be006d8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/featured_images/_upload_form.html.erb @@ -0,0 +1,17 @@ +<% form_prefix = f.object_name.parameterize("_") %> +<%= field_set_tag do %> + <%= f.check_box(:display) %> +<% end if f.object.is_a? Spotlight::Masthead %> +<%= field_set_tag(t(:'.source.header')) do %> +
    + <%= f.hidden_field(:source, value: :remote, label: t(:'.source.remote.label')) %> + <%= f.file_field_without_bootstrap(:image, data: jcrop_options.merge(input_select_target: "##{form_prefix}_source_remote")) %> +
    +<% end %> +<%= field_set_tag(t(:'.source.remote.header')) do %> +

    <%= t(:'.source.remote.help') %>

    +
    "> + <%= hidden_field_tag :"#{jcrop_options.fetch(:selector, "image")}_crop", ([f.object.image_crop_x.to_i, f.object.image_crop_y.to_i, f.object.image_crop_x.to_i + f.object.image_crop_w.to_i, f.object.image_crop_y.to_i + f.object.image_crop_h.to_i].to_json if f.object.try(:image_crop_x)) %> + <%= f.cropbox :image %> +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/filters/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/filters/_form.html.erb new file mode 100644 index 0000000..4aa2feb --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/filters/_form.html.erb @@ -0,0 +1,13 @@ +
    + <%= bootstrap_form_for [@exhibit, @exhibit.filters.first_or_initialize], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10', html: {class: "row"} do |f| %> + <%= f.text_field :field %> + <%= f.text_field :value %> + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    + <% end %> +
    + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_edit_page_link.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_edit_page_link.html.erb new file mode 100644 index 0000000..427f28d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_edit_page_link.html.erb @@ -0,0 +1 @@ +<%= exhibit_edit_link @page, edit_exhibit_home_page_path(@page.exhibit), class: 'edit-button pull-right btn btn-primary' %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_empty.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_empty.html.erb new file mode 100644 index 0000000..37dd88a --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_empty.html.erb @@ -0,0 +1,33 @@ +
    +

    Welcome to your new exhibit!

    + + <% unless current_user %> +

    In order to curate exhibit content, you need to <%= link_to t('spotlight.header_links.login'), main_app.new_user_session_path %>

    + <% end %> + + <% if can? :edit, @page %> +

    When you're ready to begin building your exhibit, here's how to get started:

    + +
      + <% if can? :update, current_exhibit %> +
    1. Visit the <%= link_to "Configuration > General", edit_exhibit_path(current_exhibit) %> page to configure the exhibit title and subtitle.
    2. + +
    3. Next, go to the <%= link_to "Configuration > Appearance", edit_exhibit_appearance_path(current_exhibit) %> page to add a site masthead image and configure other appearance options.
    4. + <% end %> + + <% if can? :manage, Spotlight::Role.new(resource: current_exhibit) %> +
    5. If you want help building the exhibit, use the <%= link_to "Configuration > Users", exhibit_roles_path(current_exhibit) %> page to add other user accounts.
    6. + <% end %> + + <% if Spotlight::Engine.config.resource_partials.any? %> +
    7. Add items to the exhibit. Go to the <%= link_to "Curation > Items", admin_exhibit_catalog_index_path(current_exhibit) %> page and click Add items. You can add items individually or in bulk via a CSV file.
    8. + <% end %> + + <% if can? :update, current_exhibit.blacklight_configuration %> +
    9. Use the other Curation pages, such as <%= link_to "Curation > Metadata", edit_exhibit_metadata_configuration_path(current_exhibit) %> and <%= link_to "Curation > Search", edit_exhibit_search_configuration_path(current_exhibit) %>, to customize the way various features are presented to exhibit visitors.
    10. + <% end %> + +
    11. Visit the Spotlight <%= link_to "documentation pages", "https://github.com/sul-dlss/spotlight/wiki" %> to learn how to add and edit feature pages, about pages, custom browse categories, and more.
    12. +
    + <% end %> +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_page_options.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_page_options.html.erb new file mode 100644 index 0000000..c562167 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_page_options.html.erb @@ -0,0 +1,2 @@ +<%= f.check_box :display_title %> +<%= f.check_box :display_sidebar? %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_sidebar.html.erb new file mode 100644 index 0000000..0fb719b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_sidebar.html.erb @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_tophat.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_tophat.html.erb new file mode 100644 index 0000000..27cf6cf --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/home_pages/_tophat.html.erb @@ -0,0 +1,2 @@ +<% description current_exhibit.description %> +<% add_exhibit_twitter_card_content %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb new file mode 100644 index 0000000..d91347b --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/indexing_complete_mailer/documents_indexed.html.erb @@ -0,0 +1,3 @@ +

    <%= t :".title" %>

    + +

    <%= t :".body", count: @number, title: @exhibit.title %>

    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/locks/_lock.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/locks/_lock.html.erb new file mode 100644 index 0000000..11a56a9 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/locks/_lock.html.erb @@ -0,0 +1,4 @@ +

    + + <%= t :'spotlight.pages.edit.locked', user: lock.by, created_at: time_ago_in_words(lock.created_at) + " ago"%> +

    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/_metadata_field.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/_metadata_field.html.erb new file mode 100644 index 0000000..9284bfd --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/_metadata_field.html.erb @@ -0,0 +1,16 @@ + + <%= f.fields_for key do |field| %> + + <%= field.hidden_field :weight, 'data-property' => 'weight' %> +
    +
    <%= t :drag %>
    + <%= index_field_label(nil, key) %> + <%= field.hidden_field :label, value: index_field_label(nil, key), class: 'form-control input-sm', data: {:"edit-field-target" => 'true'} %> +
    + + <%= field.check_box :show, inline: true, checked: config.show, label: "" %> + <% available_view_fields.keys.each do |type| %> + <%= field.check_box type, inline: true, checked: config.send(type), label: "" %> + <% end %> + <% end %> + \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/edit.html.erb new file mode 100644 index 0000000..f11d8cf --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/metadata_configurations/edit.html.erb @@ -0,0 +1,71 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    +<%= configuration_page_title %> +<%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_metadata_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %> +

    <%= t(:'.order_header') %>

    + +

    <%= t :'.instructions' %>

    + + + + + + + <% available_view_fields.keys.each do |type| %> + + <% end %> + + + + <%= f.fields_for :index_fields do |idxf| %> + <% @blacklight_configuration.blacklight_config.index_fields.each do |key, config| %> + <%= render partial: 'metadata_field', locals: { key: key, config: config, f: idxf } %> + <% end %> + <% end %> + +
    <%= t :'.fields.label' %> +
    + <%= t :'.view.show', default: t(:'blacklight.search.view.show') %> +
    + <%= select_deselect_button %> +
    +
    + <%= t :".view.#{type}", default: t(:".view.#{type}") %> +
    + <%= select_deselect_button %> +
    + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +<% end %> + + +

    <%= t(:'.exhibit_specific.header') %>

    +

    <%= t(:'.exhibit_specific.instructions') %>

    + + + + <% @exhibit.custom_fields.each do |field| %> + + + + + <% end %> + + +
    +
    <%= field.label %>
    +
    + <%= exhibit_edit_link field, class: 'btn btn-link' %> · + <%= exhibit_delete_link field, class: 'btn btn-link' %> +
    +
    + <%= field.short_description %> +
    + + +<%= exhibit_create_link Spotlight::CustomField.new, class: 'btn btn-primary' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_edit_page_link.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_edit_page_link.html.erb new file mode 100644 index 0000000..156c08e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/_edit_page_link.html.erb @@ -0,0 +1 @@ +<%= exhibit_edit_link @page, class: 'edit-button pull-right btn btn-primary' %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_empty.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_empty.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_form.html.erb new file mode 100644 index 0000000..c0ac254 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/_form.html.erb @@ -0,0 +1,79 @@ +<% + # TODO: the "if @page.persisted?" business below could possibly be done w/ some clever polymorphic routing. + # Leaving as-is for now since technically you can't get to the new page form anyway. +%> +<%= bootstrap_form_for([spotlight, @page.exhibit, @page], role: 'form', html: { + data: { + :'form-observer' => true, + :'blacklight-configuration-index-fields' => available_index_fields, + :'blacklight-configuration-search-views' => available_view_fields.map { |k,v| { key: k, label: view_label(k) }}, + :'attachment-endpoint' => spotlight.exhibit_attachments_url(@page.exhibit), + :'autocomplete-exhibit-catalog-index-path'=> spotlight.autocomplete_exhibit_catalog_index_path(@page.exhibit, q: "%QUERY", format: "json"), + :'autocomplete-exhibit-feature-pages-path' => spotlight.exhibit_feature_pages_path(@page.exhibit, format: "json"), + :'autocomplete-exhibit-searches-path' => spotlight.exhibit_searches_path(@page.exhibit, format: "json"), + :'preview-url' => (spotlight.exhibit_preview_block_url(@page.exhibit, @page) if @page.persisted?) + } + }) do |f| %> + <%= render @page.lock if @page.lock and not @page.lock.stale? and not @page.lock.current_session? %> + <% if @page.errors.any? %> +
    +

    <%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:

    + +
      + <% @page.errors.full_messages.each do |msg| %> +
    • <%= msg %>
    • + <% end %> +
    +
    + <% end %> + +
    + + +
    +
    +
    + <%= f.label :title, class: 'sr-only' %> + <%= f.text_field_without_bootstrap :title, class: 'form-control input-lg', placeholder: t(:'.title_placeholder') %> +
    +
    + <%= f.label :content, class: 'sr-only' %> + <%= f.text_area_without_bootstrap :content, value: f.object['content'], class: 'js-st-instance' %> +
    +
    + +
    + <%= render "page_options", f: f %> +
    + + <% if @page.respond_to? :thumbnail %> +
    + <%= f.fields_for :thumbnail, (@page.thumbnail || @page.build_thumbnail) do |m| %> +

    <%= t(:'.thumbnail.help') %>

    + <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_thumbnail_jcrop_options %> + <% end %> +
    + <% end %> +
    +
    + +
    +
    + <%= link_to(t('cancel'), :back, class: "btn btn-link", data: (@page.lock && @page.lock.current_session? ? { lock: url_for([spotlight, @page.exhibit, @page.lock]) } : {})) %> + <%= f.submit class: 'btn btn-primary' %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_header.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_header.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_order_pages.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_order_pages.html.erb new file mode 100644 index 0000000..f039bb5 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/_order_pages.html.erb @@ -0,0 +1,33 @@ +<%= curation_page_title t(:"spotlight.pages.index.#{page_collection_name}.header") %> +<%= bootstrap_form_for @exhibit, url: polymorphic_path([:update_all, @exhibit, page_collection_name]), layout: :horizontal, control_col: 'col-sm-10', html: {:'data-form-observer' => true} do |f| %> + + <%= render partial: 'header', locals: {f: f} %> +

    <%= t :'.pages_header' %>

    +

    <%= t :'.instructions' %>

    +
    > +
      + <%= f.fields_for page_collection_name do |p| %> + <%- if p.object.about_page? || p.object.top_level_page? -%> + <%= render partial: 'page', locals: {f: p, parent_form: f} %> + <%- end -%> + <% end %> +
    +
    +
    +
    + <%= button_tag action_label(page_collection_name, :update_all), class: "btn btn-primary", disabled: disable_save_pages_button? %> +
    +
    +<%- end -%> +
    + <%= form_for @page, url: spotlight.polymorphic_path([@exhibit, page_collection_name]), html: {class: "expanded-add-button"} do |f|%> + + <%= t(:'.new_page') %> + + <%= f.text_field(:title) %> + <%= f.submit t(:'.save'), data: {behavior: "save"} %> + <%= f.submit t(:'.cancel'), data: {behavior: "cancel"} %> + + + <%- end -%> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_page.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_page.html.erb new file mode 100644 index 0000000..7abd566 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/_page.html.erb @@ -0,0 +1,40 @@ +<% page = f.object %> +
  • +
    +
    <%= t :drag %>
    +
    +
    + <%= f.check_box :published, label: '' %> +
    +
    +
    + <%= f.hidden_field :id %> + <%= f.hidden_field :weight, data: {property: "weight"} %> +

    + <%= page.title %> + <%= f.hidden_field :title, value: page.title , class: 'form-control input-sm', data: {:"edit-field-target" => 'true'} %> +

    +
    + + + <%- if page.feature_page? -%> + <%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %> + <% end %> + +
    +
    +
    + <% if page.feature_page? and page.child_pages.present? %> +
      + <% page.child_pages.each do |child_page| %> + <%= parent_form.fields_for page_collection_name, child_page do |p| %> + <%= render partial: 'page', locals: {f: p, parent_form: parent_form} %> + <% end %> + <% end %> +
    + <% end %> +
  • diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_page_options.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_page_options.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_tophat.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_tophat.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/_view_type_group.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/_view_type_group.html.erb new file mode 100644 index 0000000..0a1e69c --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/_view_type_group.html.erb @@ -0,0 +1,14 @@ +<% views = blacklight_view_config_for_search_block(block) %> +<% if views.length > 1 -%> +
    + <%= t('blacklight.search.view_title') %> +
    + <% views.each do |view, config| %> + <%= link_to url_for(params.merge(:view => view)), :title => t("blacklight.search.view_title.#{view}", default: t("blacklight.search.view.#{view}", default: blacklight_config.view[view].title)), :class => "btn btn-default view-type-#{ view.to_s.parameterize } #{"active" if block_document_index_view_type(block) == view}" do %> + <%= render_view_type_group_icon view %> + <%= t("blacklight.search.view.#{view}") %> + <% end %> + <% end %> +
    +
    +<% end -%> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/edit.html.erb new file mode 100644 index 0000000..d85dd26 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/edit.html.erb @@ -0,0 +1,3 @@ +<%= curation_page_title %> + +<%= render 'form' %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/index.html.erb new file mode 100644 index 0000000..ec8cb69 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/index.html.erb @@ -0,0 +1,4 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= render 'order_pages' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/new.html.erb new file mode 100644 index 0000000..58f1ae8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/new.html.erb @@ -0,0 +1,5 @@ +<%= curation_page_title %> + +<%= render 'form' %> + +<%= link_to t('spotlight.dashboards.show.header'), spotlight.exhibit_dashboard_path(@page.exhibit) %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/preview.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/preview.html.erb new file mode 100644 index 0000000..e0b8d1e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/preview.html.erb @@ -0,0 +1 @@ +<%= render @block %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/pages/show.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/pages/show.html.erb new file mode 100644 index 0000000..4e8b10d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/pages/show.html.erb @@ -0,0 +1,23 @@ +<% set_html_page_title @page.title if @page.should_display_title? %> +<% render 'tophat' %> +<%= render 'sidebar' if @page.display_sidebar? %> + +<%= cache_unless current_user, @page do %> +
    +
    + <%= render 'edit_page_link' if can? :edit, @page %> + <% if @page.should_display_title? %> +

    + <%= @page.title %> +

    + <% end %> +
    +
    + <% if @page.content? %> + <%= render @page.content %> + <% else %> + <%= render 'empty' %> + <% end %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/resources/_external_resources_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/resources/_external_resources_form.html.erb new file mode 100644 index 0000000..5fb7e9c --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/resources/_external_resources_form.html.erb @@ -0,0 +1,20 @@ +<% if Spotlight::Engine.config.external_resources_partials.empty? %> + <%= render 'missing_external_resources_partials' %> +<% end %> + +
    + +
    + <% Spotlight::Engine.config.external_resources_partials.each_with_index do |p, i| %> + <%= content_tag :div, id: "external_resource_tab_#{i}", role: 'tabpanel', class: "tab-pane #{"active" if i == 0}" do %> + <%= render p %> + <% end %> + <% end %> +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/resources/_missing_external_resources_partials.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/resources/_missing_external_resources_partials.html.erb new file mode 100644 index 0000000..3e61a9f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/resources/_missing_external_resources_partials.html.erb @@ -0,0 +1,5 @@ +
    + There are no external resources available. To add items from an external resource, that resource must first be registered with this application. + + Refer your exhibits administrator to the <%= link_to 'Spotlight Resource Scenarios', 'https://github.com/sul-dlss/spotlight/wiki/Resource-Scenarios' %> wiki page for more information about registering external resources. +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/resources/csv_upload/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/resources/csv_upload/_form.html.erb new file mode 100644 index 0000000..ed0aa86 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/resources/csv_upload/_form.html.erb @@ -0,0 +1,9 @@ +<%= bootstrap_form_for([current_exhibit, @resource.becomes(Spotlight::Resources::CsvUpload)], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-sm-6 col-md-6', html: { class: 'item-upload-form', multipart: true } ) do |f| %> + <%= f.url_field :url, type: "file", help: t('.help_html', link: link_to(t('.template'), template_exhibit_resources_csv_uploads_path)), label: t('.file_label') %> +
    +
    + <%= cancel_link @resource, :back, class: 'btn btn-default' %> + <%= f.submit t('.add_item'), class: 'btn btn-primary' %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/resources/new.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/resources/new.html.erb new file mode 100644 index 0000000..cae82bd --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/resources/new.html.erb @@ -0,0 +1,20 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title %> +
    + +
    + <% Spotlight::Engine.config.resource_partials.each_with_index do |p, i| %> + <%= content_tag :div, id: "tab_#{i}", role: 'tabpanel', class: "tab-pane #{"active" if i == 0}" do %> + <%= render p %> + <% end %> + <% end %> +
    +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/resources/upload/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/resources/upload/_form.html.erb new file mode 100644 index 0000000..085f4f0 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/resources/upload/_form.html.erb @@ -0,0 +1,18 @@ +<%= bootstrap_form_for([current_exhibit, @resource.becomes(Spotlight::Resources::Upload)], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-sm-6 col-md-6', html: { class: 'item-upload-form', multipart: true } ) do |f| %> + <%= f.url_field :url, type: "file", help: t('.url-field.help', extensions: Spotlight::Engine.config.allowed_upload_extensions.join(' ')), label: "File" %> + <%= f.fields_for :data do |d| %> + <% Spotlight::Resources::Upload.fields(current_exhibit).each do |config| %> + <%= d.send((config.form_field_type || :text_field), config.field_name, label: uploaded_field_label(config)) %> + <% end %> + <% current_exhibit.custom_fields.each do |custom_field| %> + <%= d.text_field custom_field.field, label: custom_field.label %> + <% end %> + <% end %> +
    +
    + <%= cancel_link @resource, :back, class: 'btn btn-default' %> + <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-default' %> + <%= f.submit t('.add_item'), class: 'btn btn-primary' %> +
    +
    +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/roles/_edit_fields.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/roles/_edit_fields.html.erb new file mode 100644 index 0000000..b7b996e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/roles/_edit_fields.html.erb @@ -0,0 +1,11 @@ + + + <%= f.email_field :user_key, hide_label: true, disabled: f.object.persisted?, data: { behavior: 'check-user-existence' } %> + + + <%= f.select :role, roles_for_select, hide_label: true %> + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/roles/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/roles/index.html.erb new file mode 100644 index 0000000..9574d47 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/roles/index.html.erb @@ -0,0 +1,62 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> + <%= bootstrap_form_for current_exhibit, url: spotlight.update_all_exhibit_roles_path(current_exhibit) do |f| %> + + + + + + + + <%= f.fields_for :roles do |r| %> + <% if r.object.new_record? %> + <%= render partial: 'edit_fields', locals: {f: r} %> + + + + + <% else %> + + + + + + <%= render partial: 'edit_fields', locals: {f: r} %> + + + + + <% end %> + <% end %> + +
    <%= t '.email' %><%= t '.role' %><%= t '.actions' %>
    +
    +
    + <%= cancel_link r.object, '#', class: 'btn btn-link', data: {behavior: 'cancel-edit' } %> + <%=f.submit nil, class: 'btn btn-primary'%> +
    +
    +
    + <%= r.object.user.to_s %> + <%= t('.invite_pending') %> + <%= r.object.role.humanize %><%= link_to "#", data: {behavior: 'edit-user', target: r.object.id } do %> + + <% end %>
    <%= f.submit action_label(r.object, :destroy), class: 'btn btn-danger', data: { behavior: 'destroy-user', target: r.object.id} %> + <%= r.hidden_field :_destroy, data: {'destroy-for' => r.object.id} %> + +
    +
    + <%= cancel_link r.object, '#', class: 'btn btn-link', data: {behavior: 'cancel-edit' } %> + <%=f.submit nil, class: 'btn btn-primary'%> +
    +
    +
    + +
    +
    + <%= exhibit_create_link Spotlight::Role.new, '#', class: 'btn btn-default', data: {behavior: 'new-user'} %> +
    +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_default_per_page.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_default_per_page.html.erb new file mode 100644 index 0000000..da087c8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_default_per_page.html.erb @@ -0,0 +1,5 @@ +<%= f.form_group :default_per_page, label: { text: t(:'.label')} do %> + <% @blacklight_configuration.default_blacklight_config.per_page.each do |key| %> + <%= f.radio_button :default_per_page, key, label: key.to_s %> + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_document_index_view_types.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_document_index_view_types.html.erb new file mode 100644 index 0000000..2fe9dc6 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_document_index_view_types.html.erb @@ -0,0 +1,7 @@ +<%= f.form_group :document_index_view_types, label: {text: t(:'.label')} do %> + <%= f.fields_for :document_index_view_types, @blacklight_configuration.document_index_view_types_selected_hash do |vt| %> + <% @blacklight_configuration.default_blacklight_config.view.select { |_k, v| v.if != false }.keys.each do |key| %> + <%= vt.check_box key %> + <% end %> + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facet_metadata.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facet_metadata.html.erb new file mode 100644 index 0000000..64b1d2e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facet_metadata.html.erb @@ -0,0 +1,12 @@ +<%= content_tag :span, t(:'.document_count', count: metadata[:document_count]) %> +<% if metadata[:document_count] > 0 %> + • + <% if metadata[:value_count] > Spotlight::FieldMetadata::FACET_LIMIT %> + <%= content_tag :span, t(:'.too_many_values_count', count: Spotlight::FieldMetadata::FACET_LIMIT) %> + <% else %> + <%= content_tag :span, t(:'.value_count', count: metadata[:value_count]) %> + <% end %> + <% if metadata[:terms].any? %> + <%= tag("span", class: 'btn-with-tooltip glyphicon glyphicon-info-sign', data: {container: 'body', toggle: 'tooltip', placement: 'top', title: metadata[:terms].join(" • ")}) %> + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facets.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facets.html.erb new file mode 100644 index 0000000..9eb4a2e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_facets.html.erb @@ -0,0 +1,45 @@ +

    <%=t(:'.help') %>

    +
    +
      + <%= f.fields_for :facet_fields do |idxf| %> + <% @blacklight_configuration.blacklight_config.facet_fields.each do |key, config| %> + <% metadata = @field_metadata.field(key) %> +
    1. +
      <%= t :drag %>
      + <%= idxf.fields_for key do |facet| %> +
      +
      + <%= facet.hidden_field :weight, 'data-property' => 'weight' %> + <%= facet.check_box :show, checked: config.show, label: "", title: key %> +
      +
      +

      + <%= facet_field_label(key) %> + <%= facet.hidden_field :label, value: facet_field_label(key), class: 'form-control input-sm', data: {:"edit-field-target" => 'true'} %> +

      +
      + + +
      +
      +
      + <%= facet.form_group :terms, label_col: 'col-md-2', label: { text: t(:'.sort_by.label') } do %> + <%= facet.radio_button :sort, 'count', label: t(:'.sort_by.count'), inline: true, checked: (config.sort.to_s == 'count' || config.sort.nil?) %> + <%= facet.radio_button :sort, 'index', label: t(:'.sort_by.index'), inline: true, checked: (config.sort.to_s == 'index') %> + <% end %> +
      +
      +
      +
      + <% end %> +
    2. + <% end %> + <% end %> +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_search_fields.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_search_fields.html.erb new file mode 100644 index 0000000..672c22e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_search_fields.html.erb @@ -0,0 +1,57 @@ +<% default_field = @blacklight_configuration.blacklight_config.default_search_field %> +
    + +
    + +<%= field_set_tag(t(:'.header'), id: 'search_fields') do %> +

    <%= t(:'.help') %>

    +

    <%= t(:'.instructions') %>

    + + <%= f.fields_for :search_fields, @blacklight_configuration.blacklight_config.search_fields.keys do |vt| %> +
      +
    1. +
      +
      +
      +

      + <%= vt.fields_for default_field.key, default_field do |field| %> + <%= field.check_box_without_bootstrap :enabled, data: { readonly: true }, class: 'disabled' %> + <%= field.hidden_field :label, readonly: true %> + <%= field.hidden_field :weight, value: "-1", readonly: true %> + <%= default_field.label %> + <% end %> +

      +
      +
      +
      +
    2. +
    +
    +
      + <% @blacklight_configuration.blacklight_config.search_fields.select { |_k, v| v.include_in_simple_select != false }.except(default_field.key).each_with_index do |(k, config), index| %> +
    1. +
      +
      <%= t(:drag) %>
      +
      +
      +
      + <%= vt.fields_for k, config do |field| %> + <%= field.check_box_without_bootstrap :enabled %> +

      + <%= config.label %> + <%= field.hidden_field :label, {data: {:"edit-field-target" => "true"}} %> +

      + <%= field.hidden_field :weight, {value: index, data: {property: "weight"}} %> + <% end %> +
      +
      +
      +
      +
    2. + <% end %> +
    +
    + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_sort.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_sort.html.erb new file mode 100644 index 0000000..97267e3 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/_sort.html.erb @@ -0,0 +1,53 @@ +<% default_field = @blacklight_configuration.blacklight_config.default_sort_field %> +<%= field_set_tag(t(:'.header')) do %> +

    <%= t(:'.help') %>

    + + <%= f.fields_for :sort_fields, @blacklight_configuration.blacklight_config.sort_fields.keys do |vt| %> +
      +
    1. +
      +
      +
      +

      + <%= vt.fields_for default_field.key, default_field do |sort| %> + <%= sort.check_box_without_bootstrap :enable, checked: true, disabled: true, data: { readonly: true } %> + <%= sort.hidden_field :enabled, value: '1', readonly: true %> + <%= sort.hidden_field :label, readonly: true %> + <%= sort.hidden_field :weight, value: "-1", readonly: true %> + <%= default_field.label %> + <% end %> +

      + (<%= translate_sort_fields(default_field) %>) +
      +
      +
      +
    2. +
    +
    +
      + <% @blacklight_configuration.blacklight_config.sort_fields.except(default_field.key).each_with_index do |(k, config), index| %> +
    1. +
      +
      <%= t(:drag) %>
      +
      +
      +
      + <%= vt.fields_for k, config do |sort| %> + <%= sort.check_box_without_bootstrap :enabled %> +

      + <%= config.label %> + <%= sort.hidden_field :label, {data: {:"edit-field-target" => "true"}} %> +

      + (<%= translate_sort_fields(config) %>) + <%= sort.hidden_field :weight, {value: index, data: {property: "weight"}} %> + <% end %> +
      +
      +
      +
      +
    2. + <% end %> +
    +
    + <% end %> +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/edit.html.erb new file mode 100644 index 0000000..15503e9 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/search_configurations/edit.html.erb @@ -0,0 +1,46 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= configuration_page_title %> + <%= bootstrap_form_for @blacklight_configuration, url: spotlight.exhibit_search_configuration_path(@exhibit), layout: :horizontal, label_col: 'col-md-3 col-sm-3', control_col: 'col-md-5 col-sm-5' do |f| %> + +
    + +
    +
    + <%= render 'search_fields', f: f %> +
    + +
    + <%= render 'facets', f: f %> +
    + +
    + <%= field_set_tag do %> + <%= render 'document_index_view_types', f: f %> + <%= render 'default_per_page', f: f %> + <% end %> + + <%= render 'sort', f: f %> +
    + +
    +
    + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    + + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/searches/_form.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/searches/_form.html.erb new file mode 100644 index 0000000..c455a9f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/searches/_form.html.erb @@ -0,0 +1,62 @@ +<%= bootstrap_form_for [@search.exhibit, @search], layout: :horizontal, label_col: 'col-md-2 col-sm-2', control_col: 'col-md-7 col-sm-7', data: {form_observer: 'true', autocomplete_exhibit_catalog_index_path: spotlight.autocomplete_exhibit_search_path(@search.exhibit, @search, q: "%QUERY", format: "json")}, html: {id: 'edit-search'} do |f| %> + <% if @search.errors.any? %> +
    +

    <%= pluralize(@search.errors.count, "error") %> prohibited this page from being saved:

    + +
      + <% @search.errors.full_messages.each do |msg| %> +
    • <%= msg %>
    • + <% end %> +
    +
    + <% end %> +
    + + + +
    +
    + <%= f.text_field :title, control_col: "col-sm-5" %> + <%= f.text_area :long_description, rows: 5 %> + <%= f.static_control label: t(:".query_params") do %> +
    + <%= render_constraints(@search.query_params) %> +
    + <% end unless @search.query_params.blank? %> +
    +
    + <%= f.fields_for :masthead, (@search.masthead || @search.build_masthead) do |m| %> +

    <%= t(:'.masthead.help') %>

    +

    <%= t(:'.masthead.help_secondary') %>

    + <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_masthead_jcrop_options %> + <% end %> +
    +
    + <%= f.fields_for :thumbnail, (@search.thumbnail || @search.build_thumbnail) do |m| %> +

    <%= t(:'.thumbnail.help') %>

    + <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_thumbnail_jcrop_options %> + <% end %> +
    + +
    +
    + +
    +
    + <%= cancel_link @search,exhibit_searches_path(@exhibit), class: 'btn btn-link' %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/searches/_search.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/searches/_search.html.erb new file mode 100644 index 0000000..5e41c9f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/searches/_search.html.erb @@ -0,0 +1,27 @@ +<% search = f.object %> +
  • +
    <%= t :drag %>
    +
    + +
    +
  • diff --git a/tmp/blacklight-spotlight/app/views/spotlight/searches/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/searches/edit.html.erb new file mode 100644 index 0000000..31ec33e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/searches/edit.html.erb @@ -0,0 +1,5 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title %> + <%= render 'form' %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/searches/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/searches/index.html.erb new file mode 100644 index 0000000..8127fd0 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/searches/index.html.erb @@ -0,0 +1,35 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title %> +

    <%= t(:'.categories_header') %>

    + + <% if @searches.empty? %> + <%= t :'.no_saved_searches' %> + <% unless @exhibit.searchable? %> +

    + <%= t(:'.not_searchable_html', href: link_to(t(:'spotlight.configuration.sidebar.search_configuration'), spotlight.edit_exhibit_search_configuration_path(@exhibit))) %> +

    + <% end %> + <% else %> +

    <%= t(:'.instructions') %>

    + <% unless @exhibit.searchable? %> +

    + <%= t(:'.not_searchable_html', href: link_to(t(:'spotlight.configuration.sidebar.search_configuration'), spotlight.edit_exhibit_search_configuration_path(@exhibit))) %> +

    + <% end %> + <%= bootstrap_form_for @exhibit, url: update_all_exhibit_searches_path(@exhibit), layout: :horizontal, control_col: 'col-sm-10' do |f| %> + +
    +
      + <%= f.fields_for :searches do |p| %> + <%= render partial: 'search', locals: { f: p} %> + <% end %> +
    +
    + +
    + <%= submit_tag t(:'helpers.action.update_all'), class: "btn btn-primary" %> +
    + <% end %> + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/shared/_configuration_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/shared/_configuration_sidebar.html.erb new file mode 100644 index 0000000..acac718 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/shared/_configuration_sidebar.html.erb @@ -0,0 +1,14 @@ + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/shared/_curation_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/shared/_curation_sidebar.html.erb new file mode 100644 index 0000000..9d55424 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/shared/_curation_sidebar.html.erb @@ -0,0 +1,16 @@ + + \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/shared/_exhibit_sidebar.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/shared/_exhibit_sidebar.html.erb new file mode 100644 index 0000000..d24a2d1 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/shared/_exhibit_sidebar.html.erb @@ -0,0 +1,8 @@ + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/shared/_report_a_problem.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/shared/_report_a_problem.html.erb new file mode 100644 index 0000000..6f922f6 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/shared/_report_a_problem.html.erb @@ -0,0 +1,21 @@ +
    +
    +
    + <% contact_form = Spotlight::ContactForm.new current_url: request.original_url %> + <%= bootstrap_form_for contact_form, url: spotlight.exhibit_contact_form_path(current_exhibit, contact_form), layout: :horizontal, label_col: 'col-sm-3', control_col: 'col-sm-9', html: { class: 'col-md-offset-2 col-md-8 '} do |f| %> + +

    <%= t(:'.title') %>

    + <%= f.text_field :name %> + <%= f.text_field :email %> + <%= f.text_area :message, rows: 7 %> + <%= f.hidden_field :current_url %> +
    +
    + <%= link_to t(:'helpers.action.cancel'), '#', class: 'btn btn-link', data: { 'behavior' => 'cancel-link' } %> + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    + <% end %> +
    +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb new file mode 100644 index 0000000..cdaf71e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb @@ -0,0 +1 @@ +<%= render sir_trevor_block_array.to_a %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb new file mode 100644 index 0000000..9b1df8d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb @@ -0,0 +1,23 @@ +<% browse_block.with_solr_helper(self) %> + +<% if browse_block.searches? %> +
    + <% browse_block.searches.each_with_index do |search, index| %> +
    + <%= link_to spotlight.exhibit_browse_path(search.exhibit, search) do %> +
    +
    +

    + <%= search.title %> +

    + + <% if browse_block.display_item_counts? %> + <%= t(:'.items', count: search.documents.size) %> + <% end %> +
    +
    + <% end %> +
    + <% end %> +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb new file mode 100644 index 0000000..b166184 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb @@ -0,0 +1,17 @@ +<% if featured_pages_block.pages? %> + +<% end %> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_heading_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_heading_block.html.erb new file mode 100644 index 0000000..ac25663 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_heading_block.html.erb @@ -0,0 +1 @@ +

    <%= sir_trevor_markdown heading_block.text %>

    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb new file mode 100644 index 0000000..c490029 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb @@ -0,0 +1 @@ +<%= sanitize iframe_block.code, tags: %w(iframe), attributes: %w(id width height marginwidth marginheight src frameborder allowfullscreen sandbox seamless srcdoc scrolling) %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_image_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_image_block.html.erb new file mode 100644 index 0000000..264bd20 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_image_block.html.erb @@ -0,0 +1,5 @@ +<% if image_block.file && image_block.file[:url] -%> +
    + <%= image_tag image_block.file[:url] %> +
    +<% end -%> diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_list_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_list_block.html.erb new file mode 100644 index 0000000..7ebe556 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_list_block.html.erb @@ -0,0 +1,3 @@ +
    + <%= sir_trevor_markdown list_block.text %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb new file mode 100644 index 0000000..bc3c66f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb @@ -0,0 +1,14 @@ +
    +
    + <%= render_oembed_tag oembed_block.url %> +
    + + <% if oembed_block.text? %> +
    + <% unless oembed_block.title.blank? %> +

    <%= oembed_block.title %>

    + <% end %> + <%= sir_trevor_markdown oembed_block.text %> +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_quote_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_quote_block.html.erb new file mode 100644 index 0000000..895d366 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_quote_block.html.erb @@ -0,0 +1,13 @@ +
    +
    +
    + <%= sir_trevor_markdown quote_block.text %> +
    + + <% if quote_block.cite.present? %> +
    + – <%= quote_block.cite %> +
    + <% end %> +
    +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb new file mode 100644 index 0000000..1d6667d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb new file mode 100644 index 0000000..81d772f --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb @@ -0,0 +1,25 @@ +<% if search_results_block.searches? %> +
    + <% response, document_list = get_search_widget_search_results(search_results_block) %> + <%- unless document_list.present? %> +
    + No items to display. There are currently no items in this exhibit that match the curator's search criteria. +
    + <%- else %> + <% @response, @document_list = [response, document_list] %> + + <% views = blacklight_view_config_for_search_block(search_results_block) %> + <% if views.length > 1 -%> +
    +
    + <%= render partial: 'view_type_group', locals: { block: search_results_block } %> +
    +
    + <% end %> + + <%= render_document_index_with_view(block_document_index_view_type(search_results_block), document_list) %> + <%= render 'results_pagination' %> +
    + <%- end %> +
    +<% end %> \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb new file mode 100644 index 0000000..e151952 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb @@ -0,0 +1,39 @@ +<% solr_documents_block.with_solr_helper(self) %> + +
    + <% if solr_documents_block.documents? %> + +
    "> + <% solr_documents_block.each_document do |block_options, document| %> +
    +
    + <% if block_thumb = block_options[:thumbnail_image_url] %> +
    <%= link_to_document(document, image_tag(block_thumb), counter: -1) %>
    + <% elsif has_thumbnail? document %> +
    <%= render_thumbnail_tag(document, {}, document_counter: -1) %>
    + <% end %> + <% if solr_documents_block.primary_caption? %> +
    + <%= render_index_field_value document, solr_documents_block.primary_caption_field %> +
    + <% end %> + <% if solr_documents_block.secondary_caption? %> +
    + <%= render_index_field_value document, solr_documents_block.secondary_caption_field %> +
    + <% end %> +
    +
    + <% end %> +
    + <% end %> + + <% if solr_documents_block.text? %> +
    + <% unless solr_documents_block.title.blank? %> +

    <%= solr_documents_block.title %>

    + <% end %> + <%= sir_trevor_markdown solr_documents_block.text %> +
    + <% end %> +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb new file mode 100644 index 0000000..ade72d8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb @@ -0,0 +1,48 @@ +<% solr_documents_carousel_block.with_solr_helper(self) %> +<% indicators = [] %> +<% html_id = "carousel-#{solr_documents_carousel_block.object_id}" %> + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb new file mode 100644 index 0000000..061d4e2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb @@ -0,0 +1,24 @@ +<% solr_documents_embed_block.with_solr_helper(self) %> + +
    + + <% if solr_documents_embed_block.documents? %> + +
    "> + <% solr_documents_embed_block.each_document do |block_options, document| %> +
    + <%= render_document_partials document, blacklight_config.view.embed.partials, (blacklight_config.view.embed.locals || {}).reverse_merge(block: solr_documents_embed_block) %> +
    + <% end %> +
    + <% end %> + + <% if solr_documents_embed_block.text? %> +
    + <% unless solr_documents_embed_block.title.blank? %> +

    <%= solr_documents_embed_block.title %>

    + <% end %> + <%= sir_trevor_markdown solr_documents_embed_block.text %> +
    + <% end %> +
    \ No newline at end of file diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb new file mode 100644 index 0000000..ae3dbc2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb @@ -0,0 +1,40 @@ +<% solr_documents_features_block.with_solr_helper(self) %> +<% indicators = [] %> +<% html_id = "carousel-#{solr_documents_features_block.object_id}" %> + +
    + <% if solr_documents_features_block.documents? %> + + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb new file mode 100644 index 0000000..003f2e7 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb @@ -0,0 +1,26 @@ +<% solr_documents_grid_block.with_solr_helper(self) %> +
    +
    + <% if solr_documents_grid_block.documents? %> + <% solr_documents_grid_block.each_document.each_with_index do |(block_options, document), index| %> +
    + <% if block_thumb = block_options[:thumbnail_image_url] %> +
    <%= link_to_document(document, image_tag(block_thumb), counter: -1) %>
    + <% elsif has_thumbnail? document %> +
    <%= render_thumbnail_tag(document, {}, document_counter: -1) %>
    + <% end %> +
    + <% end %> + <% end %> +
    + + + <% if solr_documents_grid_block.text? %> +
    + <% unless solr_documents_grid_block.title.blank? %> +

    <%= solr_documents_grid_block.title %>

    + <% end %> + <%= sir_trevor_markdown solr_documents_grid_block.text %> +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_text_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_text_block.html.erb new file mode 100644 index 0000000..d174437 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_text_block.html.erb @@ -0,0 +1,3 @@ +
    + <%= sir_trevor_markdown text_block.text %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_tweet_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_tweet_block.html.erb new file mode 100644 index 0000000..e88482e --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_tweet_block.html.erb @@ -0,0 +1,9 @@ +
    + <%= link_to image_tag(tweet_block.profile_image_url, class: 'img'), tweet_block.screen_name %> +

    + <%= tweet_block.render_tweet_body %> +

    + From <%= link_to tweet_block.at_name, tweet_block.screen_name %> on Twitter: + +
    + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb new file mode 100644 index 0000000..deada96 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb @@ -0,0 +1,22 @@ +
    +
    + <% if uploaded_items_block.files.present? %> + <% uploaded_items_block.files.each do |file| %> +
    +
    +
    + <%= file[:title] %> +
    +
    +
    + <% end %> + <% end %> +
    + + <% if uploaded_items_block.text? %> +
    + <%= content_tag(:h3, uploaded_items_block.title) if uploaded_items_block.title.present? %> + <%= sir_trevor_markdown uploaded_items_block.text %> +
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_vimeo.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_vimeo.html.erb new file mode 100644 index 0000000..f59febd --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_vimeo.html.erb @@ -0,0 +1,4 @@ +
    + +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_youtube.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_youtube.html.erb new file mode 100644 index 0000000..314833d --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sir_trevor/blocks/videos/_youtube.html.erb @@ -0,0 +1,4 @@ +
    + +
    diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sites/_exhibit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sites/_exhibit.html.erb new file mode 100644 index 0000000..15b4ee8 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sites/_exhibit.html.erb @@ -0,0 +1,18 @@ +<% exhibit = f.object %> + + +
    +
    <%= t :drag %>
    + + <%= f.hidden_field :id %> + <%= f.hidden_field :weight, data: { property: "weight" } %> + + <%= link_to exhibit.title, exhibit %> +
    + + + <%= exhibit.published? ? t(:'.published') : t(:'.unpublished') %> + <%= exhibit.requested_by %> + <%= l exhibit.created_at, format: :short %> + <%= l exhibit.updated_at, format: :short %> + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sites/edit.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sites/edit.html.erb new file mode 100644 index 0000000..dc049b2 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sites/edit.html.erb @@ -0,0 +1,40 @@ +
    + <%= page_title(t('.section'), t('.page_title')) %> +
    + <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %> + +
    +
    +
    + <%= f.text_field :title %> + <%= f.text_field :subtitle %> +
    +
    + +
    +

    <%= t(:'.site_masthead.help') %>

    + <%= f.fields_for(:masthead, @site.masthead || @site.build_masthead) do |m| %> + <%= render '/spotlight/featured_images/upload_form', f: m, jcrop_options: default_masthead_jcrop_options %> + <% end %> +
    +
    + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    +
    + <% end %> +
    + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/sites/edit_exhibits.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/sites/edit_exhibits.html.erb new file mode 100644 index 0000000..569da60 --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/sites/edit_exhibits.html.erb @@ -0,0 +1,32 @@ +
    + <%= page_title(t('.section'), t('.page_title')) %> + <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %> +

    <%= t :'.instructions' %>

    + + + + + + + + + + + + <%= f.fields_for :exhibits do |exhibit_form| %> + <%= render partial: 'exhibit', locals: { f: exhibit_form } %> + <% end %> + +
    <%= Spotlight::Exhibit.human_attribute_name(:title) %><%= Spotlight::Exhibit.human_attribute_name(:published) %><%= Spotlight::Exhibit.human_attribute_name(:requested_by) %><%= Spotlight::Exhibit.human_attribute_name(:created_at) %><%= Spotlight::Exhibit.human_attribute_name(:updated_at) %>
    + +
    +
    + <%= f.submit nil, class: 'btn btn-primary' %> +
    +
    + <% end %> +
    + + diff --git a/tmp/blacklight-spotlight/app/views/spotlight/tags/index.html.erb b/tmp/blacklight-spotlight/app/views/spotlight/tags/index.html.erb new file mode 100644 index 0000000..6a762db --- /dev/null +++ b/tmp/blacklight-spotlight/app/views/spotlight/tags/index.html.erb @@ -0,0 +1,26 @@ +<%= render 'spotlight/shared/exhibit_sidebar' %> +
    + <%= curation_page_title t(:".header") %> + + <% if @tags.empty? %> +

    <%= t :'.no_tags' %>

    + <% else %> + + + + + <%# TODO last used? %> + + + + <% @tags.each do |tag| %> + + + + + + <% end %> + +
    <%= t '.name' %><%= t '.taggings.count' %><%= t '.actions' %>
    <%= link_to tag.name, url_to_tag_facet(tag.name) %><%= tag.taggings.count %><%= delete_link(tag, exhibit_tag_path(current_exhibit, tag), class: 'btn btn-danger btn-xs') %>
    + <% end %> +
    diff --git a/tmp/blacklight-spotlight/bin/rails b/tmp/blacklight-spotlight/bin/rails new file mode 100755 index 0000000..f19021a --- /dev/null +++ b/tmp/blacklight-spotlight/bin/rails @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/spotlight/engine', __FILE__) + +require 'rails/all' +require 'rails/engine/commands' diff --git a/tmp/blacklight-spotlight/blacklight-spotlight.gemspec b/tmp/blacklight-spotlight/blacklight-spotlight.gemspec new file mode 100644 index 0000000..668b123 --- /dev/null +++ b/tmp/blacklight-spotlight/blacklight-spotlight.gemspec @@ -0,0 +1,70 @@ +$LOAD_PATH.push File.expand_path('../lib', __FILE__) + +# Maintain your gem's version: +require 'spotlight/version' + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = 'blacklight-spotlight' + s.version = Spotlight::VERSION + s.authors = ['Chris Beer', 'Jessie Keck', 'Gary Geisler', 'Justin Coyne'] + s.email = ['exhibits-feedback@lists.stanford.edu'] + s.homepage = 'https://github.com/sul-dlss/spotlight' + s.summary = %(Enable librarians, curators, and others who are responsible +for digital collections to create attractive, feature-rich websites that feature +these collections.) + + s.files = Dir['{app,config,db,lib,vendor}/**/*', 'Rakefile', 'README.md', 'LICENSE'] + s.test_files = Dir['spec/**/*'] + + s.required_ruby_version = '~> 2.2' + + s.add_dependency 'rails', '~> 4.0', '>= 4.2.5' + s.add_dependency 'blacklight', '~> 5.17.1' + s.add_dependency 'autoprefixer-rails' + s.add_dependency 'cancancan' + s.add_dependency 'sir_trevor_rails', '~> 0.5.0b1' + s.add_dependency 'carrierwave' + s.add_dependency 'carrierwave-crop' + s.add_dependency 'mini_magick' + s.add_dependency 'bootstrap_form', '~> 2.2' + s.add_dependency 'mail_form', '~> 1.5', '>= 1.5.1' + s.add_dependency 'acts-as-taggable-on', '~> 3.5' + s.add_dependency 'friendly_id', '~> 5.1.0' + s.add_dependency 'breadcrumbs_on_rails', '~> 2.3.0' + s.add_dependency 'social-share-button', '~> 0.1.5' + s.add_dependency 'blacklight-gallery', '>= 0.3.0' + s.add_dependency 'blacklight-oembed', '>= 0.0.3' + s.add_dependency 'devise', '~> 3.0' + s.add_dependency 'devise_invitable', '~> 1.5' + s.add_dependency 'roar-rails' + s.add_dependency 'faraday' + s.add_dependency 'faraday_middleware' + s.add_dependency 'nokogiri' + s.add_dependency 'underscore-rails', '~> 1.6' + s.add_dependency 'github-markup' + s.add_dependency 'lodash-rails' + s.add_dependency 'tophat' + s.add_dependency 'legato' + s.add_dependency 'google-api-client', '~> 0.8.0' + s.add_dependency 'oauth2' + s.add_dependency 'paper_trail', '~> 4.0' + s.add_dependency 'openseadragon' + + s.add_development_dependency 'sqlite3' + s.add_development_dependency 'rspec-rails', '~> 3.1' + s.add_development_dependency 'rspec-its' + s.add_development_dependency 'rspec-activemodel-mocks' + s.add_development_dependency 'rspec-collection_matchers' + s.add_development_dependency 'capybara', '>= 2.5.0' + s.add_development_dependency 'rubocop', '~> 0.37' + s.add_development_dependency 'rubocop-rspec' + s.add_development_dependency 'poltergeist', '>= 1.5.0' + s.add_development_dependency 'factory_girl', '~> 4.5' + s.add_development_dependency 'engine_cart', '~> 0.7' + s.add_development_dependency 'database_cleaner', '~> 1.3' + s.add_development_dependency 'jettywrapper' + s.add_development_dependency 'simplecov', '~> 0.10.0' + s.add_development_dependency 'coveralls' + s.add_development_dependency 'sitemap_generator' +end diff --git a/tmp/blacklight-spotlight/config/jetty.yml b/tmp/blacklight-spotlight/config/jetty.yml new file mode 100644 index 0000000..1e379fa --- /dev/null +++ b/tmp/blacklight-spotlight/config/jetty.yml @@ -0,0 +1,6 @@ +default: + jetty_port: 8983 +test: + jetty_port: <%= ENV['TEST_JETTY_PORT'] || 8888 %> + jetty_home: <%= ENV['TEST_JETTY_PATH'] || File.expand_path(File.join('..', 'jetty'), __FILE__) %> + startup_wait: 15 \ No newline at end of file diff --git a/tmp/blacklight-spotlight/config/locales/devise.en.yml b/tmp/blacklight-spotlight/config/locales/devise.en.yml new file mode 100644 index 0000000..f29e63c --- /dev/null +++ b/tmp/blacklight-spotlight/config/locales/devise.en.yml @@ -0,0 +1,5 @@ +en: + devise: + mailer: + invitation_instructions: + subject: 'Exhibit invitation instructions' diff --git a/tmp/blacklight-spotlight/config/locales/social_share_button.en.yml b/tmp/blacklight-spotlight/config/locales/social_share_button.en.yml new file mode 100644 index 0000000..e9efc34 --- /dev/null +++ b/tmp/blacklight-spotlight/config/locales/social_share_button.en.yml @@ -0,0 +1,18 @@ +en: + social_share_button: + share_to: "%{name}" + weibo: Sina Weibo + twitter: Twitter + facebook: Facebook + douban: Douban + qq: Qzone + tqq: Tqq + delicious: Delicious + baidu: Baidu.com + kaixin001: Kaixin001.com + renren: Renren.com + google_plus: Google+ + google_bookmark: Google Bookmark + tumblr: Tumblr + plurk: Plurk + email: Email diff --git a/tmp/blacklight-spotlight/config/locales/spotlight.en.yml b/tmp/blacklight-spotlight/config/locales/spotlight.en.yml new file mode 100644 index 0000000..e8142af --- /dev/null +++ b/tmp/blacklight-spotlight/config/locales/spotlight.en.yml @@ -0,0 +1,652 @@ +en: + cancel: "Cancel" + drag: "Drag" + toggle_nav: "Toggle navigation" + helpers: + action: + new: Add a new %{model} + view: View + edit: Edit + edit_long: "Edit this %{model}" + destroy: Delete + cancel: Cancel + destroy_are_you_sure: "Are you sure you want to delete this %{model}?" + update_all: "Save changes" + spotlight/search: + destroy: "Delete" + edit_long: "Edit this saved search" + acts_as_taggable_on/tag: + destroy: "Delete tag" + spotlight/role: + create: "Add a new user" + destroy: "Remove from site" + spotlight/custom_field: + create: "Add new field" + spotlight/contact: + create: "Add contact" + spotlight/exhibit: + create: "Create Exhibit" + destroy: "Delete this exhibit" + submit: + spotlight_default: &spotlight_default + create: "Save" + submit: "Save changes" + update: "Save changes" + created: "The %{model} was created." + updated: "The %{model} was successfully updated." + batch_updated: "%{model} were successfully updated." + batch_error: "There was an error updating the requested %{model}." + destroyed: "The %{model} was deleted." + contact: + create: "Save" + created: "The %{model} was created." + destroyed: "The %{model} was destroyed." + update: "Save" + updated: "The %{model} was successfully updated." + batch_updated: "Contacts were successfully updated." + page: &spotlight_page + create: "Add new page" + submit: "Save changes" + update: "Save changes" + created: "The %{model} was created." + updated: "The %{model} was successfully updated." + batch_updated: "%{model} were successfully updated." + batch_error: "There was an error updating the requested pages." + destroyed: "The %{model} was deleted." + exhibit: *spotlight_default + filter: *spotlight_default + search: *spotlight_default + site: *spotlight_default + contact_form: + create: "Send" + created: "Thanks. Your feedback has been sent." + feature_page: *spotlight_page + about_page: *spotlight_page + home_page: *spotlight_page + blacklight_configuration: + create: "Save" + submit: "Save changes" + update: "Save changes" + updated: "The exhibit was successfully updated." + solr_document: *spotlight_default + users: *spotlight_default + custom_field: *spotlight_default + role: + updated: "User has been updated." + destroyed: "User has been removed." + batch_error: "There was a problem saving the user(s)." + invite: + invited: 'User has been invited.' + label: + solr_document: + exhibit_tag_list: "Tags" + spotlight/exhibit: + tag_list: 'Tags' + spotlight/filter: + field: 'Field' + value: 'Value' + activerecord: + models: + spotlight: + page: Page + attributes: + "spotlight/contact": + avatar: "Photo" + "spotlight/exhibit": + published: "Published?" + "spotlight/page": + display_sidebar?: "Show sidebar" + display_title: "Show title" + "spotlight/masthead": + display: "Show background image in masthead" + help: + spotlight/exhibit: + tag_list: "Enter tags separated by commas." + blacklight: + search: + fields: + facet: + exhibit_tag: Exhibit Tags + spotlight: + application_name: "%{exhibit} - %{application_name}" + html_title: "%{title} | %{application_name}" + html_admin_title: "%{section} - %{title}" + configuration: + sidebar: + header: Configuration + settings: General + appearance: Appearance + users: Users + metadata: Metadata + search_configuration: Search + header: "Configuration" + page_title: "Page title" + settings: + header: "Settings" + admin_users: + create: + success: Added user as an exhibits adminstrator + error: There was a problem adding the user as an exhibits adminstrator + destroy: + success: User removed from site adminstrator role + error: There was a problem removing the user from the site adminstrator role + index: + section: Manage exhibits + page_title: Manage administrators + instructions: Existing exhibits administrators + add: Add new administrator + destroy: Remove from role + save: Add role + pending: pending + appearances: + edit: + header: Appearance + exhibit_style: + heading: "Exhibit style" + main_navigation: + menu: Main menu + help: > + Select the menu items you want to be displayed in the main navigation menu + (menu items are only displayed when published pages exist for that item). + Click a menu item to change its display label. Drag and drop a menu item + to change their order in the menu. + restore_default: "Restore default" + site_masthead: + heading: Site masthead + help: > + You can select and crop an image to use as a background in your exhibit site's + masthead. To use an image as a masthead background, you should use an image that + is at least 120 pixels tall and 1200 pixels wide. For best results use an image at + least 1800 pixels wide. You can crop larger images using the cropping tool below. + site_thumbnail: + heading: Site thumbnail + help: "You can select and crop an image to visually represent this exhibit." + thumbnail: + small: Small + medium: Medium + large: Large + contact_forms: + new: + header: "Feedback" + curation: + sidebar: + header: Curation + dashboard: Dashboard + analytics: Analytics + items: Items + tags: Tags + browse: Browse + feature_pages: Feature pages + about_pages: About pages + nav: + home: "Home" + header: "Curation" + search_configurations: + document_index_view_types: + label: Result page types + default_per_page: + label: Default per page + edit: + header: "Search" + tab: + options: "Options" + facets: "Facets" + results: "Results" + search_fields: + header: "Field-based search" + help: > + If the search box is displayed, you can also enable field-based search. + Field-based search adds a dropdown menu to your exhibit site's search box that + provides the user with an option to restrict a search query to a single metadata field. + instructions: > + If enabled, you can select below the metadata fields that are available for searching. Click + a field name to edit its display label. Drag and drop fields to specify the order they + are displayed in the search box dropdown menu. + enable_feature: Display search box + facets: + help: > + If the sidebar is visible, users can use + the facets shown in the sidebar to limit a search. You can select the facets + that are available for searching below. Click a facet field name to edit its display label. + Drag and drop facets to specify the order they are displayed in the sidebar. + sort_by: + label: "Sort by:" + count: Frequency + index: Value + facet_metadata: + document_count: + one: "%{count} item" + other: "%{count} items" + too_many_values_count: "%{count}+ unique values" + value_count: + one: "%{count} unique value" + other: "%{count} unique values" + sort: + header: "Sort fields" + help: > + Select the fields you want to be available to users for sorting results. + Click a field title to change its display label. Drag and drop fields to + change their order in the sort dropdown menu. The field listed first is + the default sort field. + keys: + asc: ascending + desc: descending + score: relevancy score + sort_date_dtsi: date + sort_title_ssi: title + sort_type_ssi: type + sort_source_ssi: source + id: id + metadata_configurations: + edit: + field: + label: "Field name" + deselect_all: "Deselect all" + select_all: "Select all" + header: "Metadata" + order_header: "Display and Order Metadata Fields" + exhibit_specific: + header: "Exhibit-Specific Fields" + instructions: + "You can add metadata fields to supplement the metadata fields that are part of the repository item record." + view: + show: "Item Details" + instructions: > + Select metadata fields to display on each type of page. Click a field name + to edit its display label. Drag and drop fields to specify the order in which they + are displayed. + catalog: + breadcrumb: + index: 'Search Results' + edit_default: + blank_field_warning_html: > + This field is currently hidden on all pages. You can make it visible on the Curation > %{link} page. + full_title_tesim: "Title" + url-field: + help: "Valid file types: %{extensions}" + facets: + exhibit_visibility: + label: "Item Visibility" + private: "Private" + fields: + title: "Title" + date_added: "Date Added" + visibility: Public + document_visibility_control: + make_public: + label: "" + button: Make Public + make_private: + label: "" + button: Make Private + inprogress: + label: "" + private: "Private" + admin: + title: Curation - Items + header: Items + admin_header: + reindex: "Reindex items" + new_resource: "Add items" + new: + header: Import items + reindex_progress_panel: + heading: Reindexing status + begin_html: "Began reindexing a total of items." + completed_html: "Reindexed of items." + error: 'An error occured while reindexing. Contact your exhibits administrator for more information.' + invitation_mailer: + invitation_instructions: + hello: "Hello %{email}!" + someone_invited_you: "The Exhibits Administrator has invited you to help work on the \"%{exhibit_name}\" exhibit at %{url}. You can accept this invitation by clicking the link below." + accept: "Accept invitation" + ignore_html: "If you don't want to accept the invitation, please ignore this email. Your account won't be created until you access the link above." + exhibits_admin_invitation_mailer: + invitation_instructions: + hello: "Hello %{email}!" + someone_invited_you: "The Exhibits Administrator has invited you to help manage exhibits. You can accept this invitation by clicking the link below." + accept: "Accept invitation" + ignore_html: "If you don't want to accept the invitation, please ignore this email. Your exhibits administrator account won't be created until you access the link above." + confirmation_mailer: + confirmation_instructions: + welcome: "Welcome %{email}!" + instructions: "You can confirm your account email through the link below:" + confirm: Confirm my account + contact_form: + new: + header: "Feedback" + custom_fields: + edit: + header: Edit Exhibit-Specific Field + new: + header: Add Exhibit-Specific Field + form: + field_type: + label: "Type" + vocab: "Controlled vocabulary" + text: "Free text" + dashboards: + show: + header: Dashboard + page_activity: + header: Recent Site Building Activity + new_feature_page: "Add new Feature page" + new_about_page: "Add new About page" + field: + title: Title + last_edited_by: User + updated_at: Last Edited + solr_document_activity: + header: Recently Updated Items + no_documents: There are no documents in this exhibit + analytics: + header: "Analytics" + monthly_header: "User Activity Over the Past Month" + pageviews: "page views" + users: "unique visits" + sessions: "visitors" + pagetitle: "page title" + pages: + header: "Most popular pages" + exhibits: + breadcrumb: Home + index: + published: Published exhibits + user: Your exhibits + unpublished: Unpublished exhibits + delete: + heading: Delete exhibit + warning_html: > + This action is irreversible. Be sure to back up the exhibit settings and content using + the %{export_link} feature before proceeding. + edit: + header: General + basic_settings: + heading: Basic settings + form: + fields: + contact_emails: + help_block: Each contact email will receive feedback submissions + published: + label: "Published" + help_block: "" + new_exhibit_form: + fields: + title: + label: Title + help_block: This can be changed later. + slug: + label: URL slug + help_block: A hyphenated name to be displayed in the URL for the exhibit (e.g., "maps-of-africa"). + exhibit_card_front: + unpublished: Unpublished + exhibit_card_back: + visit_exhibit: "Visit exhibit" + new: + header: Create a new exhibit + filter: + heading: Filter items + import: + heading: Import data + instructions: You can import an exhibit JSON file exported from this application to use that data file to define this exhibit. + button: Import data + export: + heading: Export data + instructions: > + You can create a backup of this exhibit by exporting the data that defines it to a JSON file. + You can then import that JSON file into new exhibit to restore the exhibit data or to use as a starting point for a new exhibit. + download: Export data + confirmation_status: + confirmed: Confirmed. + confirmation_sent: Confirmation sent. + not_validated: Not validated. + resend: Resend confirmation? + tags: + all: All + main_navigation: + about: "About" + browse: "Browse" + curated_features: "Curated Features" + pages: + order_pages: + pages_header: Custom Pages + instructions: Add new pages below. Drag and drop pages to change the order in which they are displayed in the sidebar. + new_page: "Add new page" + save: "Save" + cancel: "Cancel" + index: + home_pages: + title: Exhibit Home + header: Exhibit Home + feature_pages: + title: Feature Pages + header: Feature Pages + home_pages_header: Homepage + about_pages: + title: About Pages + header: About Pages + new: + header: New page + edit: + header: Edit page + locked: "This page is currently being edited by %{user} (%{created_at})" + form: + title_placeholder: "Title" + page_content: "Content" + page_options: "Options" + page_thumbnail: "Thumbnail" + thumbnail: + help: > + You can select and crop an image to visually represent this page. It will be + used as the thumbnail image if you include this page using the 'Highlight Featured Pages' widget. + sir_trevor: + blocks: + browse_block: + items: + one: "%{count} item" + other: "%{count} items" + contacts: + edit: + header: "Edit Contact" + new: + header: "Add Exhibit Contact" + form: + name: + placeholder: First and last name + email: + placeholder: Valid email address + title: + placeholder: Job title most relevant to this exhibit + location: + placeholder: Name of library or other physical location + telephone: + placeholder: Telephone number (optional) + about_pages: + contacts_form: + header: Contacts + contact: + legend: Contact Details + instructions: > + Enter details for each librarian, curator or other contact person for this exhibit. + Select the contacts you want to be show in the sidebar of the About Pages. Drag and + drop contacts to specify the order in which they are shown in the sidebar. + nav_link: About + page_options: + published: "Publish" # Possibly no longer used + sidebar: + nav_link: About + contacts: + header: "Contacts" + feature_pages: + nav_link: Curated Features + page_options: + published: "Publish" + featured_images: + form: &featured_images_form + source: + header: "Image source" + exhibit: + label: "From this exhibit" + help: "To find an image, start typing the title of an exhibit item." + remote: + label: "Upload an image" + header: "Cropped image" + help: > + Adjust the cropping box to cover the area of the image you want to use + as the thumbnail image. Click "Save changes" to save the cropped area. + upload_form: *featured_images_form + + resources: + new: + header: "Add items" + form: + needs_provider: "Could not find an appropriate importer" + has_provider: "Ready to import" + upload: + csv: + success: "'%{file_name}' has been uploaded. An email will be sent to you once indexing is complete." + new: + single_item_form: "Single item" + multi_item_form: "Multiple items using CSV file" + error: "There was a problem uploading your object." + success: "Object uploaded successfully." + form: + title: "Upload item" + add_item: "Add item" + add_item_and_continue: "Add item and continue adding" + full_title_tesim: "Title" + url-field: + help: "Valid file types: %{extensions}" + csv_upload: + form: + title: "Upload multiple items" + add_item: "Add item" + help_html: "%{link}" + template: "Download template" + file_label: "CSV File" + bookmarklet: + instructions: "Drag this button to the bookmarks toolbar in your web browser" + bookmarklet: "%{application_name} widget" + reindexing_in_progress: "Reindexing all resources" + external_resources_form: + title: "From external resource" + roles: + edit_fields: + invite_html: "This user does not yet exist. Would you like to send them an %{link}?" + invite_link: invite + index: + title: Site Configuration - Users + invite_pending: pending + header: Users + name: Username + email: "Email Address" + role: "Role" + actions: "Actions" + sites: + new: + section: Manage exhibits + page_title: Create a new exhibit + edit: + section: Manage exhibits + page_title: Customize appearance + basic_settings: + heading: Title + site_masthead: + heading: Site masthead + help: > + You can select and crop an image to use as a background for your home page masthead. + + To use an image as a masthead background, you should use an image that is at least + 120 pixels tall and 1200 pixels wide. For best results use an image at least 1800 pixels wide. + You can crop larger images using the cropping tool below. + edit_exhibits: + section: Manage exhibits + page_title: Order exhibits + instructions: Drag and drop the exhibits below to specify the order in which they are displayed on the exhibits homepage. + searches: &search + nav_link: "Browse" + index: + header: "Browse" + title: "Curation - Browse" + categories_header: "Browse Categories" + instructions: > + Use the Save search button on a search results page to create a new browse category. + Select the categories you want to be displayed on the browse landing page. Drag and + drop categories to change the order in which they appear on that page." + no_saved_searches: > + You can save search results while in curation mode to create browse categories, + which will be displayed here. + not_searchable_html: > + This exhibit is not currently searchable. To perform searches that can be saved as + additional browse categories, temporarily turn on the Display search box + option in the Options section of the Configuration > %{href} page. + edit: + header: "Edit Browse Category" + title: "Curation - Browse" + query_params: "Active search constraints" + search: + item_count: + one: "%{count} item" + other: "%{count} items" + missing_description_html: "%{link} to add a description." + form: + search_description: "Description" + search_masthead: "Masthead" + search_thumbnail: "Thumbnail" + masthead: + help: > + You can select and crop an image to use as a browse category-specific masthead, instead + of the default site masthead, for this browse category's detail page. + help_secondary: > + To create a browse category-specific masthead, you should use an image that is at least + 120 pixels tall and 1200 pixels wide. For best results use an image at least 1800 pixels wide. + You can crop larger images using the cropping tool below. + thumbnail: + help: "You can select and crop an image to visually represent this search." + browse: + nav_link: "Browse" + index: + header: "Browse Exhibit" + search: + item_count: + one: "%{count} item" + other: "%{count} items" + tags: + index: + title: "Curation - Tags" + header: "Tags" + name: "Tag name" + taggings: + count: "Items tagged" + actions: "Actions" + no_tags: "No items in this exhibit have been tagged. You can add tags to an item on the Item Details page while in curation mode." + role: + admin: "Admin" + curator: "Curator" + header_links: + login: "Sign in" + logout: "Sign out" + contact: "Feedback" + saved_search: + label: "Save this search" + title: "Saved search title" + shared: + report_a_problem: + title: Contact Us + indexing_complete_mailer: + documents_indexed: + title: "Your CSV file has just finished being processed." + body: + one: "%{count} document has been indexed from the CSV file and added to the exhibit %{title}." + other: "%{count} documents have been indexed from the CSV file and added to the exhibit %{title}." + versions: + undo: Undo changes + redo: Redo changes + undo_error: Unable to undo changes + shared: + share_follow: + share_follow: "Share & Follow" + site_sidebar: + header: Actions + create_exhibit: 'Create a new exhibit' + documentation: 'Curator documentation' diff --git a/tmp/blacklight-spotlight/config/routes.rb b/tmp/blacklight-spotlight/config/routes.rb new file mode 100644 index 0000000..09ed3f1 --- /dev/null +++ b/tmp/blacklight-spotlight/config/routes.rb @@ -0,0 +1,124 @@ +Spotlight::Engine.routes.draw do + devise_for :contact_email, class_name: 'Spotlight::ContactEmail', only: [:confirmations] + + concern :user_existable do + collection do + get :exists + end + end + + concern :user_invitable do + collection do + post :invite + end + end + + resource :site, only: [:edit, :update] do + collection do + get '/tags', to: 'sites#tags' + end + end + + get '/exhibits/edit', to: 'sites#edit_exhibits', as: 'edit_site_exhibits' + + resources :admin_users, only: [:index, :create, :destroy], concerns: [:user_existable, :user_invitable] + + resources :exhibits, path: '/', except: [:show] do + member do + get 'exhibit', to: 'exhibits#show', as: 'get' + post 'import', to: 'exhibits#process_import' + patch 'import', to: 'exhibits#process_import' + post 'reindex', to: 'exhibits#reindex' + end + + resources :attachments, only: :create + resource :contact_form, path: 'contact', only: [:new, :create] + resource :blacklight_configuration, only: [:update] + + resource :appearance, only: [:edit, :update] + + resource :metadata_configuration, only: [:show, :edit, :update] + resource :search_configuration, only: [:show, :edit, :update] + resource :view_configuration, only: [:show] + + resources :filters, only: [:create, :update] + + blacklight_for :catalog, only: [:export] + + resources :catalog, only: [:index, :show, :edit, :update] do + collection do + get 'admin' + get 'autocomplete' + end + + get 'facet/:id', to: 'catalog#facet', as: 'catalog_facet' + + put 'visiblity', to: 'catalog#make_public' + delete 'visiblity', to: 'catalog#make_private' + end + + get 'catalog/:id', to: 'catalog#show', as: 'solr_document' + + resources :solr_document, only: [:edit], to: 'catalog#edit' + + resources :custom_fields + + resource :dashboard, only: [:show] do + get :analytics + end + + resources :resources do + collection do + get :monitor + post :reindex_all + end + end + + resources :resources_uploads, controller: 'resources/upload', path: 'upload_resources', only: [:create] + + resources :resources_csv_uploads, controller: 'resources/csv_upload', path: 'upload_csv', only: [:create] do + collection do + get :template + end + end + + resources :searches do + collection do + patch :update_all + end + member do + get :autocomplete + end + end + resources :browse, only: [:index, :show] + resources :tags, only: [:index, :destroy] + + resources :contacts, only: [:edit, :update, :destroy] + resources :about_pages, path: 'about' do + collection do + patch 'contacts' => 'about_pages#update_contacts' + resources :contacts, only: [:new, :create] + patch :update_all + end + end + resources :feature_pages, path: 'feature' do + collection do + patch :update_all + end + end + resource :home_page, path: 'home', controller: 'home_pages' + post '/pages/:id/preview' => 'pages#preview', as: :preview_block + + resources :lock, only: [:destroy] + + resources :roles, path: 'users', only: [:index, :create, :destroy], concerns: [:user_existable, :user_invitable] do + collection do + patch :update_all + end + end + post 'solr/update' => 'solr#update' + end + + get '/:exhibit_id' => 'home_pages#show', as: :exhibit_root + post 'versions/:id/revert' => 'versions#revert', as: :revert_version +end diff --git a/tmp/blacklight-spotlight/db/migrate/20131119213142_create_spotlight_pages.rb b/tmp/blacklight-spotlight/db/migrate/20131119213142_create_spotlight_pages.rb new file mode 100644 index 0000000..92312a2 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20131119213142_create_spotlight_pages.rb @@ -0,0 +1,23 @@ +class CreateSpotlightPages < ActiveRecord::Migration + def change + create_table :spotlight_pages do |t| + t.string :title + t.string :type + t.string :slug + t.string :scope + t.text :content + t.integer :weight, default: 50 + t.boolean :published + t.references :exhibit + t.integer :created_by_id + t.integer :last_edited_by_id + t.timestamps + t.integer :parent_page_id + t.boolean :display_sidebar + t.boolean :display_title + end + add_index :spotlight_pages, :exhibit_id + add_index :spotlight_pages, :parent_page_id + add_index :spotlight_pages, [:slug,:scope], unique: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20131120172811_create_spotlight_attachments.rb b/tmp/blacklight-spotlight/db/migrate/20131120172811_create_spotlight_attachments.rb new file mode 100644 index 0000000..ffbe0e2 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20131120172811_create_spotlight_attachments.rb @@ -0,0 +1,12 @@ +class CreateSpotlightAttachments < ActiveRecord::Migration + def change + create_table :spotlight_attachments do |t| + t.string :name + t.string :file + t.string :uid + t.references :exhibit + + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140128155151_create_exhibits.rb b/tmp/blacklight-spotlight/db/migrate/20140128155151_create_exhibits.rb new file mode 100644 index 0000000..a4f147d --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140128155151_create_exhibits.rb @@ -0,0 +1,13 @@ +class CreateExhibits < ActiveRecord::Migration + def change + create_table :spotlight_exhibits do |t| + t.string :title, null: false + t.string :subtitle + t.string :slug + t.text :description + t.timestamps + end + + add_index :spotlight_exhibits, :slug, unique: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140128155152_create_roles.rb b/tmp/blacklight-spotlight/db/migrate/20140128155152_create_roles.rb new file mode 100644 index 0000000..c7e02c8 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140128155152_create_roles.rb @@ -0,0 +1,11 @@ +class CreateRoles < ActiveRecord::Migration + def change + create_table :spotlight_roles do |t| + t.references :exhibit + t.references :user + t.string :role + end + + add_index :spotlight_roles, [:exhibit_id, :user_id], unique: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140130155151_create_spotlight_searches.rb b/tmp/blacklight-spotlight/db/migrate/20140130155151_create_spotlight_searches.rb new file mode 100644 index 0000000..d6f945a --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140130155151_create_spotlight_searches.rb @@ -0,0 +1,20 @@ +class CreateSpotlightSearches < ActiveRecord::Migration + def change + create_table :spotlight_searches do |t| + t.string :title + t.string :slug + t.string :scope + t.text :short_description + t.text :long_description + t.text :query_params + t.integer :weight + t.boolean :on_landing_page + t.string :featured_image + t.references :exhibit + t.timestamps + end + + add_index :spotlight_searches, :exhibit_id + add_index :spotlight_searches, [:slug,:scope], unique: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb b/tmp/blacklight-spotlight/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb new file mode 100644 index 0000000..fe9e16a --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb @@ -0,0 +1,20 @@ +class CreateSpotlightBlacklightConfigurations < ActiveRecord::Migration + def change + create_table :spotlight_blacklight_configurations do |t| + t.references :exhibit + t.text :facet_fields + t.text :index_fields + t.text :search_fields + t.text :sort_fields + t.text :default_solr_params + t.text :show + t.text :index + t.integer :default_per_page + t.text :per_page + t.text :document_index_view_types + t.string :thumbnail_size + + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/tmp/blacklight-spotlight/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..7aae4ca --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb @@ -0,0 +1,32 @@ +# This migration comes from acts_as_taggable_on_engine (originally 1) +class ActsAsTaggableOnMigration < ActiveRecord::Migration + def self.up + create_table :tags do |t| + t.string :name + end + + create_table :taggings do |t| + t.references :tag + + # You should make sure that the column created is + # long enough to store the required class names. + t.string :taggable_id + t.string :taggable_type + t.references :tagger, :polymorphic => true + + # Limit is created to prevent MySQL error on index + # length for MyISAM table type: http://bit.ly/vgW2Ql + t.string :context, :limit => 128 + + t.datetime :created_at + end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + drop_table :taggings + drop_table :tags + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/tmp/blacklight-spotlight/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..673ff54 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb @@ -0,0 +1,22 @@ +# This migration comes from acts_as_taggable_on_engine (originally 2) +class AddMissingUniqueIndices < ActiveRecord::Migration + + def self.up + add_index :tags, :name, unique: true + + remove_index :taggings, :tag_id + remove_index :taggings, [:taggable_id, :taggable_type, :context] + add_index :taggings, + [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], + unique: true, name: 'taggings_idx' + end + + def self.down + remove_index :tags, :name + + remove_index :taggings, name: 'tagging_idx' + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140211203403_create_spotlight_custom_fields.rb b/tmp/blacklight-spotlight/db/migrate/20140211203403_create_spotlight_custom_fields.rb new file mode 100644 index 0000000..5f68965 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140211203403_create_spotlight_custom_fields.rb @@ -0,0 +1,12 @@ +class CreateSpotlightCustomFields < ActiveRecord::Migration + def change + create_table :spotlight_custom_fields do |t| + t.references :exhibit + t.string :slug + t.string :field + t.text :configuration + + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb b/tmp/blacklight-spotlight/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb new file mode 100644 index 0000000..3e2b842 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb @@ -0,0 +1,12 @@ +class CreateSpotlightSolrDocumentSidecars < ActiveRecord::Migration + def change + create_table :spotlight_solr_document_sidecars do |t| + t.references :exhibit, index: true + t.string :solr_document_id, index: true + t.boolean :public, default: true + t.text :data + + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140218155151_create_contacts.rb b/tmp/blacklight-spotlight/db/migrate/20140218155151_create_contacts.rb new file mode 100644 index 0000000..08a9298 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140218155151_create_contacts.rb @@ -0,0 +1,18 @@ +class CreateContacts < ActiveRecord::Migration + def change + create_table :spotlight_contacts do |t| + t.string :slug + t.string :name + t.string :email + t.string :title + t.string :location + t.string :telephone + t.boolean :show_in_sidebar + t.integer :weight, default: 50 + t.references :exhibit + t.timestamps + end + + add_index :spotlight_contacts, :exhibit_id + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140225180948_create_contact_emails.rb b/tmp/blacklight-spotlight/db/migrate/20140225180948_create_contact_emails.rb new file mode 100644 index 0000000..97dad34 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140225180948_create_contact_emails.rb @@ -0,0 +1,16 @@ +class CreateContactEmails < ActiveRecord::Migration + def change + create_table(:spotlight_contact_emails) do |t| + t.references :exhibit + t.string :email, :null => false, :default => "" + t.string :confirmation_token + t.datetime :confirmed_at + t.datetime :confirmation_sent_at + t.string :unconfirmed_email + t.timestamps + end + + add_index :spotlight_contact_emails, [:email, :exhibit_id], :unique => true + add_index :spotlight_contact_emails, :confirmation_token, :unique => true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140228131207_create_resources.rb b/tmp/blacklight-spotlight/db/migrate/20140228131207_create_resources.rb new file mode 100644 index 0000000..e1d0e03 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140228131207_create_resources.rb @@ -0,0 +1,12 @@ +class CreateResources < ActiveRecord::Migration + def change + create_table(:spotlight_resources) do |t| + t.references :exhibit + t.string :type + t.string :url + t.text :data + t.datetime :indexed_at + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb b/tmp/blacklight-spotlight/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb new file mode 100644 index 0000000..59aff93 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb @@ -0,0 +1,6 @@ +class ChangeFeaturedImageToFeaturedImageId < ActiveRecord::Migration + def change + remove_column :spotlight_searches, :featured_image, :string + add_column :spotlight_searches, :featured_item_id, :string + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20140403180324_create_spotlight_main_navigations.rb b/tmp/blacklight-spotlight/db/migrate/20140403180324_create_spotlight_main_navigations.rb new file mode 100644 index 0000000..22bca80 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20140403180324_create_spotlight_main_navigations.rb @@ -0,0 +1,12 @@ +class CreateSpotlightMainNavigations < ActiveRecord::Migration + def change + create_table :spotlight_main_navigations do |t| + t.string :label + t.integer :weight, default: 20 + t.string :nav_type + t.references :exhibit + t.timestamps + end + add_index :spotlight_main_navigations, :exhibit_id + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20141117111311_create_locks.rb b/tmp/blacklight-spotlight/db/migrate/20141117111311_create_locks.rb new file mode 100644 index 0000000..a94d130 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20141117111311_create_locks.rb @@ -0,0 +1,11 @@ +class CreateLocks < ActiveRecord::Migration + def change + create_table :spotlight_locks do |t| + t.references :on, polymorphic: true + t.references :by, polymorphic: true + t.timestamps + end + + add_index :spotlight_locks, [:on_id, :on_type], unique: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20141118233735_change_contact_details.rb b/tmp/blacklight-spotlight/db/migrate/20141118233735_change_contact_details.rb new file mode 100644 index 0000000..74330b9 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20141118233735_change_contact_details.rb @@ -0,0 +1,40 @@ +class ChangeContactDetails < ActiveRecord::Migration + def up + add_column :spotlight_contacts, :contact_info, :text + + Spotlight::Contact.find_each do |contact| + migrated_contact_info = {} + attributes.each do |attribute| + if (value = contact.send(attribute)).present? + migrated_contact_info[attribute] = value + end + end + contact.contact_info = migrated_contact_info + contact.save! + end + + attributes.each do |col| + remove_column :spotlight_contacts, col, :string if Spotlight::Contact.column_names.include? col + end + end + def down + attributes.each do |attribute| + add_column :spotlight_contacts, col, :string + end + + Spotlight::Contact.find_each do |contact| + attributes.each do |attribute| + if (value = contact.contact_info[attribute]).present? + contact.send("#{attribute}=".to_sym, value) + end + end + contact.save! + end + + remove_column :spotlight_contacts, :contact_info, :text + end + private + def attributes + [:email, :title, :location, :telephone] + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20141126231820_add_avatar_to_contacts.rb b/tmp/blacklight-spotlight/db/migrate/20141126231820_add_avatar_to_contacts.rb new file mode 100644 index 0000000..3957859 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20141126231820_add_avatar_to_contacts.rb @@ -0,0 +1,9 @@ +class AddAvatarToContacts < ActiveRecord::Migration + def change + add_column :spotlight_contacts, :avatar, :string + add_column :spotlight_contacts, :avatar_crop_x, :integer + add_column :spotlight_contacts, :avatar_crop_y, :integer + add_column :spotlight_contacts, :avatar_crop_w, :integer + add_column :spotlight_contacts, :avatar_crop_h, :integer + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20141205005902_add_layout_options_to_exhibit.rb b/tmp/blacklight-spotlight/db/migrate/20141205005902_add_layout_options_to_exhibit.rb new file mode 100644 index 0000000..2ec1519 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20141205005902_add_layout_options_to_exhibit.rb @@ -0,0 +1,6 @@ +class AddLayoutOptionsToExhibit < ActiveRecord::Migration + def change + add_column :spotlight_exhibits, :searchable, :boolean, default: true + add_column :spotlight_exhibits, :layout, :string + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150116161616_add_published_to_exhibit.rb b/tmp/blacklight-spotlight/db/migrate/20150116161616_add_published_to_exhibit.rb new file mode 100644 index 0000000..2d0164d --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150116161616_add_published_to_exhibit.rb @@ -0,0 +1,15 @@ +class AddPublishedToExhibit < ActiveRecord::Migration + def change + add_column :spotlight_exhibits, :published, :boolean, default: false + add_column :spotlight_exhibits, :published_at, :datetime + + reversible do |dir| + dir.up do + Spotlight::Exhibit.find_each do |e| + e.published = true + e.save! + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150127173245_add_featured_image_to_exhibit.rb b/tmp/blacklight-spotlight/db/migrate/20150127173245_add_featured_image_to_exhibit.rb new file mode 100644 index 0000000..50f5cc2 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150127173245_add_featured_image_to_exhibit.rb @@ -0,0 +1,5 @@ +class AddFeaturedImageToExhibit < ActiveRecord::Migration + def change + add_column :spotlight_exhibits, :featured_image, :string + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb b/tmp/blacklight-spotlight/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb new file mode 100644 index 0000000..6cc53c2 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb @@ -0,0 +1,26 @@ +class AddPolymorphicDocumentToSidecars < ActiveRecord::Migration + def change + add_column :spotlight_solr_document_sidecars, :document_id, :string + add_column :spotlight_solr_document_sidecars, :document_type, :string + + reversible do |dir| + dir.up do + Spotlight::SolrDocumentSidecar.find_each do |e| + e.document = SolrDocument.new(id: e.solr_document_id) + e.save! + end + end + + dir.down do + Spotlight::SolrDocumentSidecar.find_each do |e| + e.solr_document_id = e.document_id + e.save! + end + end + end + + remove_column :spotlight_solr_document_sidecars, :solr_document_id + + add_index :bookmarks, [:document_type, :document_id] + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150304071512_add_spotlight_featured_images.rb b/tmp/blacklight-spotlight/db/migrate/20150304071512_add_spotlight_featured_images.rb new file mode 100644 index 0000000..8fc5452 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150304071512_add_spotlight_featured_images.rb @@ -0,0 +1,16 @@ +class AddSpotlightFeaturedImages < ActiveRecord::Migration + def change + create_table :spotlight_featured_images do |t| + t.string :type + t.boolean :display + t.string :image + t.string :source + t.string :document_global_id + t.integer :image_crop_x + t.integer :image_crop_y + t.integer :image_crop_w + t.integer :image_crop_h + t.timestamps + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb b/tmp/blacklight-spotlight/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb new file mode 100644 index 0000000..07ef837 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb @@ -0,0 +1,10 @@ +class AddFeaturedImageToSpotlightClasses < ActiveRecord::Migration + + def change + add_column :spotlight_searches, :masthead_id, :integer + add_column :spotlight_searches, :thumbnail_id, :integer + add_column :spotlight_exhibits, :masthead_id, :integer + add_column :spotlight_exhibits, :thumbnail_id, :integer + add_column :spotlight_pages, :thumbnail_id, :integer + end +end \ No newline at end of file diff --git a/tmp/blacklight-spotlight/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb b/tmp/blacklight-spotlight/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb new file mode 100644 index 0000000..4b30557 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb @@ -0,0 +1,11 @@ +class AddDisplayToSpotlightMainNavigations < ActiveRecord::Migration + def up + add_column :spotlight_main_navigations, :display, :boolean, default: true + + Spotlight::MainNavigation.reset_column_information + Spotlight::MainNavigation.update_all display: true + end + def down + remove_column :spotlight_main_navigations, :display + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150313175432_add_field_type_to_custom_fields.rb b/tmp/blacklight-spotlight/db/migrate/20150313175432_add_field_type_to_custom_fields.rb new file mode 100644 index 0000000..d095d79 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150313175432_add_field_type_to_custom_fields.rb @@ -0,0 +1,11 @@ +class AddFieldTypeToCustomFields < ActiveRecord::Migration + def up + add_column :spotlight_custom_fields, :field_type, :string + + Spotlight::CustomField.reset_column_information + Spotlight::CustomField.update_all field_type: 'text' + end + def down + remove_column :spotlight_custom_fields, :field_type + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/tmp/blacklight-spotlight/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..8edb508 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb @@ -0,0 +1,15 @@ +# This migration comes from acts_as_taggable_on_engine (originally 3) +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration + def self.up + add_column :tags, :taggings_count, :integer, default: 0 + + ActsAsTaggableOn::Tag.reset_column_information + ActsAsTaggableOn::Tag.find_each do |tag| + ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) + end + end + + def self.down + remove_column :tags, :taggings_count + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/tmp/blacklight-spotlight/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..71f2d7f --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 4) +class AddMissingTaggableIndex < ActiveRecord::Migration + def self.up + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + remove_index :taggings, [:taggable_id, :taggable_type, :context] + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/tmp/blacklight-spotlight/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb new file mode 100644 index 0000000..bfb06bc --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from acts_as_taggable_on_engine (originally 5) +# This migration is added to circumvent issue #623 and have special characters +# work properly +class ChangeCollationForTagNames < ActiveRecord::Migration + def up + if ActsAsTaggableOn::Utils.using_mysql? + execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20150713160101_change_spotlight_searches_to_published.rb b/tmp/blacklight-spotlight/db/migrate/20150713160101_change_spotlight_searches_to_published.rb new file mode 100644 index 0000000..f85ba15 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20150713160101_change_spotlight_searches_to_published.rb @@ -0,0 +1,5 @@ +class ChangeSpotlightSearchesToPublished < ActiveRecord::Migration + def up + rename_column :spotlight_searches, :on_landing_page, :published + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151016092343_remove_searchable_from_exhibit.rb b/tmp/blacklight-spotlight/db/migrate/20151016092343_remove_searchable_from_exhibit.rb new file mode 100644 index 0000000..a24a60d --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151016092343_remove_searchable_from_exhibit.rb @@ -0,0 +1,20 @@ +class RemoveSearchableFromExhibit < ActiveRecord::Migration + def up + Spotlight::Exhibit.where(searchable: false).find_each do |e| + e.home_page.update(display_sidebar: false) + end + + Spotlight::Exhibit.where(searchable: true).find_each do |e| + key = e.blacklight_configuration.default_blacklight_config.default_search_field.key + + e.blacklight_configuration.search_fields[key] ||= {} + e.blacklight_configuration.search_fields[key][:enabled] = true + end + + remove_column :spotlight_exhibits, :searchable + end + + def down + add_column :spotlight_exhibits, :searchable, :boolean, default: true + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb b/tmp/blacklight-spotlight/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb new file mode 100644 index 0000000..08b196b --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb @@ -0,0 +1,9 @@ +class AddMetadataToSpotlightResource < ActiveRecord::Migration + def up + add_column :spotlight_resources, :metadata, :binary + end + + def down + remove_column :spotlight_resources, :metadata + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb b/tmp/blacklight-spotlight/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb new file mode 100644 index 0000000..95fd41f --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb @@ -0,0 +1,5 @@ +class ChangeSpotlightExhibitPublishedDefault < ActiveRecord::Migration + def up + change_column :spotlight_exhibits, :published, :boolean, default: false + end +end \ No newline at end of file diff --git a/tmp/blacklight-spotlight/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb b/tmp/blacklight-spotlight/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb new file mode 100644 index 0000000..47844fa --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb @@ -0,0 +1,12 @@ +class RemoveDefaultFromSpotlightExhibit < ActiveRecord::Migration + def up + return unless Spotlight::Exhibit.column_names.include? 'default' + + remove_column :spotlight_exhibits, :default + end + + def down + add_column :spotlight_exhibits, :default, :boolean, default: true + add_index :spotlight_exhibits, :default, unique: true + end +end \ No newline at end of file diff --git a/tmp/blacklight-spotlight/db/migrate/20151124105543_update_custom_field_names.rb b/tmp/blacklight-spotlight/db/migrate/20151124105543_update_custom_field_names.rb new file mode 100644 index 0000000..10ca1fa --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151124105543_update_custom_field_names.rb @@ -0,0 +1,31 @@ +class UpdateCustomFieldNames < ActiveRecord::Migration + def up + fields = {} + + Spotlight::CustomField.find_each do |f| + f.update(field: f.send(:field_name)) + fields[f.solr_field] = f + end + + Spotlight::SolrDocumentSidecar.find_each do |f| + f.data.select { |k, v| fields.has_key? k }.each do |k, v| + f.data[fields[k].send(:field_name)] = f.data.delete(k) + end + end + end + + def down + fields = {} + + Spotlight::CustomField.find_each do |f| + fields[f.field] = f + f.update(field: f.send(:solr_field)) + end + + Spotlight::SolrDocumentSidecar.find_each do |f| + f.data.select { |k, v| fields.has_key? k }.each do |k, v| + f.data[fields[k].send(:solr_field)] = f.data.delete(k) + end + end + end +end \ No newline at end of file diff --git a/tmp/blacklight-spotlight/db/migrate/20151208085432_add_weight_to_exhibits.rb b/tmp/blacklight-spotlight/db/migrate/20151208085432_add_weight_to_exhibits.rb new file mode 100644 index 0000000..2889ea2 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151208085432_add_weight_to_exhibits.rb @@ -0,0 +1,5 @@ +class AddWeightToExhibits < ActiveRecord::Migration + def up + add_column :spotlight_exhibits, :weight, :integer, default: 50 + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151210073829_create_spotlight_site.rb b/tmp/blacklight-spotlight/db/migrate/20151210073829_create_spotlight_site.rb new file mode 100644 index 0000000..2cd5f3e --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151210073829_create_spotlight_site.rb @@ -0,0 +1,9 @@ +class CreateSpotlightSite < ActiveRecord::Migration + def change + create_table :spotlight_sites do |t| + t.string :title + t.string :subtitle + t.references :masthead + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb b/tmp/blacklight-spotlight/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb new file mode 100644 index 0000000..f73a8b8 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb @@ -0,0 +1,23 @@ +class AddSiteToSpotlightExhibits < ActiveRecord::Migration + def up + add_column :spotlight_exhibits, :site_id, :integer + add_index :spotlight_exhibits, :site_id + + add_default_site_to_exhibits + end + + def down + remove_column :spotlight_exhibits, :site_id, :integer + end + + private + + def add_default_site_to_exhibits + Spotlight::Site.reset_column_information + Spotlight::Exhibit.reset_column_information + + Spotlight::Exhibit.find_each do |e| + e.site = Spotlight::Site.instance + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb b/tmp/blacklight-spotlight/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb new file mode 100644 index 0000000..fcde370 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb @@ -0,0 +1,41 @@ +class ChangeRolesToSupportPolymorphicAssociations < ActiveRecord::Migration + def up + add_column :spotlight_roles, :resource_id, :integer + add_column :spotlight_roles, :resource_type, :string + + migrate_role_data_to_polymorphic_resource + + remove_index :spotlight_roles, [:exhibit_id, :user_id] + remove_column :spotlight_roles, :exhibit_id + + add_index :spotlight_roles, [:resource_type, :resource_id, :user_id], unique: true, name: 'index_spotlight_roles_on_resource_and_user_id' + end + + def down + add_column :spotlight_roles, :exhibit_id, :integer + add_index(:spotlight_roles, [:exhibit_id]) + + Spotlight::Role.reset_column_information + + Spotlight::Role.find_each do |e| + e.update(exhibit_id: e.resource_id) if e.exhibit_id.nil? && e.resource_type == 'Spotlight::Exhibit' + end + + remove_index :spotlight_roles, name: 'index_spotlight_roles_on_resource_and_user_id' + + remove_column :spotlight_roles, :resource_id + remove_column :spotlight_roles, :resource_type + + add_index :spotlight_roles, [:exhibit_id, :user_id], unique: true + end + + private + + def migrate_role_data_to_polymorphic_resource + Spotlight::Role.reset_column_information + + Spotlight::Role.find_each do |e| + e.update(resource_id: e.exhibit_id, resource_type: 'Spotlight::Exhibit') unless e.resource_id + end + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151215192845_add_index_status_to_resources.rb b/tmp/blacklight-spotlight/db/migrate/20151215192845_add_index_status_to_resources.rb new file mode 100644 index 0000000..06de027 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151215192845_add_index_status_to_resources.rb @@ -0,0 +1,6 @@ +class AddIndexStatusToResources < ActiveRecord::Migration + def change + add_column :spotlight_resources, :index_status, :integer + add_index :spotlight_resources, :index_status + end +end diff --git a/tmp/blacklight-spotlight/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb b/tmp/blacklight-spotlight/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb new file mode 100644 index 0000000..0667af3 --- /dev/null +++ b/tmp/blacklight-spotlight/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb @@ -0,0 +1,17 @@ +class CreateSpotlightExhibitFilters < ActiveRecord::Migration + def change + create_table :spotlight_filters do |t| + t.string :field + t.string :value + t.references :exhibit, index: true + + t.timestamps null: false + end + + reversible do |change| + change.up do + Spotlight::Exhibit.all.each { |exhibit| exhibit.send(:initialize_filter) } + end + end + end +end diff --git a/tmp/blacklight-spotlight/lib/blacklight/spotlight.rb b/tmp/blacklight-spotlight/lib/blacklight/spotlight.rb new file mode 100644 index 0000000..603e920 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/blacklight/spotlight.rb @@ -0,0 +1 @@ +require 'spotlight' diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/install_generator.rb b/tmp/blacklight-spotlight/lib/generators/spotlight/install_generator.rb new file mode 100644 index 0000000..ab646d4 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/install_generator.rb @@ -0,0 +1,131 @@ +require 'rails/generators' + +module Spotlight + ## + # spotlight:install generator + class Install < Rails::Generators::Base + source_root File.expand_path('../templates', __FILE__) + class_option :solr_update_class, type: :string, default: 'Spotlight::SolrDocument::AtomicUpdates' + class_option :mailer_default_url_host, type: :string, default: '' # e.g. localhost:3000 + + def inject_spotlight_routes + route "mount Spotlight::Engine, at: 'spotlight'" + gsub_file 'config/routes.rb', /^\s*root.*/ do |match| + '#' + match + ' # replaced by spotlight root path' + end + route "root to: 'spotlight/exhibits#index'" + end + + def friendly_id + gem 'friendly_id' + generate 'friendly_id' + end + + def paper_trail + generate 'paper_trail:install' + end + + def sitemaps + gem 'sitemap_generator' + copy_file 'config/sitemap.rb', 'config/sitemap.rb' + + say <<-EOS.strip_heredoc, :red + Added a default sitemap_generator configuration in config/sitemap.rb; please + update the default host to match your environment + EOS + end + + def assets + copy_file 'spotlight.scss', 'app/assets/stylesheets/spotlight.scss' + copy_file 'spotlight.js', 'app/assets/javascripts/spotlight.js' + end + + def add_roles_to_user + inject_into_class 'app/models/user.rb', User, ' include Spotlight::User' + end + + def add_controller_mixin + inject_into_file 'app/controllers/application_controller.rb', after: 'include Blacklight::Controller' do + "\n include Spotlight::Controller\n" + end + end + + def add_helper + copy_file 'spotlight_helper.rb', 'app/helpers/spotlight_helper.rb' + inject_into_class 'app/helpers/application_helper.rb', ApplicationHelper, ' include SpotlightHelper' + end + + def add_model_mixin + if File.exist? 'app/models/solr_document.rb' + inject_into_file 'app/models/solr_document.rb', after: 'include Blacklight::Solr::Document' do + "\n include Spotlight::SolrDocument\n" + end + else + say 'Unable to find SolrDocument class; add `include Spotlight::SolrDocument` to the class manually' + end + end + + def add_solr_indexing_mixin + if File.exist? 'app/models/solr_document.rb' + inject_into_file 'app/models/solr_document.rb', after: "include Spotlight::SolrDocument\n" do + "\n include #{options[:solr_update_class]}\n" + end + else + say "Unable to find SolrDocument class; add `include #{options[:solr_update_class]}` to the class manually" + end + end + + def add_search_builder_mixin + if File.exist? 'app/models/search_builder.rb' + inject_into_file 'app/models/search_builder.rb', after: "include Blacklight::Solr::SearchBuilderBehavior\n" do + "\n include Spotlight::Catalog::AccessControlsEnforcement::SearchBuilder\n" + end + else + say 'Unable to find SearchBuilder class; add `include Spotlight::Catalog::AccessControlsEnforcement::SearchBuilder` to the class manually.' + end + end + + def add_example_catalog_controller + copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb' + end + + def add_osd_viewer + gem 'blacklight-gallery', '>= 0.3.0' + generate 'blacklight_gallery:install' + end + + def add_oembed + gem 'blacklight-oembed' + generate 'blacklight_oembed:install' + end + + def add_mailer_defaults + if options[:mailer_default_url_host].present? + say 'Injecting a placeholder config.action_mailer.default_url_options; be sure to update it for your environment', :yellow + insert_into_file 'config/application.rb', after: "< Rails::Application\n" do + <<-EOF + config.action_mailer.default_url_options = { host: "#{options[:mailer_default_url_host]}", from: "noreply@example.com" } + EOF + end + else + say 'Please add a default configuration config.action_mailer.default_url_options for your environment', :red + end + end + + def generate_social_share_button_initializer + gem 'social-share-button' + directory 'config' + end + + def add_solr_config_resources + copy_file 'jetty.rake', 'lib/tasks/jetty.rake' + directory 'solr_conf' + end + + def generate_devise_invitable + gem 'devise_invitable' + generate 'devise_invitable:install' + generate 'devise_invitable', 'User' + end + end +end diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/catalog_controller.rb b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/catalog_controller.rb new file mode 100644 index 0000000..afab1a8 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/catalog_controller.rb @@ -0,0 +1,26 @@ +## +# Simplified catalog controller +class CatalogController < ApplicationController + include Blacklight::Catalog + + configure_blacklight do |config| + ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params + config.default_solr_params = { + qt: 'search', + rows: 10, + fl: '*' + } + + config.document_solr_path = 'get' + config.document_unique_id_param = 'ids' + + # solr field configuration for search results/index views + config.index.title_field = 'full_title_tesim' + + config.add_search_field 'all_fields', label: 'Everything' + + config.add_sort_field 'relevance', sort: 'score desc', label: 'Relevance' + + config.add_field_configuration_to_solr_request! + end +end diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/initializers/social_share_button.rb b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/initializers/social_share_button.rb new file mode 100644 index 0000000..d8b6e52 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/initializers/social_share_button.rb @@ -0,0 +1,3 @@ +SocialShareButton.configure do |config| + config.allow_sites = %w(twitter facebook google_plus) +end diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/sitemap.rb b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/sitemap.rb new file mode 100644 index 0000000..3107783 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/config/sitemap.rb @@ -0,0 +1,11 @@ +require 'sitemap_generator' + +# TODO: Update the default host to match your deployment environment +SitemapGenerator::Sitemap.default_host = 'http://localhost/' + +SitemapGenerator::Interpreter.send :include, Rails.application.routes.url_helpers +SitemapGenerator::Interpreter.send :include, Spotlight::Engine.routes.url_helpers + +SitemapGenerator::Sitemap.create do + Spotlight::Sitemap.add_all_exhibits(self) +end diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/jetty.rake b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/jetty.rake new file mode 100644 index 0000000..d6e8d39 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/jetty.rake @@ -0,0 +1,19 @@ +begin + require 'jettywrapper' + + namespace :jetty do + desc "Copies the application's solr config into jetty" + task configure_solr: ['jetty:clean'] do + FileList['solr_conf/conf/*'].each do |f| + cp(f.to_s, 'jetty/solr/blacklight-core/conf/', verbose: true) + end + end + end +rescue LoadError + namespace :jetty do + desc "Copies the application's solr config into jetty (requires jettywrapper)" + task :configure_solr do + # no-op + end + end +end diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/schema.xml b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/schema.xml new file mode 100644 index 0000000..3d15d92 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/schema.xml @@ -0,0 +1,159 @@ + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/solrconfig.xml b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/solrconfig.xml new file mode 100644 index 0000000..5e74ef6 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/solr_conf/conf/solrconfig.xml @@ -0,0 +1,87 @@ + + + + + ${solr.abortOnConfigurationError:true} + + 4.10.3 + + + + + + ${solr.core0.data.dir:} + + + + + + + + ${solr.data.dir:} + + + + edismax + explicit + *:* + 2<-1 5<-2 6<90% + 1 + 2 + 0.01 + + id^1000 + full_title_tesim^100 + spotlight_upload_description_tesim^50 + all_text_timv + + + full_title_tesim^100 + all_text_timv^10 + + + + *, score + + + true + 1 + 10 + + + + + + true + json + true + + + + + + + + + + + + + + + + solrpingquery + + + all + + + + + + search + + + diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.js b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.js new file mode 100644 index 0000000..04ac194 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.js @@ -0,0 +1 @@ +//= require spotlight/application \ No newline at end of file diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.scss b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.scss new file mode 100644 index 0000000..3ba194a --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight.scss @@ -0,0 +1,11 @@ +/* +*= require social-share-button +*= require bootstrap-tagsinput +*= require jquery.jcrop +*/ +@import 'spotlight/variables_bootstrap'; +@import 'bootstrap-sprockets'; +@import 'sir-trevor'; +@import 'sir-trevor-icons'; +@import 'bootstrap'; +@import 'spotlight/spotlight'; \ No newline at end of file diff --git a/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight_helper.rb b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight_helper.rb new file mode 100644 index 0000000..4173b9f --- /dev/null +++ b/tmp/blacklight-spotlight/lib/generators/spotlight/templates/spotlight_helper.rb @@ -0,0 +1,6 @@ +## +# Global Spotlight helpers +module SpotlightHelper + include ::BlacklightHelper + include Spotlight::MainAppHelpers +end diff --git a/tmp/blacklight-spotlight/lib/spotlight.rb b/tmp/blacklight-spotlight/lib/spotlight.rb new file mode 100644 index 0000000..34e9822 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/spotlight.rb @@ -0,0 +1,7 @@ +require 'spotlight/version' +require 'spotlight/engine' + +## +# Spotlight +module Spotlight +end diff --git a/tmp/blacklight-spotlight/lib/spotlight/engine.rb b/tmp/blacklight-spotlight/lib/spotlight/engine.rb new file mode 100644 index 0000000..c1ca343 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/spotlight/engine.rb @@ -0,0 +1,166 @@ +# Load blacklight which will give spotlight views a higher preference than those in blacklight + +# devise must be required to first to ensure we can override devise and invitable views in spotlight correctly +require 'devise' +require 'devise_invitable' + +require 'blacklight' +require 'blacklight/oembed' +require 'autoprefixer-rails' +require 'friendly_id' +require 'tophat' +require 'paper_trail' + +module Spotlight + ## + # Spotlight::Engine + class Engine < ::Rails::Engine + isolate_namespace Spotlight + # Breadcrumbs on rails must be required outside of an initializer or it doesn't get loaded. + require 'breadcrumbs_on_rails' + require 'carrierwave' + require 'carrierwave/crop' + require 'social-share-button' + require 'lodash-rails' + require 'github/markup' + require 'sir_trevor_rails' + require 'openseadragon' + + config.autoload_paths += %W( + #{config.root}/app/builders + ) + + initializer 'spotlight.initialize' do + require 'cancan' + require 'bootstrap_form' + require 'acts-as-taggable-on' + require 'oembed' + + Mime::Type.register 'application/solr+json', :solr_json + end + + initializer 'oembed.initialize' do + OEmbed::Providers.register_all + end + + initializer 'spotlight.factories', after: 'factory_girl.set_factory_paths' do + FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl) + end + + initializer 'spotlight.assets.precompile' do |app| + app.config.assets.precompile += %w(spotlight/default_thumbnail.jpg) + end + + def self.user_class + Spotlight::Engine.config.user_class.constantize + end + + def self.catalog_controller + Spotlight::Engine.config.catalog_controller_class.constantize + end + + def self.blacklight_config + Spotlight::Engine.config.default_blacklight_config || catalog_controller.blacklight_config + end + + config.user_class = '::User' + + config.catalog_controller_class = '::CatalogController' + config.default_blacklight_config = nil + + config.exhibit_main_navigation = [:curated_features, :browse, :about] + + config.resource_partials = ['spotlight/resources/external_resources_form', 'spotlight/resources/upload/form', 'spotlight/resources/csv_upload/form'] + config.external_resources_partials = [] + config.solr_batch_size = 20 + + Spotlight::Engine.config.reindex_progress_window = 10 + + # Filter resources by exhibit by default + config.filter_resources_by_exhibit = true + + # Should Spotlight write to solr? If set to false, Spotlight will not initiate indexing. + config.writable_index = true + + # The allowed file extensions for uploading non-repository items. + config.allowed_upload_extensions = %w(jpg jpeg png) + + # Suffixes for exhibit-specific solr fields + config.solr_fields = OpenStruct.new + config.solr_fields.prefix = ''.freeze + config.solr_fields.boolean_suffix = '_bsi'.freeze + config.solr_fields.string_suffix = '_ssim'.freeze + config.solr_fields.text_suffix = '_tesim'.freeze + + config.resource_global_id_field = :"#{config.solr_fields.prefix}spotlight_resource_id#{config.solr_fields.string_suffix}" + + # The solr field that original (largest) images will be stored. + # Set to nil if you don't want to pull thumbnails from the index + config.full_image_field = :full_image_url_ssm + config.thumbnail_field = :thumbnail_url_ssm + config.square_image_field = :thumbnail_square_url_ssm + + # Defaults to the blacklight_config.index.title_field: + config.upload_title_field = nil # OpenStruct.new(...) + + config.upload_fields = [ + OpenStruct.new(field_name: :spotlight_upload_description_tesim, label: 'Description', form_field_type: :text_area), + OpenStruct.new(field_name: :spotlight_upload_attribution_tesim, label: 'Attribution'), + OpenStruct.new(field_name: :spotlight_upload_date_tesim, label: 'Date') + ] + + # Configure the CarrierWave file storage mechanism + config.uploader_storage = :file + config.featured_image_thumb_size = [400, 300] + config.featured_image_square_size = [400, 400] + + initializer 'spotlight-assets.initialize' do + Rails.application.config.assets.precompile += %w( Jcrop.gif ) + end + + # To present curators with analytics reports on the exhibit dashboard, you need to configure + # an Analytics provider. Google Analytics support is provided out-of-the-box. + config.analytics_provider = nil + + initializer 'analytics.initialize' do + Spotlight::Engine.config.analytics_provider = Spotlight::Analytics::Ga + end + + # If you use Google Analytics, you need to wire your site to report to a Google Analytics property. + # Adding Google Analytics to your site is left as an excersize for the implementor (you could + # consider overriding the layout to inject GA code..) + # + # After getting your site to report to Google Analytics, you need to: + # a) register an OAuth service account with access to your analytics property: + # (https://github.com/tpitale/legato/wiki/OAuth2-and-Google#registering-for-api-access) + # b) download the pkcs12 key and make it accessible to your application + # c) in e.g. an initializer, set these configuration values as appropriate + # to your OAuth2 service account and analytics property: + config.ga_pkcs12_key_path = nil + config.ga_web_property_id = nil + config.ga_email = nil + config.ga_analytics_options = {} + config.ga_page_analytics_options = config.ga_analytics_options.merge(limit: 5) + + Blacklight::Engine.config.inject_blacklight_helpers = false + + # Query parameters for autocomplete requests + config.autocomplete_search_field = 'autocomplete' + config.default_autocomplete_params = { qf: 'id^1000 full_title_tesim^100 id_ng full_title_ng', + facet: false, + 'facet.field' => [] } + + config.default_browse_index_view_type = :gallery + + initializer 'blacklight.configuration' do + # Field containing the last modified date for a Solr document + Blacklight::Configuration.default_values[:index].timestamp_field ||= 'timestamp' + + # Default configuration for the browse view + Blacklight::Configuration.default_values[:browse] ||= Blacklight::OpenStructWithHashAccess.new(document_actions: []) + end + + # make blacklight configuration play nice with bootstrap_form + Blacklight::OpenStructWithHashAccess.send(:extend, ActiveModel::Translation) + end +end diff --git a/tmp/blacklight-spotlight/lib/spotlight/version.rb b/tmp/blacklight-spotlight/lib/spotlight/version.rb new file mode 100644 index 0000000..795b6fb --- /dev/null +++ b/tmp/blacklight-spotlight/lib/spotlight/version.rb @@ -0,0 +1,4 @@ +# +module Spotlight + VERSION = '0.17.1'.freeze +end diff --git a/tmp/blacklight-spotlight/lib/tasks/spotlight_tasks.rake b/tmp/blacklight-spotlight/lib/tasks/spotlight_tasks.rake new file mode 100644 index 0000000..4d1b751 --- /dev/null +++ b/tmp/blacklight-spotlight/lib/tasks/spotlight_tasks.rake @@ -0,0 +1,126 @@ +namespace :spotlight do + desc 'Create an initial admin user and default exhibit' + task initialize: :environment do + puts 'Creating an initial admin user.' + u = prompt_to_create_user + + Spotlight::Role.create(user: u, resource: nil, role: 'admin') + puts 'User created.' + end + + desc 'Add application-wide admin privileges to a user' + task admin: :environment do + u = prompt_to_create_user + Spotlight::Role.create(user: u, resource: nil, role: 'admin') + end + + desc 'Create a new exhibit' + task exhibit: :environment do + print 'Exhibit title: ' + title = $stdin.gets.chomp + + exhibit = Spotlight::Exhibit.create!(title: title) + + puts 'Who can admin this exhibit?' + + u = prompt_to_create_user + + Spotlight::Role.create(user: u, resource: exhibit, role: 'admin') + puts 'Exhibit created.' + end + + desc 'Import an exhibit' + task :import, [:exhibit_slug] => :environment do |_, args| + contents = if ENV['FILE'] + File.read(ENV['FILE']) + else + STDIN.read + end + + data = JSON.parse(contents) + + slug = args[:exhibit_slug] || data['slug'] + + exhibit = Spotlight::Exhibit.find_or_create_by! slug: slug do |e| + e.title = data['title'] + end + + exhibit.import data + + exhibit.save! + + exhibit.reindex_later + end + + desc 'Export an exhibit as JSON' + task :export, [:exhibit_slug] => :environment do |_, args| + exhibit = Spotlight::Exhibit.find_by(slug: args[:exhibit_slug]) + + puts Spotlight::ExhibitExportSerializer.new(exhibit).to_json + end + + def prompt_to_create_user + Spotlight::Engine.user_class.find_or_create_by!(email: prompt_for_email) do |u| + puts 'User not found. Enter a password to create the user.' + u.password = prompt_for_password + end + rescue => e + puts e + retry + end + + def prompt_for_email + print 'Email: ' + $stdin.gets.chomp + end + + def prompt_for_password + begin + system 'stty -echo' + print 'Password (must be 8+ characters): ' + password = $stdin.gets.chomp + puts "\n" + ensure + system 'stty echo' + end + password + end + + namespace :check do + desc 'Check the Solr connection and controller configuration' + task :solr, [:model_name] => ['blacklight:check:solr', :environment] do |_, _args| + errors = 0 + + puts "[#{Blacklight.default_index.connection.uri}]" + + print ' - atomic updates:' + begin + id = 'test123' + field = "test_#{Spotlight::Engine.config.solr_fields.string_suffix}" + sample_doc = { Spotlight::Engine.blacklight_config.document_model.unique_key => id, field => { set: 'a-new-string' } } + Blacklight.default_index.connection.add Spotlight::Engine.blacklight_config.document_model.unique_key.to_sym => id, field => 'some-string' + Blacklight.default_index.connection.update data: [sample_doc].to_json, headers: { 'Content-Type' => 'application/json' } + Blacklight.default_index.connection.delete_by_id id + print " OK\n" + rescue StandardError => e + errors += 1 + puts e.to_s + end + + exit 1 if errors > 0 + end + end + + task :reindex, [:exhibit_slug] => :environment do |_, args| + exhibits = if args[:exhibit_slug] + Spotlight::Exhibit.where(slug: args[:exhibit_slug]) + else + Spotlight::Exhibit.all + end + + exhibits.find_each do |e| + puts " == Reindexing #{e.title} ==" + e.reindex_later + end + end +end diff --git a/tmp/blacklight-spotlight/solr_conf/conf/schema.xml b/tmp/blacklight-spotlight/solr_conf/conf/schema.xml new file mode 100644 index 0000000..dac63ec --- /dev/null +++ b/tmp/blacklight-spotlight/solr_conf/conf/schema.xml @@ -0,0 +1,347 @@ + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmp/blacklight-spotlight/solr_conf/conf/solrconfig.xml b/tmp/blacklight-spotlight/solr_conf/conf/solrconfig.xml new file mode 100644 index 0000000..8c271b1 --- /dev/null +++ b/tmp/blacklight-spotlight/solr_conf/conf/solrconfig.xml @@ -0,0 +1,180 @@ + + + + + ${solr.abortOnConfigurationError:true} + + LUCENE_40 + + + + + + ${solr.core0.data.dir:} + + + + + + + + ${solr.data.dir:} + + + + + edismax + explicit + *:* + 2<-1 5<-2 6<90% + 1 + 2 + 0.01 + + + id + full_title_tesim + short_title_tesim + alternative_title_tesim + active_fedora_model_ssi + title_tesim + author_tesim + subject_tesim + all_text_timv + + + all_text_timv^10 + + + + author_tesim + + + + + title_tesim + full_title_tesim + short_title_tesim + alternative_title_tesim + + + + + subject_tesim + + + + + + *, + score + + + true + 1 + 10 + active_fedora_model_ssi + subject_ssim + + true + default + true + true + false + 5 + + + + spellcheck + + + + + + off + all + 1 + {!raw f=id v=$id} + + id, + access_ssim, + discover_access_group_ssim,discover_access_person_ssim, + read_access_group_ssim,read_access_person_ssim, + edit_access_group_ssim,edit_access_person_ssim, + depositor_ti, + embargo_release_date_dtsi + inheritable_access_ssim, + inheritable_discover_access_group_ssim,inheritable_discover_access_person_ssim, + inheritable_read_access_group_ssim,inheritable_read_access_person_ssim, + inheritable_edit_access_group_ssim,inheritable_edit_access_person_ssim, + inheritable_embargo_release_date_dtsi + + + + + + + explicit + lucene + + + + + + + all + * + 1 + {!raw f=id v=$id} + + + + + + textSpell + + + default + spell + ./spell + true + + + + + + + + + + + + + + + + solrpingquery + + + all + + + + + + search + + + diff --git a/tmp/blacklight-spotlight/spec/controllers/application_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/application_controller_spec.rb new file mode 100644 index 0000000..b294618 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/application_controller_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe ApplicationController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + it { is_expected.to be_a_kind_of Spotlight::Controller } + + describe 'exhibit-specific routing' do + context 'with a current exhibit' do + before do + allow(controller).to receive(:current_exhibit).and_return(exhibit) + end + + describe '#search_action_url' do + it 'is a path within the current exhibit' do + expected = { controller: 'spotlight/catalog', action: 'index', exhibit_id: exhibit.slug } + expect(get: controller.search_action_url(only_path: true).gsub('/spotlight', '')).to route_to expected + end + end + + describe '#search_facets_url' do + it 'is a path within the current exhibit' do + expected = { controller: 'spotlight/catalog', action: 'facet', id: 'some-facet', exhibit_id: exhibit.slug } + expect(get: controller.search_facet_url(id: 'some-facet', only_path: true).gsub('/spotlight', '')).to route_to expected + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/about_pages_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/about_pages_controller_spec.rb new file mode 100644 index 0000000..4542572 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/about_pages_controller_spec.rb @@ -0,0 +1,145 @@ +require 'spec_helper' + +describe Spotlight::AboutPagesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:valid_attributes) { { 'title' => 'MyString' } } + + it { is_expected.to be_a Spotlight::Catalog::AccessControlsEnforcement } + + describe 'when not logged in' do + describe 'POST update_all' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + it 'is not allowed' do + post :update_all, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'GET show' do + let(:page) { FactoryGirl.create(:about_page, weight: 0, exhibit: exhibit) } + let(:page2) { FactoryGirl.create(:about_page, weight: 5, exhibit: exhibit) } + describe 'on the main about page' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About', [exhibit, page]) + get :show, id: page, exhibit_id: exhibit + expect(assigns(:page)).to eq page + expect(assigns(:exhibit)).to eq exhibit + end + end + describe 'on a different about page' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About', [exhibit, page]) + expect(controller).to receive(:add_breadcrumb).with(page2.title, [exhibit, page2]) + get :show, id: page2, exhibit_id: exhibit + expect(assigns(:page)).to eq page2 + expect(assigns(:exhibit)).to eq exhibit + end + end + end + + describe 'GET edit' do + let!(:page) { FactoryGirl.create(:about_page, weight: 0, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:about_page, weight: 5, exhibit: exhibit) } + describe 'on the main about page' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About Pages', exhibit_about_pages_path(exhibit)) + get :edit, id: page, exhibit_id: exhibit + expect(assigns(:page)).to eq page + expect(assigns(:exhibit)).to eq exhibit + end + end + describe 'on a different about page' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About Pages', exhibit_about_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(page2.title, [:edit, exhibit, page2]) + get :edit, id: page2, exhibit_id: exhibit + expect(assigns(:page)).to eq page2 + expect(assigns(:exhibit)).to eq exhibit + end + end + end + + describe 'GET index' do + let!(:page) { FactoryGirl.create(:about_page, exhibit: exhibit) } + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About Pages', exhibit_about_pages_path(exhibit)) + get :index, exhibit_id: exhibit + expect(assigns(:page)).to be_kind_of Spotlight::Page + expect(assigns(:page)).to be_new_record + expect(assigns(:pages)).to include page + expect(assigns(:exhibit)).to eq exhibit + end + end + describe 'POST create' do + it 'redirects to the about page index' do + post :create, about_page: { title: 'MyString' }, exhibit_id: exhibit + expect(response).to redirect_to(exhibit_about_pages_path(exhibit)) + end + end + describe 'PUT update' do + let!(:page) { FactoryGirl.create(:about_page, exhibit: exhibit) } + it 'redirects to the about page' do + put :update, id: page, exhibit_id: page.exhibit.id, about_page: valid_attributes + page.reload + expect(response).to redirect_to(exhibit_about_page_path(page.exhibit, page)) + expect(flash[:notice]).to have_link 'Undo changes' + end + end + describe 'POST update_all' do + let!(:page1) { FactoryGirl.create(:about_page, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:about_page, exhibit: exhibit, published: true) } + let!(:page3) { FactoryGirl.create(:about_page, exhibit: exhibit, published: true) } + before { request.env['HTTP_REFERER'] = 'http://example.com' } + it 'updates whether they are on the landing page' do + post :update_all, exhibit_id: page1.exhibit, exhibit: { + about_pages_attributes: [ + { id: page1.id, published: true, title: 'This is a new title!' }, + { id: page2.id, published: false } + ] + } + expect(response).to redirect_to 'http://example.com' + expect(flash[:notice]).to eq 'About pages were successfully updated.' + expect(page1.reload.published).to be_truthy + expect(page1.title).to eq 'This is a new title!' + expect(page2.reload.published).to be_falsey + expect(page3.reload.published).to be_truthy # should remain untouched since it wasn't in present[] + end + end + + describe 'PATCH update_contacts' do + let!(:contact1) { FactoryGirl.create(:contact, name: 'Aphra Behn', exhibit: exhibit) } + let!(:contact2) { FactoryGirl.create(:contact, exhibit: exhibit) } + it 'updates contacts' do + patch :update_contacts, exhibit_id: exhibit, exhibit: { contacts_attributes: [ + { 'show_in_sidebar' => '1', 'id' => contact1.id, weight: 1 }, + { 'show_in_sidebar' => '0', 'id' => contact2.id, weight: 2 }] } + expect(response).to redirect_to exhibit_about_pages_path(exhibit) + expect(flash[:notice]).to eq 'Contacts were successfully updated.' + expect(exhibit.contacts.size).to eq 2 + expect(exhibit.contacts.published.map(&:name)).to eq ['Aphra Behn'] + expect(contact1.reload.weight).to eq 1 + expect(contact2.reload.weight).to eq 2 + end + it 'shows index on failure' do + expect_any_instance_of(Spotlight::Exhibit).to receive(:update).and_return(false) + patch :update_contacts, exhibit_id: exhibit, exhibit: { contacts_attributes: [ + { 'show_in_sidebar' => '1', 'name' => 'Justin Coyne', 'email' => 'jcoyne@justincoyne.com', 'title' => '', 'location' => 'US' }, + { 'show_in_sidebar' => '0', 'name' => '', 'email' => '', 'title' => '', 'location' => '' }, + { 'show_in_sidebar' => '0', 'name' => '', 'email' => '', 'title' => 'Librarian', 'location' => '' }] } + expect(response).to render_template('index') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/admin_users_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/admin_users_controller_spec.rb new file mode 100644 index 0000000..5b25700 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/admin_users_controller_spec.rb @@ -0,0 +1,83 @@ +require 'spec_helper' + +describe Spotlight::AdminUsersController, type: :controller do + routes { Spotlight::Engine.routes } + + before { sign_in(user) } + context 'by a non-admin' do + let(:user) { FactoryGirl.create(:exhibit_visitor) } + it 'redirects with an error message' do + get :index + expect(response).to redirect_to '/' + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + end + end + + context 'by an admin user' do + before { request.env['HTTP_REFERER'] = 'http://example.com' } + let(:user) { FactoryGirl.create(:site_admin) } + describe 'GET index' do + it 'is successful' do + get :index + expect(response).to be_success + end + end + + describe 'DELETE destroy' do + before do + post :invite, user: 'user@example.com', role: 'admin' + end + it 'removes the site admin role from the given user' do + last_user = Spotlight::Site.instance.roles.last.user + expect(last_user.email).to eq 'user@example.com' + + delete :destroy, id: last_user.id + expect(response).to redirect_to(admin_users_path) + expect(flash[:notice]).to eq 'User removed from site adminstrator role' + expect(Spotlight::Site.instance.roles.last.user.id).not_to eq last_user.id + end + end + + describe 'GET exists' do + it 'requires a user parameter' do + expect do + get :exists + end.to raise_error(ActionController::ParameterMissing) + end + + it 'returns a successful status when the requested user exists' do + user = FactoryGirl.create(:exhibit_curator) + get :exists, user: user.email + expect(response).to be_success + end + + it 'returns an unsuccessful status when the user does not exist' do + get :exists, user: 'user@example.com' + expect(response).not_to be_success + expect(response.status).to eq 404 + end + end + + describe 'GET invite' do + it 'invites the selected user to be an admin' do + expect do + post :invite, user: 'user@example.com', role: 'admin' + end.to change { Spotlight::Engine.user_class.count }.by(1) + expect(Spotlight::Engine.user_class.last.roles.length).to eq 1 + expect(Spotlight::Engine.user_class.last.roles.first.resource).to eq Spotlight::Site.instance + end + + it 'redirects back with a flash notice upon success' do + post :invite, user: 'user@example.com', role: 'admin' + expect(flash[:notice]).to eq 'User has been invited.' + expect(response).to redirect_to(:back) + end + + it 'redirects back with flash error upon failure' do + post :invite, user: 'user@example.com', role: 'not-a-real-role' + expect(flash[:alert]).to eq 'There was a problem saving the user(s).' + expect(response).to redirect_to(:back) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/appearances_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/appearances_controller_spec.rb new file mode 100644 index 0000000..a7c697a --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/appearances_controller_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' +describe Spotlight::AppearancesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET edit' do + it 'denies access' do + get :edit, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when not logged in' do + describe 'PATCH update' do + it 'is not allowed' do + patch :update, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET edit' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Appearance', edit_exhibit_appearance_path(exhibit)) + get :edit, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:exhibit]).to be_kind_of Spotlight::Exhibit + end + end + + describe 'PATCH update' do + it 'updates the navigation' do + first_nav = exhibit.main_navigations.first + last_nav = exhibit.main_navigations.last + patch :update, exhibit_id: exhibit, exhibit: { + main_navigations_attributes: [ + { id: first_nav.id, label: 'Some Label', weight: 500 }, + { id: last_nav.id, display: false } + ] + } + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_appearance_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.main_navigations.find(first_nav.id).label).to eq 'Some Label' + expect(saved.main_navigations.find(first_nav.id).weight).to eq 500 + expect(saved.main_navigations.find(last_nav.id)).not_to be_displayable + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/application_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/application_controller_spec.rb new file mode 100644 index 0000000..43f07ff --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/application_controller_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +describe Spotlight::ApplicationController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + it 'provides a search_action_url override' do + allow(controller).to receive_messages(current_exhibit: exhibit) + expect(controller.search_action_url(q: 'query')).to eq exhibit_catalog_index_url(exhibit, q: 'query') + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/attachments_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/attachments_controller_spec.rb new file mode 100644 index 0000000..cdf4414 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/attachments_controller_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Spotlight::AttachmentsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + describe 'when not logged in' do + describe 'GET edit' do + it 'is successful' do + post :create, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'POST create' do + it 'is successful' do + post :create, exhibit_id: exhibit, attachment: { name: 'xyz' } + expect(response).to be_successful + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/browse_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/browse_controller_spec.rb new file mode 100644 index 0000000..7fc5338 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/browse_controller_spec.rb @@ -0,0 +1,77 @@ +require 'spec_helper' + +describe Spotlight::BrowseController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:search) { FactoryGirl.create(:published_search, exhibit: exhibit) } + let!(:unpublished) { FactoryGirl.create(:search, exhibit: exhibit) } + let(:admin) { FactoryGirl.create(:site_admin) } + + it { is_expected.to be_a Spotlight::Catalog::AccessControlsEnforcement } + + describe 'when authenticated as an admin' do + before { sign_in admin } + describe 'GET index' do + it 'does not show unpublished categories' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Browse', exhibit_browse_index_path(exhibit)) + get :index, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:searches]).to eq [search] + expect(assigns[:searches]).to_not include unpublished + expect(assigns[:exhibit]).to eq exhibit + expect(response).to render_template 'spotlight/browse/index' + end + end + end + + describe 'when unauthenticated' do + describe 'GET index' do + it 'shows the list of browse categories' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Browse', exhibit_browse_index_path(exhibit)) + get :index, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:searches]).to eq [search] + expect(assigns[:searches]).to_not include unpublished + expect(assigns[:exhibit]).to eq exhibit + expect(response).to render_template 'spotlight/browse/index' + end + end + + describe 'GET show' do + let(:mock_response) { double } + let(:document_list) { double } + before do + allow(controller).to receive_messages(search_results: [mock_response, document_list]) + end + it 'shows the items in the category' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Browse', exhibit_browse_index_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(search.title, exhibit_browse_path(exhibit, search)) + get :show, id: search, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:search]).to be_a Spotlight::Search + expect(assigns[:response]).to eq mock_response + expect(assigns[:document_list]).to eq document_list + expect(response).to render_template 'spotlight/browse/show' + end + + it 'removes all the document actions' do + get :show, id: search, exhibit_id: exhibit + expect(controller.blacklight_config.index.document_actions).to be_blank + end + + it 'uses the blacklight.browse configuration for the document actions' do + config = Blacklight::Configuration.new do |c| + c.browse.document_actions = [:a, :b, :c] + end + + allow(controller). to receive(:blacklight_config).and_return(config) + + get :show, id: search, exhibit_id: exhibit + expect(controller.blacklight_config.index.document_actions).to match_array [:a, :b, :c] + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/catalog_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/catalog_controller_spec.rb new file mode 100644 index 0000000..bfc5db0 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/catalog_controller_spec.rb @@ -0,0 +1,365 @@ +require 'spec_helper' + +describe Spotlight::CatalogController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + it { is_expected.to be_a_kind_of ::CatalogController } + it { is_expected.to be_a_kind_of Spotlight::Concerns::ApplicationController } + its(:view_context) { should be_a_kind_of Spotlight::ApplicationHelper } + + describe 'when the user is not authenticated' do + describe 'GET admin' do + it 'redirects to the login page' do + get :admin, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET edit' do + it 'is not allowed' do + get :edit, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET show' do + let(:document) { SolrDocument.find('dq287tq6352') } + let(:search) { FactoryGirl.create(:search, exhibit: exhibit) } + it 'shows the item' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with("L'AMERIQUE", exhibit_catalog_path(exhibit, document)) + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to be_successful + end + + it 'shows the item with breadcrumbs to the browse page' do + allow(controller).to receive_messages(current_browse_category: search) + + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with('Browse', exhibit_browse_index_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(search.title, exhibit_browse_path(exhibit, search)) + expect(controller).to receive(:add_breadcrumb).with("L'AMERIQUE", exhibit_catalog_path(exhibit, document)) + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to be_successful + end + + it 'shows the item with breadcrumbs to the feature page' do + feature_page = FactoryGirl.create(:feature_page, exhibit: exhibit) + allow(controller).to receive_messages(current_page_context: feature_page) + + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with(feature_page.title, [exhibit, feature_page]) + expect(controller).to receive(:add_breadcrumb).with("L'AMERIQUE", exhibit_catalog_path(exhibit, document)) + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to be_successful + end + + it 'shows the item with breadcrumbs from the home page' do + home_page = FactoryGirl.create(:home_page) + allow(controller).to receive_messages(current_page_context: home_page) + + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with("L'AMERIQUE", exhibit_catalog_path(exhibit, document)) + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to be_successful + end + + it 'adds the curation widget' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(controller.blacklight_config.show.partials.first).to eq 'curation_mode_toggle' + end + + it 'does not have a solr_json serialization' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352', format: :solr_json + expect(response).not_to be_successful + end + end + + describe 'GET index' do + it 'shows the index when there are parameters' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with('Search Results', exhibit_catalog_index_path(exhibit, q: 'map')) + get :index, exhibit_id: exhibit, q: 'map' + expect(response).to be_successful + end + it 'redirects to the exhibit home page when there are no parameters' do + get :index, exhibit_id: exhibit + expect(response).to redirect_to(exhibit_root_path(exhibit)) + end + end + + describe 'GET autocomplete' do + it 'has partial matches for title' do + # Testing with ps921pn8250 because it has html escapable characters in the title (c'estadire) + get :autocomplete, exhibit_id: exhibit, q: 'PLANIS', format: 'json' + expect(assigns[:document_list].first.id).to eq 'ps921pn8250' + expect(response).to be_successful + json = JSON.parse(response.body) + doc = json['docs'].first + expect(doc).to include 'id', 'title', 'description', 'thumbnail', 'url' + expect(doc['id']).to eq 'ps921pn8250' + expect(doc['description']).to eq 'ps921pn8250' + expect(doc['title']).to eq "PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises en plan." + expect(doc['thumbnail']).to eq assigns[:document_list].first.first(:thumbnail_url_ssm) + expect(doc['url']).to eq exhibit_catalog_path(exhibit, id: 'ps921pn8250') + end + it 'has partial matches for id' do + get :autocomplete, exhibit_id: exhibit, q: 'dx157', format: 'json' + expect(assigns[:document_list].first.id).to eq 'dx157dh4345' + expect(response).to be_successful + json = JSON.parse(response.body) + expect(json['docs'].first['id']).to eq 'dx157dh4345' + expect(json['docs'].first['title']).to eq 'KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren 1721 en 1722' + end + end + end + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET index' do + it 'applies gated discovery access controls' do + expect(controller.search_params_logic).to include :apply_permissive_visibility_filter + end + end + + describe 'GET admin' do + it 'denies access' do + get :admin, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + + describe 'GET edit' do + it 'is not allowed' do + get :edit, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + end + end + + describe 'GET show with private item' do + it 'is not allowed' do + allow_any_instance_of(::SolrDocument).to receive(:private?).and_return(true) + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + end + end + + describe 'PUT make_public' do + it 'is not allowed' do + put :make_public, exhibit_id: exhibit, catalog_id: 'dq287tq6352' + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + end + end + + describe 'DELETE make_private' do + it 'is not allowed' do + delete :make_private, exhibit_id: exhibit, catalog_id: 'dq287tq6352' + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + end + end + end + + describe 'when the user is a curator' do + before { sign_in FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + it 'shows all the items' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_path(exhibit, q: '')) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Items', admin_exhibit_catalog_index_path(exhibit)) + get :admin, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:document_list]).to be_a Array + expect(assigns[:exhibit]).to eq exhibit + expect(response).to render_template 'spotlight/catalog/admin' + expect(controller.blacklight_config.view.admin_table.document_actions).to be_empty + end + + it 'uses the admin table view and hide the document actions' do + get :admin, exhibit_id: exhibit + + expect(controller.blacklight_config.view.to_h.keys).to match_array [:admin_table] + expect(controller.blacklight_config.view.admin_table.document_actions).to be_empty + end + + describe 'GET edit' do + it 'is successful' do + get :edit, exhibit_id: exhibit, id: 'dq287tq6352' + expect(response).to be_successful + expect(assigns[:exhibit]).to eq exhibit + expect(assigns[:document]).to be_kind_of SolrDocument + end + end + describe 'PATCH update' do + it 'is successful' do + expect do + patch :update, exhibit_id: exhibit, id: 'dq287tq6352', solr_document: { exhibit_tag_list: 'one, two' } + end.to change { exhibit.owned_taggings.count }.by(2) + end + end + + describe 'PUT make_public' do + before do + request.env['HTTP_REFERER'] = 'where_i_came_from' + allow_any_instance_of(::SolrDocument).to receive(:reindex) + end + + it 'is successful' do + expect_any_instance_of(::SolrDocument).to receive(:reindex) + expect_any_instance_of(::SolrDocument).to receive(:make_public!).with(exhibit) + put :make_public, exhibit_id: exhibit, catalog_id: 'dq287tq6352' + expect(response).to redirect_to 'where_i_came_from' + end + end + + describe 'DELETE make_private' do + before do + request.env['HTTP_REFERER'] = 'where_i_came_from' + allow_any_instance_of(::SolrDocument).to receive(:reindex) + end + + it 'is successful' do + expect_any_instance_of(::SolrDocument).to receive(:reindex) + expect_any_instance_of(::SolrDocument).to receive(:make_private!).with(exhibit) + delete :make_private, exhibit_id: exhibit, catalog_id: 'dq287tq6352' + expect(response).to redirect_to 'where_i_came_from' + end + end + end + + describe 'when the user is a site admin' do + before { sign_in FactoryGirl.create(:site_admin, exhibit: exhibit) } + + describe 'GET show' do + it 'has a solr_json serialization' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352', format: :solr_json + expect(response).to be_successful + data = JSON.parse(response.body).with_indifferent_access + expect(data).to include id: 'dq287tq6352' + expect(data).to include exhibit.solr_data + expect(data).to include ::SolrDocument.solr_field_for_tagger(exhibit) + end + end + end + + describe '.exhibit_search_facet_url' do + before do + allow(subject).to receive(:current_exhibit).and_return(exhibit) + end + + it 'routes to the facet page' do + url = subject.exhibit_search_facet_url(id: 'x').sub('http://test.host/spotlight/', '/') + route = Spotlight::Engine.routes.recognize_path(url) + expect(route).to include controller: 'spotlight/catalog', + action: 'facet', + id: 'x' + end + + it 'preserves the current exhibit context' do + url = subject.exhibit_search_facet_url(id: 'x').sub('http://test.host/spotlight/', '/') + route = Spotlight::Engine.routes.recognize_path(url) + expect(route).to include exhibit_id: exhibit.slug + end + + context 'with search parameters' do + before do + allow(subject).to receive(:search_results).and_return([]) + end + + it 'preserves query parameters' do + get :index, q: 'xyz', exhibit_id: exhibit + url = subject.exhibit_search_facet_url(id: 'x') + expect(url).to include '?q=xyz' + end + end + end + + describe 'next and previous documents' do + before do + exhibit.searches.first.update(published: true) + allow(controller).to receive(:current_search_session).and_return(search) + allow(controller).to receive(:search_session).and_return(search_session) + end + + let(:search_session) { { 'counter' => 2 } } + + let(:response) { double(total: 5, documents: [first_doc, nil, last_doc]) } + let(:first_doc) { double } + let(:last_doc) { double } + + context 'when arriving from a browse page' do + let(:search) do + Search.new(query_params: { action: 'show', controller: 'spotlight/browse', id: exhibit.searches.first.id }.with_indifferent_access) + end + + context 'when published' do + before do + exhibit.searches.first.update(published: true) + allow(controller).to receive(:get_previous_and_next_documents_for_search).with(1, exhibit.searches.first.query_params).and_return(response) + end + + it 'uses the saved search context' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + + expect(assigns(:previous_document)).to eq first_doc + expect(assigns(:next_document)).to eq last_doc + end + end + + context 'when arriving from a private browse page' do + before do + exhibit.searches.first.update(published: false) + end + + it 'ignores the search context' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + + expect(assigns(:previous_document)).to be_nil + expect(assigns(:next_document)).to be_nil + end + end + end + + context 'when arriving from a feature page' do + let(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let(:search) do + Search.new(query_params: { action: 'show', controller: 'spotlight/feature_pages', id: page.id }.with_indifferent_access) + end + + context 'when published' do + before do + page.update(published: true) + end + + it 'uses the page context' do + pending 'Waiting to figure out how to construct previous/next documents' + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + + expect(assigns(:previous_document)).to be_a_kind_of SolrDocument + expect(assigns(:next_document)).to be_a_kind_of SolrDocument + end + end + + context 'when unpublished' do + before do + page.update(published: false) + end + + it 'ignores the search context' do + get :show, exhibit_id: exhibit, id: 'dq287tq6352' + + expect(assigns(:previous_document)).to be_nil + expect(assigns(:next_document)).to be_nil + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/confirmations_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/confirmations_controller_spec.rb new file mode 100644 index 0000000..a6d58e8 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/confirmations_controller_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe Spotlight::ConfirmationsController, type: :controller do + routes { Spotlight::Engine.routes } + before do + # rubocop:disable RSpec/InstanceVariable + @request.env['devise.mapping'] = Devise.mappings[:contact_email] + # rubocop:enable RSpec/InstanceVariable + end + + describe 'GET new' do + it 'exists' do + get :new + expect(response).to be_successful + end + end + + describe 'GET show' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:contact_email) { Spotlight::ContactEmail.create!(email: 'justin@example.com', exhibit: exhibit) } + let(:raw_token) { contact_email.instance_variable_get(:@raw_confirmation_token) } + describe 'when the token is invalid' do + it 'gives reset instructions' do + get :show + expect(response).to be_successful + end + end + describe 'when the token is valid' do + it 'updates the user' do + get :show, confirmation_token: raw_token + expect(contact_email.reload).to be_confirmed + expect(response).to redirect_to main_app.new_user_session_path + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/contact_forms_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/contact_forms_controller_spec.rb new file mode 100644 index 0000000..703e5a6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/contact_forms_controller_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe Spotlight::ContactFormsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + request.env['HTTP_REFERER'] = 'http://example.com' + exhibit.contact_emails_attributes = [{ 'email' => 'test@example.com' }, { 'email' => 'test2@example.com' }] + exhibit.save! + exhibit.contact_emails.first.tap do |e| + if e.respond_to? :confirm + e.confirm + else + e.confirm! + end + end + end + describe 'POST create' do + it 'redirects back' do + post :create, exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com' } + expect(response).to redirect_to :back + end + it 'sets a flash message' do + post :create, exhibit_id: exhibit.id, contact_form: { name: 'Joe Doe', email: 'jdoe@example.com' } + expect(flash[:notice]).to eq 'Thanks. Your feedback has been sent.' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/contacts_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/contacts_controller_spec.rb new file mode 100644 index 0000000..2192096 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/contacts_controller_spec.rb @@ -0,0 +1,77 @@ +require 'spec_helper' + +describe Spotlight::ContactsController, type: :controller do + routes { Spotlight::Engine.routes } + describe 'when not logged in' do + describe 'GET edit' do + let(:contact) { FactoryGirl.create(:contact) } + it 'is successful' do + get :edit, id: contact, exhibit_id: contact.exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:contact) { FactoryGirl.create(:contact, exhibit: exhibit, name: 'Andrew Carnegie') } + before { sign_in user } + + describe 'GET edit' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About Pages', exhibit_about_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(contact.name, edit_exhibit_contact_path(exhibit, contact)) + get :edit, id: contact, exhibit_id: contact.exhibit + expect(response).to be_successful + end + end + describe 'PATCH update' do + it 'is successful' do + patch :update, id: contact, contact: { name: 'Chester' }, exhibit_id: contact.exhibit + expect(response).to redirect_to exhibit_about_pages_path(exhibit) + expect(contact.reload.name).to eq 'Chester' + end + it 'fails by rendering edit' do + expect_any_instance_of(Spotlight::Contact).to receive(:update).and_return(false) + patch :update, id: contact, contact: { name: 'Chester' }, exhibit_id: contact.exhibit + expect(response).to render_template 'edit' + end + end + describe 'DELETE destroy' do + it 'is successful' do + contact # force contact to be created + expect do + delete :destroy, id: contact, exhibit_id: contact.exhibit + end.to change { Spotlight::Contact.count }.by(-1) + expect(response).to redirect_to exhibit_about_pages_path(exhibit) + end + end + describe 'GET new' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('About Pages', exhibit_about_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Add contact', new_exhibit_contact_path(exhibit)) + get :new, exhibit_id: exhibit + expect(response).to be_successful + end + end + describe 'POST create' do + it 'fails by rendering new' do + expect_any_instance_of(Spotlight::Contact).to receive(:update).and_return(false) + post :create, exhibit_id: exhibit, contact: { name: 'Chester' } + expect(response).to render_template 'new' + end + it 'is successful' do + expect do + post :create, exhibit_id: exhibit, contact: { name: 'Chester' } + end.to change { Spotlight::Contact.count }.by(1) + expect(response).to redirect_to exhibit_about_pages_path(exhibit) + expect(Spotlight::Contact.last.show_in_sidebar).to be_truthy + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/custom_fields_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/custom_fields_controller_spec.rb new file mode 100644 index 0000000..736bc0d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/custom_fields_controller_spec.rb @@ -0,0 +1,59 @@ +require 'spec_helper' +describe Spotlight::CustomFieldsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when signed in as an exhibit admin' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET new' do + it 'assigns a new custom field' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Metadata', edit_exhibit_metadata_configuration_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Add new field', new_exhibit_custom_field_path(exhibit)) + get :new, exhibit_id: exhibit + expect(assigns(:custom_field)).to be_a_new(Spotlight::CustomField) + end + end + + describe 'GET edit' do + let(:field) { FactoryGirl.create(:custom_field, exhibit: exhibit) } + it 'assigns the requested custom_field' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Metadata', edit_exhibit_metadata_configuration_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(field.label, edit_exhibit_custom_field_path(exhibit, field)) + get :edit, exhibit_id: exhibit, id: field + expect(assigns(:custom_field)).to eq field + expect(assigns(:exhibit)).to eq exhibit + end + end + + describe 'POST create' do + describe 'with valid params' do + it 'creates a new Page' do + expect do + post :create, custom_field: { label: 'MyString' }, exhibit_id: exhibit + end.to change(Spotlight::CustomField, :count).by(1) + end + + it 'redirects to the exhibit metadata page' do + post :create, custom_field: { label: 'MyString' }, exhibit_id: exhibit + expect(response).to redirect_to(edit_exhibit_metadata_configuration_path(exhibit)) + end + end + + describe 'with invalid params' do + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + allow_any_instance_of(Spotlight::CustomField).to receive(:save).and_return(false) + post :create, custom_field: { label: 'MyString' }, exhibit_id: exhibit + expect(assigns(:custom_field)).to be_a_new(Spotlight::CustomField) + expect(response).to render_template('new') + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/dashboards_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/dashboards_controller_spec.rb new file mode 100644 index 0000000..b0c3990 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/dashboards_controller_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' + +describe Spotlight::DashboardsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:repository) { double } + + before do + allow(controller).to receive(:repository).and_return(repository) + end + + describe 'when logged in' do + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in curator } + describe 'GET show' do + it 'loads the exhibit' do + exhibit.blacklight_configuration.index = { timestamp_field: 'timestamp_field' } + exhibit.save! + expect(controller).to receive(:search_results).with({ sort: 'timestamp_field desc' }, kind_of(Array)).and_return([double(:response), [{ id: 1 }]]) + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Dashboard', exhibit_dashboard_path(exhibit)) + get :show, exhibit_id: exhibit.id + expect(response).to render_template 'spotlight/dashboards/show' + expect(assigns[:exhibit]).to eq exhibit + expect(assigns[:pages].length).to eq exhibit.pages.length + expect(assigns[:solr_documents]).to have(1).item + end + end + + describe 'GET analytics' do + it 'loads the exhibit' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Analytics', analytics_exhibit_dashboard_path(exhibit)) + get :analytics, exhibit_id: exhibit.id + expect(response).to render_template 'spotlight/dashboards/analytics' + expect(assigns[:exhibit]).to eq exhibit + end + end + end + + describe 'when user does not have access' do + before { sign_in FactoryGirl.create(:exhibit_visitor) } + it 'does not allow show' do + get :show, exhibit_id: exhibit.id + expect(response).to redirect_to main_app.root_path + end + + it 'does not allow analytics' do + get :analytics, exhibit_id: exhibit.id + expect(response).to redirect_to main_app.root_path + end + end + + describe 'when not logged in' do + describe 'GET show' do + it 'redirects to the sign in form' do + get :show, exhibit_id: exhibit.id + expect(response).to redirect_to(main_app.new_user_session_path) + expect(flash[:alert]).to be_present + expect(flash[:alert]).to match(/You need to sign in/) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/exhibits_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/exhibits_controller_spec.rb new file mode 100644 index 0000000..c7e68a0 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/exhibits_controller_spec.rb @@ -0,0 +1,189 @@ +require 'spec_helper' +require 'rack/test' +describe Spotlight::ExhibitsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + before do + allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later) + end + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET edit' do + it 'denies access' do + get :edit, id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when not logged in' do + describe 'GET index' do + it 'is allowed' do + get :index + expect(response).to be_success + end + end + + describe 'GET new' do + it 'is not allowed' do + get :new, id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET edit' do + it 'is not allowed' do + get :edit, id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'PATCH update' do + it 'is not allowed' do + patch :update, id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'PATCH process_import' do + it 'is not allowed' do + patch :process_import, id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'DELETE destroy' do + it 'is not allowed' do + delete :destroy, id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a site admin' do + let(:user) { FactoryGirl.create(:site_admin) } + before { sign_in user } + + describe 'GET new' do + it 'is successful' do + get :new + expect(response).to be_successful + end + end + + describe 'POST create' do + before do + # decouple this test from needing solr running + allow_any_instance_of(Spotlight::Search).to receive(:set_default_featured_image) + end + + it 'is successful' do + expect do + post :create, exhibit: { title: 'Some Title', slug: 'custom-slug', tag_list: '2014, R. Buckminster Fuller' } + end.to change { Spotlight::Exhibit.count }.by(1) + + exhibit = Spotlight::Exhibit.last + expect(response).to redirect_to(exhibit_dashboard_path(exhibit)) + + expect(exhibit.title).to eq 'Some Title' + expect(exhibit.slug).to eq 'custom-slug' + expect(exhibit.tags.map(&:name)).to eq ['2014', 'R. Buckminster Fuller'] + + expect(user.exhibits).to include exhibit + end + end + end + + describe 'when signed in as an exhibit admin' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET new' do + it 'is not allowed' do + get :new + expect(response).to_not be_successful + end + end + + describe 'PATCH process_import' do + it 'is successful' do + expect_any_instance_of(Spotlight::Exhibit).to receive(:reindex_later).and_return(true) + f = Tempfile.new('foo') + begin + f.write '{ "title": "Foo", "subtitle": "Bar"}' + f.rewind + file = Rack::Test::UploadedFile.new(f.path, 'application/json') + patch :process_import, id: exhibit, file: file + ensure + f.close + f.unlink + end + expect(response).to be_redirect + assigns[:exhibit].tap do |saved| + expect(saved.title).to eq 'Foo' + expect(saved.subtitle).to eq 'Bar' + end + end + end + + describe 'GET edit' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('General', edit_exhibit_path(exhibit)) + get :edit, id: exhibit + expect(response).to be_successful + end + end + + describe '#update' do + it 'is successful' do + patch :update, id: exhibit, exhibit: { + title: 'Foo', + subtitle: 'Bar', + description: 'Baz', + contact_emails_attributes: { '0' => { email: 'bess@stanford.edu' }, '1' => { email: 'naomi@stanford.edu' } } + } + + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.title).to eq 'Foo' + expect(saved.subtitle).to eq 'Bar' + expect(saved.description).to eq 'Baz' + expect(saved.contact_emails.pluck(:email)).to eq ['bess@stanford.edu', 'naomi@stanford.edu'] + end + end + + it 'shows errors and ignore blank emails' do + patch :update, id: exhibit, exhibit: { + title: 'Foo', + subtitle: 'Bar', + description: 'Baz', + contact_emails_attributes: { '0' => { email: 'bess@stanford.edu' }, '1' => { email: 'naomi@' }, '2' => { email: '' } } + } + + expect(response).to be_successful + assigns[:exhibit].tap do |obj| + expect(obj.contact_emails.last.errors[:email]).to eq ['is not valid'] + expect(obj.contact_emails.size).to eq 2 + end + end + end + + describe '#destroy' do + it 'is successful' do + delete :destroy, id: exhibit + expect(Spotlight::Exhibit.exists?(exhibit.id)).to be_falsey + expect(flash[:notice]).to eq 'The exhibit was deleted.' + expect(response).to redirect_to main_app.root_path + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/feature_pages_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/feature_pages_controller_spec.rb new file mode 100644 index 0000000..e86f16b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/feature_pages_controller_spec.rb @@ -0,0 +1,177 @@ +require 'spec_helper' +describe Spotlight::FeaturePagesController, type: :controller do + routes { Spotlight::Engine.routes } + + it { is_expected.to be_a Spotlight::Catalog::AccessControlsEnforcement } + + # This should return the minimal set of attributes required to create a valid + # Page. As you add validations to Page, be sure to + # adjust the attributes here as well. + let(:valid_attributes) { { 'title' => 'MyString' } } + describe 'when signed in as a curator' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'GET index' do + let!(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + it 'assigns all feature pages as @pages' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Feature pages', exhibit_feature_pages_path(exhibit)) + get :index, exhibit_id: exhibit + expect(assigns(:pages)).to include page + expect(assigns(:exhibit)).to eq exhibit + end + end + + describe 'GET show' do + describe 'on a top level page' do + let(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + it 'assigns the requested page as @page' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(page.title, [exhibit, page]) + get :show, exhibit_id: page.exhibit.id, id: page + expect(assigns(:page)).to eq(page) + end + end + describe 'on a sub-page' do + let(:page) { FactoryGirl.create(:feature_subpage, exhibit: exhibit) } + it 'assigns the requested page as @page' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(page.parent_page.title, [exhibit, page.parent_page]) + expect(controller).to receive(:add_breadcrumb).with(page.title, [exhibit, page]) + get :show, exhibit_id: page.exhibit, id: page + expect(assigns(:page)).to eq(page) + end + end + end + + describe 'GET new' do + it 'assigns a new page as @page' do + get :new, exhibit_id: exhibit + expect(assigns(:page)).to be_a_new(Spotlight::FeaturePage) + expect(assigns(:page).exhibit).to eq exhibit + end + end + + describe 'GET edit' do + let(:page) { FactoryGirl.create(:feature_subpage, exhibit: exhibit) } + it 'assigns the requested page as @page' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Feature pages', exhibit_feature_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(page.parent_page.title, [exhibit, page.parent_page]) + expect(controller).to receive(:add_breadcrumb).with(page.title, [:edit, exhibit, page]) + get :edit, exhibit_id: page.exhibit.id, id: page.id + expect(assigns(:page)).to eq page + end + end + + describe 'POST create' do + describe 'with valid params' do + it 'creates a new Page' do + expect do + post :create, feature_page: { title: 'MyString' }, exhibit_id: exhibit + end.to change(Spotlight::FeaturePage, :count).by(1) + end + + it 'assigns a newly created page as @page' do + post :create, feature_page: { title: 'MyString' }, exhibit_id: exhibit + expect(assigns(:page)).to be_a(Spotlight::FeaturePage) + expect(assigns(:page)).to be_persisted + end + it 'redirects to the feature page index' do + post :create, feature_page: { title: 'MyString' }, exhibit_id: exhibit + expect(response).to redirect_to(exhibit_feature_pages_path(Spotlight::FeaturePage.last.exhibit)) + end + end + + describe 'with invalid params' do + it 'assigns a newly created but unsaved page as @page' do + # Trigger the behavior that occurs when invalid params are submitted + allow_any_instance_of(Spotlight::FeaturePage).to receive(:save).and_return(false) + post :create, feature_page: { 'title' => 'invalid value' }, exhibit_id: exhibit + expect(assigns(:page)).to be_a_new(Spotlight::FeaturePage) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + allow_any_instance_of(Spotlight::FeaturePage).to receive(:save).and_return(false) + post :create, feature_page: { 'title' => 'invalid value' }, exhibit_id: exhibit + expect(response).to render_template('new') + end + end + end + + describe 'PUT update' do + let(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + describe 'with valid params' do + it 'updates the requested page' do + # Assuming there are no other pages in the database, this + # specifies that the Page created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + expect_any_instance_of(Spotlight::FeaturePage).to receive(:update).with(hash_including(valid_attributes)) + put :update, id: page, exhibit_id: page.exhibit.id, feature_page: valid_attributes + end + + it 'assigns the requested page as @page' do + put :update, id: page, exhibit_id: page.exhibit.id, feature_page: valid_attributes + expect(assigns(:page)).to eq(page) + end + + it 'redirects to the feature page' do + put :update, id: page, exhibit_id: page.exhibit.id, feature_page: valid_attributes + page.reload + expect(response).to redirect_to(exhibit_feature_page_path(page.exhibit, page)) + expect(flash[:notice]).to have_link 'Undo changes' + end + end + + describe 'with invalid params' do + it 'assigns the page as @page' do + # Trigger the behavior that occurs when invalid params are submitted + allow_any_instance_of(Spotlight::FeaturePage).to receive(:save).and_return(false) + put :update, id: page, exhibit_id: page.exhibit.id, feature_page: { 'title' => 'invalid value' } + expect(assigns(:page)).to eq(page) + end + + it "re-renders the 'edit' template" do + # Trigger the behavior that occurs when invalid params are submitted + allow_any_instance_of(Spotlight::FeaturePage).to receive(:save).and_return(false) + put :update, id: page, exhibit_id: page.exhibit.id, feature_page: { 'title' => 'invalid value' } + expect(response).to render_template('edit') + end + end + end + + describe 'POST update_all' do + let!(:page1) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:feature_page, exhibit: page1.exhibit) } + let!(:page3) { FactoryGirl.create(:feature_page, exhibit: page1.exhibit, parent_page_id: page1.id) } + before { request.env['HTTP_REFERER'] = 'http://example.com' } + it 'updates the parent/child relationship' do + post :update_all, exhibit_id: page1.exhibit, exhibit: { feature_pages_attributes: [{ id: page2.id, parent_page_id: page1.id }] } + expect(response).to redirect_to 'http://example.com' + expect(flash[:notice]).to eq 'Feature pages were successfully updated.' + expect(page1.parent_page).to be_nil + expect(page1.child_pages).to include page2 + expect(page3.parent_page).to eq page1 # should remain untouched since in wasn't present + end + end + + describe 'DELETE destroy' do + let!(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + it 'destroys the requested page' do + expect do + delete :destroy, id: page, exhibit_id: page.exhibit.id + end.to change(Spotlight::FeaturePage, :count).by(-1) + end + + it 'redirects to the pages list' do + delete :destroy, id: page, exhibit_id: page.exhibit.id + expect(response).to redirect_to(exhibit_feature_pages_path(page.exhibit)) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/filters_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/filters_controller_spec.rb new file mode 100644 index 0000000..da68711 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/filters_controller_spec.rb @@ -0,0 +1,71 @@ +require 'spec_helper' + +describe Spotlight::FiltersController do + routes { Spotlight::Engine.routes } + + describe '#create' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_filter) { exhibit.filters.first } + + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(false) + end + + context 'when not signed in' do + it 'is not successful' do + post :create, exhibit_id: exhibit, filter: { field: 'foo_ssi', value: 'bar_ssi' } + expect(:response).to redirect_to main_app.new_user_session_path + end + end + + context 'when signed in as a site admin' do + before { sign_in user } + let(:user) { FactoryGirl.create(:site_admin) } + + it 'is successful' do + post :create, exhibit_id: exhibit, filter: { field: 'foo_ssi', value: 'bar' } + expect(:response).to redirect_to edit_exhibit_path(exhibit, anchor: 'filter') + expect(assigns[:exhibit].solr_data).to eq('foo_ssi' => 'bar') + end + + it 'valids filter values' do + post :create, exhibit_id: exhibit, filter: { field: 'foo_ssi', value: '' } + expect(:response).to redirect_to edit_exhibit_path(exhibit, anchor: 'filter') + expect(flash[:alert]).to include "Value can't be blank" + end + end + end + + describe '#update' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_filter) { exhibit.filters.first } + + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true) + end + + context 'when not signed in' do + it 'is not successful' do + patch :update, exhibit_id: exhibit, id: exhibit_filter, filter: { field: 'foo_ssi', value: 'bar_ssi' } + expect(:response).to redirect_to main_app.new_user_session_path + end + end + + context 'when signed in as a site admin' do + before { sign_in user } + let(:user) { FactoryGirl.create(:site_admin) } + + it 'is successful' do + patch :update, exhibit_id: exhibit, id: exhibit_filter, filter: { field: 'foo_ssi', value: 'bar' } + expect(:response).to redirect_to edit_exhibit_path(exhibit, anchor: 'filter') + expect(assigns[:exhibit].solr_data).to eq('foo_ssi' => 'bar') + end + + it 'valids filter values' do + patch :update, exhibit_id: exhibit, id: exhibit_filter, filter: { field: 'foo_ssi', value: '' } + expect(:response).to redirect_to edit_exhibit_path(exhibit, anchor: 'filter') + expect(flash[:alert]).to include "Value can't be blank" + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/home_pages_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/home_pages_controller_spec.rb new file mode 100644 index 0000000..c94f066 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/home_pages_controller_spec.rb @@ -0,0 +1,98 @@ +require 'spec_helper' + +describe Spotlight::HomePagesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:valid_attributes) { { 'title' => 'MyString' } } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:page) { exhibit.home_page } + + it { is_expected.to be_a Spotlight::Catalog::AccessControlsEnforcement } + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before do + sign_in user + end + + describe 'GET edit' do + describe "when the page title isn't set" do + before do + page.title = nil + end + + it 'shows breadcrumbs' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Feature pages', exhibit_feature_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Exhibit Home', [:edit, exhibit, page]) + get :edit, id: page, exhibit_id: page.exhibit + expect(response).to be_successful + end + end + it 'shows breadcrumbs' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit_root_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Feature pages', exhibit_feature_pages_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with(page.title, [:edit, exhibit, page]) + get :edit, id: page, exhibit_id: page.exhibit + expect(response).to be_successful + end + end + describe 'PUT update' do + it 'redirects to the feature page index action' do + put :update, id: page, exhibit_id: page.exhibit.id, home_page: valid_attributes + page.reload + expect(response).to redirect_to(exhibit_home_page_path(page.exhibit, page)) + expect(flash[:notice]).to have_link 'Undo changes' + end + end + end + + describe 'GET show' do + it 'gets search results for display facets' do + allow(controller).to receive_messages(search_results: [double, double]) + get :show, exhibit_id: exhibit + expect(assigns[:response]).to_not be_blank + expect(assigns[:document_list]).to_not be_blank + expect(assigns[:page]).to eq exhibit.home_page + end + it 'does not render breadcrumbs' do + expect(controller).not_to receive(:add_breadcrumb) + allow(controller).to receive_messages(search_results: [double, double]) + get :show, exhibit_id: exhibit + expect(response).to be_successful + end + it 'does not do the search when the sidebar is hidden' do + page.display_sidebar = false + page.save + allow(controller).to receive_messages(search_results: [double, double]) + get :show, exhibit_id: exhibit + expect(assigns).not_to have_key :response + expect(assigns).not_to have_key :document_list + end + + context 'when the exhibit is not published' do + before do + exhibit.update(published: false) + end + + it 'redirects an anonymous user to the signin path' do + get :show, exhibit_id: exhibit + expect(response).to redirect_to(main_app.new_user_session_path) + end + + it 'redirects an unauthorized user to the signin path' do + user = FactoryGirl.create(:exhibit_curator) + sign_in user + expect do + get :show, exhibit_id: exhibit + end.to raise_error ActionController::RoutingError + end + + it 'redirects an authorized user to the signin path' do + user = FactoryGirl.create(:exhibit_curator, exhibit: exhibit) + sign_in user + get :show, exhibit_id: exhibit + expect(response).to be_successful + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/metadata_configurations_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/metadata_configurations_controller_spec.rb new file mode 100644 index 0000000..da10683 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/metadata_configurations_controller_spec.rb @@ -0,0 +1,88 @@ +require 'spec_helper' +describe Spotlight::MetadataConfigurationsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET show' do + it 'denies access' do + get :show, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + + describe 'GET edit' do + it 'denies access' do + get :edit, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when not logged in' do + describe 'PATCH update' do + it 'denies access' do + patch :update, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET edit' do + it 'denies access' do + get :edit, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET edit' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Metadata', edit_exhibit_metadata_configuration_path(exhibit)) + get :edit, exhibit_id: exhibit + expect(response).to be_successful + end + end + + describe 'GET show' do + it 'is successful' do + get :show, exhibit_id: exhibit, format: 'json' + expect(response).to be_successful + expect(JSON.parse(response.body).keys).to eq exhibit.blacklight_config.index_fields.keys + end + end + + describe 'PATCH update' do + it 'updates metadata fields' do + blacklight_config = Blacklight::Configuration.new + blacklight_config.add_index_field %w(a b c d e f) + allow(::CatalogController).to receive_messages(blacklight_config: blacklight_config) + patch :update, exhibit_id: exhibit, blacklight_configuration: { + index_fields: { + c: { enabled: true, show: true }, + d: { enabled: true, show: true }, + e: { enabled: true, list: true }, + f: { enabled: true, list: true } + } + } + + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_metadata_configuration_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.blacklight_configuration.index_fields).to include 'c', 'd', 'e', 'f' + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb new file mode 100644 index 0000000..9a977a6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/csv_upload_controller_spec.rb @@ -0,0 +1,59 @@ +require 'spec_helper' + +describe Spotlight::Resources::CsvUploadController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when not logged in' do + describe 'POST create' do + it 'is not allowed' do + post :create, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'POST create' do + let(:csv) { fixture_file_upload(File.expand_path(File.join('..', 'spec', 'fixtures', 'csv-upload-fixture.csv'), Rails.root), 'text/csv') } + let(:serialized_csv) do + [ + { + 'url' => 'http://lorempixel.com/800/500/', + 'full_title_tesim' => 'A random image', + 'spotlight_upload_description_tesim' => 'A random 800 by 500 image from lorempixel', + 'spotlight_upload_attribution_tesim' => 'lorempixel.com', + 'spotlight_upload_date_tesim' => '2015' + }, + { + 'url' => 'http://lorempixel.com/900/600/', + 'full_title_tesim' => 'Another random image', + 'spotlight_upload_description_tesim' => 'A random 900 by 600 image from lorempixel', + 'spotlight_upload_attribution_tesim' => 'lorempixel.com', + 'spotlight_upload_date_tesim' => '2014' + } + ] + end + before do + request.env['HTTP_REFERER'] = 'http://test.host/' + end + it 'starts an AddUploadsFromCSV job with the serialized CSV' do + expect(Spotlight::AddUploadsFromCSV).to receive(:perform_later).with(serialized_csv, exhibit, user).and_return(nil) + post :create, exhibit_id: exhibit, resources_csv_upload: { url: csv } + end + it 'sets the flash message' do + expect(Spotlight::AddUploadsFromCSV).to receive(:perform_later).and_return(nil) + post :create, exhibit_id: exhibit, resources_csv_upload: { url: csv } + expect(flash[:notice]).to eq "'csv-upload-fixture.csv' has been uploaded. An email will be sent to you once indexing is complete." + end + it 'redirects back' do + expect(Spotlight::AddUploadsFromCSV).to receive(:perform_later).and_return(nil) + post :create, exhibit_id: exhibit, resources_csv_upload: { url: csv } + expect(response).to redirect_to :back + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/upload_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/upload_controller_spec.rb new file mode 100644 index 0000000..b6cfc4f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources/upload_controller_spec.rb @@ -0,0 +1,45 @@ +require 'spec_helper' + +describe Spotlight::Resources::UploadController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when not logged in' do + describe 'POST create' do + it 'is not allowed' do + post :create, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'POST create' do + let(:blacklight_solr) { double } + + before do + allow_any_instance_of(Spotlight::Resource).to receive(:reindex).and_return(true) + allow_any_instance_of(Spotlight::Resource).to receive(:blacklight_solr).and_return blacklight_solr + end + it 'create a Spotlight::Resources::Upload resource' do + expect_any_instance_of(Spotlight::Resource).to receive(:reindex_later) + post :create, exhibit_id: exhibit, resources_upload: { url: 'url-data' } + expect(assigns[:resource]).to be_persisted + expect(assigns[:resource]).to be_a(Spotlight::Resources::Upload) + end + it 'redirects to the item admin page' do + post :create, exhibit_id: exhibit, resources_upload: { url: 'url-data' } + expect(flash[:notice]).to eq 'Object uploaded successfully.' + expect(response).to redirect_to admin_exhibit_catalog_index_path(exhibit, sort: :timestamp) + end + it 'redirects to the upload form when the add-and-continue parameter is present' do + post :create, exhibit_id: exhibit, 'add-and-continue' => 'true', resources_upload: { url: 'url-data' } + expect(flash[:notice]).to eq 'Object uploaded successfully.' + expect(response).to redirect_to new_exhibit_resource_path(exhibit, anchor: 'new_resources_upload') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/resources_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources_controller_spec.rb new file mode 100644 index 0000000..86a0191 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/resources_controller_spec.rb @@ -0,0 +1,74 @@ +require 'spec_helper' + +describe Spotlight::ResourcesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when not logged in' do + describe 'GET new' do + it 'is not allowed' do + get :new, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET monitor' do + it 'is not allowed' do + get :monitor, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'POST create' do + it 'is not allowed' do + post :create, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'POST reindex_all' do + it 'is not allowed' do + post :reindex_all, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in as a curator' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { sign_in user } + + describe 'GET new' do + it 'renders form' do + get :new, exhibit_id: exhibit + expect(response).to render_template 'spotlight/resources/new' + end + end + + describe 'GET monitor' do + it 'succesfully renders json' do + get :monitor, exhibit_id: exhibit + expect(response).to be_success + end + end + + describe 'POST create' do + let(:blacklight_solr) { double } + it 'create a resource' do + expect_any_instance_of(Spotlight::Resource).to receive(:reindex_later) + allow_any_instance_of(Spotlight::Resource).to receive(:blacklight_solr).and_return blacklight_solr + post :create, exhibit_id: exhibit, resource: { url: 'info:uri' } + expect(assigns[:resource]).to be_persisted + end + end + + describe 'POST reindex_all' do + it 'triggers a reindex' do + expect_any_instance_of(Spotlight::Exhibit).to receive(:reindex_later) + post :reindex_all, exhibit_id: exhibit + expect(response).to redirect_to admin_exhibit_catalog_index_path(exhibit) + expect(flash[:notice]).to include 'Reindexing' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/roles_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/roles_controller_spec.rb new file mode 100644 index 0000000..0376743 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/roles_controller_spec.rb @@ -0,0 +1,153 @@ +require 'spec_helper' + +describe Spotlight::RolesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when user does not have access' do + before { sign_in FactoryGirl.create(:exhibit_visitor) } + describe 'GET index' do + it 'denies access' do + get :index, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + end + end + end + + describe 'when user is an admin' do + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + let(:user) { FactoryGirl.create(:user) } + let(:role) { admin.roles.first } + before { sign_in admin } + it 'allows index' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Users', exhibit_roles_path(exhibit)) + get :index, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:roles].to_a).to eq [admin.roles.first] + end + + describe 'PATCH update_all' do + it 'creates new roles' do + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'role' => 'curator', 'user_key' => user.email } + } + } + + expect(exhibit.roles.last.role).to eq 'curator' + expect(exhibit.roles.last.user.email).to eq user.email + end + + it 'updates roles' do + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'role' => 'curator', 'id' => role.id } + } + } + expect(response).to redirect_to exhibit_roles_path(exhibit) + expect(flash[:notice]).to eq 'User has been updated.' + + admin.reload + + expect(admin.roles.first.role).to eq 'curator' + end + + it 'ignores empty roles' do + expect do + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'user_key' => '', 'role' => '' } + } + } + end.not_to change { exhibit.roles.length } + end + + it 'authorizes records' do + allow(controller).to receive(:authorize!).and_raise(CanCan::AccessDenied) + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'role' => 'curator', 'id' => role.id } + } + } + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to eq 'You are not authorized to access this page.' + expect(admin.reload.roles.first.role).to eq 'admin' + end + + it 'destroys records' do + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'role' => 'curator', 'id' => role.id, '_destroy' => '1' } + } + } + + expect(response).to redirect_to exhibit_roles_path(exhibit) + expect(admin.reload.roles).to be_empty + expect(flash[:notice]).to eq 'User has been removed.' + end + + it 'handles failure' do + allow_any_instance_of(Spotlight::Exhibit).to receive_messages(update: false) + patch :update_all, exhibit_id: exhibit, 'exhibit' => { + 'roles_attributes' => { + '0' => { 'role' => 'curator', 'id' => role.id } + } + } + expect(response).to be_successful + expect(flash[:alert]).to eq 'There was a problem saving the user(s).' + end + end + + describe 'GET exists' do + it 'requires a user parameter' do + expect do + get :exists, exhibit_id: exhibit + end.to raise_error(ActionController::ParameterMissing) + end + + it 'returns a successful status when the requested user exists' do + user = FactoryGirl.create(:exhibit_curator) + get :exists, exhibit_id: exhibit, user: user.email + expect(response).to be_success + end + + it 'returns an unsuccessful status when the user does not exist' do + get :exists, exhibit_id: exhibit, user: 'user@example.com' + expect(response).not_to be_success + expect(response.status).to eq 404 + end + end + + describe 'GET invite' do + before { request.env['HTTP_REFERER'] = 'http://example.com' } + + it 'invites the selected user' do + expect do + post :invite, exhibit_id: exhibit, user: 'user@example.com', role: 'curator' + end.to change { Spotlight::Engine.user_class.count }.by(1) + expect(Spotlight::Engine.user_class.last.roles.length).to eq 1 + expect(Spotlight::Engine.user_class.last.roles.first.resource).to eq exhibit + end + + it 'adds the user to the exhibit via a role' do + expect do + post :invite, exhibit_id: exhibit, user: 'user@example.com', role: 'curator' + end.to change { Spotlight::Role.count }.by(1) + end + + it 'redirects back with a flash notice upon success' do + post :invite, exhibit_id: exhibit, user: 'user@example.com', role: 'curator' + expect(flash[:notice]).to eq 'User has been invited.' + expect(response).to redirect_to(:back) + end + + it 'redirects back with flash error upon failure' do + post :invite, exhibit_id: exhibit, user: 'user@example.com', role: 'not-a-real-role' + expect(flash[:alert]).to eq 'There was a problem saving the user(s).' + expect(response).to redirect_to(:back) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/search_configurations_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/search_configurations_controller_spec.rb new file mode 100644 index 0000000..909312f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/search_configurations_controller_spec.rb @@ -0,0 +1,127 @@ +require 'spec_helper' +describe Spotlight::SearchConfigurationsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET edit' do + it 'denies access' do + get :edit, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when not logged in' do + describe 'PATCH update' do + it 'denies access' do + patch :update, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + + describe 'GET edit' do + it 'denies access' do + get :edit, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when signed in' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET edit' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Configuration', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Search', edit_exhibit_search_configuration_path(exhibit)) + get :edit, exhibit_id: exhibit + expect(response).to be_successful + end + + it 'assigns the field metadata' do + get :edit, exhibit_id: exhibit + expect(assigns(:field_metadata)).to be_an_instance_of(Spotlight::FieldMetadata) + expect(assigns(:field_metadata).repository).to eq controller.repository + expect(assigns(:field_metadata).blacklight_config).to eq controller.blacklight_config + end + end + + describe 'PATCH update' do + it 'updates facet fields' do + patch :update, exhibit_id: exhibit, blacklight_configuration: { + facet_fields: { 'genre_ssim' => { enabled: '1', label: 'Label' } } + } + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_search_configuration_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.blacklight_configuration.facet_fields.keys).to eq ['genre_ssim'] + end + end + + it 'updates sort fields' do + patch :update, exhibit_id: exhibit, blacklight_configuration: { + sort_fields: { + 'relevance' => { 'enabled' => '1', 'label' => 'Relevance' }, + 'title' => { 'enabled' => '1', 'label' => 'Title' }, + 'type' => { 'enabled' => '1', 'label' => 'Type' }, + 'date' => { 'enabled' => '0', 'label' => 'Date' }, + 'source' => { 'enabled' => '0', 'label' => 'Source' }, + 'identifier' => { 'enabled' => '0', 'label' => 'Identifier' } + } + } + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_search_configuration_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.blacklight_configuration.sort_fields).to eq( + 'relevance' => { 'label' => 'Relevance', 'enabled' => true }, + 'title' => { 'label' => 'Title', 'enabled' => true }, + 'type' => { 'label' => 'Type', 'enabled' => true }, + 'date' => { 'label' => 'Date', 'enabled' => false }, + 'source' => { 'label' => 'Source', 'enabled' => false }, + 'identifier' => { 'label' => 'Identifier', 'enabled' => false } + ) + end + end + + it 'updates search fields' do + patch :update, exhibit_id: exhibit, blacklight_configuration: { + search_fields: { + 'all_fields' => { 'enabled' => '1' }, + 'title' => { 'enabled' => '0', 'label' => 'Title' }, + 'author' => { 'enabled' => '1', 'label' => 'Primary Author' } + } + } + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_search_configuration_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.blacklight_configuration.search_fields).to eq( + 'all_fields' => { 'label' => 'Everything', 'enabled' => true }, + 'title' => { 'label' => 'Title', 'enabled' => false }, + 'author' => { 'label' => 'Primary Author', 'enabled' => true } + ) + end + end + + it 'updates appearance fields' do + patch :update, exhibit_id: exhibit, blacklight_configuration: { + document_index_view_types: { 'list' => '1', 'gallery' => '1', 'map' => '0' }, + default_per_page: '50' + } + expect(flash[:notice]).to eq 'The exhibit was successfully updated.' + expect(response).to redirect_to edit_exhibit_search_configuration_path(exhibit) + assigns[:exhibit].tap do |saved| + expect(saved.blacklight_configuration.document_index_view_types).to eq %w(list gallery) + expect(saved.blacklight_configuration.default_per_page).to eq 50 + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/searches_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/searches_controller_spec.rb new file mode 100644 index 0000000..373ffa4 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/searches_controller_spec.rb @@ -0,0 +1,170 @@ +require 'spec_helper' + +describe Spotlight::SearchesController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + before do + allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later) + end + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'POST create' do + it 'denies access' do + post :create, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + + describe 'GET index' do + it 'denies access' do + get :index, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when the user is a curator' do + before do + sign_in FactoryGirl.create(:exhibit_curator, exhibit: exhibit) + end + let(:search) { FactoryGirl.create(:search, exhibit: exhibit) } + + it 'creates a saved search' do + request.env['HTTP_REFERER'] = '/referring_url' + post :create, 'search' => { 'title' => 'A bunch of maps' }, 'f' => { 'genre_ssim' => ['map'] }, exhibit_id: exhibit + expect(response).to redirect_to '/referring_url' + expect(flash[:notice]).to eq 'The search was created.' + expect(assigns[:search].title).to eq 'A bunch of maps' + expect(assigns[:search].query_params).to eq('f' => { 'genre_ssim' => ['map'] }) + end + + describe 'GET index' do + let!(:search) { FactoryGirl.create(:search, exhibit: exhibit) } + it 'shows all the items' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Browse', exhibit_searches_path(exhibit)) + get :index, exhibit_id: search.exhibit_id + expect(response).to be_successful + expect(assigns[:exhibit]).to eq search.exhibit + expect(assigns[:searches]).to include search + end + + it 'has a JSON response with published resources' do + search.published = true + search.save! + + get :index, exhibit_id: exhibit, format: 'json' + expect(response).to be_successful + json = JSON.parse(response.body) + expect(json.size).to eq 1 + expect(json.last).to include('id' => search.id, 'title' => search.title) + end + end + + describe 'GET autocomplete' do + let(:search) do + FactoryGirl.create(:search, exhibit: exhibit, title: 'New Mexico Maps', query_params: { q: 'New Mexico' }) + end + + let(:search_fq) do + FactoryGirl.create(:search, exhibit: exhibit, title: 'New Mexico Maps', query_params: { f: { subject_geographic_ssim: ['Pacific Ocean'] } }) + end + + it "shows all the items returned search's query_params" do + pending("A search defined by a query doesn't work with autocomplete correctly.") + get :autocomplete, exhibit_id: exhibit, id: search, format: 'json' + expect(response).to be_successful + docs = JSON.parse(response.body)['docs'] + doc_ids = docs.map { |d| d['id'] } + expect(docs.length).to eq 2 + expect(doc_ids).to include 'cz507zk0531' + expect(doc_ids).to include 'rz818vx8201' + end + it 'searches within the items returned in the query_params' do + get :autocomplete, exhibit_id: exhibit, id: search_fq, q: 'California', format: 'json' + expect(response).to be_successful + docs = JSON.parse(response.body)['docs'] + expect(docs.length).to eq 1 + expect(docs.first['id']).to eq 'sn161bw2027' + expect(docs.first['description']).to eq 'sn161bw2027' + expect(docs.first['title']).to match(/Pas-caart van Zuyd-Zee/) + expect(docs.first).to have_key('thumbnail') + expect(docs.first).to have_key('url') + end + end + + describe 'GET edit' do + it 'shows edit page' do + get :edit, id: search, exhibit_id: search.exhibit + expect(response).to be_successful + expect(assigns[:search]).to eq search + expect(assigns[:exhibit]).to eq search.exhibit + end + end + + describe 'PATCH update' do + it 'shows edit page' do + patch :update, id: search, exhibit_id: search.exhibit, search: { + title: 'Hey man', + long_description: 'long', + featured_image: 'http://lorempixel.com/64/64/' + } + + expect(assigns[:search].title).to eq 'Hey man' + expect(response).to redirect_to exhibit_searches_path(search.exhibit) + end + + it "renders edit if there's an error" do + expect_any_instance_of(Spotlight::Search).to receive(:update).and_return(false) + patch :update, id: search, exhibit_id: search.exhibit, search: { + title: 'Hey man', + long_description: 'long', + featured_image: 'http://lorempixel.com/64/64/' + } + + expect(response).to be_successful + expect(response).to render_template 'edit' + end + end + + describe 'DELETE destroy' do + let!(:search) { FactoryGirl.create(:search, exhibit: exhibit) } + it 'removes it' do + expect do + delete :destroy, id: search, exhibit_id: search.exhibit + end.to change { Spotlight::Search.count }.by(-1) + expect(response).to redirect_to exhibit_searches_path(search.exhibit) + expect(flash[:alert]).to eq 'The search was deleted.' + end + end + + describe 'POST update_all' do + let!(:search2) { FactoryGirl.create(:search, exhibit: exhibit, published: true) } + let!(:search3) { FactoryGirl.create(:search, exhibit: exhibit, published: true) } + before { request.env['HTTP_REFERER'] = 'http://example.com' } + it 'updates whether they are on the landing page' do + post :update_all, exhibit_id: exhibit, exhibit: { + searches_attributes: [ + { id: search.id, published: true, weight: '1' }, + { id: search2.id, published: false, weight: '0' } + ] + } + + expect(search.reload.published).to be_truthy + expect(search.weight).to eq 1 + expect(search2.reload.published).to be_falsey + expect(search3.reload.published).to be_truthy # should remain untouched since it wasn't present + expect(response).to redirect_to 'http://example.com' + expect(flash[:notice]).to eq 'Searches were successfully updated.' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/sites_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/sites_controller_spec.rb new file mode 100644 index 0000000..52de434 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/sites_controller_spec.rb @@ -0,0 +1,60 @@ +require 'spec_helper' + +describe Spotlight::SitesController, type: :controller do + routes { Spotlight::Engine.routes } + + describe 'when user does not have access' do + before { sign_in FactoryGirl.create(:exhibit_visitor) } + describe 'GET edit' do + it 'denies access' do + get :edit + expect(response).to redirect_to main_app.root_path + end + end + end + + describe 'when user is an admin' do + let(:admin) { FactoryGirl.create(:site_admin) } + before { sign_in admin } + + describe 'GET edit' do + it 'allows access' do + get :edit + expect(response).to be_successful + end + end + + describe 'GET edit_exhibits' do + it 'allows access' do + get :edit_exhibits + expect(response).to be_successful + end + end + + describe 'PATCH update' do + let!(:exhibit_a) { FactoryGirl.create(:exhibit) } + let!(:exhibit_b) { FactoryGirl.create(:exhibit) } + + it 'changes the exhibit order' do + patch :update, site: { exhibits_attributes: [{ id: exhibit_a.id, weight: 5 }, { id: exhibit_b.id, weight: 2 }] } + + expect(response).to redirect_to(exhibits_path) + + expect(Spotlight::Exhibit.all.first).to eq exhibit_b + expect(exhibit_a.reload.weight).to eq 5 + end + end + + describe 'GET tags' do + let!(:exhibit_a) { FactoryGirl.create(:exhibit, tag_list: 'a') } + + it 'serializes the exhibit-level tags' do + get :tags, format: 'json' + expect(response).to be_successful + data = JSON.parse(response.body) + + expect(data).to include 'a' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/solr_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/solr_controller_spec.rb new file mode 100644 index 0000000..12305ab --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/solr_controller_spec.rb @@ -0,0 +1,79 @@ +require 'spec_helper' + +describe Spotlight::SolrController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when user does not have access' do + before { sign_in FactoryGirl.create(:exhibit_visitor) } + + describe 'POST update' do + it 'does not allow update' do + post :update, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + end + end + end + + describe 'when user is an admin' do + let(:admin) { FactoryGirl.create(:site_admin) } + let(:role) { admin.roles.first } + let(:solr) { double } + before { sign_in admin } + before do + allow(controller).to receive(:blacklight_solr).and_return(solr) + end + + describe 'POST update' do + it 'passes through the request data' do + doc = {} + expect(solr).to receive(:update) do |arr| + doc = arr.first + end + + post :update, { a: 1 }.to_json, content_type: :json, exhibit_id: exhibit + + expect(response).to be_successful + expect(doc).to include 'a' => 1 + end + + context 'when the index is not writable' do + before do + allow(Spotlight::Engine.config).to receive_messages(writable_index: false) + end + + it 'raises an error' do + post :update, { a: 1 }.to_json, content_type: :json, exhibit_id: exhibit + + expect(response.code).to eq '409' + end + end + + it 'enriches the request with exhibit solr data' do + doc = {} + expect(solr).to receive(:update) do |arr| + doc = arr.first + end + + post :update, { a: 1 }.to_json, content_type: :json, exhibit_id: exhibit + + expect(response).to be_successful + expect(doc).to include exhibit.solr_data + end + + it 'enriches the request with sidecar data' do + doc = {} + expect(solr).to receive(:update) do |arr| + doc = arr.first + end + + allow_any_instance_of(SolrDocument).to receive(:to_solr).and_return(b: 1) + + post :update, { a: 1 }.to_json, content_type: :json, exhibit_id: exhibit + + expect(response).to be_successful + expect(doc).to include b: 1 + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/tags_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/tags_controller_spec.rb new file mode 100644 index 0000000..5d94a94 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/tags_controller_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe Spotlight::TagsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when not signed in' do + describe 'GET index' do + it 'redirects to sign inl' do + get :index, exhibit_id: exhibit + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + describe 'when signed in as a curator' do + before { sign_in FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + describe 'GET index' do + it 'is successful' do + expect(controller).to receive(:add_breadcrumb).with('Home', exhibit) + expect(controller).to receive(:add_breadcrumb).with('Curation', exhibit_dashboard_path(exhibit)) + expect(controller).to receive(:add_breadcrumb).with('Tags', exhibit_tags_path(exhibit)) + get :index, exhibit_id: exhibit + expect(response).to be_successful + expect(assigns[:tags]).to eq [] + expect(assigns[:exhibit]).to eq exhibit + end + + it 'has a json serialization' do + get :index, exhibit_id: exhibit, format: 'json' + expect(response).to be_successful + end + end + + describe 'DELETE destroy' do + let!(:tagging) { FactoryGirl.create(:tagging, tagger: exhibit) } + it 'is successful' do + expect do + delete :destroy, exhibit_id: exhibit, id: tagging.tag + end.to change { ActsAsTaggableOn::Tagging.count }.by(-1) + expect(response).to redirect_to exhibit_tags_path(exhibit) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/versions_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/versions_controller_spec.rb new file mode 100644 index 0000000..57160e5 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/versions_controller_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe Spotlight::VersionsController, type: :controller do + routes { Spotlight::Engine.routes } + + describe 'when not logged in' do + describe 'POST revert' do + it 'is not allowed' do + post :revert, id: 1 + expect(response).to redirect_to main_app.new_user_session_path + end + end + end + + describe 'when not authorized for the exhibit resource' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_visitor) } + let!(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + before do + sign_in user + end + + describe 'POST revert' do + it 'is not allowed' do + post :revert, id: page.versions.last + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when logged in as a curator' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let!(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + before do + sign_in user + end + + describe 'POST revert' do + it 'reverts the change' do + page.title = 'xyz' + page.save! + + post :revert, id: page.versions.last + page.reload + expect(page.title).not_to eq 'xyz' + expect(response).to redirect_to [exhibit, page] + expect(flash[:notice]).to be_present + expect(flash[:notice]).to match(/Redo changes/) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/controllers/spotlight/view_configurations_controller_spec.rb b/tmp/blacklight-spotlight/spec/controllers/spotlight/view_configurations_controller_spec.rb new file mode 100644 index 0000000..3070157 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/controllers/spotlight/view_configurations_controller_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' +describe Spotlight::ViewConfigurationsController, type: :controller do + routes { Spotlight::Engine.routes } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe 'when the user is not authorized' do + before do + sign_in FactoryGirl.create(:exhibit_visitor) + end + + describe 'GET show' do + it 'denies access' do + get :show, exhibit_id: exhibit + expect(response).to redirect_to main_app.root_path + expect(flash[:alert]).to be_present + end + end + end + + describe 'when signed in' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { sign_in user } + + describe 'GET show' do + it 'is successful' do + get :show, exhibit_id: exhibit, format: 'json' + expect(response).to be_successful + available = JSON.parse(response.body) + expect(available).to match_array %w(list gallery slideshow) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/contacts.rb b/tmp/blacklight-spotlight/spec/factories/contacts.rb new file mode 100644 index 0000000..31bcbc1 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/contacts.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :contact, class: Spotlight::Contact do + exhibit + avatar { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) } + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/custom_fields.rb b/tmp/blacklight-spotlight/spec/factories/custom_fields.rb new file mode 100644 index 0000000..8e5a9a4 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/custom_fields.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :custom_field, class: Spotlight::CustomField do + exhibit + field 'field_name_tesim' + configuration('label' => 'Some Field') + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/exhibits.rb b/tmp/blacklight-spotlight/spec/factories/exhibits.rb new file mode 100644 index 0000000..b72e07a --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/exhibits.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :exhibit, class: Spotlight::Exhibit do + sequence(:title) { |n| "Exhibit Title #{n}" } + published true + after(:build) { |exhibit| exhibit.searches << FactoryGirl.build(:default_search) } + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/featured_images.rb b/tmp/blacklight-spotlight/spec/factories/featured_images.rb new file mode 100644 index 0000000..1752c9b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/featured_images.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :featured_image, class: Spotlight::FeaturedImage do + image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) } + end + + factory :masthead, class: Spotlight::Masthead do + image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) } + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/pages.rb b/tmp/blacklight-spotlight/spec/factories/pages.rb new file mode 100644 index 0000000..05a5e9d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/pages.rb @@ -0,0 +1,26 @@ +FactoryGirl.define do + factory :feature_page, class: 'Spotlight::FeaturePage' do + exhibit + sequence(:title) { |n| "FeaturePage#{n}" } + published true + content '[]' + end + factory :feature_subpage, parent: :feature_page do + transient do + exhibit + end + title 'SubPage1' + content '[]' + after(:build) { |subpage, evaluator| subpage.parent_page = FactoryGirl.create(:feature_page, exhibit: evaluator.exhibit) } + end + factory :about_page, class: 'Spotlight::AboutPage' do + exhibit + sequence(:title) { |n| "AboutPage#{n}" } + content '[]' + published true + end + + factory :home_page, class: 'Spotlight::HomePage' do + exhibit + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/resources.rb b/tmp/blacklight-spotlight/spec/factories/resources.rb new file mode 100644 index 0000000..94fb115 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/resources.rb @@ -0,0 +1,11 @@ +FactoryGirl.define do + factory :resource, class: Spotlight::Resource do + exhibit + type 'Spotlight::Resource' + url 'some url' + end + factory :uploaded_resource, class: Spotlight::Resources::Upload, parent: :resource do + type 'Spotlight::Resources::Upload' + url { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) } + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/roles.rb b/tmp/blacklight-spotlight/spec/factories/roles.rb new file mode 100644 index 0000000..fefd07f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/roles.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :role, class: Spotlight::Role do + resource { FactoryGirl.build(:exhibit) } + role 'curator' + user + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/searches.rb b/tmp/blacklight-spotlight/spec/factories/searches.rb new file mode 100644 index 0000000..ed17778 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/searches.rb @@ -0,0 +1,20 @@ +FactoryGirl.define do + factory :search, class: Spotlight::Search do + exhibit + sequence(:title) { |n| "Exhibit Search #{n}" } + sequence(:slug) { |n| "Search#{n}" } + + after(:build) { |search| search.thumbnail = FactoryGirl.create(:featured_image) } + end + + factory :published_search, parent: :search do + published true + end + + factory :default_search, class: Spotlight::Search do + title 'All Exhibit Items' + long_description 'All items in this exhibit.' + + after(:build) { |search| search.thumbnail = FactoryGirl.create(:featured_image) } + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/tags.rb b/tmp/blacklight-spotlight/spec/factories/tags.rb new file mode 100644 index 0000000..fc3cce5 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/tags.rb @@ -0,0 +1,11 @@ +FactoryGirl.define do + factory :tag, class: ActsAsTaggableOn::Tag do + sequence(:name) { |n| "tag#{n}" } + end + + factory :tagging, class: ActsAsTaggableOn::Tagging do + sequence(:tag) { |n| FactoryGirl.create(:tag, name: "tagging#{n}") } + tagger { FactoryGirl.create(:exhibit) } + context :tags + end +end diff --git a/tmp/blacklight-spotlight/spec/factories/users.rb b/tmp/blacklight-spotlight/spec/factories/users.rb new file mode 100644 index 0000000..9a8e64e --- /dev/null +++ b/tmp/blacklight-spotlight/spec/factories/users.rb @@ -0,0 +1,29 @@ +FactoryGirl.define do + factory :spotlight_user do + transient do + exhibit { FactoryGirl.create(:exhibit) } + end + sequence(:email) { |n| "user#{n}@example.com" } + password 'insecure' + + factory :site_admin do + after(:create) do |user, _evaluator| + user.roles.create role: 'admin', resource: Spotlight::Site.instance + end + end + + factory :exhibit_admin do + after(:create) do |user, evaluator| + user.roles.create role: 'admin', resource: evaluator.exhibit + end + end + factory :exhibit_curator do + after(:create) do |user, evaluator| + user.roles.create role: 'curator', resource: evaluator.exhibit + end + end + + factory :exhibit_visitor do + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/about_page_spec.rb b/tmp/blacklight-spotlight/spec/features/about_page_spec.rb new file mode 100644 index 0000000..e388a58 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/about_page_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe 'About page', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let!(:about_page1) { FactoryGirl.create(:about_page, title: 'First Page', exhibit: exhibit) } + let!(:about_page2) { FactoryGirl.create(:about_page, title: 'Second Page', exhibit: exhibit) } + let(:unpublished_page) { FactoryGirl.create(:about_page, title: 'Unpublished Page', published: false, exhibit: exhibit) } + describe 'sidebar' do + it 'displays' do + visit spotlight.exhibit_about_page_path(about_page1.exhibit, about_page1) + # the sidebar should display + within('#sidebar') do + # within the sidebar navigation + within('ul.sidenav') do + # the current page should be active + expect(page).to have_css('li.active', text: about_page1.title) + # the other page should be linked + expect(page).to have_css('li a', text: about_page2.title) + end + end + end + end + describe 'page options' do + before { login_as exhibit_curator } + describe 'publish' do + it 'is updatable from the edit page' do + expect(unpublished_page).not_to be_published + + visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page) + expect(find('#about_page_published')).not_to be_checked + + check 'Publish' + click_button 'Save changes' + + expect(unpublished_page.reload).to be_published + + visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page) + expect(find('#about_page_published')).to be_checked + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/add_contacts_spec.rb b/tmp/blacklight-spotlight/spec/features/add_contacts_spec.rb new file mode 100644 index 0000000..92b95c7 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/add_contacts_spec.rb @@ -0,0 +1,61 @@ +require 'spec_helper' + +describe 'Add a contact to an exhibit', type: :feature do + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:about_page) { FactoryGirl.create(:about_page, exhibit: exhibit) } + before { login_as curator } + it 'displays a newly added contact in the sidebar' do + visit spotlight.exhibit_about_pages_path(exhibit) + click_link 'Add contact' + within '#new_contact' do + fill_in 'Name', with: 'Marcus Aurelius' + fill_in 'Email', with: 'marcus@rome.gov' + fill_in 'Title', with: 'Emperor' + fill_in 'Location', with: 'Rome' + fill_in 'Telephone', with: '(555) 555-5555 ext. 12345 (mobile)' + + click_button 'Save' + end + expect(page).to have_content 'The contact was created.' + + within '.contacts_admin' do + check 'exhibit_contacts_attributes_0_show_in_sidebar' + end + within '.exhibit-contacts' do + click_button 'Save changes' + end + + expect(page).to have_content 'Contacts were successfully updated.' + + within '#nested-pages' do + click_link 'View' + end + + within '#sidebar .contacts' do + expect(page).to have_selector '.name', text: 'Marcus Aurelius' + expect(page).to have_selector 'div', text: 'marcus@rome.gov' + expect(page).to have_selector 'div', text: 'Emperor' + expect(page).to have_selector 'div', text: 'Rome' + expect(page).to have_selector 'div', text: '(555) 555-5555 ext. 12345 (mobile)' + expect(page).to_not have_selector 'img.contact-photo' + end + end + + it "allows the curator to crop the contact's avatar", js: true do + skip "Capyabara and jcrop don't play well together.." + + visit spotlight.exhibit_about_pages_path(exhibit) + click_link 'Add contact' + page.document.synchronize do + find('.jcrop-holder') + end + within '#new_contact' do + fill_in 'Name', with: 'Pictured User' + fill_in 'Email', with: 'marcus@rome.gov' + attach_file('contact_avatar', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + expect(page).to have_content 'The contact was created.' + expect(page).to have_selector 'img.contact-photo' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/add_custom_field_metadata_spec.rb b/tmp/blacklight-spotlight/spec/features/add_custom_field_metadata_spec.rb new file mode 100644 index 0000000..2b37fb2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/add_custom_field_metadata_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe 'Adding custom metadata field data', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + let(:custom_field) { FactoryGirl.create(:custom_field, exhibit: exhibit) } + let(:config) { exhibit.blacklight_configuration } + before do + login_as(admin) + config.index_fields[custom_field.field] = { enabled: true, show: true, 'label' => 'Some Field' } + config.save! + end + + it 'works' do + visit spotlight.exhibit_catalog_path(exhibit, 'dq287tq6352') + + expect(page).to have_link 'Edit' + + click_on 'Edit' + + fill_in 'Some Field', with: 'My new custom field value' + + click_on 'Save changes' + + expect(::SolrDocument.find('dq287tq6352').sidecar(exhibit).data).to include 'field_name_tesim' => 'My new custom field value' + sleep(1) # The data isn't commited to solr immediately. + + visit spotlight.exhibit_catalog_path(exhibit, 'dq287tq6352') + expect(page).to have_content 'Some Field' + expect(page).to have_content 'My new custom field value' + end + + it 'has a public toggle' do + visit spotlight.exhibit_catalog_path(exhibit, 'dq287tq6352') + + expect(page).not_to have_selector '.blacklight-private' + + click_on 'Edit' + + uncheck 'Public' + + click_on 'Save changes' + + expect(page).to have_selector '.blacklight-private' + + click_on 'Edit' + + check 'Public' + + click_on 'Save changes' + + expect(page).not_to have_selector '.blacklight-private' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/add_items_spec.rb b/tmp/blacklight-spotlight/spec/features/add_items_spec.rb new file mode 100644 index 0000000..bbef95c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/add_items_spec.rb @@ -0,0 +1,87 @@ +require 'spec_helper' + +describe 'Uploading a non-repository item', type: :feature do + let!(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:custom_field) { FactoryGirl.create(:custom_field, exhibit: exhibit) } + let!(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as exhibit_curator } + + describe 'forms' do + it 'displays the single item upload form' do + visit spotlight.new_exhibit_resource_path(exhibit) + expect(page).to have_css('h1', text: /Curation/) + expect(page).to have_css 'h1 small', text: 'Add items' + + click_link 'Upload item' + + within('form#new_resources_upload') do + expect(page).to have_css('#resources_upload_url[type="file"]') + expect(page).to have_css('.help-block', text: 'Valid file types: jpg jpeg png') + expect(page).to have_css('#resources_upload_data_full_title_tesim[type="text"]') + expect(page).to have_css('textarea#resources_upload_data_spotlight_upload_description_tesim') + expect(page).to have_css('#resources_upload_data_spotlight_upload_attribution_tesim[type="text"]') + expect(page).to have_css('#resources_upload_data_spotlight_upload_date_tesim[type="text"]') + expect(page).to have_css("#resources_upload_data_#{custom_field.field}[type='text']") + end + end + + it 'creates a new item' do + visit spotlight.new_exhibit_resource_path(exhibit) + + click_link 'Upload item' + + attach_file('resources_upload_url', File.join(FIXTURES_PATH, '800x600.png')) + fill_in 'Title', with: '800x600' + + within '#new_resources_upload' do + click_button 'Add item' + end + expect(page).to have_content 'Object uploaded successfully.' + + expect(Spotlight::Resource.last.url.file.path).to end_with '800x600.png' + Blacklight.default_index.connection.delete_by_id Spotlight::Resource.last.send(:compound_id) + Blacklight.default_index.connection.commit + end + + it 'displays the multi-item CSV upload form' do + visit spotlight.new_exhibit_resource_path(exhibit) + expect(page).to have_css('h1', text: /Curation/) + expect(page).to have_css 'h1 small', text: 'Add items' + + click_link 'Upload multiple items' + + within('form#new_resources_csv_upload') do + expect(page).to have_css('#resources_csv_upload_url[type="file"]') + expect(page).to have_css('.help-block a', text: 'Download template') + end + end + end + + describe 'upload' do + it 'is editable' do + visit spotlight.new_exhibit_resource_path(exhibit) + + click_link 'Upload item' + + attach_file('resources_upload_url', File.join(FIXTURES_PATH, '800x600.png')) + fill_in 'Title', with: '800x600' + + within '#new_resources_upload' do + click_button 'Add item' + end + + click_link '800x600' + click_link 'Edit' + fill_in 'Title', with: 'This is a now an avatar' + + attach_file('File', File.join(FIXTURES_PATH, 'avatar.png')) + + click_button 'Save' + + expect(page).to have_content 'This is a now an avatar' + expect(Spotlight::Resource.last.url.file.path).to end_with 'avatar.png' + Blacklight.default_index.connection.delete_by_id Spotlight::Resource.last.send(:compound_id) + Blacklight.default_index.connection.commit + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/browse_category_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/browse_category_admin_spec.rb new file mode 100644 index 0000000..6180b0f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/browse_category_admin_spec.rb @@ -0,0 +1,78 @@ +require 'spec_helper' + +describe 'Browse Category Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let!(:search) { FactoryGirl.create(:search, exhibit: exhibit, query_params: { f: { 'genre_ssim' => ['Value'] } }) } + before { login_as curator } + describe 'index' do + it 'has searches' do + visit spotlight.exhibit_searches_path(exhibit) + expect(page).to have_css('.panel .search .title', text: search.title) + end + end + describe 'edit' do + it 'displays an edit form' do + visit spotlight.edit_exhibit_search_path(exhibit, search) + expect(page).to have_css('h1 small', text: 'Edit Browse Category') + expect(find_field('search_title').value).to eq search.title + within '.appliedFilter' do + expect(page).to have_content 'Genre' + expect(page).to have_content 'Value' + end + end + + it 'attaches a masthead image' do + visit spotlight.edit_exhibit_search_path exhibit, search + + click_link 'Masthead' + + within '#search-masthead' do + choose 'Upload an image' + attach_file('search_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The search was successfully updated.') + + search.reload + + expect(search.masthead).not_to be nil + expect(search.masthead.image.cropped).not_to be_nil + expect(search.masthead.image.path).to end_with 'avatar.png' + end + + it 'attaches a thumbnail image' do + visit spotlight.edit_exhibit_search_path exhibit, search + + click_link 'Thumbnail' + + within '#search-thumbnail' do + choose 'Upload an image' + attach_file('search_thumbnail_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The search was successfully updated.') + + search.reload + + expect(search.thumbnail).not_to be nil + expect(search.thumbnail.image.thumb).not_to be_nil + expect(search.thumbnail.image.path).to end_with 'avatar.png' + end + end + describe 'destroy' do + it 'destroys a tag' do + skip('TODO: Allow searches to be destroyed without javascript') + visit spotlight.exhibit_searches_path(exhibit) + within('.panel .search') do + click_link('Delete') + end + expect(page).to have_content('Search was deleted') + expect(page).not_to have_content(search.title) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/browse_category_spec.rb b/tmp/blacklight-spotlight/spec/features/browse_category_spec.rb new file mode 100644 index 0000000..6a09a6f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/browse_category_spec.rb @@ -0,0 +1,65 @@ +require 'spec_helper' + +feature 'Browse pages' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + + context 'a browse page' do + let!(:search) { FactoryGirl.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) } + context 'with the standard exhibit masthead' do + it 'includes the search title and resource count in the body' do + visit spotlight.exhibit_browse_path(exhibit, search) + + within '#main-container' do + expect(page).to have_selector 'h1', text: 'Some Saved Search' + end + + expect(page).not_to have_selector '.masthead .h1', text: 'Some Saved Search' + end + + it 'shows the search bar' do + visit spotlight.exhibit_browse_path(exhibit, search) + + expect(page).to have_selector '.search-query-form' + end + + it 'has breadcrumbs' do + visit spotlight.exhibit_browse_path(exhibit, search) + + expect(page).to have_selector '.breadcrumbs-container' + end + end + + context 'with a custom masthead' do + let(:masthead) { FactoryGirl.create(:masthead, display: true) } + + before do + search.masthead = masthead + search.save + end + + it 'has a contextual masthead with the title and resource count' do + visit spotlight.exhibit_browse_path(exhibit, search) + + expect(page).to have_selector '.masthead .h1', text: 'Some Saved Search' + + within '#main-container' do + expect(page).not_to have_selector 'h1', text: 'Some Saved Search' + end + + expect(page).to have_selector '.masthead small.item-count', text: /\d+ items/ + end + + it 'does not show the search bar' do + visit spotlight.exhibit_browse_path(exhibit, search) + + expect(page).not_to have_selector '.search-query-form' + end + + it 'does not have breadcrumbs' do + visit spotlight.exhibit_browse_path(exhibit, search) + + expect(page).not_to have_selector '.breadcrumbs-container' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/catalog_spec.rb b/tmp/blacklight-spotlight/spec/features/catalog_spec.rb new file mode 100644 index 0000000..b5ccd99 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/catalog_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe 'Catalog', type: :feature do + describe 'admin' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + before do + login_as curator + d = SolrDocument.new(id: 'dq287tq6352') + d.make_private! exhibit + d.reindex + Blacklight.default_index.connection.commit + end + + after do + d = SolrDocument.new(id: 'dq287tq6352') + d.make_public! exhibit + d.reindex + Blacklight.default_index.connection.commit + end + + it "has a 'Item Visiblity' facet" do + visit spotlight.exhibit_catalog_index_path(exhibit) + expect(page).to have_selector '.panel-title', text: 'Item Visibility' + end + end + describe 'Non-spotlight #show' do + it 'is able to render without exhibit context' do + visit catalog_path('dq287tq6352') + expect(page).to have_css 'h1', text: "L'AMERIQUE" + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/confirm_email_spec.rb b/tmp/blacklight-spotlight/spec/features/confirm_email_spec.rb new file mode 100644 index 0000000..6b13f6d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/confirm_email_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe 'Confirming an email', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:contact_email) { Spotlight::ContactEmail.create!(email: 'justin@example.com', exhibit: exhibit) } + let(:raw_token) { contact_email.instance_variable_get(:@raw_confirmation_token) } + + it 'resends confirmation instructions' do + visit spotlight.new_contact_email_confirmation_url(confirmation_token: contact_email.confirmation_token) + expect(page).to have_content('Resend confirmation instructions') + within '#new_contact_email' do + fill_in 'Email', with: contact_email.email + click_button 'Resend confirmation instructions' + end + end + + it 'confirms email' do + visit spotlight.contact_email_confirmation_url(confirmation_token: raw_token) + expect(page).to have_content('successfully confirmed') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/create_exhibit_spec.rb b/tmp/blacklight-spotlight/spec/features/create_exhibit_spec.rb new file mode 100644 index 0000000..1e2ea91 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/create_exhibit_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' + +describe 'Create a new exhibit', type: :feature do + let(:user) { FactoryGirl.create(:site_admin) } + before do + allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later) + login_as user + end + + it 'has a link in the user dropdown' do + visit '/' + within '.dropdown-menu' do + click_link 'Create Exhibit' + end + expect(page).to have_selector 'h1', text: 'Manage exhibits' + expect(page).to have_selector 'h1 small', text: 'Create a new exhibit' + end + + it 'allows admins to create a new exhibit' do + visit '/' + within '.dropdown-menu' do + click_link 'Create Exhibit' + end + + fill_in 'Title', with: 'My exhibit title' + + click_button 'Save' + + expect(page).to have_content 'The exhibit was created.' + expect(Spotlight::Exhibit.last.slug).to eq 'my-exhibit-title' + end + + it 'allows admins to create a new exhibit with a slug' do + visit '/' + within '.dropdown-menu' do + click_link 'Create Exhibit' + end + + fill_in 'Title', with: 'My exhibit title' + fill_in 'URL slug', with: 'custom-slug' + + click_button 'Save' + + expect(page).to have_content 'The exhibit was created.' + expect(Spotlight::Exhibit.last.slug).to eq 'custom-slug' + end + + it 'fails validation if the slug is already used' do + visit spotlight.new_exhibit_path + + fill_in 'Title', with: 'My exhibit title' + fill_in 'URL slug', with: 'custom-slug' + + click_button 'Save' + + visit spotlight.new_exhibit_path + + fill_in 'Title', with: 'My exhibit title' + fill_in 'URL slug', with: 'custom-slug' + + click_button 'Save' + expect(page).to have_content 'has already been taken' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/create_page_spec.rb b/tmp/blacklight-spotlight/spec/features/create_page_spec.rb new file mode 100644 index 0000000..fad5a8b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/create_page_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'Creating a page', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + describe 'when a bunch of about pages exist' do + let!(:page1) { FactoryGirl.create(:about_page, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:about_page, exhibit: exhibit) } + let!(:page3) { FactoryGirl.create(:about_page, exhibit: exhibit, title: 'A new one') } + it 'is able to show a list of About pages to be curated' do + login_as exhibit_curator + visit spotlight.exhibit_dashboard_path(exhibit) + within '#sidebar' do + click_link 'About pages' + end + expect(page).to have_content 'A new one' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/curator_items.rb b/tmp/blacklight-spotlight/spec/features/curator_items.rb new file mode 100644 index 0000000..13ed0f2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/curator_items.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe 'A curator can see the items page', type: :feature do + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + it 'works' do + login_as exhibit_curator + visit spotlight.exhibit_dashboard_path(exhibit) + + expect(page).to have_content 'Items' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/dashboard_spec.rb b/tmp/blacklight-spotlight/spec/features/dashboard_spec.rb new file mode 100644 index 0000000..2bc1250 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/dashboard_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe 'Dashboard', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before do + login_as(admin) + end + + let!(:parent_feature_page) do + FactoryGirl.create(:feature_page, title: 'Parent Page', exhibit: exhibit) + end + let!(:child_feature_page) do + FactoryGirl.create( + :feature_page, + title: 'Child Page', + parent_page: parent_feature_page, + exhibit: exhibit + ) + end + + it 'includes a list of recently edited feature pages' do + visit spotlight.exhibit_dashboard_path(exhibit) + expect(page).to have_content 'Recent Site Building Activity' + expect(page).to have_content 'Parent Page' + expect(page).to have_content 'Child Page' + end + + it 'includes a list of recently indexed items' do + visit spotlight.exhibit_dashboard_path(exhibit) + expect(page).to have_content 'Recently Updated Items' + expect(page).to have_selector('#documents') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/edit_contact_spec.rb b/tmp/blacklight-spotlight/spec/features/edit_contact_spec.rb new file mode 100644 index 0000000..47d274b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/edit_contact_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'Add a contact to an exhibit', type: :feature do + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:about_page) { FactoryGirl.create(:about_page, exhibit: exhibit) } + let!(:contact) { FactoryGirl.create(:contact, name: 'Marcus Aurelius', exhibit: exhibit) } + before { login_as curator } + it 'displays a newly added contact in the sidebar' do + visit spotlight.exhibit_about_pages_path(exhibit) + + within '.contacts_admin' do + click_link 'Edit' + end + + click_button 'Save' + + expect(page).to have_content 'The contact was successfully updated.' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/edit_search_fields_spec.rb b/tmp/blacklight-spotlight/spec/features/edit_search_fields_spec.rb new file mode 100644 index 0000000..1ae87dc --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/edit_search_fields_spec.rb @@ -0,0 +1,79 @@ +require 'spec_helper' + +describe 'Search Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as exhibit_admin } + + describe 'edit' do + it 'displays the search configuration edit screen' do + visit spotlight.edit_exhibit_search_configuration_path(exhibit) + expect(page).to have_css('h1 small', text: 'Search') + end + + it 'has breadcrumbs' do + visit spotlight.edit_exhibit_search_configuration_path exhibit + expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Search' + end + + describe 'facets' do + it 'displays information about the facets' do + visit spotlight.edit_exhibit_search_configuration_path(exhibit) + within("[data-id='genre_ssim']") do + expect(page).to have_content('Genre') + expect(page).to have_content(/\d+ items/) + expect(page).to have_content(/(\d+) unique values/) + end + end + + it 'allows curators to select and unselect facets for display' do + visit spotlight.edit_exhibit_search_configuration_path exhibit + + expect(page).to have_content 'Configuration Search Options Facets' + expect(page).to have_button 'Save' + + uncheck 'blacklight_configuration_facet_fields_language_ssim_show' # Language + uncheck 'blacklight_configuration_facet_fields_genre_ssim_show' # Genre + check 'blacklight_configuration_facet_fields_subject_temporal_ssim_show' # Era + + click_on 'Save changes' + + expect(exhibit.reload.blacklight_config.facet_fields.select { |_k, v| v.show }.keys).to include('subject_temporal_ssim') + expect(exhibit.blacklight_config.facet_fields.select { |_k, v| v.show }.keys).to_not include('language_ssim', 'genre_ssim') + end + end + + describe 'sort' do + it 'displays the sort fields edit area' do + visit spotlight.edit_exhibit_search_configuration_path(exhibit) + expect(page).to have_content('Sort fields') + end + + it 'updates sort options' do + visit spotlight.edit_exhibit_search_configuration_path(exhibit) + + # #field_labeled doesn't appear to work for disabled inputs + expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']") + expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'Date (new to old)') + + uncheck 'blacklight_configuration_sort_fields_title_enabled' + uncheck 'blacklight_configuration_sort_fields_identifier_enabled' + + find('#blacklight_configuration_sort_fields_type_weight').set('100') + + click_button 'Save changes' + + click_link 'Results' + + expect(page).to have_css("input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']") + expect(find('#blacklight_configuration_sort_fields_type_enabled')).to be_checked + expect(find('#blacklight_configuration_sort_fields_date_enabled')).to be_checked + expect(find('#blacklight_configuration_sort_fields_title_enabled')).to_not be_checked + expect(find('#blacklight_configuration_sort_fields_identifier_enabled')).to_not be_checked + + # Type is now sorted last + expect(page).to have_css('#nested-sort-fields .dd-item:nth-child(5) h3', text: 'Type') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibit_masthead_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibit_masthead_spec.rb new file mode 100644 index 0000000..aae9240 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibit_masthead_spec.rb @@ -0,0 +1,100 @@ +require 'spec_helper' + +describe 'Add and update the site masthead', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + + before { login_as user } + it 'updates exhibit masthead options' do + visit spotlight.exhibit_dashboard_path(exhibit) + + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + choose 'Upload an image' + attach_file('exhibit_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Site masthead' + + within '#site-masthead' do + expect(field_labeled('Show background image in masthead')).to be_checked + expect(field_labeled('Upload an image')).to be_checked + end + end + it 'displays a masthead image when one is uploaded and configured' do + visit spotlight.exhibit_dashboard_path(exhibit) + expect(page).to_not have_css('.image-masthead') + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + + attach_file('exhibit_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + expect(page).to have_css('.image-masthead .background-container') + end + it 'does not display an uploaded masthead if configured to not display' do + visit spotlight.exhibit_dashboard_path(exhibit) + expect(page).to_not have_css('.image-masthead') + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Site masthead' + + within '#site-masthead' do + attach_file('exhibit_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + expect(page).to_not have_css('.image-masthead .background-container') + end + it 'displays a masthead image when one is uploaded from an exhibit item', js: true do + skip "Capyabara and jcrop don't play well together.." + visit spotlight.exhibit_dashboard_path(exhibit) + expect(page).to_not have_css('.image-masthead') + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + + fill_in_typeahead_field 'document_title', with: 'Armenia' + end + + click_button 'Save changes' + + expect(page).to have_content('The appearance was successfully updated.') + + expect(page).to have_css('.image-masthead .background-container') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibits/add_tags_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibits/add_tags_spec.rb new file mode 100644 index 0000000..0a1f8b8 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibits/add_tags_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +describe 'Add tags to an item in an exhibit', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:custom_field) { FactoryGirl.create(:custom_field, exhibit: exhibit) } + + before do + login_as(curator) + end + + it 'changes and display the of tags' do + visit spotlight.exhibit_catalog_path(exhibit, 'dq287tq6352') + + expect(page).to have_link 'Edit' + + click_on 'Edit' + + fill_in 'Tags', with: 'One, Two and a half, Three' + + click_on 'Save changes' + + visit spotlight.exhibit_catalog_path(exhibit, 'dq287tq6352') + + within('dd.blacklight-exhibit_tags') do + expect(page).to have_selector 'a', text: 'One' + expect(page).to have_selector 'a', text: 'Two and a half' + expect(page).to have_selector 'a', text: 'Three' + end + + click_on 'Two and a half' + + expect(page).to have_content 'Remove constraint Exhibit Tags: Two and a half' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibits/administration_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibits/administration_spec.rb new file mode 100644 index 0000000..f4aa714 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibits/administration_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe 'Exhibit Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + let(:email_id_0) { 'exhibit_contact_emails_attributes_0_email' } + let(:email_address_0) { 'admin@example.com' } + let(:email_id_1) { 'exhibit_contact_emails_attributes_1_email' } + let(:email_address_1) { 'admin2@example.com' } + before { login_as admin } + + describe 'Contact Emails' do + it 'has breadcrumbs' do + visit spotlight.edit_exhibit_path(exhibit) + expect(page).to have_breadcrumbs 'Home', 'Configuration', 'General' + end + + it 'has a blank input field when there are no contacts yet' do + visit spotlight.edit_exhibit_path(exhibit) + expect(page).to have_css('input.exhibit-contact') + expect(find_field(email_id_0).value).to be_blank + end + it 'stores and retreive a contact email address' do + visit spotlight.edit_exhibit_path(exhibit) + fill_in email_id_0, with: email_address_0 + click_button 'Save changes' + expect(page).to have_content('The exhibit was successfully updated.') + visit spotlight.edit_exhibit_path(exhibit) + expect(find_field(email_id_0).value).to eq email_address_0 + end + it "has new inputs added when clicking on the 'add contact' button", js: true do + # Exhibit administration edit + visit spotlight.edit_exhibit_path(exhibit) + + # fill in first email field + fill_in email_id_0, with: email_address_0 + + # Additonal blank fields should not exist + expect(page).not_to have_css("input##{email_id_1}") + # click the + (add contact) button + find('#another-email').click + # An additional blank field should exist now + expect(page).to have_css("input##{email_id_1}") + expect(find_field(email_id_1).value).to be_blank + + # fill in the second email field + fill_in email_id_1, with: email_address_1 + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + visit spotlight.edit_exhibit_path(exhibit) + + expect(find_field(email_id_0).value).to eq email_address_0 + expect(find_field(email_id_1).value).to eq email_address_1 + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibits/custom_metadata_fields_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibits/custom_metadata_fields_spec.rb new file mode 100644 index 0000000..5bab153 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibits/custom_metadata_fields_spec.rb @@ -0,0 +1,74 @@ +require 'spec_helper' + +describe 'Adding custom metadata fields', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + + before do + login_as(admin) + end + + it 'works' do + # Add + + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + click_on 'Add new field' + fill_in 'Label', with: 'My new custom field' + fill_in 'Short description', with: 'Helps to remind me what this field is for' + + click_on 'Save' + + expect(page).to have_content 'The custom field was created.' + within '#exhibit-specific-fields' do + expect(page).to have_selector '.field-label', text: 'My new custom field' + expect(page).to have_selector '.field-description', text: 'Helps to remind me what this field is for' + # Edit + click_link 'Edit' + end + + # on the edit form + expect(find_field('Label').value).to eq 'My new custom field' + expect(find_field('Short description').value).to eq 'Helps to remind me what this field is for' + fill_in 'Short description', with: 'A much better description' + + click_button 'Save changes' + + expect(page).to have_content 'The custom field was successfully updated.' + + within '#exhibit-specific-fields' do + expect(page).to have_selector '.field-label', text: 'My new custom field' + expect(page).to have_selector '.field-description', text: 'A much better description' + # Destroy + click_link 'Delete' + end + + expect(page).to have_content 'The custom field was deleted.' + end + + it 'has breadcrumbs' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + click_on 'Add new field' + expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Metadata', 'Add new field' + end + + it 'lets the curator choose the type of field on create' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + click_on 'Add new field' + fill_in 'Label', with: 'My new custom field' + + choose 'Controlled vocabulary' + click_on 'Save' + + expect(page).to have_content 'The custom field was created.' + within '#exhibit-specific-fields' do + # Edit + click_link 'Edit' + end + + expect(page).to have_checked_field 'Controlled vocabulary' + expect(page).to have_unchecked_field 'Free text' + + visit spotlight.edit_exhibit_search_configuration_path exhibit + expect(page).to have_content 'My new custom field' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibits/edit_metadata_fields_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibits/edit_metadata_fields_spec.rb new file mode 100644 index 0000000..c0102a4 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibits/edit_metadata_fields_spec.rb @@ -0,0 +1,48 @@ +require 'spec_helper' + +describe 'Editing metadata fields', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as(admin) } + + it 'works' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + + expect(page).to have_content 'Display and Order Metadata Fields' + + check :blacklight_configuration_index_fields_language_ssm_show + check :blacklight_configuration_index_fields_abstract_tesim_show + uncheck :blacklight_configuration_index_fields_note_mapuse_tesim_show + + uncheck :blacklight_configuration_index_fields_abstract_tesim_list + check :blacklight_configuration_index_fields_language_ssm_list + check :blacklight_configuration_index_fields_note_mapuse_tesim_list + + click_on 'Save changes' + + expect(exhibit.reload.blacklight_config.index_fields.select { |_k, x| x.list }).to include 'language_ssm', 'note_mapuse_tesim' + expect(exhibit.blacklight_config.index_fields.select { |_k, x| x.list }).to_not include 'abstract_tesim' + expect(exhibit.blacklight_config.show_fields.select { |_k, x| x.show }).to include 'language_ssm', 'abstract_tesim' + expect(exhibit.blacklight_config.show_fields.select { |_k, x| x.show }).to_not include 'note_mapuse_tesim' + end + + it 'has in-place editing of labels', js: true do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + check :blacklight_configuration_index_fields_language_ssm_show + check :blacklight_configuration_index_fields_language_ssm_list + + click_on 'Language' + + expect(page).to have_field :blacklight_configuration_index_fields_language_ssm_label, visible: true + fill_in :blacklight_configuration_index_fields_language_ssm_label, with: 'Language of Origin' + + click_on 'Save changes' + expect(exhibit.reload.blacklight_config.index_fields['language_ssm'].label).to eq 'Language of Origin' + end + + it 'has breadcrumbs' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + + expect(page).to have_breadcrumbs 'Home', 'Configuration', 'Metadata' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/exhibits_index_spec.rb b/tmp/blacklight-spotlight/spec/features/exhibits_index_spec.rb new file mode 100644 index 0000000..9c4a3dc --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/exhibits_index_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe 'Exhibits index page', type: :feature do + context 'with multiple exhibits' do + let!(:exhibit) { FactoryGirl.create(:exhibit, title: 'Some Exhibit Title') } + let!(:other_exhibit) { FactoryGirl.create(:exhibit, title: 'Some Other Title') } + + it 'shows some cards for each published exhibit' do + visit spotlight.exhibits_path + + within '.exhibit-card:first-child' do + expect(page).to have_selector 'h2', text: 'Some Exhibit Title' + end + end + + context 'with tagged exhibits' do + before do + exhibit.tag_list = %w(a) + other_exhibit.tag_list = %w(a b) + + exhibit.save + other_exhibit.save + end + + it 'shows controls to filter exhibits by tags' do + visit spotlight.exhibits_path + + expect(page).to have_selector '.exhibit-card', count: 2 + + within '.tags' do + expect(page).to have_selector '.active', text: 'All' + + click_link 'a' + end + + expect(page).to have_selector '.exhibit-card', count: 2 + + within '.tags' do + expect(page).to have_selector '.active', text: 'a' + click_link 'b' + end + + expect(page).to have_selector '.exhibit-card', count: 1 + end + end + end + + context 'with a single exhibit' do + let!(:exhibit) { FactoryGirl.create(:exhibit, title: 'Some Exhibit Title') } + + it 'redirects to the exhibit home page' do + visit spotlight.exhibits_path + + expect(current_url).to eq spotlight.exhibit_root_url(exhibit) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/feature_page_spec.rb b/tmp/blacklight-spotlight/spec/features/feature_page_spec.rb new file mode 100644 index 0000000..30cde62 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/feature_page_spec.rb @@ -0,0 +1,124 @@ +require 'spec_helper' + +describe 'Feature page', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + describe 'sidebar' do + let!(:parent_feature_page) do + FactoryGirl.create(:feature_page, title: 'Parent Page', exhibit: exhibit) + end + let!(:child_feature_page) do + FactoryGirl.create( + :feature_page, + title: 'Child Page', + parent_page: parent_feature_page, exhibit: exhibit + ) + end + describe 'when configured to display' do + before { parent_feature_page.update display_sidebar: true } + after { parent_feature_page.update display_sidebar: false } + + it 'is present' do + visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page) + # the sidebar should display + within('#sidebar') do + # the current page should be the sidebar header + expect(page).to have_css('h4', text: parent_feature_page.title) + # within the sidebar navigation + within('ol.sidenav') do + # there should be a link to the child page + expect(page).to have_css('li a', text: child_feature_page.title) + end + end + end + end + describe 'when configured to not display' do + before { parent_feature_page.update display_sidebar: false } + context 'with a child page' do + it 'is present anyway' do + visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page) + expect(page).to have_css('#sidebar') + expect(page).to have_content(child_feature_page.title) + end + end + + context 'with an unpublished child page' do + before { child_feature_page.update published: false } + it 'does not be present' do + visit spotlight.exhibit_feature_page_path(parent_feature_page.exhibit, parent_feature_page) + expect(page).not_to have_css('#sidebar') + expect(page).not_to have_content(child_feature_page.title) + end + end + end + end + describe 'page options' do + before { login_as exhibit_curator } + describe 'publish' do + let!(:unpublished_page) { FactoryGirl.create(:feature_page, published: false, exhibit: exhibit) } + it 'is updatable from the edit page' do + expect(unpublished_page).not_to be_published + + visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page) + expect(find('#feature_page_published')).not_to be_checked + + check 'Publish' + click_button 'Save changes' + + expect(unpublished_page.reload).to be_published + + visit spotlight.edit_exhibit_feature_page_path(unpublished_page.exhibit, unpublished_page) + expect(find('#feature_page_published')).to be_checked + end + end + describe 'display_sidebar' do + let!(:feature_page) { FactoryGirl.create(:feature_page, display_sidebar: false, exhibit: exhibit) } + before { feature_page.update display_sidebar: false } + it 'is updatable from the edit page' do + expect(feature_page.display_sidebar?).to be_falsey + + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + expect(find('#feature_page_display_sidebar')).not_to be_checked + + check 'Show sidebar' + click_button 'Save changes' + + expect(feature_page.reload.display_sidebar?).to be_truthy + + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + expect(find('#feature_page_display_sidebar')).to be_checked + end + end + end + + describe 'page locking' do + before { login_as exhibit_curator } + let!(:feature_page) { FactoryGirl.create(:feature_page, display_sidebar: false, exhibit: exhibit) } + + it 'shows a lock message if someone is currently editing the page' do + # open the edit page + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + + # and then open the edit page again + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + + expect(page).to have_css '.alert' + within '.alert' do + expect(page).to have_content 'This page is currently being edited by ' + exhibit_curator.to_s + end + end + + it 'releases the lock when the lock holder cancels edits', js: true do + # open the edit page + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + + click_on 'Cancel' + sleep 2 + + # and then open the edit page again + visit spotlight.edit_exhibit_feature_page_path(feature_page.exhibit, feature_page) + + expect(page).not_to have_css '.alert' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/home_page_spec.rb b/tmp/blacklight-spotlight/spec/features/home_page_spec.rb new file mode 100644 index 0000000..158cc51 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/home_page_spec.rb @@ -0,0 +1,84 @@ +require 'spec_helper' +describe 'Home page', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as exhibit_curator } + it 'exists by default on exhibits' do + visit spotlight.exhibit_dashboard_path(exhibit) + click_link 'Feature pages' + expect(page).to have_selector 'h3', text: 'Homepage' + expect(page).to have_selector 'h3.panel-title', text: 'Exhibit Home' + end + + it 'allows users to edit the home page title' do + visit spotlight.exhibit_dashboard_path(exhibit) + click_link 'Feature pages' + within('.home_page') do + click_link 'Edit' + end + fill_in 'home_page_title', with: 'New Home Page Title' + click_button 'Save changes' + expect(page).to have_content('The home page was successfully updated.') + + within '.dropdown-menu' do + click_link 'Dashboard' + end + click_link 'Feature pages' + expect(page).to have_content 'New Home Page Title' + expect(page).to have_selector '.panel-title a', text: 'New Home Page Title' + end + + it 'has working facet links' do + visit spotlight.exhibit_home_page_path(exhibit.home_page) + click_link 'Genre' + click_link 'map' + expect(page).to have_content exhibit.title + expect(page).to have_content 'You searched for: Genre map' + end + + it 'has a search box' do + visit spotlight.exhibit_home_page_path(exhibit.home_page) + fill_in 'q', with: 'query' + click_button 'Search' + + expect(page).to have_content exhibit.title + expect(page).to have_content 'You searched for: query' + end + + it 'has tags' do + TopHat.current['twitter_card'] = nil + visit spotlight.exhibit_home_page_path(exhibit.home_page) + + expect(page).to have_css "meta[name='twitter:card'][value='summary']", visible: false + expect(page).to have_css "meta[name='twitter:url'][value='#{spotlight.exhibit_root_url(exhibit)}']", visible: false + end + + describe 'page options on edit form' do + describe 'show title' do + let(:home_page) { FactoryGirl.create(:home_page, display_title: false, exhibit: exhibit) } + it 'is updatable from the edit page' do + expect(home_page.display_title).to be_falsey + + visit spotlight.edit_exhibit_home_page_path(home_page.exhibit, home_page) + expect(find('#home_page_display_title')).not_to be_checked + + check 'Show title' + click_button 'Save changes' + + visit spotlight.edit_exhibit_home_page_path(home_page.exhibit, home_page) + expect(find('#home_page_display_title')).to be_checked + end + end + end + + describe 'when configured to not display sidebar' do + before do + exhibit.home_page.display_sidebar = false + exhibit.home_page.save + end + it 'does not display the facet sidebar' do + visit spotlight.exhibit_home_page_path(exhibit) + expect(page).not_to have_css('#sidebar') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/import_exhibit_spec.rb b/tmp/blacklight-spotlight/spec/features/import_exhibit_spec.rb new file mode 100644 index 0000000..3adb8e7 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/import_exhibit_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' +require 'tempfile' + +describe 'Allow exhibit admins to import and export content from an exhibit', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as user } + + pending 'should allow admins to export content from an exhibit' do + pending(%(There's not really any good way to test the contents of a +downloaded file with Poltergeist (which is now necessary since we've moved +the export option behind a bootstrap tab))) + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'General' + within('.nav-tabs') do + click_link 'Export data' + end + within('#export') do + click_link 'Export data' + end + + data = JSON.parse(page.body) + + expect(data).to include 'title', 'searches', 'home_page' + end + + it 'allows admins to import content into an exhibit' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'General' + + within('.nav-tabs') do + click_link 'Import data' + end + + file = Tempfile.new('foo') + file.write({ 'title' => 'A better title' }.to_json) + file.rewind + begin + attach_file('file', File.expand_path(file.path)) + within('#import') do + click_button 'Import data' + end + ensure + file.close + file.unlink + end + expect(page).to have_content 'The exhibit was successfully updated.' + expect(page).to have_content 'A better title' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/item_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/item_admin_spec.rb new file mode 100644 index 0000000..795ba62 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/item_admin_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe 'Item Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as curator } + + before do + allow_any_instance_of(::SolrDocument).to receive_messages(reindex: true) + end + + describe 'admin' do + it "does not have a 'Save this search' button" do + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + expect(page).not_to have_css('button', text: 'Save this search') + end + it 'has catalog items' do + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + expect(page).to have_css('h1 small', text: 'Items') + expect(page).to have_css('table#documents') + expect(page).to have_css('.pagination') + + item = first('tr[itemscope]') + expect(item).to have_link 'View' + expect(item).to have_link 'Edit' + end + + it 'has a public/private toggle' do + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + item = first('tr[itemscope]') + expect(item).to have_button 'Make Private' + item.click_button 'Make Private' + + item = first('tr[itemscope]') + expect(item).to have_button 'Make Public' + item.click_button 'Make Public' + end + + it "toggles the 'blacklight-private' label", js: true do + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + # The label should be toggled when the checkbox is clicked + expect(page).to_not have_css('tr.blacklight-private') + within 'tr[itemscope]:first-child' do + find("input.toggle_visibility[type='checkbox']").click + end + expect(page).to have_css('tr.blacklight-private') + + # The label should show up on page load + expect(page).to have_css('tr.blacklight-private') + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + within 'tr[itemscope]:first-child' do + find("input.toggle_visibility[type='checkbox']").click + end + expect(page).to_not have_css('tr.blacklight-private') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/about_page_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/about_page_admin_spec.rb new file mode 100644 index 0000000..a84ee24 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/about_page_admin_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +feature 'About Pages Adminstration', js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as exhibit_curator } + + it 'is able to create new pages' do + login_as exhibit_curator + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'About pages' + + add_new_page_via_button('My New Page') + + expect(page).to have_content 'The about page was created.' + expect(page).to have_css('li.dd-item') + expect(page).to have_css('h3', text: 'My New Page') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/block_controls_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/block_controls_spec.rb new file mode 100644 index 0000000..affae68 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/block_controls_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +feature 'Block controls' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as exhibit_curator } + + scenario 'should be split into separate sections', js: true do + # create page + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + + add_new_page_via_button('My New Feature Page') + + expect(page).to have_css('h3', text: 'My New Feature Page') + + expect(page).to have_content('The feature page was created.') + within('li.dd-item') do + click_link 'Edit' + end + # fill in title + fill_in 'feature_page_title', with: 'Exhibit Title' + # click to add widget + click_add_widget + + within('.st-block-controls') do + expect(page).to have_css('.st-controls-group', count: 2) + within(first('.st-controls-group')) do + expect(page).to have_content 'Standard widgets' + expect(page).to have_css('a.st-block-control') + end + within(all('.st-controls-group').last) do + expect(page).to have_content 'Exhibit item widgets' + expect(page).to have_css('a.st-block-control') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb new file mode 100644 index 0000000..a2c705f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'Featured Browse Category Block', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let!(:search1) { FactoryGirl.create(:published_search, exhibit: exhibit, title: 'Title1', published: true) } + let!(:search2) { FactoryGirl.create(:published_search, exhibit: exhibit, title: 'Title2', published: true) } + + before do + login_as exhibit_curator + + visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) + add_widget 'browse' + end + + it 'allows a curator to select from existing browse categories' do + check 'Include item counts?' + + fill_in_typeahead_field with: 'Title1' + + within(:css, '.panel') do + uncheck 'Display?' + end + + fill_in_typeahead_field with: 'Title2' + + save_page + + # Documents should exist + expect(page).not_to have_css('.category-title', text: search1.title) + expect(page).to have_css('.category-title', text: search2.title) + expect(page).to have_css('.item-count', text: /\d+ items/i) + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_pages_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_pages_block_spec.rb new file mode 100644 index 0000000..ed5a83d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/blocks/featured_pages_block_spec.rb @@ -0,0 +1,59 @@ +require 'spec_helper' + +describe 'Featured Pages Blocks', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:feature_page1) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage1 Title', + weight: 1, + exhibit: exhibit + ) + end + let!(:feature_page2) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage2 Title', + weight: 0, + exhibit: exhibit + ) + end + + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + before do + login_as exhibit_curator + end + + it 'saves the selected exhibits' do + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + + click_link('Edit') + + add_widget 'featured_pages' + + fill_in_typeahead_field with: feature_page2.title + + save_page + + expect(page).to have_content feature_page2.title + end + + it 'persists the user selected sort order' do + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + + click_link('Edit') + + add_widget 'featured_pages' + + fill_in_typeahead_field with: feature_page1.title + fill_in_typeahead_field with: feature_page2.title + + save_page + + feature_page1_position = page.body =~ /

    \s+#{feature_page1.title}/ + feature_page2_position = page.body =~ /

    \s+#{feature_page2.title}/ + + expect(feature_page1_position).to be < feature_page2_position + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/blocks/search_result_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/blocks/search_result_block_spec.rb new file mode 100644 index 0000000..3b24ddf --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/blocks/search_result_block_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +describe 'Search Result Block', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let!(:alt_search) { FactoryGirl.create(:search, title: 'Alt. Search', exhibit: exhibit) } + + before do + login_as exhibit_curator + + exhibit.searches.each { |x| x.update published: true } + + visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) + add_widget 'search_results' + end + + it 'allows a curator to select from existing browse categories' do + fill_in_typeahead_field with: 'All Exhibit Items' + + check 'Gallery' + check 'Slideshow' + + save_page + + expect(page).not_to have_content 'per page' + expect(page).not_to have_content 'Sort by' + + # The two configured view types should be + # present and the one not selected should not be + within('.view-type-group') do + expect(page).not_to have_css('.view-type-list') + expect(page).to have_css('.view-type-gallery') + expect(page).to have_css('.view-type-slideshow') + end + + # Documents should exist + expect(page).to have_css('.documents .document') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/blocks/solr_documents_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/blocks/solr_documents_block_spec.rb new file mode 100644 index 0000000..5cf9dfe --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/blocks/solr_documents_block_spec.rb @@ -0,0 +1,166 @@ +require 'spec_helper' + +feature 'Solr Document Block', feature: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:feature_page) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage1', + exhibit: exhibit + ) + end + + before do + login_as exhibit_curator + visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) + add_widget 'solr_documents' + end + + scenario 'it should allow you to add the solr document block widget', js: true do + expect(page).to have_content 'This widget displays exhibit items in a horizontal row.' + expect(page).to have_content 'Optionally, you can add a heading and/or text to be displayed adjacent to the items.' + expect(page).to have_content 'Primary caption' + expect(page).to have_content 'Secondary caption' + expect(page).to have_content 'Display text on' + expect(page).to have_content 'Heading' + expect(page).to have_content 'Text' + end + + scenario 'it should allow you to add a solr document to the widget', js: true do + fill_in_typeahead_field with: 'dq287tq6352' + within(:css, '.panel') do + expect(page).to have_content "L'AMERIQUE" + end + + save_page + + # verify that the item + image widget is displaying an image from the document. + within(:css, '.items-block') do + expect(page).to have_css('.thumbnail') + expect(page).to have_css('.thumbnail a img') + expect(page).not_to have_css('.title') + end + end + + scenario 'it should allow you to add multiple solr documents to the widget', js: true do + fill_in_typeahead_field with: 'dq287tq6352' + fill_in_typeahead_field with: 'gk446cj2442' + + save_page + + expect(page).to have_selector '.items-block .box', count: 2 + end + + scenario 'it should allow you toggle visibility of solr documents', js: true do + fill_in_typeahead_field with: 'dq287tq6352' + + within(:css, '.panel') do + uncheck 'Display?' + end + + fill_in_typeahead_field with: 'gk446cj2442' + + # display the title as the primary caption + within('.primary-caption') do + check('Primary caption') + select('Title', from: 'primary-caption-field') + end + + save_page + + expect(page).to have_selector '.items-block .box', count: 1 + expect(page).to have_content '[World map]' + expect(page).not_to have_content "L'AMERIQUE" + end + + scenario 'should allow you to optionally display captions with the image', js: true do + fill_in_typeahead_field with: 'gk446cj2442' + + # display the title as the primary caption + within('.primary-caption') do + check('Primary caption') + select('Title', from: 'primary-caption-field') + end + # display the language as the secondary caption + within('.secondary-caption') do + check('Secondary caption') + select('Language', from: 'secondary-caption-field') + end + # create the page + save_page + + # verify that the item + image widget is displaying image and title from the requested document. + within(:css, '.items-block') do + expect(page).to have_css('.thumbnail') + expect(page).to have_css('.thumbnail a img') + expect(page).to have_css('.primary-caption', text: '[World map]') + expect(page).to have_css('.secondary-caption', text: 'Latin') + end + end + + scenario 'should allow you to add text to the image', js: true do + # fill in the content-editable div + content_editable = find('.st-text-block') + content_editable.set('zzz') + # create the page + save_page + + # visit the show page for the document we just saved + # verify that the item + image widget is displaying image and title from the requested document. + within(:css, '.items-block') do + expect(page).to have_content 'zzz' + end + end + + scenario 'should allow you to choose which side the text will be on', js: true do + fill_in_typeahead_field with: 'dq287tq6352' + + # fill in the content editable div + content_editable = find('.st-text-block') + content_editable.set('zzz') + # Select to align the text right + choose 'Right' + # create the page + save_page + + # verify that the item + image widget is displaying image and title from the requested document. + within(:css, '.items-block') do + expect(page).to have_content 'zzz' + expect(page).to have_css('.items-col.pull-left') + expect(page).to have_css('.text-col') + end + end + + scenario 'round-trip data', js: true do + fill_in_typeahead_field with: 'dq287tq6352' + + within(:css, '.panel') do + uncheck 'Display?' + end + + fill_in_typeahead_field with: 'gk446cj2442' + + # display the title as the primary caption + within('.primary-caption') do + check('Primary caption') + select('Title', from: 'primary-caption-field') + end + + # fill in the content editable div + content_editable = find('.st-text-block') + content_editable.set('zzz') + # Select to align the text right + choose 'Right' + + save_page + + click_on 'Edit' + + expect(page).to have_selector '.panel', count: 2 + + # for some reason, the text area above isn't getting filled in + # expect(page).to have_selector ".st-text-block", text: "zzz" + expect(find_field('primary-caption-field').value).to eq 'full_title_tesim' + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/blocks/uploaded_items_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/blocks/uploaded_items_block_spec.rb new file mode 100644 index 0000000..3743685 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/blocks/uploaded_items_block_spec.rb @@ -0,0 +1,63 @@ +require 'spec_helper' + +feature 'Uploaded Items Block', feature: true, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:fixture_file1) { File.join(FIXTURES_PATH, '800x600.png') } + let(:fixture_file2) { File.join(FIXTURES_PATH, 'avatar.png') } + + before do + login_as exhibit_curator + visit spotlight.edit_exhibit_home_page_path(exhibit) + add_widget 'uploaded_items' + end + + scenario 'users can upload images with text' do + heading = 'Some Uploaded Images' + text = 'Take a look at these images I just uploaded!' + fill_in 'Heading', with: heading + content_editable = find('.st-text-block') + content_editable.set(text) + + expect(page).not_to have_css('.dd-list li') + attach_file('uploaded_item_url', fixture_file1) + + expect(page).to have_css('.dd-list li', count: 1) + within('.dd-list') do + expect(page).to have_css('.panel-title', text: '800x600.png') + end + + attach_file('uploaded_item_url', fixture_file2) + + expect(page).to have_css('.dd-list li', count: 2) + within('.dd-list') do + expect(page).to have_css('.panel-title', text: 'avatar.png') + end + + save_page + + expect(page).to have_css('h3', text: heading) + expect(page).to have_css('p', text: text) + + within('.uploaded-items-block') do + expect(page).to have_css('img[alt="800x600.png"]') + expect(page).to have_css('img[alt="avatar.png"]') + end + end + + scenario 'users can toggle individual images to not display' do + attach_file('uploaded_item_url', fixture_file1) + attach_file('uploaded_item_url', fixture_file2) + + within('.panel') do + uncheck 'Display?' + end + + save_page + + within('.uploaded-items-block') do + expect(page).not_to have_css('img[alt="800x600.png"]') + expect(page).to have_css('img[alt="avatar.png"]') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/edit_in_place_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/edit_in_place_spec.rb new file mode 100644 index 0000000..ef34f31 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/edit_in_place_spec.rb @@ -0,0 +1,62 @@ +require 'spec_helper' + +describe 'Edit in place', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as admin } + describe 'Feature Pages' do + it 'updates the label' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + + add_new_page_via_button('My New Feature Page') + + expect(page).to have_css('h3', text: 'My New Feature Page') + + within('.feature_pages_admin') do + expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]', visible: false) + expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') + click_link('My New Feature Page') + expect(page).not_to have_css('#exhibit_feature_pages_attributes_0_title[type="hidden"]') + expect(page).to have_css('#exhibit_feature_pages_attributes_0_title[type="text"]') + fill_in 'exhibit_feature_pages_attributes_0_title', with: 'My Newer Feature Page' + end + click_button 'Save changes' + + expect(page).to have_content('Feature pages were successfully updated.') + expect(page).to have_css('h3', text: 'My Newer Feature Page') + expect(page).to_not have_css('h3', text: 'My New Feature Page') + end + end + describe 'Main navigation' do + it 'updates the label' do + visit spotlight.exhibit_dashboard_path(exhibit) + + within '#sidebar' do + click_link 'Appearance' + end + + click_link 'Main menu' + + within('#nested-navigation') do + expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']", visible: false) + expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='text']") + click_link('Curated Features') + expect(page).not_to have_css("#exhibit_main_navigations_attributes_0_label[type='hidden']") + expect(page).to have_css("#exhibit_main_navigations_attributes_0_label[type='text']") + fill_in 'exhibit_main_navigations_attributes_0_label', with: 'My Page Label' + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + click_link 'Main menu' + + within('#nested-navigation') do + expect(page).to have_css('h3', text: 'My Page Label') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/feature_page_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/feature_page_admin_spec.rb new file mode 100644 index 0000000..961b757 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/feature_page_admin_spec.rb @@ -0,0 +1,133 @@ +require 'spec_helper' + +feature 'Feature Pages Adminstration', js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let!(:page1) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage1', + exhibit: exhibit + ) + end + let!(:page2) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage2', + exhibit: exhibit, + display_sidebar: true + ) + end + + before { login_as exhibit_curator } + + it 'is able to create new pages' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + + add_new_page_via_button('My New Page') + + expect(page).to have_content 'The feature page was created.' + expect(page).to have_css('li.dd-item') + expect(page).to have_css('h3', text: 'My New Page') + end + + it 'updates the page titles' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + within("[data-id='#{page1.id}']") do + within('h3') do + expect(page).to have_content('FeaturePage1') + expect(page).to have_css('input', visible: false) + click_link('FeaturePage1') + expect(page).to have_css('input', visible: true) + find('input').set('NewFeaturePage1') + end + end + click_button('Save changes') + within("[data-id='#{page1.id}']") do + within('h3') do + expect(page).to have_content('NewFeaturePage1') + end + end + end + + it 'stays in curation mode if a user has unsaved data' do + visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1) + + fill_in('Title', with: 'Some Fancy Title') + click_link 'Cancel' + expect(page).not_to have_selector 'a', text: 'Edit' + end + + it 'stays in curation mode if a user has unsaved contenteditable data' do + visit spotlight.edit_exhibit_feature_page_path(page1.exhibit, page1) + + add_widget 'solr_documents' + content_editable = find('.st-text-block') + content_editable.set('Some Fancy Text.') + + click_link 'Cancel' + expect(page).not_to have_selector 'a', text: 'Edit' + end + + it 'does not update the pages list when the user has unsaved changes' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + within("[data-id='#{page1.id}']") do + within('h3') do + expect(page).to have_content('FeaturePage1') + expect(page).to have_css('input', visible: false) + click_link('FeaturePage1') + expect(page).to have_css('input', visible: true) + find('input').set('NewFancyTitle') + end + end + + within '#exhibit-navbar' do + click_link 'Home' + end + expect(page).not_to have_content('Feature pages were successfully updated.') + # NOTE: get flash message about unsaved changes + expect(page).to have_content('Welcome to your new exhibit') + + # ensure page title not changed + click_link exhibit_curator.email + within '#user-util-collapse .dropdown' do + click_link 'Dashboard' + end + click_link 'Feature pages' + within("[data-id='#{page1.id}']") do + within('h3') do + expect(page).to have_content('FeaturePage1') # old title + end + end + end + + it 'is able to update home page titles' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Feature pages' + + within('.home_page') do + within('h3.panel-title') do + expect(page).to have_content(exhibit.home_page.title) + expect(page).to have_css('input', visible: false) + click_link(exhibit.home_page.title) + expect(page).to have_css('input', visible: true) + find('input').set('New Home Page Title') + end + end + + click_button('Save changes') + + within('.home_page') do + within('h3.panel-title') do + expect(page).to have_content('New Home Page Title') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/home_page_edit_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/home_page_edit_spec.rb new file mode 100644 index 0000000..70218fc --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/home_page_edit_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +feature 'Editing the Home Page', js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + + before { login_as admin } + + it 'does not have a search results widget' do + visit spotlight.edit_exhibit_home_page_path(exhibit) + click_add_widget + within("[data-icon='add']") do + expect(page).not_to have_css("[data-type='search_results']", visible: true) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/metadata_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/metadata_admin_spec.rb new file mode 100644 index 0000000..4a5d1dd --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/metadata_admin_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +feature 'Metadata Administration', js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as admin } + describe 'Select/Deselect all button' do + it 'deselects all checkboxes when all are selected' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + # No checkboxes should be unchecked + expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + within('tr th:nth-child(2)') do + click_button 'Deselect all' + expect(page).to have_css('button', text: 'Select all', visible: true) + end + # No checkboxes should be checked + expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:checked") + end + it 'selects all checkboxes when any are unselected' do + visit spotlight.edit_exhibit_metadata_configuration_path exhibit + # No checkboxes should be unchecked + expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + first_button_area = find('tr th:nth-child(2)') + within first_button_area do + expect(page).to have_css('button', text: 'Deselect all') + end + # Uncheck first checkbox + find("tr:first-child td:nth-child(2) input[type='checkbox']").set(false) + # A checkbox should be checked + expect(page).to have_css("tr td:nth-child(2) input[type='checkbox']:checked") + within first_button_area do + click_button 'Select all' + end + # No checkboxes should be unchecked + expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)") + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/multi_image_select_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/multi_image_select_spec.rb new file mode 100644 index 0000000..85ac1f3 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/multi_image_select_spec.rb @@ -0,0 +1,50 @@ +require 'spec_helper' + +describe 'Multi image selector', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + before { login_as exhibit_curator } + + it 'allows the user to select which image in a multi image object to display' do + visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) + + add_widget 'solr_documents' + + fill_in_typeahead_field with: 'xd327cm9378' + + expect(page).to have_selector '.panel' + + within('.panel') do + expect(page).to have_content(/Image \d of \d/) + expect(page).to have_link 'Change' + end + + save_page + + visit spotlight.exhibit_feature_page_path(exhibit, feature_page) + + expect(page).to have_css("[data-id='xd327cm9378']") + expect(page).to have_css("img[src='https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_thumb']") + expect(page).to_not have_css("img[src='https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_thumb']") + + click_link('Edit') + + within('.panel') do + expect(page).to have_content(/Image \d of \d/) + find('a', text: 'Change').trigger('click') + end + + expect(page).to have_css('.thumbs-list ul', visible: true) + + within('.thumbs-list ul') do + all('li')[1].trigger('click') + end + + save_page + + expect(page).to have_css("[data-id='xd327cm9378']") + expect(page).to_not have_css("img[src='https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_thumb']") + expect(page).to have_css("img[src='https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_thumb']") + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/preview_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/preview_block_spec.rb new file mode 100644 index 0000000..65fe3fb --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/preview_block_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +feature 'Block preview' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:feature_page) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage1', + exhibit: exhibit + ) + end + + before do + login_as exhibit_curator + visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page) + end + + scenario 'should allow you to preview a widget', js: true do + add_widget 'solr_documents' + fill_in_typeahead_field with: 'dq287tq6352' + + # display the title as the primary caption + within('.primary-caption') do + check('Primary caption') + select('Title', from: 'primary-caption-field') + end + + # Preview page + find('a[data-icon="preview"]').trigger('click') + # verify that the page was previewed + expect(page).to have_css('.preview') + # verify that the item + image widget is displaying an image from the document. + within(:css, '.preview') do + expect(page).to have_css 'img' + expect(page).to have_content "L'AMERIQUE" + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/reindex_monitor_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/reindex_monitor_spec.rb new file mode 100644 index 0000000..f6e1f65 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/reindex_monitor_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +feature 'Reindex Monitor', js: true do + let(:resources) do + [FactoryGirl.create(:resource, updated_at: Time.zone.now, index_status: 1)] + end + let(:exhibit) { FactoryGirl.create(:exhibit, resources: resources) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + before do + login_as exhibit_curator + visit spotlight.admin_exhibit_catalog_index_path(exhibit) + end + + it 'is rendered on the item admin page' do + expect(page).to have_css('.panel.index-status', visible: true) + within('.panel.index-status') do + expect(page).to have_css('p', text: /Began reindexing a total of \d items/) + expect(page).to have_css('p', text: /Reindexed \d of \d items/) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/roles_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/roles_admin_spec.rb new file mode 100644 index 0000000..929a3a7 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/roles_admin_spec.rb @@ -0,0 +1,49 @@ +require 'spec_helper' + +describe 'Roles Admin', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before do + login_as exhibit_admin + + visit spotlight.exhibit_dashboard_path(exhibit) + click_link 'Users' + end + + it 'informs the admin that a user they are trying to add does not yet exist' do + expect(page).to have_css('.help-block[data-behavior="no-user-note"]', visible: false) + expect(page).not_to have_css('input[disabled]') + + click_link 'Add a new user' + fill_in 'User key', with: 'user@example.com' + + expect(page).to have_css('.help-block[data-behavior="no-user-note"]', visible: true) + expect(page).to have_link('invite', visible: true) + expect(page).to have_css('input[disabled]') + end + + it 'has the appropriate status message when an existing user is added' do + second_user = FactoryGirl.create(:site_admin) + + click_link 'Add a new user' + fill_in 'User key', with: second_user.email + + click_button 'Save changes' + + expect(page).to have_css('.alert-info', text: 'User has been updated.') + expect(page).to have_css('.table.users td', text: second_user.email) + end + + it 'persists invited users to the exhibits user list' do + expect(page).not_to have_css('.label-warning pending-label', text: 'pending', visible: true) + + click_link 'Add a new user' + fill_in 'User key', with: 'user@example.com' + click_link 'invite' + + within('tr.invite-pending') do + expect(page).to have_css('td', text: 'user@example.com') + expect(page).to have_css('.label-warning.pending-label', text: 'pending', visible: true) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/rule_block_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/rule_block_spec.rb new file mode 100644 index 0000000..22ded99 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/rule_block_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'Horizontal rule block', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + before { login_as exhibit_curator } + + it 'allows the user to select which image in a multi image object to display' do + exhibit.home_page.content = '[]' + exhibit.home_page.save + + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + click_link 'Edit' + + add_widget 'rule' + + save_page + + expect(page).to have_css('hr') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/search_config_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/search_config_admin_spec.rb new file mode 100644 index 0000000..a829b3f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/search_config_admin_spec.rb @@ -0,0 +1,151 @@ +require 'spec_helper' + +feature 'Search Configuration Administration', js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as user } + + describe 'search fields' do + it 'allows the curator to disable all search fields' do + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + expect(page).to have_css 'select#search_field' + + click_link user.email + within '#user-util-collapse .dropdown' do + click_link 'Dashboard' + end + click_link 'Search' + click_link 'Options' + + uncheck 'Display search box' + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + expect(page).not_to have_css 'select#search_field' + end + + it 'allows the curator to update search field options' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Search' + + click_link 'Options' + + within('#nested-search-fields') do + expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']", visible: false) + expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='text']") + click_link('Title') + expect(page).not_to have_css("#blacklight_configuration_search_fields_title_label[type='hidden']") + expect(page).to have_css("#blacklight_configuration_search_fields_title_label[type='text']") + fill_in 'blacklight_configuration_search_fields_title_label', with: 'My Title Label' + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + expect(page).to have_select 'Search in', with_options: ['My Title Label'] + end + end + + describe 'facets' do + it 'allows us to update the label with edit-in-place' do + input_id = 'blacklight_configuration_facet_fields_genre_ssim_label' + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Search' + + click_link 'Facets' + + facet = find('.edit-in-place', text: 'Genre') + expect(page).not_to have_content('Topic') + expect(page).to have_css("input##{input_id}", visible: false) + + facet.click + + expect(page).to have_css("input##{input_id}", visible: true) + + fill_in(input_id, with: 'Topic') + + click_button 'Save changes' + click_link 'Facets' + + expect(page).to have_content('The exhibit was successfully updated.') + + expect(page).not_to have_content('Genre') + expect(page).to have_content('Topic') + end + + it 'allows the curator to select a different facet sort order' do + visit spotlight.edit_exhibit_search_configuration_path(exhibit) + click_link 'Facets' + + within '.facet-config-genre_ssim' do + click_link 'Options' + expect(find(:css, '#blacklight_configuration_facet_fields_genre_ssim_sort_count')).to be_checked + + choose 'Value' + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + exhibit.reload + expect(exhibit.blacklight_config.facet_fields['genre_ssim'].sort).to eq 'index' + end + end + + describe 'results' do + it 'updates search result options' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Search' + + click_link 'Results' + + uncheck 'List' + + choose '20' + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + click_link 'Results' + + expect(field_labeled('List')).to_not be_checked + expect(field_labeled('Gallery')).to be_checked + + expect(field_labeled('20')).to be_checked + expect(field_labeled('10')).to_not be_checked + end + it 'updates Sort field result options' do + visit spotlight.exhibit_dashboard_path(exhibit) + + click_link 'Search' + + click_link 'Results' + + within('#nested-sort-fields') do + expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']", visible: false) + expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='text']") + click_link('Title') + expect(page).not_to have_css("#blacklight_configuration_sort_fields_title_label[type='hidden']") + expect(page).to have_css("#blacklight_configuration_sort_fields_title_label[type='text']") + fill_in 'blacklight_configuration_sort_fields_title_label', with: 'My Title Label' + end + + click_button 'Save changes' + + expect(page).to have_content('The exhibit was successfully updated.') + + click_link 'Results' + + within('#nested-sort-fields') do + expect(page).to have_css('h3', text: 'My Title Label') + end + end # Sort field + end # results tab +end diff --git a/tmp/blacklight-spotlight/spec/features/javascript/search_context_spec.rb b/tmp/blacklight-spotlight/spec/features/javascript/search_context_spec.rb new file mode 100644 index 0000000..210840d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/javascript/search_context_spec.rb @@ -0,0 +1,87 @@ +require 'spec_helper' + +feature 'Search contexts' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + let(:feature_page) do + FactoryGirl.create( + :feature_page, + title: 'FeaturePage1', + exhibit: exhibit + ) + end + before { login_as exhibit_curator } + + scenario 'should add context breadcrumbs back to the home page when navigating to an item from the home page', js: true do + exhibit.home_page.content = [ + { + type: 'solr_documents', + data: { + item: { + dq287tq6352: { + id: 'dq287tq6352', + display: 'true' + } + } + } + }].to_json + exhibit.home_page.save + + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + + # verify that the item + image widget is displaying an image from the document. + within(:css, '.items-block') do + expect(page).to have_css('.thumbnail') + expect(page).to have_css('.thumbnail a img') + expect(page).not_to have_css('.title') + end + + find('.thumbnail a').trigger('click') + + expect(page).to have_selector '.breadcrumb a', text: 'Home' + end + + scenario 'should add context breadcrumb back to the feature page when navigating to an item from a feature page', js: true do + feature_page.content = [ + { + type: 'solr_documents', + data: { + item: { + dq287tq6352: { + id: 'dq287tq6352', + display: 'true' + } + } + } + }].to_json + feature_page.save + + visit spotlight.exhibit_feature_page_path(exhibit, feature_page) + + # verify that the item + image widget is displaying an image from the document. + within(:css, '.items-block') do + expect(page).to have_css('.thumbnail') + expect(page).to have_css('.thumbnail a img') + expect(page).not_to have_css('.title') + end + + find('.thumbnail a').trigger('click') + + expect(page).to have_selector '.breadcrumb a', text: 'Home' + expect(page).to have_link 'FeaturePage1', href: spotlight.exhibit_feature_page_path(exhibit, feature_page) + end + + context 'from a browse page' do + let!(:search) { FactoryGirl.create(:search, title: 'Some Saved Search', exhibit: exhibit, published: true) } + + scenario 'should add context breadcrumbs back to the browse page when navigating to an item', js: true do + visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page) + click_link 'Browse' + click_link 'Some Saved Search' + click_link 'A MAP of AMERICA from the latest and best Observations' + expect(page).to have_link 'Home' + expect(page).to have_link 'Browse' + expect(page).to have_link 'Some Saved Search', href: spotlight.exhibit_browse_path(exhibit, search) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/main_navigation_spec.rb b/tmp/blacklight-spotlight/spec/features/main_navigation_spec.rb new file mode 100644 index 0000000..a351b66 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/main_navigation_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' + +describe 'Main navigation labels are settable', type: :feature do + let!(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:about) { FactoryGirl.create(:about_page, exhibit: exhibit, published: true) } + before do + about_nav = exhibit.main_navigations.about + about_nav.label = 'New About Label' + about_nav.save + browse_nav = exhibit.main_navigations.browse + browse_nav.label = 'New Browse Label' + browse_nav.save + search = exhibit.searches.first + search.published = true + search.save + exhibit.reload + end + + it 'has the configured about and browse navigation labels' do + visit spotlight.exhibit_path(exhibit) + expect(page).to have_css('.navbar-nav li', text: 'New About Label') + expect(page).to have_css('.navbar-nav li', text: 'New Browse Label') + end + it 'has the configured about page label in the sidebar' do + visit spotlight.exhibit_about_page_path(exhibit, about) + expect(page).to have_css('#sidebar h4', text: 'New About Label') + end + it 'has the configured about page label visible in the breadcrumb' do + visit spotlight.exhibit_about_page_path(exhibit, about) + expect(page).to have_css('.breadcrumb li', text: 'New About Label') + end + it 'has the configured browse page label visible in the breadcrumb of the browse index page' do + visit spotlight.exhibit_browse_index_path(exhibit, exhibit.searches.first) + expect(page).to have_content('New Browse Label') + expect(page).to have_css('.breadcrumb li', text: 'New Browse Label') + end + it 'has the configured browse page label visible in the breadcrumb of the browse show page' do + visit spotlight.exhibit_browse_path(exhibit, exhibit.searches.first) + expect(page).to have_content('New Browse Label') + expect(page).to have_css('.breadcrumb li', text: 'New Browse Label') + end + it 'does not display any main navigation menu items that are configured to not display' do + about_nav = exhibit.main_navigations.about + about_nav.display = false + about_nav.save + visit spotlight.exhibit_path(exhibit) + expect(page).to_not have_css('.navbar-nav li', text: 'New About Label') + about_nav = exhibit.main_navigations.about + about_nav.display = true + about_nav.save + end +end diff --git a/tmp/blacklight-spotlight/spec/features/metadata_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/metadata_admin_spec.rb new file mode 100644 index 0000000..d6a9f44 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/metadata_admin_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe 'Metadata Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as user } + + describe 'edit' do + it 'displays the metadata edit page' do + visit spotlight.edit_exhibit_metadata_configuration_path(exhibit) + expect(page).to have_css('h1 small', text: 'Metadata') + within("[data-id='language_ssm']") do + expect(page).to have_css('td', text: 'Language') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/report_a_problem_spec.rb b/tmp/blacklight-spotlight/spec/features/report_a_problem_spec.rb new file mode 100644 index 0000000..731a7a8 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/report_a_problem_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'Report a Problem', type: :feature do + let!(:exhibit) { FactoryGirl.create(:exhibit) } + it 'does not have a header link' do + visit root_path + expect(page).to_not have_content 'Feedback' + end + + describe 'when emails are setup' do + before do + exhibit.contact_emails_attributes = [{ 'email' => 'test@example.com' }, { 'email' => 'test2@example.com' }] + exhibit.save! + exhibit.contact_emails.first.tap do |e| + if e.respond_to? :confirm + e.confirm + else + e.confirm! + end + end + end + + it 'accepts a problem report', js: true do + visit spotlight.exhibit_catalog_path(exhibit, id: 'dq287tq6352') + click_on 'Feedback' + expect(find('#contact_form_current_url', visible: false).value).to end_with spotlight.exhibit_catalog_path(exhibit, id: 'dq287tq6352') + fill_in 'Name', with: 'Some Body' + fill_in 'Email', with: 'test@example.com' + fill_in 'Message', with: 'This is my problem report' + + expect do + click_on 'Send' + end.to change { ActionMailer::Base.deliveries.count }.by(1) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/site_admin_management_spec.rb b/tmp/blacklight-spotlight/spec/features/site_admin_management_spec.rb new file mode 100644 index 0000000..9e3ca66 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/site_admin_management_spec.rb @@ -0,0 +1,67 @@ +require 'spec_helper' + +describe 'Site admin management', js: true do + let(:user) { FactoryGirl.create(:site_admin) } + let(:existing_user) { FactoryGirl.create(:exhibit_visitor) } + + before do + login_as(user) + visit spotlight.admin_users_path + end + + it 'displays the current admin users' do + expect(page).to have_css('td', text: user.email) + end + + it 'allows for existing users to be added as site adminstrators' do + expect(page).not_to have_css('td', text: existing_user.email) + click_link 'Add new administrator' + + fill_in 'user_email', with: existing_user.email + click_button 'Add role' + + expect(page).to have_content('Added user as an exhibits adminstrator') + expect(page).to have_css('td', text: existing_user.email) + end + + it 'allows non-existing users to be invited' do + click_link 'Add new administrator' + + fill_in 'user_email', with: 'not-an-existing-user@example.com' + + expect(page).to have_content('This user does not yet exist. Would you like to send them an invite?') + + expect { click_link('invite') }.to change { ActionMailer::Base.deliveries.count }.by(1) + + expect(page).to have_content('User has been invited.') + end + + it 'allows the admin to remove the admin role from the user' do + click_link 'Add new administrator' + + fill_in 'user_email', with: 'not-an-admin@example.com' + + click_link 'invite' + expect(page).to have_content('User has been invited.') + + expect(page).to have_css(:td, text: 'not-an-admin@example.com') + + expect(page).to have_css(:a, text: 'Remove from role', count: 2) + within(all('table tbody tr').last) do + click_link 'Remove from role' + end + + expect(page).to have_content 'User removed from site adminstrator role' + expect(page).to have_css(:a, text: 'Remove from role', count: 1) + + expect(page).not_to have_css(:td, text: 'not-an-admin@example.com') + end + + it 'does not provide a button for users to remove their own adminstrator privs' do + click_link 'Add new administrator' + + expect(page).to have_css('td', text: user.email) + # There are two users, the original site admin and our admin user so only one button + expect(page).to have_css(:a, text: 'Remove from role', count: 1) + end +end diff --git a/tmp/blacklight-spotlight/spec/features/site_masthead_spec.rb b/tmp/blacklight-spotlight/spec/features/site_masthead_spec.rb new file mode 100644 index 0000000..d41b623 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/site_masthead_spec.rb @@ -0,0 +1,85 @@ +require 'spec_helper' + +describe 'Add and update the site masthead', type: :feature do + let(:user) { FactoryGirl.create(:site_admin) } + + before { login_as user } + + it 'updates site masthead options' do + visit spotlight.edit_site_path + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + attach_file('site_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The site was successfully updated.') + + visit spotlight.edit_site_path + click_link 'Site masthead' + + within '#site-masthead' do + expect(field_labeled('Show background image in masthead')).to be_checked + end + end + + it 'idempotently updates the site masthead options' do + visit spotlight.edit_site_path + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + attach_file('site_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The site was successfully updated.') + + visit spotlight.edit_site_path + click_link 'Site masthead' + click_button 'Save changes' + expect(page).to have_css('.image-masthead .background-container') + end + it 'displays a masthead image when one is uploaded and configured' do + visit spotlight.edit_site_path + + expect(page).to_not have_css('.image-masthead') + + click_link 'Site masthead' + + within '#site-masthead' do + check 'Show background image in masthead' + + attach_file('site_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The site was successfully updated.') + + expect(page).to have_css('.image-masthead .background-container') + end + it 'does not display an uploaded masthead if configured to not display' do + visit spotlight.edit_site_path + + expect(page).to_not have_css('.image-masthead') + + click_link 'Site masthead' + + within '#site-masthead' do + attach_file('site_masthead_attributes_image', File.absolute_path(File.join(FIXTURES_PATH, 'avatar.png'))) + end + + click_button 'Save changes' + + expect(page).to have_content('The site was successfully updated.') + + expect(page).to_not have_css('.image-masthead .background-container') + end +end diff --git a/tmp/blacklight-spotlight/spec/features/slideshow_spec.rb b/tmp/blacklight-spotlight/spec/features/slideshow_spec.rb new file mode 100644 index 0000000..81b4726 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/slideshow_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'Slideshow', type: :feature, js: true do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + + before do + login_as user + exhibit.blacklight_configuration.update(document_index_view_types: %w(list gallery slideshow)) + end + it 'has slideshow' do + visit spotlight.exhibit_catalog_index_path(exhibit, f: { genre_ssim: ['map'] }) + expect(page).to have_content 'You searched for:' + within '.view-type' do + click_link 'Slideshow' + end + find('.grid [data-slide-to="1"]').trigger('click') + expect(page).to have_selector '#slideshow', visible: true + end +end diff --git a/tmp/blacklight-spotlight/spec/features/tags_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/tags_admin_spec.rb new file mode 100644 index 0000000..54d2ed2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/tags_admin_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe 'Tags Administration', type: :feature do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:tagging) { FactoryGirl.create(:tagging, tagger: exhibit) } + let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + before { login_as exhibit_curator } + + describe 'index' do + it 'has tags' do + visit spotlight.exhibit_tags_path(exhibit) + expect(page).to have_css('td', text: tagging.tag.name) + end + + it 'links tags to a search' do + visit spotlight.exhibit_tags_path(exhibit) + click_on tagging.tag.name + expect(page).to have_content "Remove constraint Exhibit Tags: #{tagging.tag.name}" + end + end + + describe 'destroy' do + it 'destroys a tag' do + visit spotlight.exhibit_tags_path(exhibit) + click_link 'Delete' + expect(page).not_to have_css('td', text: tagging.tag.name) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/features/user_admin_spec.rb b/tmp/blacklight-spotlight/spec/features/user_admin_spec.rb new file mode 100644 index 0000000..e4cdb49 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/features/user_admin_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe 'User Administration', type: :feature do + let!(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + before { login_as user } + describe 'index' do + it 'shows the users for the exhibit' do + visit spotlight.exhibit_roles_path(exhibit) + exhibit.roles.each do |role| + expect(page).to have_css('td', text: role.user.email) + expect(page).to have_css('td', text: role.role.humanize) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/fixtures/800x600.png b/tmp/blacklight-spotlight/spec/fixtures/800x600.png new file mode 100644 index 0000000000000000000000000000000000000000..0a4abfd9d19e187ffcdf6289b18c58f756655550 GIT binary patch literal 2200 zcmcgtiB}R>7pJerR&}O131yS|HRg$g0pv>KA zES1GQa08q)Qgfj)Gd0veC2>U&MMOU6kC=DPJMWzL?tAy%-~HX+%evy>q<-Mo0RRA? z?&55J6#&?+3jqAbZ_jS!PK00iW#yuM#m&c|zrQ~}KcB^7H8eC-R8*9dlr%Rtv)ODi znf!8ZNxaf*f1I=b9RT3qkE*!~P*ef}0QQ}9vA6R{99!hNd!Ot+3JBi+JumaO0IO^i z?@fHO#jk=)o@+PBs-(Mjp)Uz7Dp&Yp<+tFe{Ejpm**viPd*SRh`pMz0DfVW}Y6P0w zvPl_cBby2(S`d+Ufz*s&YZ7TljMGxAQJLk={P@7IjMZR-m41mWJ8P-| zck@NWVCB8#L`u#gyN-~vmsq_B4`yVeq=8u>D>nk&3{lx2*hrX*JIviuN=Hypa)gcd zjpK}hz0YFsy)Lp7?#lw)7Vib3K7*Ri{}xWc`JOYLJiNzs>CU@i+XhKf7#^C71M>Bx z>y+AcBW4TpY4;qvX=k+I!~k1A{pGqM{fmToRq2meum=OMjCqE=sI_I-9ExDnv|br|Na+@1l%z={Q%;{HmHyJ& zfqk)sS0rwq$B#73N(bH=Dl7P@e#3oj$idA0dK4wzxUll47lOCFom*xlZ@IKp&%hfX zhAwab!x#XMgE1*#JDj0eq#)p?iHX^~9WZSCCWx<>0sFFZ@ zr`pkG;G(Lc-(C1zDJcf4Ker4+bya$@Lz0yiMIj)I99`q0nI6^6(*eUq@5?Si= zt4$4yi8gLPrqADoS_v<~)oqh4HMO4^nI3`@609S}mY@`{i}mV~T5BDe@i&S{S;i*0 zvLbSK2PmlkB`lE;vzNczyl3J{HZIVOIyRknt_f-0BOHs>7Ig5G(Ktv^k-M#b+OgE0 zrZ(AGXn(1rtEU`8!TMf9RAkCA!}j1EX~JnMGAr)5dC_`bE1%6+CX=4hsJ}Iq1sJm={)_HfhMr&ynF8*Y z1_#qD#TH=0v2e)E=yzVYoHPBx@WqUT;i>H`@F=R=WUhz<#>nQu{ZS_Mp`d`Us`2pA z(5AJrt-r{;>gT7tK*>U!K_t2CfcOH6kQ;*|`qadlA5!xuO|W#{Y2~z16M`17%_f7l z)YaO#ZA=d%4Iy`m$UR|i0KEJ4@~NcMjPT?P(e~6|YtV&|f)*v|{VS*j=@6HIUJeo~VDvh0T@9l<64_}jfm=3ej6v-dfW`&sDw;k|xbQ~>mT1~C`7#iod z2x5&PE59{keookZg0 zFc_&KVkr(-BSC)?PA|GwJYobPhl!HRF1AJ6LX$YDtlAk$HFr(^Fi$0QpZe&lv#7FI zrdx4#JsW zjo%3tL+4Yp-5cQLWdQWzDylE%!_f>kQu=ks+`gu9RWuP4hma-wB`Kl3MUt6%mD z1{hfJ&+TD-RX^p%V=C*x9YofLMaBhW)+7{MGL1l5Yk>d!*vIcw%HsVQs%NTzS8o)2 z+}t@Jc(rSy^%J__gO5$>CWr}2_$>E*A96JJ9QTGqq%cXFh8S9`QVJ319>^4A2+yj5p?FeA%U3E+*NHyc-O_@`hF1FryI+H#y==B0j~q}D24 zcxUNk@67MRi3H0N3LUIWw6Ve`9==K(Zcfa_D;cekyk^4j%TkmxAy89~f98 ACIA2c literal 0 HcmV?d00001 diff --git a/tmp/blacklight-spotlight/spec/fixtures/avatar.png b/tmp/blacklight-spotlight/spec/fixtures/avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..148e81240c1b1c9d6c6f5516762871c23c4e3037 GIT binary patch literal 6943 zcmb_gWmr^gw;o`Cp+iubp+O|1a~K*V6$J)(>5duchM`fql^O);E-5J`1!h2`Tcwqh zlsNOg-*>+6J=ghj&UMbduD$oO*R$$gKi2)M{X$~oU7Zv_A#z3Zf`tgor84A%ER*gLt}0RS2=GK>g~4TkULn?3;%2~gtjy^&N5$Y7{= zx^2n9iK9fsM)~x|P+_=>qAEUrJ8|Kb2>?dI{t}<6ZYBnw*6xo7v-*X`_ z*;r>NI@fbUVH2%w572LNAc=ZiMh$?4%RRP5Qiwv>QZxeqyihWID~<-~Hl_X8SjvN> zqZk&$%(QU#hjI<{`B7z6~ErE$=#<3P6}10rDlN<<-q^%Wp$ zAW|c9^(p;y>Z&dMyUckN^#<@MK2qDRQMDYvtMOIzSh`#|F`Uxc1t&`g=_lLAk}D>0 z?<-3zkFA}Za+OBZtk^}2RQWBHsQ&}*oIIImyEcueA0rrA`-aUc)cW~KY6c$*vofoM zb2hK=lT^_vQ*Sk&I-v62kh`LXu~grEO4O!j@hNo>j}8-^sPzhF*seDlhXBC4+7KMU z7Tv5u|23X&pUQRQu4eEXd4>TD$xD{r;ldw7Dd&z5p&21(n$p8?B{gfoJGRjYU#t0o zZo#o@+R8~ZZ&e3}{R*ouu4aW}X~BD=W3j|6^`ZL71H_EYR4+KVa>>|2ve=K3(&sF9 zU~NVIR)$RP(j#R0%>A7v!bB_{X;_t1Nt-rfd};X#62j=L+IWsR8mtG;nAC$-B*UEO+dcS z%R%Mp1b)QscWYh*uEPC5K>@w?akAe8i$b*fCmz2DQL(TFPoNwn1|sla4j;I2uex`; z0;%(<+d)a786x?}1u)&|ktLcsI=p_=y7!J#ddiCEMN}c`m8c@`R#?al#~hdPe%E8h zMY;x`p5W)cL#!Ty^sU@=eLt3>Q%%T^h@dA>I1&sZdc)?Wf;XWWPf5~u*IiAHQh^ir zLWMe+larPTY;DWZ0OV8sluT?(_$1;gkx5yX<6g4hcZnm)ZRKS!>M?0?VMUpQbG)uf z-eZIqU4mL^QMn_z3G(h6{)q%f+IEU+b-kjj@m)uXOKRpm0C&#YasDthu4Ac zj2E%KzJ9X)$M@2q^OpyfjeS}8(jvw%_G&{_ z>+Sl4;b&(@2S*A=R@yCMLt;f@v#2QI4B`{wCE{9|b(#d4PFe@vyS$nFEQaq3XKOi2 zZL9j8Sn~_$S3H#|@iK7Ie_i8R#8i`8{9ehw_6UD{^FAl74Xpxg&7+i0x*4MPleX!W zkmy3sEv>DNEr;#S3YBMfrodBPQ%|O@E0`pC%bG?@Q#1cG+INIrMGP7x1jssBSZnZJuu?X!dTxYl@oBX~H<3?FxIn z_xkKTy`B4Id$M>pVC%?xW;_3LaPL!_08!D`jIXOlapVO$q4M?18_Qo z@h;EEcnQ!1d<46sCZq(U-ek&ToAlER%MVjUJtQ89&Rc%5|J6I&Cx!MacaJ#qyyKk) zPQy(zNee6yGtir4n!G>hVy`0V&`8=SV4t^9))wKP?O%LBOY-HzL^z_pzt9EODtrXk z8(BdlDNvrdoOzMioJmnlXUJw4Wk_aN%gvyxo!e?}z0il4CZB#i-BGnaUpA}#j<3n7 z!QaLOK2l%Z)M>BYc-&&@IOBLWzx*NJp?m5k6K{#_i&eRD+(#pI9`zKPJR4Nn8-vtI z`_deA1)2)YpNr|BGz&7j+s@>B@qK42doy6@L`YJrg|wv;j^TN&{Z(gPe7nA*OLieR zCNPO`l4IDWLp`Z9pJ$=*({V~x*u5E-mKjlm=)Tu}@N#WXRj>*~Js47F20Mn0b-h9$ z5ibxisFxP;7EvpBp~1ILZ%uB)05QlmoUyRTp4A@lFv*Cf2q{HzMZB~;ZVYOXL7Oa* zxCRtLW6i=&>_n`p%o9^X)_KpKh8yGpB3x5kbNRTh{z~P$%GJXtDK6_r>*=K_5-G>* z3x!*cMT<_=I+IRcn9~MJ4v48SO;T6V$qKyVK2^>|n8D2SuKLa|4zsAm?wk`Pym;F; z+qd*0!r;231~o4`W@U2N#5k!_g2@lDir$DHrRTA~kG93g<*I1B)SA!v6~&CMv8LcA zJqqC zR`VOkk6#;Y9mRuvuX^5>>cV)*s@-q`*a#I~?>QVotz3Kh05n}YqxbFF@_QRRA3_gBYL+P6N_Uu-Z zy2}9ujQEt@Cp&z*q?zcNYKuWLqlUeu%h$U?=?hti1?U`jdA#wVt<5*?k2;l-!Q~p2 zt>)VX{+5l?8|yg=u50k^<(=kcc+Tm&&u*xe)`CMhQ?=t}t{+gc)l5Q58AuHDj-kILA;`)0Ixny;GKAp(=Huo=3io#VSu ze!RDtWbwT7`H#Zm{%Ebltepks`6P3n)}W@3^+h)?Co=|gv(P0qnt$+g$am;joOA~4 znT$7U&3vr!U5agU-`!}+k#A{j$zMUgzrNJH$$Qfgw@0;?v1rt8aRc2|oa!FE@h%vw z-|SOfiTRmS$g&hX>VI{lxtAu?sjBCsH-g%RRQkhzU-_XzEjHuIg#s*yEyz#q-IiZ% zZWxu+CSI+d82yG`LHAuIcGo2Nm!01)9iwml7_sbIjW~nt$3W79zMLCh4__E8Y_?)B z(e}Y?!E@(RKU^kTRuN~>jnOetu2iN0G(DEe22TKfjf4ObTshgEKqgg1pW9So_72fU zROdVoI*K&=sgUyKfW8N~U|{~^cOUG54{5u&2KOC>kn?j1%~ZoW^^F<*g&#~w*S;Mb zn7RQpbO1rLWE2!`^ei{+B&nTbP|w64%RE%ATG=A3?F9YYo@2EE069My?9$E7 z%L?r0<_h~BS#%tz4 zr5sfBK7W%_T;@wkF&b$V-Ht~;0*&_)FvPYo->Swf-@V_lMVqBnq37bC@hElVbIVz+ zDQ*Aa&CN})8WI3Z1q-88_#J^jaPl4KxD+msnjKkiM}%7^3=lp*2u`NN0p=w?bRq^) zia`Kjks$C^WW1&U7+G+L1L9NxDDv29XXD}k6DXiyHe8Slo6Tn$5ZEyYfJ;OL9Vens zD}h?pZ-Y##*InJ*1WZkw?c(C%E=sqx9YY_6<>cgOqjq-{ecats$Osf(l3>84DdG7! zIU^Dh^K+M%YVYdmgz?+gCm|^*ny_4LxT{G|4PFJ25<~>i?4A9-5c|EihqhZ+ zPnaeliJKc9MsaLE%M()?XLud_P-|!j?t4CG&-_P53)g|{&cVq9py1^A@NnY5GZ$tx zG6P2-8YU-0)&+FU#~HkvaqJ`d-gn=+K-d?&?pc_J%wA-!Epo?>e4Ay$Wk}$9%8bEa zVq_O)I1*+q{T&=6QTCxXSA(%-;!j+7-tUN?n0*o=`T{@Q+gl#WhFOOkZ?vqIU48A3 zTZ@J{yuFIWmv$1vS*qDN37E48y*`PIP}|i*g|JdJe_~|{D)%~*by9SRP?9euQRO)P z{P_vw+Gp2+UP*p;YU&vroOdT%9oi^*5f6XtR8s1RpD-H}6LXQi@FWFu&f(p?Qt7pm z_bc7>?6uo?HY~bcabSLV8BNBsmY<(*2+?UcVKZmNt>MT*uHQS#^XbT|eRFnt+E7$f z^nTJ;+^{Q1+uBzVV!Uo5Gq+$EfIA8iE6g`!w3N^om6erkdo|VZiSk*kziV*pOb+sd z>LM*j9by|1r0p*_M7SRJEGjglt-_*e%lDU5DcKIJx<`C$dZ?;EeBx|>h5wJ;*>CFVfecj(SQo72W(d8 zYXz{fcD*t(;p&uMNMyK>{fn8~Ru^~e93;YbA*J%8f|MU+?bjo=i_~Cr?`5{e+`e9p znGMiQ^5ddobprVeV@Jvyz32RDTZkF3%A!>f+Qq^8D@(J%y`bTX=?BAN@JOE=yZNcpk5Wb09}cx2{jY$FL$0P@gL*KYo2NI8*X9}S zz-vi2hX*7I>GsDjO0|0Cmx-pEr#JY}@cP;<$Tk5N0I^R88tkx|-kcVq!x{EllK)LXLx34H+REt&21iZ&*_ z63Urrt?jQ{dp5uuKh9FDsr2mTt;jN$bOI7e-!Wk63%n+Ei0duDIFhU40j*mehLh8Y zr_*%2QFdb&&<5L^a%|PX{=%zC#dfcK#_5zf1W>w zn=(%%to=7AJih_&xj*QsCP2|hGiN2dC!Gkq#fP_XL|K*!ND4933>-yt2LG1$eXyo{ z6SDcRp8@6VgANntxxNE1d&S zX{`%te?=xu8Jh?QuX!=tB*FPFsZO!<{8sN{9uD6e>ohHiMqtOHczuVD+e&AkQQEwI zf-#Y>(x9{S4p|rg2gr<6q6S)XAq#ApnNFgiNI*C_l#K|to*Ft{Z;}|G42A*}2@8^e zVa8Yh#scb{Y?N45!PD0WhgM;$QI%P=ObMcdj^prhDuNBM)M7aD7y$xe2?#)w3Z~@8 zMyOmblLX=d&s{13=`hYi-FlBNODMe~-FjgmwJqVSPX_*_#?s&48@S5x0Oj-b?AqS* zRLVIU(>5xN_qz^-LA|hXyts=#Q1Wsk3*zRI@xr#S?z3OT-vee!0;^ua*tV=CGBysT zF&?c;Zj~OzIYuvkkBiq!Bd)7nu(8(?aCm(ucza1%2c&E&R%F6W!7^wHWAcu24;Ex5 zfjdY=7oeyPhgMMFXaN*W8T!~LrLk$Z;gmyw4{(5PPLwgw@7Nsv$4-#l?;6DH={BoT z>#H3KsPEM%EA#kqE5VG?BW#XC{=1ugx}X3#)F%)BG&}zSL^B8}>ps$WATDITWI(DeC7xaI~@&5(r|H6r5ZUF)g_ec|X@IVDFQ(o4Eh7OvB_%dn@c}o!icghwn^F zgqN~>IjNFSkdqrdJv}|*OAGjBUYo_}?CWbZ2Lu6$T2oA|r@c&N7mm0Xe>hfqS**VM zfl1_%RkAQMi?91kF#Gf8Pn+zo>gwtj7xVKbr$_4}gWG2|Z0wW=AjfP0ixdnm6BCo% zA%AG&)S2pjs=|pFOwnb@8ow(4*ZH|(Phx?@P*?Ep%(DiDv6hyWIbP4_QV_NRDj0;_ zB1K`?_bNg7;#DWB0Be;8Sss?9r==7WMkFLzr-x(|AP{uvl8>)xp`p;iPoGA^%8c5$ zrinKR39Jes-v2`mAf9d_LrO7B0QI~8tLehz3%+R1~GKC@i#_8Ev zrD?sHC%v{dGk<#qc zXQg`GN%83Wq0bMvJa^$nKG}nB@dchUBy=npagcKDTwhy|l+I{rX|=VATUS;kMs84z zYgBDFF7%(4&LqaFZD3HhbX1K;iAfZw#Sb1UucsgSE0W~G#a&&S)af3TW!w99Ec8wU zycOob_PO!0D)GjWIiIDf!s`&kIp^1p$K+wPx&q}?;deW$t1XTm&+zbB?LOAmY0kRzOx~z8|>mV&8p~K;6Vp%QrbSl@+AZ+11s1Id=v^ zqg0{0j!W4xva;1)k{xBK33r;HTN2?C4}Li{XC9Y^G==1&P$QT)%M@}PdCo$I#^%K7 zJC@HNVo#z&IPl$ihrr&VFRNMIL2@zBhNKV(A+8-;GBI|dc**5N2#m(g6!8D$OmVJ2 YvJegY^vUt#p989 + + cartographic + map + Digital Maps + Early Maps + 44 + + L'AMERIQUE + + + chez l'auteur sur le quay de l'orloge, pres le palais, avec privilege de sa Maiesté, pour 20 ans. + + Paris + + 1669 + + + 1 of 4 maps as part of title cartouche: 4.5 x 4.9 cm. on sheet 41 x 54 cm. + + + + creator + + Duval, P. (Pierre), 1619-1682 + + Dedication: A Monseigneur le Dauphin, parson tres-humble, tres-obeifsant, et tres-fidele serviteur, P. DvVal Geographe du Roy. + California as an island with rounded northern coastline, with suggestion of sea passage to its north and large landmass to its northwest. + On sheet: 52 playing cards (uncut), each describing a geographical region. + Engraved by: Cordier sculp. (within sheet title cartouche). + Sheet title cartouche is as follows: "L'AFRIQUE" map, identified crown and shield of "Monseigneur le Dauphin", "L'AMERIQUE" and "L'EUROPE" maps, title: LES TABLES de GEOGRAPHIE, reduites en vn IEV DE CARTES, and "L'ASIE" map. (top center of sheet). + Par P. Dv-Val Geographe du Roy. + None found. + + America--Maps + + + California as an island--Maps + + + + indeterminable. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQUE + full_title_tesim: + - L'AMERIQUE + sort_title_tesim: + - L'AMERIQUE + sort_title_ssi: L'AMERIQUE + personal_name_ssim: + - Duval, P. (Pierre), 1619-1682 + personal_name_tesim: + - Duval, P. (Pierre), 1619-1682 + personal_name_ssm: + - Duval, P. (Pierre), 1619-1682 + origin_place_term_ssim: + - Paris + origin_place_term_tesim: + - Paris + origin_place_term_ssm: + - Paris + origin_date_created_ssim: + - '1669' + origin_date_created_tesim: + - '1669' + origin_date_created_ssm: + - '1669' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - 'Dedication: A Monseigneur le Dauphin, parson tres-humble, tres-obeifsant, et + tres-fidele serviteur, P. DvVal Geographe du Roy.' + - California as an island with rounded northern coastline, with suggestion of sea + passage to its north and large landmass to its northwest. + - 'On sheet: 52 playing cards (uncut), each describing a geographical region.' + - 'Engraved by: Cordier sculp. (within sheet title cartouche).' + - 'Sheet title cartouche is as follows: "L''AFRIQUE" map, identified crown and shield + of "Monseigneur le Dauphin", "L''AMERIQUE" and "L''EUROPE" maps, title: LES TABLES + de GEOGRAPHIE, reduites en vn IEV DE CARTES, and "L''ASIE" map. (top center of + sheet).' + - None found. + note_Statement of responsibility_tesim: + - Par P. Dv-Val Geographe du Roy. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n indeterminable.\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n indeterminable.\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '44' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '44' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - dq287tq6352_05_0001 + content_metadata_first_image_width_ssm: + - '14890' + content_metadata_first_image_height_ssm: + - '11013' + content_metadata_image_file_name_ssm: + - dq287tq6352_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/dq287tq6352%2Fdq287tq6352_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/dq287tq6352/dq287tq6352_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/dq287tq6352/dq287tq6352_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/dq287tq6352/dq287tq6352_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/dq287tq6352/dq287tq6352_05_0001_full +- :id: jp266yb7109 + :druid_ssi: jp266yb7109 + mods_xml_ssm: + - | + + + + Clüver, Philipp, 1580-1622 + + creator + + + cartographic + map + Digital Maps + Early Maps + 194 + + AMERICA + + + 1720 + 1729 + + + 1 map : hand col.; 13.5 x 17.1 cm.; 14.9 x 18.4 cm. including border. + + From Eptiome Geographiae Cluverianae Nova...Phillippi Cluverii? 1727 + In Latin. + None found. + California as an island with indented northern coast and narrow center. Regio Incognita and Terra Iesso to north. Nova Guinea, Quiri Regio and many islands in Pacific. + Title cartouche with features copied from Visscher and de Wit. Includes snake above placque, standing native pointing to stacked gold and kneeling figure (bottom left). + 'pag.642' above map (top right). + + America--Maps + + + California as an island--Maps + + + + [ca.1:150,000,000]. [S.l. : s.n.], [172 + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICA + full_title_tesim: + - AMERICA + sort_title_tesim: + - AMERICA + sort_title_ssi: AMERICA + personal_name_ssim: + - Clüver, Philipp, 1580-1622 + personal_name_tesim: + - Clüver, Philipp, 1580-1622 + personal_name_ssm: + - Clüver, Philipp, 1580-1622 + origin_date_created_ssim: + - '1720' + - '1729' + origin_date_created_tesim: + - '1720' + - '1729' + origin_date_created_ssm: + - '1720' + - '1729' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - From Eptiome Geographiae Cluverianae Nova...Phillippi Cluverii? 1727 + - In Latin. + - None found. + - California as an island with indented northern coast and narrow center. Regio + Incognita and Terra Iesso to north. Nova Guinea, Quiri Regio and many islands + in Pacific. + - Title cartouche with features copied from Visscher and de Wit. Includes snake + above placque, standing native pointing to stacked gold and kneeling figure (bottom + left). + - "'pag.642' above map (top right)." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:150,000,000]. [S.l. : s.n.], [172\n (W 160° --E 20°/N 90° + --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:150,000,000]. [S.l. : s.n.], [172\n (W 160° --E 20°/N 90° + --S 90°)\n " + identifier_tesim: + - '194' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '194' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - jp266yb7109_05_0001 + content_metadata_first_image_width_ssm: + - '4996' + content_metadata_first_image_height_ssm: + - '3922' + content_metadata_image_file_name_ssm: + - jp266yb7109_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/jp266yb7109%2Fjp266yb7109_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/jp266yb7109/jp266yb7109_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/jp266yb7109/jp266yb7109_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/jp266yb7109/jp266yb7109_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/jp266yb7109/jp266yb7109_05_0001_full +- :id: zv316zr9542 + :druid_ssi: zv316zr9542 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 81 + + AMERIQUE SEPTENTRIONALE + + + 1684 + + [Franckfurt] + + 1684 + + 81-02 + + 1 map : 14 x 10.7 cm.; 15.4 x 11.4 cm. including border. + + + + creator + + Manesson-Mallet, Allain, 1630?-1706? + + At page top, above map: das Mitternächtige America. Fig: 8. Barania R is unlabeled. With French title inside border and German title outside border. + California shown to 40 deg. N. and labelled I. Californie. + LC 3447, 4280; BN Manesson-Mallet I A(624) & I B; Faupel's Americana 90/81 & 91/54. + Issued in his German edition: Beschreibung des ganzen Welt-Kreisses ..., V, Franckfurt, 1684. Also issued in his: Beschreibung des gantzen weltkreises …, J. A. Jung…Frankfurt am Mayn 1719. + + California as an island--Maps + + + North America--Maps + + + + [ca.1:80,000,000] + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERIQUE SEPTENTRIONALE + full_title_tesim: + - AMERIQUE SEPTENTRIONALE + sort_title_tesim: + - AMERIQUE SEPTENTRIONALE + sort_title_ssi: AMERIQUE SEPTENTRIONALE + personal_name_ssim: + - Manesson-Mallet, Allain, 1630?-1706? + personal_name_tesim: + - Manesson-Mallet, Allain, 1630?-1706? + personal_name_ssm: + - Manesson-Mallet, Allain, 1630?-1706? + origin_place_term_ssim: + - "[Franckfurt]" + origin_place_term_tesim: + - "[Franckfurt]" + origin_place_term_ssm: + - "[Franckfurt]" + origin_date_created_ssim: + - '1684' + - '1684' + origin_date_created_tesim: + - '1684' + - '1684' + origin_date_created_ssm: + - '1684' + - '1684' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 2_tesim: + - 'At page top, above map: das Mitternächtige America. Fig: 8. Barania R is unlabeled. + With French title inside border and German title outside border.' + note_[]_tesim: + - California shown to 40 deg. N. and labelled I. Californie. + - LC 3447, 4280; BN Manesson-Mallet I A(624) & I B; Faupel's Americana 90/81 & 91/54. + - 'Issued in his German edition: Beschreibung des ganzen Welt-Kreisses ..., V, Franckfurt, + 1684. Also issued in his: Beschreibung des gantzen weltkreises …, J. A. Jung…Frankfurt + am Mayn 1719.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca.1:80,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1:80,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '81' + - 81-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '81' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 81-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zv316zr9542_05_0001 + content_metadata_first_image_width_ssm: + - '2565' + content_metadata_first_image_height_ssm: + - '3671' + content_metadata_image_file_name_ssm: + - zv316zr9542_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zv316zr9542%2Fzv316zr9542_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zv316zr9542/zv316zr9542_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zv316zr9542/zv316zr9542_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zv316zr9542/zv316zr9542_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zv316zr9542/zv316zr9542_05_0001_full +- :id: vw323gf4937 + :druid_ssi: vw323gf4937 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 3 + + AMERICA with those known parts in that unknowne worlde both people and manner of buildings Discribed and inlarged by I.S.Ano.1626 + + + by G. Humble + + [London] + + 1626 + + 3-01 + + 35.2 x 43.7 cm., 39.5 x 51.2 cm. including border. + + + + creator + + Speed, John, 1552?-1629 + + Separate Map + 1626, "Are to be sold in pops-head alley against the Exchange by G. Humble, 1626". Issued in his: A prospect of the most famous parts of the world . -- London : G. Humble, 1627. Reissued in the 1631 edition with no changes to map but changed text on verso. Reissued 1646, 1650-54. + 1662, with the town of Boston in New England, Connecticut, Maryland and Long Island are added to the plate and a dotted boundary placed round Delaware and Hudsons Rio. The text on verso has unchanged content but the type is reset and now commences with a historiated capital A, a new fleuron heading and the page number 9 restored top right. + 1662, with imprint changed from G. Humble to: Are to be sold by Roger Rea ye Elder and younger at ye Golden Cross in Cornhill against ye Exchange. + [1676], "are to be sold by Thomas Bassett in Fleet Street, and by Richard Chiswell in St. Paul's Churchyard." The text on verso is rewritten and there is no fleuron heading. Map is still dated 1626. Issued in his: The Theatre of Great Britaine, London, 1676. + LC 442 and 488; Wagner 301b; Wheat 39; Tooley 2, 3, 4, 5 (Plate 27); Leighly 6 (Plate IV); UCB; Goss (Plate 25); Burden 217 (Plate 217); Clancy (Map 7.6). + California with flat northern coast and with place names mostly taken from Brigg's map. Inset: The northerly part of America (upper left). The borders of the map on the top contain plans of towns and on the sides figures of the inhabitants of different countries. Text on verso paged 9 and 10. Engraved by: Abraham Goos Amstelodamiensis Sculpsit (lower right). + + America--Maps + + + California as an island--Maps + + + + [ca. 1:46,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICA with those known parts in that unknowne worlde both people and manner + of buildings Discribed and inlarged by I.S.Ano.1626 + full_title_tesim: + - AMERICA with those known parts in that unknowne worlde both people and manner + of buildings Discribed and inlarged by I.S.Ano.1626 + sort_title_tesim: + - AMERICA with those known parts in that unknowne worlde both people and manner + of buildings Discribed and inlarged by I.S.Ano.1626 + sort_title_ssi: AMERICA with those known parts in that unknowne worlde both people + and manner of buildings Discribed and inlarged by I.S.Ano.1626 + personal_name_ssim: + - Speed, John, 1552?-1629 + personal_name_tesim: + - Speed, John, 1552?-1629 + personal_name_ssm: + - Speed, John, 1552?-1629 + origin_place_term_ssim: + - "[London]" + origin_place_term_tesim: + - "[London]" + origin_place_term_ssm: + - "[London]" + origin_date_created_ssim: + - '1626' + origin_date_created_tesim: + - '1626' + origin_date_created_ssm: + - '1626' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 1_tesim: + - '1626, "Are to be sold in pops-head alley against the Exchange by G. Humble, 1626". + Issued in his: A prospect of the most famous parts of the world . -- London : + G. Humble, 1627. Reissued in the 1631 edition with no changes to map but changed + text on verso. Reissued 1646, 1650-54.' + note_State 2_tesim: + - 1662, with the town of Boston in New England, Connecticut, Maryland and Long Island + are added to the plate and a dotted boundary placed round Delaware and Hudsons + Rio. The text on verso has unchanged content but the type is reset and now commences + with a historiated capital A, a new fleuron heading and the page number 9 restored + top right. + note_State 3_tesim: + - '1662, with imprint changed from G. Humble to: Are to be sold by Roger Rea ye + Elder and younger at ye Golden Cross in Cornhill against ye Exchange.' + note_State 4_tesim: + - '[1676], "are to be sold by Thomas Bassett in Fleet Street, and by Richard Chiswell + in St. Paul''s Churchyard." The text on verso is rewritten and there is no fleuron + heading. Map is still dated 1626. Issued in his: The Theatre of Great Britaine, + London, 1676.' + note_[]_tesim: + - LC 442 and 488; Wagner 301b; Wheat 39; Tooley 2, 3, 4, 5 (Plate 27); Leighly 6 + (Plate IV); UCB; Goss (Plate 25); Burden 217 (Plate 217); Clancy (Map 7.6). + - 'California with flat northern coast and with place names mostly taken from Brigg''s + map. Inset: The northerly part of America (upper left). The borders of the map + on the top contain plans of towns and on the sides figures of the inhabitants + of different countries. Text on verso paged 9 and 10. Engraved by: Abraham Goos + Amstelodamiensis Sculpsit (lower right).' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1:46,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:46,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '3' + - 3-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '3' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 3-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - vw323gf4937_05_0001 + content_metadata_first_image_width_ssm: + - '12909' + content_metadata_first_image_height_ssm: + - '10199' + content_metadata_image_file_name_ssm: + - vw323gf4937_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/vw323gf4937%2Fvw323gf4937_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/vw323gf4937/vw323gf4937_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/vw323gf4937/vw323gf4937_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/vw323gf4937/vw323gf4937_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/vw323gf4937/vw323gf4937_05_0001_full +- :id: ps921pn8250 + :druid_ssi: ps921pn8250 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 118 + + PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises en plan. + + + 1707 + + [Paris] + + 1707 + + 118-02 + + 1 map : hand col.; 19.5 cm. diameter. + + + + creator + + Moulart-Sanson, Pierre, d. 1730. + + Without ‘fol.4’; with shortened title: PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises en plan; and without much text on map; and without parallel ecliptical lines other than ‘Cercle de L’Ecliptique’, through map center. + Sphere with text showing parallels both vertical and at 23 deg. tilt. At center, small sphere showing Western Hemisphere and California as a large island. Similar to his known maps of 1695 & 1697. + see Shirley 573, 574, 591 & 592. + Issued in: Introduction a la geographie in plusieurs cartes avec leur explication. / Par Les Srs Sanson, Geographes ordinaires du Roy. -- A Paris : Dans le cloitre de St. Nicolas du Louvre, MDCCVII [1707], following [page] 5. 1 volume ; [xvi], 139 : 24 maps (hand col.) ; 26 cm. + + America--Maps + + + California as an island--Maps + + + + [ca.1:70,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises + en plan. + full_title_tesim: + - PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises + en plan. + sort_title_tesim: + - PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et TERRESTRE mises + en plan. + sort_title_ssi: PLANISPHERE URANO-GEOGRAPHIQUE c'estadire LES SPHERES CELESTE et + TERRESTRE mises en plan. + personal_name_ssim: + - Moulart-Sanson, Pierre, d. 1730. + personal_name_tesim: + - Moulart-Sanson, Pierre, d. 1730. + personal_name_ssm: + - Moulart-Sanson, Pierre, d. 1730. + origin_place_term_ssim: + - "[Paris]" + origin_place_term_tesim: + - "[Paris]" + origin_place_term_ssm: + - "[Paris]" + origin_date_created_ssim: + - '1707' + - '1707' + origin_date_created_tesim: + - '1707' + - '1707' + origin_date_created_ssm: + - '1707' + - '1707' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 2_tesim: + - 'Without ‘fol.4’; with shortened title: PLANISPHERE URANO-GEOGRAPHIQUE c''estadire + LES SPHERES CELESTE et TERRESTRE mises en plan; and without much text on map; + and without parallel ecliptical lines other than ‘Cercle de L’Ecliptique’, through + map center.' + note_[]_tesim: + - Sphere with text showing parallels both vertical and at 23 deg. tilt. At center, + small sphere showing Western Hemisphere and California as a large island. Similar + to his known maps of 1695 & 1697. + - see Shirley 573, 574, 591 & 592. + - 'Issued in: Introduction a la geographie in plusieurs cartes avec leur explication. + / Par Les Srs Sanson, Geographes ordinaires du Roy. -- A Paris : Dans le cloitre + de St. Nicolas du Louvre, MDCCVII [1707], following [page] 5. 1 volume ; [xvi], + 139 : 24 maps (hand col.) ; 26 cm.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:70,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:70,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '118' + - 118-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '118' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 118-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - ps921pn8250_05_0001 + content_metadata_first_image_width_ssm: + - '9802' + content_metadata_first_image_height_ssm: + - '6447' + content_metadata_image_file_name_ssm: + - ps921pn8250_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/ps921pn8250%2Fps921pn8250_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/ps921pn8250/ps921pn8250_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/ps921pn8250/ps921pn8250_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/ps921pn8250/ps921pn8250_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/ps921pn8250/ps921pn8250_05_0001_full +- :id: nq874ts4848 + :druid_ssi: nq874ts4848 + mods_xml_ssm: + - | + + + 1274 + + Introduction a la Geographie Avec une Description Historique Sur Touttes les parties de la Terre + Title page + + cartographic + + 1717 + + + Fer, Nicolas de, 1646-1720. + + + image/tiff + digitized other analog + + + Lyberteam Metadata ToolKit + + Early Maps + Digital Maps + + + (W 180° --E 180°/N 85° --S 85°) + + + Includes bibliographical references (p. xv-xvi) and indexes. + Glen McLaughlin with Nancy H. Mayo. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - |- + Introduction a la Geographie Avec une Description Historique Sur Touttes les parties de la Terre + Title page + full_title_tesim: + - |- + Introduction a la Geographie Avec une Description Historique Sur Touttes les parties de la Terre + Title page + sort_title_tesim: + - |- + Introduction a la Geographie Avec une Description Historique Sur Touttes les parties de la Terre + Title page + sort_title_ssi: |- + Introduction a la Geographie Avec une Description Historique Sur Touttes les parties de la Terre + Title page + personal_name_ssim: + - Fer, Nicolas de, 1646-1720. + personal_name_tesim: + - Fer, Nicolas de, 1646-1720. + personal_name_ssm: + - Fer, Nicolas de, 1646-1720. + origin_date_created_ssim: + - '1717' + origin_date_created_tesim: + - '1717' + origin_date_created_ssm: + - '1717' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - Early Maps + - Digital Maps + genre_tesim: + - Early Maps + - Digital Maps + coordinates_tesim: + - "(W 180° --E 180°/N 85° --S 85°)" + point_bbox: + - "-180.0 -85.0 180.0 85.0" + note_[]_tesim: + - Includes bibliographical references (p. xv-xvi) and indexes. + note_Statement of responsibility_tesim: + - Glen McLaughlin with Nancy H. Mayo. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + subject_cartographics_tesim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + identifier_tesim: + - '1274' + identifier_local_Post publication map number_tesim: + - '1274' + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - nq874ts4848_05_0001 + content_metadata_first_image_width_ssm: + - '1995' + content_metadata_first_image_height_ssm: + - '3019' + content_metadata_image_file_name_ssm: + - nq874ts4848_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/nq874ts4848%2Fnq874ts4848_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/nq874ts4848/nq874ts4848_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/nq874ts4848/nq874ts4848_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/nq874ts4848/nq874ts4848_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/nq874ts4848/nq874ts4848_05_0001_full +- :id: bm387cy2596 + :druid_ssi: bm387cy2596 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 27 + + L'AMERIQVE + + + + Paris + + 1661 + + + 7.9 x 12.1 cm. 1 of 18 maps on one sheet, 40 x 48.4 cm. + + + + creator + + Duval, P. (Pierre), 1619-1682 + + California with indented northern coast. California shown on 3 of the 18 maps. Map titles with paragraph of descriptive text for each (from top left): L'Ameriqve, Le Canada, La G Vaiane, Les Isles Caribes, La Nle. Espagne, Le N. Mexiqve, Les Isles Antilles, La Floride, La Castille Dor, Le Perov, Le Bresil, Le Chili, Le Paragvai, La Virginie, La Nle. Holande, La Nle. Svede, Le Nouueau Danemarq, and La Magellaniqve. + Par P. Duval Geographe du Roy. + None found. + + America--Maps + + + California as an island--Maps + + + + [ca. 1: 150,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQVE + full_title_tesim: + - L'AMERIQVE + sort_title_tesim: + - L'AMERIQVE + sort_title_ssi: L'AMERIQVE + personal_name_ssim: + - Duval, P. (Pierre), 1619-1682 + personal_name_tesim: + - Duval, P. (Pierre), 1619-1682 + personal_name_ssm: + - Duval, P. (Pierre), 1619-1682 + origin_place_term_ssim: + - Paris + origin_place_term_tesim: + - Paris + origin_place_term_ssm: + - Paris + origin_date_created_ssim: + - '1661' + origin_date_created_tesim: + - '1661' + origin_date_created_ssm: + - '1661' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - 'California with indented northern coast. California shown on 3 of the 18 maps. + Map titles with paragraph of descriptive text for each (from top left): L''Ameriqve, + Le Canada, La G Vaiane, Les Isles Caribes, La Nle. Espagne, Le N. Mexiqve, Les + Isles Antilles, La Floride, La Castille Dor, Le Perov, Le Bresil, Le Chili, Le + Paragvai, La Virginie, La Nle. Holande, La Nle. Svede, Le Nouueau Danemarq, and + La Magellaniqve.' + - None found. + note_Statement of responsibility_tesim: + - Par P. Duval Geographe du Roy. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1: 150,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1: 150,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '27' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '27' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - bm387cy2596_05_0001 + content_metadata_first_image_width_ssm: + - '8840' + content_metadata_first_image_height_ssm: + - '7133' + content_metadata_image_file_name_ssm: + - bm387cy2596_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/bm387cy2596%2Fbm387cy2596_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/bm387cy2596/bm387cy2596_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/bm387cy2596/bm387cy2596_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/bm387cy2596/bm387cy2596_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/bm387cy2596/bm387cy2596_05_0001_full +- :id: gk446cj2442 + :druid_ssi: gk446cj2442 + mods_xml_ssm: + - | + + + + [World map] + + + Weigel, Johann Christoph + 1661-1726 + + cartographic + map + cartographic image + Early maps. + Digital maps. + Maps. + + + gw + + + [Nuremberg + + Weigel + 174-?] + 174u + monographic + + + lat + + +

    map +
    map
    + 4 maps on 4 sheets ; each 10.9 x 16.3 cm. +
    unmediated
    +
    sheet
    + + [Map 1]. Europae recens designatio -- [Map 2]. Africae emendata descriptio -- [Map 3]. Asiae nova delineatio -- [Map 4]. Americae + [Johann Christoph Weigel]. + Relief shown pictorially. + Each map includes a small cartouche surrounded by figures representing the continents. + Asiae - "II. Th. pag. 21." at top right and "G. Haupt Sc." at lower right. Europae - "II. Th. pag. 20." at top right and "G Haupt Sc." at lower right. Africae - "II. Th. pag. 26." at top right and "G Haupt Sc. a. v." at lower left. + McLaughlin map number 1245, 1246, 1247. + Map of America is McLaughlin map number 217. + + + Scale approximately 1:170,000,000. + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + rda + STF + 130214 + 20130216011148.0 + a9940387 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[World map]" + full_title_tesim: + - "[World map]" + sort_title_tesim: + - "[World map]" + sort_title_ssi: "[World map]" + personal_name_ssim: + - Weigel, Johann Christoph + personal_name_tesim: + - Weigel, Johann Christoph + personal_name_ssm: + - Weigel, Johann Christoph + language_ssim: + - Latin + language_tesim: + - Latin + language_ssm: + - Latin + origin_place_term_ssim: + - gw + - "[Nuremberg" + origin_place_term_tesim: + - gw + - "[Nuremberg" + origin_place_term_ssm: + - gw + - "[Nuremberg" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - cartographic image + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - cartographic image + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + table_of_contents_tesim: + - "[Map 1]. Europae recens designatio -- [Map 2]. Africae emendata descriptio -- + [Map 3]. Asiae nova delineatio -- [Map 4]. Americae" + note_[]_tesim: + - "[Johann Christoph Weigel]." + - Relief shown pictorially. + - Each map includes a small cartouche surrounded by figures representing the continents. + - Asiae - "II. Th. pag. 21." at top right and "G. Haupt Sc." at lower right. Europae + - "II. Th. pag. 20." at top right and "G Haupt Sc." at lower right. Africae - + "II. Th. pag. 26." at top right and "G Haupt Sc. a. v." at lower left. + note_Local note_tesim: + - McLaughlin map number 1245, 1246, 1247. + - Map of America is McLaughlin map number 217. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale approximately 1:170,000,000.\n (W 180°--E 180°/N 90°--S 90°).\n + \ " + subject_cartographics_tesim: + - "\n Scale approximately 1:170,000,000.\n (W 180°--E 180°/N 90°--S 90°).\n + \ " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - gk446cj2442_05_0001 + content_metadata_first_image_width_ssm: + - '4956' + content_metadata_first_image_height_ssm: + - '3943' + content_metadata_image_file_name_ssm: + - gk446cj2442_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/gk446cj2442%2Fgk446cj2442_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/gk446cj2442/gk446cj2442_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/gk446cj2442/gk446cj2442_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/gk446cj2442/gk446cj2442_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/gk446cj2442/gk446cj2442_05_0001_full +- :id: zs247rr8237 + :druid_ssi: zs247rr8237 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + 55 + + AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + + + 1690 + + [Italy?] + + 1674 + + 55-07 + + 1 map : hand col.; 52.2 x 83.7 cm., 56.5 x 85.7 cm. including border and added title. + + + + creator + + Jaillot, Alexis Hubert, 1632?-1712 + + Early Maps + A later reproduction probably copied from the first (1674) state. Based upon the cartography and the dating, it appears to have been produced between 1674 and 1690. The lettering is crude, and the cartography is slightly less detailed. It is possibly Italian in origin. Title (in cartouche) spelling changed from S. Sanson to Sr. Sanson. Spelling variants include V instead of U. + Wagner 409b; Wheat 58; Tooley 37 (Plate 44, State 1) & 38; Leighly 64; BN Jaillot,I,Aa(5); UCB; Philip Burden correspondence. + Dedication (within title cartouche): Presentée a Monseigneur le Davphin, Parson tres-humble, tres obeissant, et tres fidele Seruiteur, Herbert Iaillot. Title along map top: L'Amerique Septentrionale divisée en ses principales parties, scauoir Les Terres Arctiques, Le Canada ou Nouvelle France, Le Mexique ou Nouvelle Espagne, Le Nouveau Mexique, Les Isles de Terre Neuve de Californie, et | Antilles, ou sont distingués les uns des autres, Les Estats, comme Ils sont possedés presentement par Les François, Castillans, Anglois, Sued Ois, Danois, et par Les Estats Generaux des Provinces Vnies ou Hollandois. Tirée des Relations de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy, 1674. California copied from Sanson's 1656 map, and labelled Isle de Californie. Agubela de Gato as peninsula on mainland to north. Terre de Iesso ou Ieco to west. Great Lakes open to west. Decorative title cartouche (upper left) with crown and arms of the Dauphin. Multiple scales given within decorative cartouche (lower left). + Hubert Iaillot. + + California as an island--Maps + + + North America--Maps + + + + [ca. 1:16,000,000]. + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + full_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + sort_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + sort_title_ssi: AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont + distingués les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet + aux FRANÇOIS, CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations + de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + personal_name_ssim: + - Jaillot, Alexis Hubert, 1632?-1712 + personal_name_tesim: + - Jaillot, Alexis Hubert, 1632?-1712 + personal_name_ssm: + - Jaillot, Alexis Hubert, 1632?-1712 + origin_place_term_ssim: + - "[Italy?]" + origin_place_term_tesim: + - "[Italy?]" + origin_place_term_ssm: + - "[Italy?]" + origin_date_created_ssim: + - '1690' + - '1674' + origin_date_created_tesim: + - '1690' + - '1674' + origin_date_created_ssm: + - '1690' + - '1674' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 7_tesim: + - A later reproduction probably copied from the first (1674) state. Based upon the + cartography and the dating, it appears to have been produced between 1674 and + 1690. The lettering is crude, and the cartography is slightly less detailed. It + is possibly Italian in origin. Title (in cartouche) spelling changed from S. Sanson + to Sr. Sanson. Spelling variants include V instead of U. + note_[]_tesim: + - Wagner 409b; Wheat 58; Tooley 37 (Plate 44, State 1) & 38; Leighly 64; BN Jaillot,I,Aa(5); + UCB; Philip Burden correspondence. + - 'Dedication (within title cartouche): Presentée a Monseigneur le Davphin, Parson + tres-humble, tres obeissant, et tres fidele Seruiteur, Herbert Iaillot. Title + along map top: L''Amerique Septentrionale divisée en ses principales parties, + scauoir Les Terres Arctiques, Le Canada ou Nouvelle France, Le Mexique ou Nouvelle + Espagne, Le Nouveau Mexique, Les Isles de Terre Neuve de Californie, et | Antilles, + ou sont distingués les uns des autres, Les Estats, comme Ils sont possedés presentement + par Les François, Castillans, Anglois, Sued Ois, Danois, et par Les Estats Generaux + des Provinces Vnies ou Hollandois. Tirée des Relations de toutes ces Nations Par + le Sr. Sanson, Geographe Ordinaire du Roy, 1674. California copied from Sanson''s + 1656 map, and labelled Isle de Californie. Agubela de Gato as peninsula on mainland + to north. Terre de Iesso ou Ieco to west. Great Lakes open to west. Decorative + title cartouche (upper left) with crown and arms of the Dauphin. Multiple scales + given within decorative cartouche (lower left).' + note_Statement of responsibility_tesim: + - Hubert Iaillot. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca. 1:16,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca. 1:16,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '55' + - 55-07 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '55' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 55-07 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zs247rr8237_05_0001 + content_metadata_first_image_width_ssm: + - '14381' + content_metadata_first_image_height_ssm: + - '9768' + content_metadata_image_file_name_ssm: + - zs247rr8237_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zs247rr8237%2Fzs247rr8237_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zs247rr8237/zs247rr8237_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zs247rr8237/zs247rr8237_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zs247rr8237/zs247rr8237_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zs247rr8237/zs247rr8237_05_0001_full +- :id: rx614sw9194 + :druid_ssi: rx614sw9194 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 31 + + AMERICÆ nova discriptio. + + + 1705 + + Amstelodami + + 1705 + + 31-03 + + 42 x 52.4 cm., 43 x 53.4 cm. including border. + + + + creator + + Allard, Carel, 1648-ca. 1709 + + Undated, with imprint Apud Carolum Allard. + Apud Carolum Allard + LC 3437; Wagner 387; Leighly 41; Koeman, I, All2(492); Koeman, II, Jon1; Burden 362 (Plate 362, State 1). + California with indented northern coast. "Agubela de Cato" is peninsula on mainland near northeast tip of California. Nothing further north. Very few details of interior of North America. Title cartouche (upper left) topped with female native riding large armadillo, same as on DeWit's map of 1660. + Issued in: Atlas Major, Tomus III / Apud Carolum Allard. -- A Amsterdam : Chez (Carolus Allard) Avec Privil-., [1705]. + + America--Maps + + + California as an island--Maps + + + + [ca.1:45,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICÆ nova discriptio. + full_title_tesim: + - AMERICÆ nova discriptio. + sort_title_tesim: + - AMERICÆ nova discriptio. + sort_title_ssi: AMERICÆ nova discriptio. + personal_name_ssim: + - Allard, Carel, 1648-ca. 1709 + personal_name_tesim: + - Allard, Carel, 1648-ca. 1709 + personal_name_ssm: + - Allard, Carel, 1648-ca. 1709 + origin_place_term_ssim: + - Amstelodami + origin_place_term_tesim: + - Amstelodami + origin_place_term_ssm: + - Amstelodami + origin_date_created_ssim: + - '1705' + - '1705' + origin_date_created_tesim: + - '1705' + - '1705' + origin_date_created_ssm: + - '1705' + - '1705' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 3_tesim: + - Undated, with imprint Apud Carolum Allard. + note_Statement of responsibility_tesim: + - Apud Carolum Allard + note_[]_tesim: + - LC 3437; Wagner 387; Leighly 41; Koeman, I, All2(492); Koeman, II, Jon1; Burden + 362 (Plate 362, State 1). + - California with indented northern coast. "Agubela de Cato" is peninsula on mainland + near northeast tip of California. Nothing further north. Very few details of interior + of North America. Title cartouche (upper left) topped with female native riding + large armadillo, same as on DeWit's map of 1660. + - 'Issued in: Atlas Major, Tomus III / Apud Carolum Allard. -- A Amsterdam : Chez + (Carolus Allard) Avec Privil-., [1705].' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:45,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:45,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '31' + - 31-03 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '31' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 31-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - rx614sw9194_05_0001 + content_metadata_first_image_width_ssm: + - '16414' + content_metadata_first_image_height_ssm: + - '13241' + content_metadata_image_file_name_ssm: + - rx614sw9194_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/rx614sw9194%2Frx614sw9194_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/rx614sw9194/rx614sw9194_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/rx614sw9194/rx614sw9194_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/rx614sw9194/rx614sw9194_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/rx614sw9194/rx614sw9194_05_0001_full +- :id: dx157dh4345 + :druid_ssi: dx157dh4345 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 195 + + KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren 1721 en 1722 + + + 1720 + + Amsterdam? + + 1729 + + + 1 map : 18.3 x 34.4 cm., 19.6 x 35.6 cm. including border. + + JKS NOTE: Two maps are on this record: one in black and white, one in color. + Possibly the work of Isaac Tirion. + Shows the voyage of three Dutch ships under the command of Capt. Jacob Roggeveen from Amsterdam to Iava. Includes partial outlines of N. Zeeland, van Diemens Land, Nieuw Holland, and t'Land van Quiri. + California as an island with indented coastline and place names including K. Blanco, K.S. Sebastiaan, and F. Draks baai. (No previous use of 'K' used for 'cape' seen.) Water passage continues north between Compagnies Land and Noord America. + None found. + [Anonymous]. + + America--Maps + + + California as an island--Maps + + + + [ca.1:90,000,000]. [S.l.: s.n., 172 + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren 1721 en 1722 + full_title_tesim: + - KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren 1721 en 1722 + sort_title_tesim: + - KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren 1721 en 1722 + sort_title_ssi: KAART der REYZE van drie Schepen naar het ZUYDLAND in de Jaaren + 1721 en 1722 + origin_place_term_ssim: + - Amsterdam? + origin_place_term_tesim: + - Amsterdam? + origin_place_term_ssm: + - Amsterdam? + origin_date_created_ssim: + - '1720' + - '1729' + origin_date_created_tesim: + - '1720' + - '1729' + origin_date_created_ssm: + - '1720' + - '1729' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 1_tesim: + - 'JKS NOTE: Two maps are on this record: one in black and white, one in color.' + note_[]_tesim: + - Possibly the work of Isaac Tirion. + - Shows the voyage of three Dutch ships under the command of Capt. Jacob Roggeveen + from Amsterdam to Iava. Includes partial outlines of N. Zeeland, van Diemens Land, + Nieuw Holland, and t'Land van Quiri. + - California as an island with indented coastline and place names including K. Blanco, + K.S. Sebastiaan, and F. Draks baai. (No previous use of 'K' used for 'cape' seen.) + Water passage continues north between Compagnies Land and Noord America. + - None found. + note_Statement of responsibility_tesim: + - "[Anonymous]." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:90,000,000]. [S.l.: s.n., 172\n (W 160° --E 20°/N 90° --S + 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:90,000,000]. [S.l.: s.n., 172\n (W 160° --E 20°/N 90° --S + 90°)\n " + identifier_tesim: + - '195' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '195' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - dx157dh4345_05_0001 + content_metadata_first_image_width_ssm: + - '9738' + content_metadata_first_image_height_ssm: + - '6560' + content_metadata_image_file_name_ssm: + - dx157dh4345_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/dx157dh4345%2Fdx157dh4345_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/dx157dh4345/dx157dh4345_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/dx157dh4345/dx157dh4345_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/dx157dh4345/dx157dh4345_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/dx157dh4345/dx157dh4345_05_0001_full +- :id: sd345mz1879 + :druid_ssi: sd345mz1879 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 227 + + A MAP of AMERICA from the latest and best Observations + + + 1745 + 1745 + + + 1 map : hand col.; 38.3 x 28.5 cm.; 39.5 x 29.7 cm. including border. + + + + creator + + Seale, Richard William + + California as an island on second Sanson model, and with M. Nevada, several points, and one town, St Isidore, marked. + None found. + by R.W. Seale. + Prime meridian: London. + Copperplate engraved. + + America--Maps + + + California as an island--Maps. + + + + [ca. 1:45,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - A MAP of AMERICA from the latest and best Observations + full_title_tesim: + - A MAP of AMERICA from the latest and best Observations + sort_title_tesim: + - A MAP of AMERICA from the latest and best Observations + sort_title_ssi: A MAP of AMERICA from the latest and best Observations + personal_name_ssim: + - Seale, Richard William + personal_name_tesim: + - Seale, Richard William + personal_name_ssm: + - Seale, Richard William + origin_date_created_ssim: + - '1745' + - '1745' + origin_date_created_tesim: + - '1745' + - '1745' + origin_date_created_ssm: + - '1745' + - '1745' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - California as an island on second Sanson model, and with M. Nevada, several points, + and one town, St Isidore, marked. + - None found. + - 'Prime meridian: London.' + - Copperplate engraved. + note_Statement of responsibility_tesim: + - by R.W. Seale. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps. + subject_topic_tesim: + - America--Maps + - California as an island--Maps. + subject_cartographics_ssim: + - "\n [ca. 1:45,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:45,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '227' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '227' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sd345mz1879_05_0001 + content_metadata_first_image_width_ssm: + - '8037' + content_metadata_first_image_height_ssm: + - '10532' + content_metadata_image_file_name_ssm: + - sd345mz1879_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sd345mz1879%2Fsd345mz1879_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sd345mz1879/sd345mz1879_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sd345mz1879/sd345mz1879_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sd345mz1879/sd345mz1879_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sd345mz1879/sd345mz1879_05_0001_full +- :id: gw298sq0504 + :druid_ssi: gw298sq0504 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + 1004 + + PLANISPHÆRIVM BRAHEVM, Sive Structura MVNDI TOTIVS, EX HYPOTHESI TYCHONIS BRAHEI IN PLANO DELINEATA. [Amstelodami : Apud Joannem Janssonium, 1660]. + + + 1660 + + Amsterdam + + 1660 + + + 42 x 51.8 cm. + + + + creator + + Cellarius, Andreas + + + Astronomy--Charts, diagrams, etc. + + Early Maps + Tycho Brahe’s theory of the universe is diagrammed. + Koeman IV, Cel 1(6); Celestial charts, antique maps of the heavens, p. 58-59 / Carole Stott. -- London : Studio Editions Ltd., 1995. + California is shown as a rounded island on small sphere (1.8 cm. diam.) showing north polar projection of earth (center of chart). + Number ‘6’ (within border, bottom right). + Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial atlas of universal harmony). -- Amsterdam : Apud Joannem Janssonium, 1660. Chart probably issued in 1708 edition published by Valk and Schenk. + [Andreas Cellarius]. + + + (W 0° --E 0°/N 90° --N 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - 'PLANISPHÆRIVM BRAHEVM, Sive Structura MVNDI TOTIVS, EX HYPOTHESI TYCHONIS BRAHEI + IN PLANO DELINEATA. [Amstelodami : Apud Joannem Janssonium, 1660].' + full_title_tesim: + - 'PLANISPHÆRIVM BRAHEVM, Sive Structura MVNDI TOTIVS, EX HYPOTHESI TYCHONIS BRAHEI + IN PLANO DELINEATA. [Amstelodami : Apud Joannem Janssonium, 1660].' + sort_title_tesim: + - 'PLANISPHÆRIVM BRAHEVM, Sive Structura MVNDI TOTIVS, EX HYPOTHESI TYCHONIS BRAHEI + IN PLANO DELINEATA. [Amstelodami : Apud Joannem Janssonium, 1660].' + sort_title_ssi: 'PLANISPHÆRIVM BRAHEVM, Sive Structura MVNDI TOTIVS, EX HYPOTHESI + TYCHONIS BRAHEI IN PLANO DELINEATA. [Amstelodami : Apud Joannem Janssonium, 1660].' + personal_name_ssim: + - Cellarius, Andreas + personal_name_tesim: + - Cellarius, Andreas + personal_name_ssm: + - Cellarius, Andreas + origin_place_term_ssim: + - Amsterdam + origin_place_term_tesim: + - Amsterdam + origin_place_term_ssm: + - Amsterdam + origin_date_created_ssim: + - '1660' + - '1660' + origin_date_created_tesim: + - '1660' + - '1660' + origin_date_created_ssm: + - '1660' + - '1660' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 0° --E 0°/N 90° --N 90°)" + point_bbox: + - "-0.0 90.0 0.0 90.0" + note_[]_tesim: + - Tycho Brahe’s theory of the universe is diagrammed. + - 'Koeman IV, Cel 1(6); Celestial charts, antique maps of the heavens, p. 58-59 + / Carole Stott. -- London : Studio Editions Ltd., 1995.' + - California is shown as a rounded island on small sphere (1.8 cm. diam.) showing + north polar projection of earth (center of chart). + - Number ‘6’ (within border, bottom right). + - 'Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial atlas of universal + harmony). -- Amsterdam : Apud Joannem Janssonium, 1660. Chart probably issued + in 1708 edition published by Valk and Schenk.' + note_Statement of responsibility_tesim: + - "[Andreas Cellarius]." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - Astronomy--Charts, diagrams, etc. + subject_topic_tesim: + - Astronomy--Charts, diagrams, etc. + subject_cartographics_ssim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + subject_cartographics_tesim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + identifier_tesim: + - '1004' + identifier_local_Post publication map number_tesim: + - '1004' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - gw298sq0504_05_0001 + content_metadata_first_image_width_ssm: + - '14463' + content_metadata_first_image_height_ssm: + - '12017' + content_metadata_image_file_name_ssm: + - gw298sq0504_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/gw298sq0504%2Fgw298sq0504_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/gw298sq0504/gw298sq0504_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/gw298sq0504/gw298sq0504_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/gw298sq0504/gw298sq0504_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/gw298sq0504/gw298sq0504_05_0001_full +- :id: sn161bw2027 + :druid_ssi: sn161bw2027 + mods_xml_ssm: + - | + + + + Pas-caart van Zuyd-Zee, tusschen California en ilhas de Ladrones + + + La Atlas del mundo o el mundo aguado + + + Doncker, Hendrik I. + 1626-1699 + + cartographic + map + Nautical Charts. + Early maps. + Digital maps. + Maps. + + + ne + + + T'Amsterdam + + By Hendrick Doncker + [1669] + 1669 + monographic + + + dut + + + 1 map : hand col. ; 41.6 x 52.5 cm. + + ... Hendrick Doncker Boekverkooper en Graadboogh maker inde Nieubrughsteegh in’t Stuurmans Gereetshap. + Sea chart of the Pacific, with East at the top and the equator running down the middle. The northwestern tip of California is shown and labelled “I. CALIFORNIA”, and with 4 place names: C. Blanco, P.St.Francisco Draco, P.de Monte Rey, and P.de la Conception. Also included are partial outlines of: Compagnies Landt, Japan, Staten Lant, Ant van Diemens Lant. + Title cartouche with cherubs at top right. + Issued in his La Atlas del mundo o el mundo aguado. -- Amsterdam, [1669]. + McLaughlin map number 508. + + + Scale [ca. 1:225,000] + (E 110°--W 70°/N 63°--S 53°). + + + + Pacific Ocean + Maps + 1669 + + + + Tooley. Mapping of Australia and Antarctica, + + 453 + + + + A.E. Nordenskiöld coll., + + 1,68(51) + + + aacr + CSt-ES + 121012 + 20121210191002.0 + a9851017 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Pas-caart van Zuyd-Zee, tusschen California en ilhas de Ladrones + full_title_tesim: + - Pas-caart van Zuyd-Zee, tusschen California en ilhas de Ladrones + - La Atlas del mundo o el mundo aguado + alternative_title_tesim: + - La Atlas del mundo o el mundo aguado + sort_title_tesim: + - Pas-caart van Zuyd-Zee, tusschen California en ilhas de Ladrones + sort_title_ssi: Pas-caart van Zuyd-Zee, tusschen California en ilhas de Ladrones + personal_name_ssim: + - Doncker, Hendrik I. + personal_name_tesim: + - Doncker, Hendrik I. + personal_name_ssm: + - Doncker, Hendrik I. + language_ssim: + - Dutch; Flemish + language_tesim: + - Dutch; Flemish + language_ssm: + - Dutch; Flemish + origin_place_term_ssim: + - ne + - T'Amsterdam + origin_place_term_tesim: + - ne + - T'Amsterdam + origin_place_term_ssm: + - ne + - T'Amsterdam + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Nautical Charts. + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Nautical Charts. + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(E 110°--W 70°/N 63°--S 53°)." + note_[]_tesim: + - "... Hendrick Doncker Boekverkooper en Graadboogh maker inde Nieubrughsteegh in’t + Stuurmans Gereetshap." + - 'Sea chart of the Pacific, with East at the top and the equator running down the + middle. The northwestern tip of California is shown and labelled “I. CALIFORNIA”, + and with 4 place names: C. Blanco, P.St.Francisco Draco, P.de Monte Rey, and P.de + la Conception. Also included are partial outlines of: Compagnies Landt, Japan, + Staten Lant, Ant van Diemens Lant.' + - Title cartouche with cherubs at top right. + - Issued in his La Atlas del mundo o el mundo aguado. -- Amsterdam, [1669]. + note_Local note_tesim: + - McLaughlin map number 508. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_geographic_ssim: + - Pacific Ocean + subject_geographic_tesim: + - Pacific Ocean + subject_temporal_ssim: + - '1669' + subject_temporal_tesim: + - '1669' + subject_genre_ssim: + - Maps + subject_genre_tesim: + - Maps + subject_cartographics_ssim: + - "\n Scale [ca. 1:225,000]\n (E 110°--W 70°/N 63°--S 53°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:225,000]\n (E 110°--W 70°/N 63°--S 53°).\n " + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sn161bw2027_05_0001 + content_metadata_first_image_width_ssm: + - '9767' + content_metadata_first_image_height_ssm: + - '7605' + content_metadata_image_file_name_ssm: + - sn161bw2027_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sn161bw2027%2Fsn161bw2027_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sn161bw2027/sn161bw2027_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sn161bw2027/sn161bw2027_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sn161bw2027/sn161bw2027_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sn161bw2027/sn161bw2027_05_0001_full +- :id: yh941cp6284 + :druid_ssi: yh941cp6284 + mods_xml_ssm: + - | + + + + Orbis terrarum tabula recens emendata et in lucem edita + + + Stopendael, Daniel. + + + Keur, Pieter. + + + Keur, Jacob. + + cartographic + map + Early maps. + Digital maps. + Maps. + + + ne + + + [Rotterdam + + [Pieter and Jacob Keur + ca.1680?] + 1680 + monographic + + + lat + + + 1 map : hand col ; 2 hemispheres each 22.1 cm. in diam., on sheet 38.9 x 51 cm. + + D. Stoopendaal Fec. + Relief shown pictorially. + California shown as an island with a flat northern coastline and place names along western coast. Includes the beginning of New Zealand's coastline. Shows Great Wall of China. + Includes "D. Stoopendaal Fec." in the bottom left area and "6" in the bottom right corner, 4 allegorical vignettes in each corner, and two solar charts in upper and lower center between hemispheres, illustrating the Copernican and Ptolemaic theories of the solar system. + From a Dutch bible and Based on Nicolaas Visscher’s bible map of 1663. + Includes text on verso in Dutch. + McLaughlin map number 1234. + + + Scale [ca. 1:100,000,000] + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + + Shirley, R.W. Mapping the world (4th ed.), + + 498 + + + aacr + CSt-ES + 121218 + a9855599 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Orbis terrarum tabula recens emendata et in lucem edita + full_title_tesim: + - Orbis terrarum tabula recens emendata et in lucem edita + sort_title_tesim: + - Orbis terrarum tabula recens emendata et in lucem edita + sort_title_ssi: Orbis terrarum tabula recens emendata et in lucem edita + personal_name_ssim: + - Stopendael, Daniel. + - Keur, Pieter. + - Keur, Jacob. + personal_name_tesim: + - Stopendael, Daniel. + - Keur, Pieter. + - Keur, Jacob. + personal_name_ssm: + - Stopendael, Daniel. + - Keur, Pieter. + - Keur, Jacob. + language_ssim: + - Latin + language_tesim: + - Latin + language_ssm: + - Latin + origin_place_term_ssim: + - ne + - "[Rotterdam" + origin_place_term_tesim: + - ne + - "[Rotterdam" + origin_place_term_ssm: + - ne + - "[Rotterdam" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - D. Stoopendaal Fec. + - Relief shown pictorially. + - California shown as an island with a flat northern coastline and place names along + western coast. Includes the beginning of New Zealand's coastline. Shows Great + Wall of China. + - Includes "D. Stoopendaal Fec." in the bottom left area and "6" in the bottom right + corner, 4 allegorical vignettes in each corner, and two solar charts in upper + and lower center between hemispheres, illustrating the Copernican and Ptolemaic + theories of the solar system. + - From a Dutch bible and Based on Nicolaas Visscher’s bible map of 1663. + - Includes text on verso in Dutch. + note_Local note_tesim: + - McLaughlin map number 1234. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale [ca. 1:100,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:100,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - yh941cp6284_05_0001 + content_metadata_first_image_width_ssm: + - '12430' + content_metadata_first_image_height_ssm: + - '9535' + content_metadata_image_file_name_ssm: + - yh941cp6284_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/yh941cp6284%2Fyh941cp6284_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/yh941cp6284/yh941cp6284_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/yh941cp6284/yh941cp6284_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/yh941cp6284/yh941cp6284_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/yh941cp6284/yh941cp6284_05_0001_full +- :id: gv664gb7394 + :druid_ssi: gv664gb7394 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + C3 + + SITVS TERRÆ CIRCVLIS COELESTIBVS CIRCVNDATÆ. + + + 1660 + + [Amsterdam] + + 1660 + + C3-01 + + 1 celestial chart : hand col. ; 43.2 x 51.2 cm. + + + + creator + + Cellarius, Andreas + + With no imprint. Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial atlas of universal harmony). -- Amstelodami : apud Joannem Janssonium, 1660, 1661. + With imprint: Prostant Amstelaedami apud PETRUM SCHENK, et GERARDUM VALK C. Priv. (below title on right side). Issued in his Atlas Coelestis ... , published by Gerardum Valk & Petrum Schenk, 1708. + L.C. 469, 4274; Koeman IV,Cel 1(11), Cel 2, Cel 3 (State 2); Snyder p.36 (PLATE 15); UCBm. + Copperplate engraved.Shows the Ptolemaic view of the universe. At center is unmoving spherical earth, surrounded by a sphere of fixed stars which revolves daily from east to west (depicted by ribbon of zodiac). California as an island with rounded northern coastline. Title divided between 2 areas of parted clouds (top left and right). Winged figures throughout. Engraved by: J. van Loon f. (lower center). '11' (bottom right). + + Astronomy--Charts, Diagrams, etc. + + + California as an island--Maps + + + + (W 21° --E 159°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - SITVS TERRÆ CIRCVLIS COELESTIBVS CIRCVNDATÆ. + full_title_tesim: + - SITVS TERRÆ CIRCVLIS COELESTIBVS CIRCVNDATÆ. + sort_title_tesim: + - SITVS TERRÆ CIRCVLIS COELESTIBVS CIRCVNDATÆ. + sort_title_ssi: SITVS TERRÆ CIRCVLIS COELESTIBVS CIRCVNDATÆ. + personal_name_ssim: + - Cellarius, Andreas + personal_name_tesim: + - Cellarius, Andreas + personal_name_ssm: + - Cellarius, Andreas + origin_place_term_ssim: + - "[Amsterdam]" + origin_place_term_tesim: + - "[Amsterdam]" + origin_place_term_ssm: + - "[Amsterdam]" + origin_date_created_ssim: + - '1660' + - '1660' + origin_date_created_tesim: + - '1660' + - '1660' + origin_date_created_ssm: + - '1660' + - '1660' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 21° --E 159°/N 90° --S 90°)" + point_bbox: + - "-21.0 -90.0 159.0 90.0" + note_State 1_tesim: + - 'With no imprint. Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial + atlas of universal harmony). -- Amstelodami : apud Joannem Janssonium, 1660, 1661.' + note_State 2_tesim: + - 'With imprint: Prostant Amstelaedami apud PETRUM SCHENK, et GERARDUM VALK C. Priv. + (below title on right side). Issued in his Atlas Coelestis ... , published by + Gerardum Valk & Petrum Schenk, 1708.' + note_[]_tesim: + - L.C. 469, 4274; Koeman IV,Cel 1(11), Cel 2, Cel 3 (State 2); Snyder p.36 (PLATE + 15); UCBm. + - 'Copperplate engraved.Shows the Ptolemaic view of the universe. At center is unmoving + spherical earth, surrounded by a sphere of fixed stars which revolves daily from + east to west (depicted by ribbon of zodiac). California as an island with rounded + northern coastline. Title divided between 2 areas of parted clouds (top left and + right). Winged figures throughout. Engraved by: J. van Loon f. (lower center). + ''11'' (bottom right).' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - Astronomy--Charts, Diagrams, etc. + - California as an island--Maps + subject_topic_tesim: + - Astronomy--Charts, Diagrams, etc. + - California as an island--Maps + subject_cartographics_ssim: + - "\n (W 21° --E 159°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n (W 21° --E 159°/N 90° --S 90°)\n " + identifier_tesim: + - C3 + - C3-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - C3 + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - C3-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - gv664gb7394_05_0001 + content_metadata_first_image_width_ssm: + - '13640' + content_metadata_first_image_height_ssm: + - '11949' + content_metadata_image_file_name_ssm: + - gv664gb7394_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/gv664gb7394%2Fgv664gb7394_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/gv664gb7394/gv664gb7394_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/gv664gb7394/gv664gb7394_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/gv664gb7394/gv664gb7394_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/gv664gb7394/gv664gb7394_05_0001_full +- :id: ys360dp2191 + :druid_ssi: ys360dp2191 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + C5 + + TYPUS SELENOGRAPHICUS LUNÆ PHASES ET ASPECTUS VARIOS ADUMBRANS. + + + 1660 + + [Amsterdam] + + 1660 + + + 1 celestial chart : hand col. ; 43.2 x 51.5 cm. + + + + creator + + Cellarius, Andreas + + Copperplate engraved. + L.C. 469, 4274; Koeman IV,Cel 1(19); Cel 2, Cel 3. + Shows the earth at center surrounded by 8 phases of the moon. The sun at the top. + California as an island with rounded northern coastline. + Smaller illustrations of "Nomina phasivm et aspectvvm sunæ" (bottom left) and "Phases lvnæ respectv solis et ocvli" (bottom right). + Title divided between 2 cartouches of draped cloth held by winged figures (top left and right). + Engraved by: J. van Loon fecit (bottom center). + '19' (bottom right). + Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial atlas of universal harmony). -- Amstelodami : apud Joannem Janssonium, 1660, 1661. Published by Gerardum Valk & Petrum Schenk, 1708. + [Andreas Cellarius]. + + Astronomy--Charts, diagrams, etc. + + + California as an island--Maps + + + + (W 0° --E 0°/N 90° --N 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - TYPUS SELENOGRAPHICUS LUNÆ PHASES ET ASPECTUS VARIOS ADUMBRANS. + full_title_tesim: + - TYPUS SELENOGRAPHICUS LUNÆ PHASES ET ASPECTUS VARIOS ADUMBRANS. + sort_title_tesim: + - TYPUS SELENOGRAPHICUS LUNÆ PHASES ET ASPECTUS VARIOS ADUMBRANS. + sort_title_ssi: TYPUS SELENOGRAPHICUS LUNÆ PHASES ET ASPECTUS VARIOS ADUMBRANS. + personal_name_ssim: + - Cellarius, Andreas + personal_name_tesim: + - Cellarius, Andreas + personal_name_ssm: + - Cellarius, Andreas + origin_place_term_ssim: + - "[Amsterdam]" + origin_place_term_tesim: + - "[Amsterdam]" + origin_place_term_ssm: + - "[Amsterdam]" + origin_date_created_ssim: + - '1660' + - '1660' + origin_date_created_tesim: + - '1660' + - '1660' + origin_date_created_ssm: + - '1660' + - '1660' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 0° --E 0°/N 90° --N 90°)" + point_bbox: + - "-0.0 90.0 0.0 90.0" + note_[]_tesim: + - Copperplate engraved. + - L.C. 469, 4274; Koeman IV,Cel 1(19); Cel 2, Cel 3. + - Shows the earth at center surrounded by 8 phases of the moon. The sun at the top. + - California as an island with rounded northern coastline. + - Smaller illustrations of "Nomina phasivm et aspectvvm sunæ" (bottom left) and + "Phases lvnæ respectv solis et ocvli" (bottom right). + - Title divided between 2 cartouches of draped cloth held by winged figures (top + left and right). + - 'Engraved by: J. van Loon fecit (bottom center).' + - "'19' (bottom right)." + - 'Issued in: Atlas coelestis; seu harmonia macrocosmica (Celestial atlas of universal + harmony). -- Amstelodami : apud Joannem Janssonium, 1660, 1661. Published by Gerardum + Valk & Petrum Schenk, 1708.' + note_Statement of responsibility_tesim: + - "[Andreas Cellarius]." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - Astronomy--Charts, diagrams, etc. + - California as an island--Maps + subject_topic_tesim: + - Astronomy--Charts, diagrams, etc. + - California as an island--Maps + subject_cartographics_ssim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + subject_cartographics_tesim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + identifier_tesim: + - C5 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - C5 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - ys360dp2191_05_0001 + content_metadata_first_image_width_ssm: + - '13137' + content_metadata_first_image_height_ssm: + - '11521' + content_metadata_image_file_name_ssm: + - ys360dp2191_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/ys360dp2191%2Fys360dp2191_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/ys360dp2191/ys360dp2191_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/ys360dp2191/ys360dp2191_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/ys360dp2191/ys360dp2191_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/ys360dp2191/ys360dp2191_05_0001_full +- :id: sb904gg2771 + :druid_ssi: sb904gg2771 + mods_xml_ssm: + - | + + + + Planisphaerium terrestre cum utroque coelesti hemisphaerio ... = + Vlakke ared-kloot met het beide hemelsch half-rond + + + Zuerner, Adam Friedrich + 1680-1742 + + cartographic + map + Early maps. + Maps. + + + ne + + + [Amsterdam + + Pieter Schenk + 1700?] + 1700 + monographic + + + lat + + + 1 map : hand col. ; 2 hemispheres each 28 cm. in diam. + + opera et studio A.F. Zürneri. + Relief shown pictorially. + California shown as a labeled island with an indented northern coast. Nova Albion and P. to Draco labeled at north end. + Surrounded by two celestial maps, 26 astronomical and geographical diagrams, and illustrations. + Includes text explaining the illustrations. + Issued in Pieter Schenk's Atlas Contractus. + McLaughlin map number 1077. + + + Scale [ca. 1:95,000,000 at the equator] + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + G3200 1700 .Z8 + + + Shirley, R.W. Mapping the world (4th ed.) + + 639 + + + aacr + EYM + 130128 + a9336610 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Planisphaerium terrestre cum utroque coelesti hemisphaerio ... = + full_title_tesim: + - Planisphaerium terrestre cum utroque coelesti hemisphaerio ... = Vlakke ared-kloot + met het beide hemelsch half-rond + sort_title_tesim: + - Planisphaerium terrestre cum utroque coelesti hemisphaerio ... = Vlakke ared-kloot + met het beide hemelsch half-rond + sort_title_ssi: Planisphaerium terrestre cum utroque coelesti hemisphaerio ... = + Vlakke ared-kloot met het beide hemelsch half-rond + personal_name_ssim: + - Zuerner, Adam Friedrich + personal_name_tesim: + - Zuerner, Adam Friedrich + personal_name_ssm: + - Zuerner, Adam Friedrich + language_ssim: + - Latin + language_tesim: + - Latin + language_ssm: + - Latin + origin_place_term_ssim: + - ne + - "[Amsterdam" + origin_place_term_tesim: + - ne + - "[Amsterdam" + origin_place_term_ssm: + - ne + - "[Amsterdam" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - opera et studio A.F. Zürneri. + - Relief shown pictorially. + - California shown as a labeled island with an indented northern coast. Nova Albion + and P. to Draco labeled at north end. + - Surrounded by two celestial maps, 26 astronomical and geographical diagrams, and + illustrations. + - Includes text explaining the illustrations. + - Issued in Pieter Schenk's Atlas Contractus. + note_Local note_tesim: + - McLaughlin map number 1077. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale [ca. 1:95,000,000 at the equator]\n (W 180°--E 180°/N 90°--S + 90°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:95,000,000 at the equator]\n (W 180°--E 180°/N 90°--S + 90°).\n " + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sb904gg2771_05_0001 + content_metadata_first_image_width_ssm: + - '16184' + content_metadata_first_image_height_ssm: + - '13915' + content_metadata_image_file_name_ssm: + - sb904gg2771_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sb904gg2771%2Fsb904gg2771_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sb904gg2771/sb904gg2771_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sb904gg2771/sb904gg2771_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sb904gg2771/sb904gg2771_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sb904gg2771/sb904gg2771_05_0001_full +- :id: vb000vb1451 + :druid_ssi: vb000vb1451 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 242 + + AMERICA + + + + [ca. 1: 11,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + 1784 + + Augsburg + + 1784 + + + 15.7 x 18.7 cm, 16.4 x 23 cm including borders and text. + + + + creator + + Probst, Johann Michael, d. 1809 + + California with nearly flat northern coast and many coastal place names. TERRA ESONIS INCOGNITA and Fretum Anian to northwest, and Paye de Moozemleck to north. + Title cartouche (lower left) with one seated native near an elephant and lion. + Column of text to map right explains map abbreviations. + Similar to map of same title issued by Schrieber, 1749, except for changed cartouche (Entry 233). + Issued in his: Atlas minor ex tabulis geographicis. -- [Augsburg, 1784?]. + None found. + verlegt von loh: Mich: Probst in Augsburg. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICA + full_title_tesim: + - AMERICA + sort_title_tesim: + - AMERICA + sort_title_ssi: AMERICA + personal_name_ssim: + - Probst, Johann Michael, d. 1809 + personal_name_tesim: + - Probst, Johann Michael, d. 1809 + personal_name_ssm: + - Probst, Johann Michael, d. 1809 + origin_place_term_ssim: + - Augsburg + origin_place_term_tesim: + - Augsburg + origin_place_term_ssm: + - Augsburg + origin_date_created_ssim: + - '1784' + - '1784' + origin_date_created_tesim: + - '1784' + - '1784' + origin_date_created_ssm: + - '1784' + - '1784' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - California with nearly flat northern coast and many coastal place names. TERRA + ESONIS INCOGNITA and Fretum Anian to northwest, and Paye de Moozemleck to north. + - Title cartouche (lower left) with one seated native near an elephant and lion. + - Column of text to map right explains map abbreviations. + - Similar to map of same title issued by Schrieber, 1749, except for changed cartouche + (Entry 233). + - 'Issued in his: Atlas minor ex tabulis geographicis. -- [Augsburg, 1784?].' + - None found. + note_Statement of responsibility_tesim: + - 'verlegt von loh: Mich: Probst in Augsburg.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n [ca. 1: 11,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1: 11,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '242' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '242' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - vb000vb1451_05_0001 + content_metadata_first_image_width_ssm: + - '7062' + content_metadata_first_image_height_ssm: + - '4783' + content_metadata_image_file_name_ssm: + - vb000vb1451_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/vb000vb1451%2Fvb000vb1451_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/vb000vb1451/vb000vb1451_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/vb000vb1451/vb000vb1451_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/vb000vb1451/vb000vb1451_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/vb000vb1451/vb000vb1451_05_0001_full +- :id: vy180gj7659 + :druid_ssi: vy180gj7659 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 70 + + L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale des Sciences. + + + + [ca.1:90,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + 1739 + + [France and Italy] + + 1730 + + 70-05 + + 16.2 x 12.4 cm; 17.5 x 13.8 cm. including border. + + + + creator + + Buffier, Claude, 1661-1737 + + California with indented northern coastline and without place names, except on State 9, which is engraved by H. van Loon. Mainland coastline continues northwest to 55 deg. N. The States and Variants listed identify differences between very similar maps and may, with additional research, be re-arranged. + French text. With changed title: L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale des Sciences. Without engraver’s name. No pagination except for “E” below map (bottom right). Leon on mainland; Mexique on mainland of Mexico; Zelande labeled; Tropique du Capricorne; and N York, Baston and Virginie labeled; and with NOUVau MEXIQUE. + Ashley Baynton-Williams; Nordenskiöld 1,40(18)(Italian text, State 2). + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale des Sciences. + full_title_tesim: + - L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale des Sciences. + sort_title_tesim: + - L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale des Sciences. + sort_title_ssi: L'AMERIQUE Suivant les dernieres observations de l'Acad. Royale + des Sciences. + personal_name_ssim: + - Buffier, Claude, 1661-1737 + personal_name_tesim: + - Buffier, Claude, 1661-1737 + personal_name_ssm: + - Buffier, Claude, 1661-1737 + origin_place_term_ssim: + - "[France and Italy]" + origin_place_term_tesim: + - "[France and Italy]" + origin_place_term_ssm: + - "[France and Italy]" + origin_date_created_ssim: + - '1739' + - '1730' + origin_date_created_tesim: + - '1739' + - '1730' + origin_date_created_ssm: + - '1739' + - '1730' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - California with indented northern coastline and without place names, except on + State 9, which is engraved by H. van Loon. Mainland coastline continues northwest + to 55 deg. N. The States and Variants listed identify differences between very + similar maps and may, with additional research, be re-arranged. + note_State 5_tesim: + - 'French text. With changed title: L''AMERIQUE Suivant les dernieres observations + de l''Acad. Royale des Sciences. Without engraver’s name. No pagination except + for “E” below map (bottom right). Leon on mainland; Mexique on mainland of Mexico; + Zelande labeled; Tropique du Capricorne; and N York, Baston and Virginie labeled; + and with NOUVau MEXIQUE.' + - Ashley Baynton-Williams; Nordenskiöld 1,40(18)(Italian text, State 2). + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n [ca.1:90,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:90,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '70' + - 70-05 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '70' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 70-05 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - vy180gj7659_05_0001 + content_metadata_first_image_width_ssm: + - '4137' + content_metadata_first_image_height_ssm: + - '5049' + content_metadata_image_file_name_ssm: + - vy180gj7659_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/vy180gj7659%2Fvy180gj7659_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/vy180gj7659/vy180gj7659_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/vy180gj7659/vy180gj7659_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/vy180gj7659/vy180gj7659_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/vy180gj7659/vy180gj7659_05_0001_full +- :id: nz081wv9348 + :druid_ssi: nz081wv9348 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 45 + + AMERIQUE SEPTENTRIONALE Par N. Sanson Geographe Ord.re du Roy. Reveue et changée en plusieurs endroits suivant les Memoires les plus recents augmentée et corrigée en cette seconde edition + + + Chez Pierre Mariette rüe St. Iacques à l'Esperace + + A PARIS + + 1690 + + 45-02 + + 38 x 54 cm., 39.5 x 55.4 cm. including border. + + + + creator + + Sanson, Guillaume + + 1690, with “augmentée et corrigée en cette seconde edition” inserted in title above Par G. Sanson, and with additions of Detroit d'Anien, Nouvelle Albion, labelling of Terre de Iesso, I. de Pararos instead of I. de Para, and N. Yorc aut added above Amsterdam. Map examined is attached to page of text in columnar form, listing regional place names, and with imprint: A PARIS Chez l’Auteur NICOLAS SANSON dAbbeuille Geogr du Roy aueq Privilege pour dix Ans 1644. R. Cordier Abbauil Sculp (bottom left). + L.C. 484, 486 & 3426; Wagner 399; Tooley 8 & 9; Leighly 53; BN Sanson V E(213); UCB; Nordenskiöld 2,275 (32); Burden 404 (Plate 404). + California based on N. Sanson's map of 1650, with indented northern coastline and many coastal place names. Agubela de Cato as peninsula on mainland to north. Great Lakes are open-ended to west. Decorative title cartouche with cherubs and fruit (upper left). + Par G. Sanson Geogr. Ordinaire du Roy. + + California as an island--Maps + + + North America--Maps + + + + [ca.1:21,500,000] + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERIQUE SEPTENTRIONALE Par N. Sanson Geographe Ord.re du Roy. Reveue et changée + en plusieurs endroits suivant les Memoires les plus recents augmentée et corrigée + en cette seconde edition + full_title_tesim: + - AMERIQUE SEPTENTRIONALE Par N. Sanson Geographe Ord.re du Roy. Reveue et changée + en plusieurs endroits suivant les Memoires les plus recents augmentée et corrigée + en cette seconde edition + sort_title_tesim: + - AMERIQUE SEPTENTRIONALE Par N. Sanson Geographe Ord.re du Roy. Reveue et changée + en plusieurs endroits suivant les Memoires les plus recents augmentée et corrigée + en cette seconde edition + sort_title_ssi: AMERIQUE SEPTENTRIONALE Par N. Sanson Geographe Ord.re du Roy. Reveue + et changée en plusieurs endroits suivant les Memoires les plus recents augmentée + et corrigée en cette seconde edition + personal_name_ssim: + - Sanson, Guillaume + personal_name_tesim: + - Sanson, Guillaume + personal_name_ssm: + - Sanson, Guillaume + origin_place_term_ssim: + - A PARIS + origin_place_term_tesim: + - A PARIS + origin_place_term_ssm: + - A PARIS + origin_date_created_ssim: + - '1690' + origin_date_created_tesim: + - '1690' + origin_date_created_ssm: + - '1690' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 2_tesim: + - '1690, with “augmentée et corrigée en cette seconde edition” inserted in title + above Par G. Sanson, and with additions of Detroit d''Anien, Nouvelle Albion, + labelling of Terre de Iesso, I. de Pararos instead of I. de Para, and N. Yorc + aut added above Amsterdam. Map examined is attached to page of text in columnar + form, listing regional place names, and with imprint: A PARIS Chez l’Auteur NICOLAS + SANSON dAbbeuille Geogr du Roy aueq Privilege pour dix Ans 1644. R. Cordier Abbauil + Sculp (bottom left).' + note_[]_tesim: + - L.C. 484, 486 & 3426; Wagner 399; Tooley 8 & 9; Leighly 53; BN Sanson V E(213); + UCB; Nordenskiöld 2,275 (32); Burden 404 (Plate 404). + - California based on N. Sanson's map of 1650, with indented northern coastline + and many coastal place names. Agubela de Cato as peninsula on mainland to north. + Great Lakes are open-ended to west. Decorative title cartouche with cherubs and + fruit (upper left). + note_Statement of responsibility_tesim: + - Par G. Sanson Geogr. Ordinaire du Roy. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca.1:21,500,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1:21,500,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '45' + - 45-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '45' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 45-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - nz081wv9348_05_0001 + content_metadata_first_image_width_ssm: + - '21411' + content_metadata_first_image_height_ssm: + - '11523' + content_metadata_image_file_name_ssm: + - nz081wv9348_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/nz081wv9348%2Fnz081wv9348_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/nz081wv9348/nz081wv9348_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/nz081wv9348/nz081wv9348_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/nz081wv9348/nz081wv9348_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/nz081wv9348/nz081wv9348_05_0001_full +- :id: wt855xd4818 + :druid_ssi: wt855xd4818 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 82 + + CONTINENT ARCTIQVE + + + 1683 + + [Paris] + + 1683 + + 82-01 + + 1 map : 8.9 cm. diam. within 14.5 x 10.5 cm. including border. + + + + creator + + Manesson-Mallet, Allain, 1630?-1706? + + At page top, above map: TERRES ARCTIQUES. [PAGE] 273[,] FIGURE XCIX. [Figure]273 (map top right). Tome I. (page bottom left) and S (page bottom right). Issued in his: Description de l'univers, Tome I, Paris, 1683. + Issued in his German edition: Beschreibung des ganzen Welt-Kreisses ..., V, Franckfurt, 1684. + At page top, above map: Das unter den Nord=Pol gelogene Veste Land. Fig. 99. With French title inside border and German title outside border. Issued in his: Description de L’Univers … Chez Jean David Zunner .. Francfurt, 1685. Issued in his German edition: Beschreibung des gantzen weltkreises …, J.A. Jung … Frankfurt am Mayn, 1719. + LC 3447, 4280; BN Manesson-Mallet I A(100) & I B; Faupel's Americana 91/71 + Northern hemisphere. Northern part of California shown with nearly flat northern coast. Northwestern coastline of North America starts to extend west near 60 deg. N. Text on verso entitled "Terre de Jesso." + + California as an island--Maps + + + Northern hemisphere--Maps + + + + [ca.1:130,000,000] + Azimuthal Equidistant Polar Projection + (W 0° --E 0°/N 90° --N 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - CONTINENT ARCTIQVE + full_title_tesim: + - CONTINENT ARCTIQVE + sort_title_tesim: + - CONTINENT ARCTIQVE + sort_title_ssi: CONTINENT ARCTIQVE + personal_name_ssim: + - Manesson-Mallet, Allain, 1630?-1706? + personal_name_tesim: + - Manesson-Mallet, Allain, 1630?-1706? + personal_name_ssm: + - Manesson-Mallet, Allain, 1630?-1706? + origin_place_term_ssim: + - "[Paris]" + origin_place_term_tesim: + - "[Paris]" + origin_place_term_ssm: + - "[Paris]" + origin_date_created_ssim: + - '1683' + - '1683' + origin_date_created_tesim: + - '1683' + - '1683' + origin_date_created_ssm: + - '1683' + - '1683' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 0° --E 0°/N 90° --N 90°)" + point_bbox: + - "-0.0 90.0 0.0 90.0" + note_State 1_tesim: + - 'At page top, above map: TERRES ARCTIQUES. [PAGE] 273[,] FIGURE XCIX. [Figure]273 + (map top right). Tome I. (page bottom left) and S (page bottom right). Issued + in his: Description de l''univers, Tome I, Paris, 1683.' + note_State 2_tesim: + - 'Issued in his German edition: Beschreibung des ganzen Welt-Kreisses ..., V, Franckfurt, + 1684.' + note_State 3_tesim: + - 'At page top, above map: Das unter den Nord=Pol gelogene Veste Land. Fig. 99. + With French title inside border and German title outside border. Issued in his: + Description de L’Univers … Chez Jean David Zunner .. Francfurt, 1685. Issued in + his German edition: Beschreibung des gantzen weltkreises …, J.A. Jung … Frankfurt + am Mayn, 1719.' + note_[]_tesim: + - LC 3447, 4280; BN Manesson-Mallet I A(100) & I B; Faupel's Americana 91/71 + - Northern hemisphere. Northern part of California shown with nearly flat northern + coast. Northwestern coastline of North America starts to extend west near 60 deg. + N. Text on verso entitled "Terre de Jesso." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - Northern hemisphere--Maps + subject_topic_tesim: + - California as an island--Maps + - Northern hemisphere--Maps + subject_cartographics_ssim: + - "\n [ca.1:130,000,000]\n Azimuthal Equidistant Polar Projection\n (W + 0° --E 0°/N 90° --N 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:130,000,000]\n Azimuthal Equidistant Polar Projection\n (W + 0° --E 0°/N 90° --N 90°)\n " + identifier_tesim: + - '82' + - 82-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '82' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 82-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - wt855xd4818_05_0001 + content_metadata_first_image_width_ssm: + - '3423' + content_metadata_first_image_height_ssm: + - '5086' + content_metadata_image_file_name_ssm: + - wt855xd4818_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/wt855xd4818%2Fwt855xd4818_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/wt855xd4818/wt855xd4818_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/wt855xd4818/wt855xd4818_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/wt855xd4818/wt855xd4818_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/wt855xd4818/wt855xd4818_05_0001_full +- :id: jy409qg0248 + :druid_ssi: jy409qg0248 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 75 + + Novissima et Accuratissima TOTIUS AMERICÆ DESCRIPTIO. + + + 1680 + + Amstelodami + + 1680 + + 75-02 + + 1 map : hand col.; 47.1 x 56.6 cm., 49.2 x 57.8 cm. including border. + + + + creator + + Danckerts, Justus, 1635-1701 + + Similar to DeWit's map of same title, with copied title cartouche and plaque surrounded by angels. New Guinea, Solomon Islands and Quiri Regio, Fretum Aniani and Terra Esonis are added to the plate, as in 2nd State of DeWit's map [1680], although vignettes of ships are not removed, and I.de Pararos, off California coast is now named I.de Mara al Pararos. Number '6.' in manuscript (sheet top right). + Koeman,II,Dan1(2). + California as an island with indented northern coast. Peninsula named Agubela de Cato to northeast. Similar to DeWit's 1670 map of same title, with copied title cartouche and plaque surrounded by angels. I.de Pararos, off California coast, is now named I.de Mara al Pararos. + per I. Danckerts. + + America--Maps + + + California as an island--Maps + + + + [ca.1:38,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Novissima et Accuratissima TOTIUS AMERICÆ DESCRIPTIO. + full_title_tesim: + - Novissima et Accuratissima TOTIUS AMERICÆ DESCRIPTIO. + sort_title_tesim: + - Novissima et Accuratissima TOTIUS AMERICÆ DESCRIPTIO. + sort_title_ssi: Novissima et Accuratissima TOTIUS AMERICÆ DESCRIPTIO. + personal_name_ssim: + - Danckerts, Justus, 1635-1701 + personal_name_tesim: + - Danckerts, Justus, 1635-1701 + personal_name_ssm: + - Danckerts, Justus, 1635-1701 + origin_place_term_ssim: + - Amstelodami + origin_place_term_tesim: + - Amstelodami + origin_place_term_ssm: + - Amstelodami + origin_date_created_ssim: + - '1680' + - '1680' + origin_date_created_tesim: + - '1680' + - '1680' + origin_date_created_ssm: + - '1680' + - '1680' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 2_tesim: + - Similar to DeWit's map of same title, with copied title cartouche and plaque surrounded + by angels. New Guinea, Solomon Islands and Quiri Regio, Fretum Aniani and Terra + Esonis are added to the plate, as in 2nd State of DeWit's map [1680], although + vignettes of ships are not removed, and I.de Pararos, off California coast is + now named I.de Mara al Pararos. Number '6.' in manuscript (sheet top right). + note_[]_tesim: + - Koeman,II,Dan1(2). + - California as an island with indented northern coast. Peninsula named Agubela + de Cato to northeast. Similar to DeWit's 1670 map of same title, with copied title + cartouche and plaque surrounded by angels. I.de Pararos, off California coast, + is now named I.de Mara al Pararos. + note_Statement of responsibility_tesim: + - per I. Danckerts. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:38,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:38,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '75' + - 75-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '75' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 75-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - jy409qg0248_05_0001 + content_metadata_first_image_width_ssm: + - '14378' + content_metadata_first_image_height_ssm: + - '12302' + content_metadata_image_file_name_ssm: + - jy409qg0248_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/jy409qg0248%2Fjy409qg0248_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/jy409qg0248/jy409qg0248_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/jy409qg0248/jy409qg0248_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/jy409qg0248/jy409qg0248_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/jy409qg0248/jy409qg0248_05_0001_full +- :id: kw406zk5778 + :druid_ssi: kw406zk5778 + mods_xml_ssm: + - | + + + + Both hemispheres, each approximately 13 cm diameter. + + cartographic + map + Digital Maps + Early Maps + + [America] + + + + creator + + Burnet, Thomas, 1635?-1715 + + + 1700 + + [Amsterdam] + + 1700 + + 77-05 + 77 + Western Hemisphere of azimuthal equal-area projection. No place names except for the label “America” on the continent. Attempt to show the ocean floor in relief. California as an island similar to second Sanson model but with a more angular northwest tip, as by Colom and Doncker. + Shirley 507; UCB; Ashley Baynton-Williams. + Issued in: Boor-bereidselen tot de bybelsche wysheid, en gebruik der heilige en kerklijke historien ... / by Wilhelmus Goeree. -- Amsterdam, 1700? + [1700?], both hemispheres (each approximately 13 cm. diameter) with very rough edges; Western Hemisphere at page bottom with text below: “Den Aardkloot van water ontbloot, na twee zijden aante sien.”; and with “909” at top right. + + + (W 180° --E 180°/N 85° --S 85°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[America]" + full_title_tesim: + - "[America]" + sort_title_tesim: + - "[America]" + sort_title_ssi: "[America]" + personal_name_ssim: + - Burnet, Thomas, 1635?-1715 + personal_name_tesim: + - Burnet, Thomas, 1635?-1715 + personal_name_ssm: + - Burnet, Thomas, 1635?-1715 + origin_place_term_ssim: + - "[Amsterdam]" + origin_place_term_tesim: + - "[Amsterdam]" + origin_place_term_ssm: + - "[Amsterdam]" + origin_date_created_ssim: + - '1700' + - '1700' + origin_date_created_tesim: + - '1700' + - '1700' + origin_date_created_ssm: + - '1700' + - '1700' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 180° --E 180°/N 85° --S 85°)" + point_bbox: + - "-180.0 -85.0 180.0 85.0" + note_[]_tesim: + - Western Hemisphere of azimuthal equal-area projection. No place names except for + the label “America” on the continent. Attempt to show the ocean floor in relief. + California as an island similar to second Sanson model but with a more angular + northwest tip, as by Colom and Doncker. + - Shirley 507; UCB; Ashley Baynton-Williams. + - 'Issued in: Boor-bereidselen tot de bybelsche wysheid, en gebruik der heilige + en kerklijke historien ... / by Wilhelmus Goeree. -- Amsterdam, 1700?' + note_State 5_tesim: + - "[1700?], both hemispheres (each approximately 13 cm. diameter) with very rough + edges; Western Hemisphere at page bottom with text below: “Den Aardkloot van water + ontbloot, na twee zijden aante sien.”; and with “909” at top right." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + subject_cartographics_tesim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + identifier_tesim: + - 77-05 + - '77' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 77-05 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '77' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - kw406zk5778_05_0001 + content_metadata_first_image_width_ssm: + - '4839' + content_metadata_first_image_height_ssm: + - '7767' + content_metadata_image_file_name_ssm: + - kw406zk5778_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/kw406zk5778%2Fkw406zk5778_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/kw406zk5778/kw406zk5778_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/kw406zk5778/kw406zk5778_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/kw406zk5778/kw406zk5778_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/kw406zk5778/kw406zk5778_05_0001_full +- :id: sx619yv5558 + :druid_ssi: sx619yv5558 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 132 + + Recentissima NOVI ORBIS, Sive AMERICÆ SEPTENTRIONALIS et MERIDIONALIS TABULA + + + 1721 + + [S.l.] + + 1721 + + 132-02 + + 48.1 x 56.9 cm., 49.7 x 58.5 cm. including border. + + + + creator + + Allard, Carel, 1648-ca. 1709 + + Separate Map + [1721?], with changed imprint: Per Caroli Allard ex Officina I. Cóvens et C. Mortier Cum Privilegio. Possibly a separate issue as it is not noted in the known Covens and Mortier atlases. (Covens and Mortier were registered as a business in 1721.) + California as an island on second Sanson model, with indented northern coast. Immediately north is large land mass, Terra Esonis, stretching between America Septentrionalis and Iaponiz' Ins. (Japan) and Yedso. Engraved by: Ph. Tideman del [;] G.v. Gouwen sculp. (bottom left). Title cartouche same as on G.& L. Valck's map of 1710 with crown of feathers, "America" (female native) surrounded by native flora and fauna, receiving a subject (lower left). But this map has added inset (bottom left) of part of Zeelandia Nova. + Tooley 65; Leighly 109 (Plate XVI); Koeman, I, p.33 (Al.4); Koeman, I, All 3 (52). + Per Caroli Allard ex Officina I. Cóvens et C. Mortier Cum Privilegio + + America--Maps + + + California as an island--Maps + + + + [ca. 1:38,000,000]. + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Recentissima NOVI ORBIS, Sive AMERICÆ SEPTENTRIONALIS et MERIDIONALIS TABULA + full_title_tesim: + - Recentissima NOVI ORBIS, Sive AMERICÆ SEPTENTRIONALIS et MERIDIONALIS TABULA + sort_title_tesim: + - Recentissima NOVI ORBIS, Sive AMERICÆ SEPTENTRIONALIS et MERIDIONALIS TABULA + sort_title_ssi: Recentissima NOVI ORBIS, Sive AMERICÆ SEPTENTRIONALIS et MERIDIONALIS + TABULA + personal_name_ssim: + - Allard, Carel, 1648-ca. 1709 + personal_name_tesim: + - Allard, Carel, 1648-ca. 1709 + personal_name_ssm: + - Allard, Carel, 1648-ca. 1709 + origin_place_term_ssim: + - "[S.l.]" + origin_place_term_tesim: + - "[S.l.]" + origin_place_term_ssm: + - "[S.l.]" + origin_date_created_ssim: + - '1721' + - '1721' + origin_date_created_tesim: + - '1721' + - '1721' + origin_date_created_ssm: + - '1721' + - '1721' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 2_tesim: + - "[1721?], with changed imprint: Per Caroli Allard ex Officina I. Cóvens et C. + Mortier Cum Privilegio. Possibly a separate issue as it is not noted in the known + Covens and Mortier atlases. (Covens and Mortier were registered as a business + in 1721.)" + note_[]_tesim: + - 'California as an island on second Sanson model, with indented northern coast. + Immediately north is large land mass, Terra Esonis, stretching between America + Septentrionalis and Iaponiz'' Ins. (Japan) and Yedso. Engraved by: Ph. Tideman + del [;] G.v. Gouwen sculp. (bottom left). Title cartouche same as on G.& L. Valck''s + map of 1710 with crown of feathers, "America" (female native) surrounded by native + flora and fauna, receiving a subject (lower left). But this map has added inset + (bottom left) of part of Zeelandia Nova.' + - Tooley 65; Leighly 109 (Plate XVI); Koeman, I, p.33 (Al.4); Koeman, I, All 3 (52). + note_Statement of responsibility_tesim: + - Per Caroli Allard ex Officina I. Cóvens et C. Mortier Cum Privilegio + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1:38,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:38,000,000].\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '132' + - 132-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '132' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 132-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sx619yv5558_05_0001 + content_metadata_first_image_width_ssm: + - '14881' + content_metadata_first_image_height_ssm: + - '12680' + content_metadata_image_file_name_ssm: + - sx619yv5558_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sx619yv5558%2Fsx619yv5558_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sx619yv5558/sx619yv5558_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sx619yv5558/sx619yv5558_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sx619yv5558/sx619yv5558_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sx619yv5558/sx619yv5558_05_0001_full +- :id: zq083qg2931 + :druid_ssi: zq083qg2931 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 159 + + [Pacific Ocean] + + + + [ca.1:36,000,000] + (E 110° --W 70°/N 63° --S 53°) + + + + 1703 + + [Munich] + + 1703 + + + 1 map : 23.1 x 34.5 cm. including border. + + + Scherer, Heinrich, 1628-1704. + + + California as an island--Maps + + California with indented northern coast. Map in reverse. + "INSVLA CALIFORNIA" AND "MARE VERMEIO" on map left and "IAPONIA","TARTARIA", "CHINENSIS" and "CHINA" on map right. Shows interior mountains on California and Fortunæ, C. Blanco and C. Mendocino & Arboledo. + Globe, Fig.II, near page center, also with mapping in reverse. + Above globe, American and Asian figures hold large ruler marked in "Leucæ Germanicæ". Map lower left gives distance measurements in Levcæ Germanicæ Commvnes, Levcæ Gallicæ and Milliaria Italica. + From: Geographia politica. Sive historia geographica exhibens totius orbis terraquei status et regimen politicum cum adjectis potissimarum nationum, regnorum ac provinciarum geniis et typis geographicis, Authore P. Henrico Scherer, Societatis Jesu. Pars IV. Sumptibus Joannis Caspari Bencard, Bibliopolæ Academiæ. Monarchii, Typis, Mariæ Magdalenæ Rauchin Viduæ, Anno M.DCCIII. : Atlas Novus exhibens orbem terraqueum per naturæ opera, historiæ novæ ac veteris monumenta, artisque geographicæ leges et præcepta. Hoc est: Geographic universa in septem partes contracta, et instructa ducentis fere chartis geographicis, ac figuris, cujus; Pars IV ... Geographia politica; FOL. I.D. Fig. I.; following [p.] 808. 7 parts (pars) published 1702-10; reissued 1730-37. + UCB. + [P. Henrico Scherer]. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[Pacific Ocean]" + full_title_tesim: + - "[Pacific Ocean]" + sort_title_tesim: + - "[Pacific Ocean]" + sort_title_ssi: "[Pacific Ocean]" + personal_name_ssim: + - Scherer, Heinrich, 1628-1704. + personal_name_tesim: + - Scherer, Heinrich, 1628-1704. + personal_name_ssm: + - Scherer, Heinrich, 1628-1704. + origin_place_term_ssim: + - "[Munich]" + origin_place_term_tesim: + - "[Munich]" + origin_place_term_ssm: + - "[Munich]" + origin_date_created_ssim: + - '1703' + - '1703' + origin_date_created_tesim: + - '1703' + - '1703' + origin_date_created_ssm: + - '1703' + - '1703' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(E 110° --W 70°/N 63° --S 53°)" + point_bbox: + - 110.0 -53.0 -70.0 63.0 + note_[]_tesim: + - California with indented northern coast. Map in reverse. + - '"INSVLA CALIFORNIA" AND "MARE VERMEIO" on map left and "IAPONIA","TARTARIA", + "CHINENSIS" and "CHINA" on map right. Shows interior mountains on California and + Fortunæ, C. Blanco and C. Mendocino & Arboledo.' + - Globe, Fig.II, near page center, also with mapping in reverse. + - Above globe, American and Asian figures hold large ruler marked in "Leucæ Germanicæ". + Map lower left gives distance measurements in Levcæ Germanicæ Commvnes, Levcæ + Gallicæ and Milliaria Italica. + - 'From: Geographia politica. Sive historia geographica exhibens totius orbis terraquei + status et regimen politicum cum adjectis potissimarum nationum, regnorum ac provinciarum + geniis et typis geographicis, Authore P. Henrico Scherer, Societatis Jesu. Pars + IV. Sumptibus Joannis Caspari Bencard, Bibliopolæ Academiæ. Monarchii, Typis, + Mariæ Magdalenæ Rauchin Viduæ, Anno M.DCCIII. : Atlas Novus exhibens orbem terraqueum + per naturæ opera, historiæ novæ ac veteris monumenta, artisque geographicæ leges + et præcepta. Hoc est: Geographic universa in septem partes contracta, et instructa + ducentis fere chartis geographicis, ac figuris, cujus; Pars IV ... Geographia + politica; FOL. I.D. Fig. I.; following [p.] 808. 7 parts (pars) published 1702-10; + reissued 1730-37.' + - UCB. + note_Statement of responsibility_tesim: + - "[P. Henrico Scherer]." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + subject_topic_tesim: + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:36,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + subject_cartographics_tesim: + - "\n [ca.1:36,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + identifier_tesim: + - '159' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '159' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zq083qg2931_05_0001 + content_metadata_first_image_width_ssm: + - '9107' + content_metadata_first_image_height_ssm: + - '6506' + content_metadata_image_file_name_ssm: + - zq083qg2931_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zq083qg2931%2Fzq083qg2931_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zq083qg2931/zq083qg2931_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zq083qg2931/zq083qg2931_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zq083qg2931/zq083qg2931_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zq083qg2931/zq083qg2931_05_0001_full +- :id: sn343fc0807 + :druid_ssi: sn343fc0807 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 89 + + AMERICQVE SEPTENTRIONALE + + + 1682 + + [Utrecht] + + 1682 + + 89-01 + + 18.8 x 26.8 cm.; 19.8 x 27.8 cm. including border. + + + + creator + + Sanson, Nicolas, 1600-1667 + + Separate Map + In French. California with flat northern coastline. + [1682?], California with indented northern coastline. In French. + [1705], in Dutch and French, with changed title: NOORDER AMERICA. / Door N. Sanson d'Abbeville Geographe du Roy. California with indented northern coastline. Issued in: Algeemeene Weereld-Beschreibung ... / Pherotee De La Croix. -- Amsterdam : Francois Halma, 1705. + LC 494; Wheat 51 (State 2); Leighly 29; BN Sanson II F(1); UCB (State 2); Nordenskiöld 3, 713(13) and 3, 359(3); Burden 324 (Plate 324). + Par N. Sanson...d'.Abbeville Geographe du Roÿ + Issued in: Curieuse aenmerckingen der bysonderste oost en west-Indische ... / door S.[imon] de Vries I. Deel. -- tot Utregt By I:Ribbius, 1682. Issued in his: L’Europe [l’Asie, l’Afrique, l’Amérique] en plusieurs cartes, et en divers traités de géographie et d’histoire ... , Paris : chez l’autheur, 1683. Issued in his: L'Amerique en plusieurs cartes nouvelles et exactes, et en divers traittez de graphie & d'histoire... , [Amsterdam], [1683]. Issued in: Introductio ad geographicam / J. Luyts. -- Utrecht : Francis Halma, 1692 + California with northern coastline sloping up to east. Few place names on island: C. Blanco, C. Mendocino, C. de Pinos, C. de S. Lucas. Terre de Iesso to northwest. Great Lakes open-ended to west. Title cartouche of scrollwork (upper left). Engraved by: A. d'Winter sculp (lower left). Nearly identical with 1657 map of same title, engraved by A. Peyrounin (Entry 18). + + California as an island--Maps + + + North America--Maps + + + + [ca.1:40,000,000] + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICQVE SEPTENTRIONALE + full_title_tesim: + - AMERICQVE SEPTENTRIONALE + sort_title_tesim: + - AMERICQVE SEPTENTRIONALE + sort_title_ssi: AMERICQVE SEPTENTRIONALE + personal_name_ssim: + - Sanson, Nicolas, 1600-1667 + personal_name_tesim: + - Sanson, Nicolas, 1600-1667 + personal_name_ssm: + - Sanson, Nicolas, 1600-1667 + origin_place_term_ssim: + - "[Utrecht]" + origin_place_term_tesim: + - "[Utrecht]" + origin_place_term_ssm: + - "[Utrecht]" + origin_date_created_ssim: + - '1682' + - '1682' + origin_date_created_tesim: + - '1682' + - '1682' + origin_date_created_ssm: + - '1682' + - '1682' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 1_tesim: + - In French. California with flat northern coastline. + note_State 2_tesim: + - "[1682?], California with indented northern coastline. In French." + note_State 3_tesim: + - "[1705], in Dutch and French, with changed title: NOORDER AMERICA. / Door N. Sanson + d'Abbeville Geographe du Roy. California with indented northern coastline. Issued + in: Algeemeene Weereld-Beschreibung ... / Pherotee De La Croix. -- Amsterdam : + Francois Halma, 1705." + note_[]_tesim: + - LC 494; Wheat 51 (State 2); Leighly 29; BN Sanson II F(1); UCB (State 2); Nordenskiöld + 3, 713(13) and 3, 359(3); Burden 324 (Plate 324). + - 'Issued in: Curieuse aenmerckingen der bysonderste oost en west-Indische ... / + door S.[imon] de Vries I. Deel. -- tot Utregt By I:Ribbius, 1682. Issued in his: + L’Europe [l’Asie, l’Afrique, l’Amérique] en plusieurs cartes, et en divers traités + de géographie et d’histoire ... , Paris : chez l’autheur, 1683. Issued in his: + L''Amerique en plusieurs cartes nouvelles et exactes, et en divers traittez de + graphie & d''histoire... , [Amsterdam], [1683]. Issued in: Introductio ad geographicam + / J. Luyts. -- Utrecht : Francis Halma, 1692' + - 'California with northern coastline sloping up to east. Few place names on island: + C. Blanco, C. Mendocino, C. de Pinos, C. de S. Lucas. Terre de Iesso to northwest. + Great Lakes open-ended to west. Title cartouche of scrollwork (upper left). Engraved + by: A. d''Winter sculp (lower left). Nearly identical with 1657 map of same title, + engraved by A. Peyrounin (Entry 18).' + note_Statement of responsibility_tesim: + - Par N. Sanson...d'.Abbeville Geographe du Roÿ + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca.1:40,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1:40,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '89' + - 89-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '89' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 89-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sn343fc0807_05_0001 + content_metadata_first_image_width_ssm: + - '5181' + content_metadata_first_image_height_ssm: + - '3534' + content_metadata_image_file_name_ssm: + - sn343fc0807_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sn343fc0807%2Fsn343fc0807_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sn343fc0807/sn343fc0807_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sn343fc0807/sn343fc0807_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sn343fc0807/sn343fc0807_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sn343fc0807/sn343fc0807_05_0001_full +- :id: ym733yc1437 + :druid_ssi: ym733yc1437 + mods_xml_ssm: + - | + + + + [Maps of the world] + + + A new and universal dictionary of arts and sciences: ... With an introductory preface, ... And illustrated with a great number of copper-plates, engraven by the best hands + + + Seale, Richard William. + + + Hinton, John + -1781 + + + Barrow, John + teacher of mathematics + + cartographic + map + Maps. + Digital maps. + Early maps. + + + enk + + + London + + Printed for J. Hinton at the Kings Arms in Newgate Street + [1751] + 1751 + monographic + + + eng + + + 7 maps on 1 sheet ; 10.5 x 10.5 cm. or smaller, on sheet 37.5 x 25 cm. + + R.W. Seale Sculp; Printed for J. Hinton. + Relief shown pictorially. + California shown as an island visible in several figures. Figure 7 is double hemisphere world map, showing California as a labeled island with no place names. + Includes 10 figures on page. + "Plate XLI. Engraved for the New Dictionary of Arts and Sciences. Facing Map." at top. "Printed for J. Hinton at the Kings Arms in Newgate Street." at bottom "R.W. Seale Sculp" at bottom right, inside neat line. + From A new and universal dictionary of arts and sciences: ... With an introductory preface, ... And illustrated with a great number of copper-plates, engraven by the best hands. + McLaughlin map number 1135. + + + Scales differ + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + aacr + CSt-ES + 121129 + a9761901 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[Maps of the world]" + full_title_tesim: + - "[Maps of the world]" + - 'A new and universal dictionary of arts and sciences: ... With an introductory + preface, ... And illustrated with a great number of copper-plates, engraven by + the best hands' + alternative_title_tesim: + - 'A new and universal dictionary of arts and sciences: ... With an introductory + preface, ... And illustrated with a great number of copper-plates, engraven by + the best hands' + sort_title_tesim: + - "[Maps of the world]" + sort_title_ssi: "[Maps of the world]" + personal_name_ssim: + - Seale, Richard William. + - Hinton, John + - Barrow, John teacher of mathematics + personal_name_tesim: + - Seale, Richard William. + - Hinton, John + - Barrow, John teacher of mathematics + personal_name_ssm: + - Seale, Richard William. + - Hinton, John + - Barrow, John teacher of mathematics + language_ssim: + - English + language_tesim: + - English + language_ssm: + - English + origin_place_term_ssim: + - enk + - London + origin_place_term_tesim: + - enk + - London + origin_place_term_ssm: + - enk + - London + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Maps. + - Digital maps. + - Early maps. + genre_tesim: + - map + - Maps. + - Digital maps. + - Early maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - R.W. Seale Sculp; Printed for J. Hinton. + - Relief shown pictorially. + - California shown as an island visible in several figures. Figure 7 is double hemisphere + world map, showing California as a labeled island with no place names. + - Includes 10 figures on page. + - '"Plate XLI. Engraved for the New Dictionary of Arts and Sciences. Facing Map." + at top. "Printed for J. Hinton at the Kings Arms in Newgate Street." at bottom + "R.W. Seale Sculp" at bottom right, inside neat line.' + - 'From A new and universal dictionary of arts and sciences: ... With an introductory + preface, ... And illustrated with a great number of copper-plates, engraven by + the best hands.' + note_Local note_tesim: + - McLaughlin map number 1135. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scales differ\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scales differ\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - ym733yc1437_05_0001 + content_metadata_first_image_width_ssm: + - '6182' + content_metadata_first_image_height_ssm: + - '10070' + content_metadata_image_file_name_ssm: + - ym733yc1437_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/ym733yc1437%2Fym733yc1437_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/ym733yc1437/ym733yc1437_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/ym733yc1437/ym733yc1437_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/ym733yc1437/ym733yc1437_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/ym733yc1437/ym733yc1437_05_0001_full +- :id: rz043dh7915 + :druid_ssi: rz043dh7915 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 61-02 + 61 + 19 + + MAR DEL ZUR HISPANIS MARE PACIFICUM. + + + 1676 + + [Amsterdam] + + 1676 + + 19-03 + + 1 map : 52.4 x 60.6 cm.; 53 x 61.1 cm. including border. + + + + creator + + Doncker, Hendrick, 1626-1699 + + Issued by Hendrick Doncker, in Amsterdam. Without island chain. Dedication: Ampl.mo Spectat.mo Gravissimog Viro D.D. Georgio Backer... Hendrick Doncker. (lower left), with coat-of-arms above. With part of "Zeelandia Nova" (New Zealand) added. + Koeman,IV,Don16[78]; Koeman, IV,Don29(67); L.C. 464, 480 & 3330; Koeman,IV,A.Col 3(18). + Map of the Pacific with California as an island of Briggs type, with nearly flat northern coast, and with many place names. "Mare Vermio" to its east. Scale given below title cartouche (upper right): Millaria Germanica Commùnia. Based on Jansson map of 1650 of same title (state 1). Colom map lacks "Terra Incognita" to north. Jansson's scale cartouche is replaced by a dedication (bottom left) and the title cartouche of Asians is replaced by standing women blowing trumpets (top right). + + America--Maps + + + California as an island--Maps + + + + [ca. 1:30,000,000] + (E 110° --W 70°/N 63° --S 53°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - MAR DEL ZUR HISPANIS MARE PACIFICUM. + full_title_tesim: + - MAR DEL ZUR HISPANIS MARE PACIFICUM. + sort_title_tesim: + - MAR DEL ZUR HISPANIS MARE PACIFICUM. + sort_title_ssi: MAR DEL ZUR HISPANIS MARE PACIFICUM. + personal_name_ssim: + - Doncker, Hendrick, 1626-1699 + personal_name_tesim: + - Doncker, Hendrick, 1626-1699 + personal_name_ssm: + - Doncker, Hendrick, 1626-1699 + origin_place_term_ssim: + - "[Amsterdam]" + origin_place_term_tesim: + - "[Amsterdam]" + origin_place_term_ssm: + - "[Amsterdam]" + origin_date_created_ssim: + - '1676' + - '1676' + origin_date_created_tesim: + - '1676' + - '1676' + origin_date_created_ssm: + - '1676' + - '1676' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(E 110° --W 70°/N 63° --S 53°)" + point_bbox: + - 110.0 -53.0 -70.0 63.0 + note_State 3_tesim: + - 'Issued by Hendrick Doncker, in Amsterdam. Without island chain. Dedication: Ampl.mo + Spectat.mo Gravissimog Viro D.D. Georgio Backer... Hendrick Doncker. (lower left), + with coat-of-arms above. With part of "Zeelandia Nova" (New Zealand) added.' + note_[]_tesim: + - Koeman,IV,Don16[78]; Koeman, IV,Don29(67); L.C. 464, 480 & 3330; Koeman,IV,A.Col + 3(18). + - 'Map of the Pacific with California as an island of Briggs type, with nearly flat + northern coast, and with many place names. "Mare Vermio" to its east. Scale given + below title cartouche (upper right): Millaria Germanica Commùnia. Based on Jansson + map of 1650 of same title (state 1). Colom map lacks "Terra Incognita" to north. + Jansson''s scale cartouche is replaced by a dedication (bottom left) and the title + cartouche of Asians is replaced by standing women blowing trumpets (top right).' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1:30,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:30,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + identifier_tesim: + - 61-02 + - '61' + - '19' + - 19-03 + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 61-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '61' + identifier_local_Updated McLaughlin Book Number_tesim: + - '19' + identifier_local_Updated McLaughlin book number with latest state information_tesim: + - 19-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - rz043dh7915_05_0001 + content_metadata_first_image_width_ssm: + - '10047' + content_metadata_first_image_height_ssm: + - '8544' + content_metadata_image_file_name_ssm: + - rz043dh7915_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/rz043dh7915%2Frz043dh7915_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/rz043dh7915/rz043dh7915_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/rz043dh7915/rz043dh7915_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/rz043dh7915/rz043dh7915_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/rz043dh7915/rz043dh7915_05_0001_full +- :id: qb677kc3995 + :druid_ssi: qb677kc3995 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 15 + + L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + + + + A PARIS + + 1684 + + 15-08 + + 35.5 x 36.8 cm., 36.7 x 38.1 cm. including border. + + + + creator + + Duval, P. (Pierre), 1619-1682 + + 1684, with additions of "Partie de la grande Terre Australe" added (lower right) and pictorial cartouche of native and his canoe and net surrounds "Explication des Marques", and with "chez l'Autheur au coin de la rüe de Harlay, proche le Palais." California with 12 place names and with Mer de Californie named; Anien shown on mainland where coastline continues north and forms large bay. Explanatory text in North America, and many added place names throughout. + California with flat northern coast sloping up to east. Destroit d' Anien, Anien, and Terre de Iesso to the north. + Wagner 425; Wheat 64; Tooley 20 (Plate 36) & 21; Leighly 45; BN Duval II B(4); BN Duval II C(11); UCB; Philip Burden, correspondence, 1995; Burden 311 (Plate312). + Par P. Du Val d'Abbeuille Geographe Ordinaire du Roy. + + America--Maps + + + California as an island--Maps + + + + [ca. 1:36,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + full_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + sort_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + sort_title_ssi: L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + personal_name_ssim: + - Duval, P. (Pierre), 1619-1682 + personal_name_tesim: + - Duval, P. (Pierre), 1619-1682 + personal_name_ssm: + - Duval, P. (Pierre), 1619-1682 + origin_place_term_ssim: + - A PARIS + origin_place_term_tesim: + - A PARIS + origin_place_term_ssm: + - A PARIS + origin_date_created_ssim: + - '1684' + origin_date_created_tesim: + - '1684' + origin_date_created_ssm: + - '1684' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 8_tesim: + - 1684, with additions of "Partie de la grande Terre Australe" added (lower right) + and pictorial cartouche of native and his canoe and net surrounds "Explication + des Marques", and with "chez l'Autheur au coin de la rüe de Harlay, proche le + Palais." California with 12 place names and with Mer de Californie named; Anien + shown on mainland where coastline continues north and forms large bay. Explanatory + text in North America, and many added place names throughout. + note_[]_tesim: + - California with flat northern coast sloping up to east. Destroit d' Anien, Anien, + and Terre de Iesso to the north. + - Wagner 425; Wheat 64; Tooley 20 (Plate 36) & 21; Leighly 45; BN Duval II B(4); + BN Duval II C(11); UCB; Philip Burden, correspondence, 1995; Burden 311 (Plate312). + note_Statement of responsibility_tesim: + - Par P. Du Val d'Abbeuille Geographe Ordinaire du Roy. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1:36,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:36,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '15' + - 15-08 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '15' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 15-08 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - qb677kc3995_05_0001 + content_metadata_first_image_width_ssm: + - '10100' + content_metadata_first_image_height_ssm: + - '7600' + content_metadata_image_file_name_ssm: + - qb677kc3995_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/qb677kc3995%2Fqb677kc3995_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/qb677kc3995/qb677kc3995_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/qb677kc3995/qb677kc3995_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/qb677kc3995/qb677kc3995_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/qb677kc3995/qb677kc3995_05_0001_full +- :id: zn001wm6450 + :druid_ssi: zn001wm6450 + mods_xml_ssm: + - | + + + 15-10 + 15 + + L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + + cartographic + + Chez Mad.lle Du Val Fille de l'Auteur sur le Quay de l'Orloge du Palais. + + A PARIS + + 1684 + + + + creator + + Duval, P. (Pierre), 1619-1682 + + map + Digital Maps + Early Maps + + 35.5 x 36.8 cm., 36.7 x 38.1 cm. including border. + digitized other analog + + + Lyberteam Metadata ToolKit + + California with flat northern coast sloping up to east. Destroit d' Anien, Anien, and Terre de Iesso to the north. + Wagner 425; Wheat 64; Tooley 20 (Plate 36) & 21; Leighly 45; BN Duval II B(4); BN Duval II C(11); UCB; Philip Burden, correspondence, 1995; Burden 311 (Plate312). + 1684, with additions of "Partie de la grande Terre Australe" added (lower right) and pictorial cartouche of native and his canoe and net surrounds "Explication des Marques", and with "chez Mad.lle Du Val Fille de l'Auteur sur le Quay de l'Orloge du Palais." California with 12 place names and with Mer de Californie named; Anien shown on mainland where coastline continues north and forms large bay. Explanatory text in North America, and many added place names throughout. + Par P. Du Val d'Abbeuille Geographe Ordinaire du Roy. + + California as an island--Maps + + + America--Maps + + + + [ca. 1:36,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + full_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + sort_title_tesim: + - L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + sort_title_ssi: L'AMERIQVE autrement Le NOVVEAV MONDE et INDES OCCIDENTALES + personal_name_ssim: + - Duval, P. (Pierre), 1619-1682 + personal_name_tesim: + - Duval, P. (Pierre), 1619-1682 + personal_name_ssm: + - Duval, P. (Pierre), 1619-1682 + origin_place_term_ssim: + - A PARIS + origin_place_term_tesim: + - A PARIS + origin_place_term_ssm: + - A PARIS + origin_date_created_ssim: + - '1684' + origin_date_created_tesim: + - '1684' + origin_date_created_ssm: + - '1684' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_[]_tesim: + - California with flat northern coast sloping up to east. Destroit d' Anien, Anien, + and Terre de Iesso to the north. + - Wagner 425; Wheat 64; Tooley 20 (Plate 36) & 21; Leighly 45; BN Duval II B(4); + BN Duval II C(11); UCB; Philip Burden, correspondence, 1995; Burden 311 (Plate312). + note_State 10_tesim: + - 1684, with additions of "Partie de la grande Terre Australe" added (lower right) + and pictorial cartouche of native and his canoe and net surrounds "Explication + des Marques", and with "chez Mad.lle Du Val Fille de l'Auteur sur le Quay de l'Orloge + du Palais." California with 12 place names and with Mer de Californie named; Anien + shown on mainland where coastline continues north and forms large bay. Explanatory + text in North America, and many added place names throughout. + note_Statement of responsibility_tesim: + - Par P. Du Val d'Abbeuille Geographe Ordinaire du Roy. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - America--Maps + subject_topic_tesim: + - California as an island--Maps + - America--Maps + subject_cartographics_ssim: + - "\n [ca. 1:36,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:36,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - 15-10 + - '15' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 15-10 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '15' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zn001wm6450_05_0001 + content_metadata_first_image_width_ssm: + - '9946' + content_metadata_first_image_height_ssm: + - '7504' + content_metadata_image_file_name_ssm: + - zn001wm6450_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zn001wm6450%2Fzn001wm6450_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zn001wm6450/zn001wm6450_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zn001wm6450/zn001wm6450_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zn001wm6450/zn001wm6450_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zn001wm6450/zn001wm6450_05_0001_full +- :id: fh912bx9878 + :druid_ssi: fh912bx9878 + mods_xml_ssm: + - | + + + + [Americas] + + + Homann, Johann Baptist + 1663-1724 + + cartographic + map + Early maps. + Digital maps. + Maps. + + + gw + + + [Noribergae + + J.B. Homann + 1719] + 1719 + monographic + + + und + + + 1 map : hand col. ; 23 x 28 cm. + + + California shown as an island labeled C., with an indented northern coast line. + "One of the earliest school atlases to use a system of letters on blank maps that are coded to a separate key list. This method was based on a teaching system formulated by Johann Hübner (1668-1731) and adapted by Homann"--David Rumsey Collection catalog. + Folded. 6th map in book. + McLaughlin map number 1285. + + + Scale not given + (W 160°--E 10°/N 80°--S 60°). + + + + World maps + Early works to 1800 + + + + Atlas methodicus explorandis juvenum profectibus in studio geographico ad methodum Hübnerianam accomodatus + + + Homann, Johann Baptist, 1663-1724. + + + + aacr + CSt-ES + 130429 + a9957790 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[Americas]" + full_title_tesim: + - "[Americas]" + sort_title_tesim: + - "[Americas]" + sort_title_ssi: "[Americas]" + personal_name_ssim: + - Homann, Johann Baptist + personal_name_tesim: + - Homann, Johann Baptist + personal_name_ssm: + - Homann, Johann Baptist + language_ssim: + - Undetermined + language_tesim: + - Undetermined + language_ssm: + - Undetermined + origin_place_term_ssim: + - gw + - "[Noribergae" + origin_place_term_tesim: + - gw + - "[Noribergae" + origin_place_term_ssm: + - gw + - "[Noribergae" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 160°--E 10°/N 80°--S 60°)." + note_[]_tesim: + - '' + - California shown as an island labeled C., with an indented northern coast line. + - '"One of the earliest school atlases to use a system of letters on blank maps + that are coded to a separate key list. This method was based on a teaching system + formulated by Johann Hübner (1668-1731) and adapted by Homann"--David Rumsey Collection + catalog.' + - Folded. 6th map in book. + note_Local note_tesim: + - McLaughlin map number 1285. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale not given\n (W 160°--E 10°/N 80°--S 60°).\n " + subject_cartographics_tesim: + - "\n Scale not given\n (W 160°--E 10°/N 80°--S 60°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - fh912bx9878_05_0001 + content_metadata_first_image_width_ssm: + - '10363' + content_metadata_first_image_height_ssm: + - '7957' + content_metadata_image_file_name_ssm: + - fh912bx9878_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/fh912bx9878%2Ffh912bx9878_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/fh912bx9878/fh912bx9878_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/fh912bx9878/fh912bx9878_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/fh912bx9878/fh912bx9878_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/fh912bx9878/fh912bx9878_05_0001_full +- :id: tg729zw9405 + :druid_ssi: tg729zw9405 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 24 + + NOVA TOTIVS AMERICÆ DESCRIPTIO. + + + 1660 + + [S.l.] + + 1660 + + 24-03 + + 1 map : hand col.; 38.4 x 45.7 cm., 43.7 x 54.9 cm. including border. + + + + creator + + Wit, Frederik de + + Date, 1660, within title cartouche; 'f.o 2' (top right) + With '2'(or possibly '3') instead of 'f.o 2' (top right) + With date erased, and with '2'(or possibly '3') + Wagner 385b; Tooley 18 (Plate 34; state 1); Leighly 40; Koeman,III,p.212; Jonathan Potter's selection of fine, decorative and rare old maps, the World and North America, Autumn 1985, Item #78. + California as a large island on second Sanson model with indented northern coast. A peninsula on mainland near northern tip is named "Agubela de Cato". Title cartouche (upper left) topped with female native riding large armadillo. Copied from Visscher's map of 1636. Also found on Allard's map of [1705]. Map is based on Kaerius' map of 1614 and Visscher's map, but the west coast is revised and now shows California as an island. Top border is decorated with birds-eye views of Cusco, Mexico [City], Olinda in Pharnambuco, Havana Portus, S. Domingo and Cartagena. Side borders have costumed native figures; 4 on each side. Includes vignette of Neptune and his queen on sea horses amidst mermaids (lower left). Separately published. + Auct. F.de Wit. + + America--Maps + + + California as an island--Maps + + + + [ca.1:45,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - NOVA TOTIVS AMERICÆ DESCRIPTIO. + full_title_tesim: + - NOVA TOTIVS AMERICÆ DESCRIPTIO. + sort_title_tesim: + - NOVA TOTIVS AMERICÆ DESCRIPTIO. + sort_title_ssi: NOVA TOTIVS AMERICÆ DESCRIPTIO. + personal_name_ssim: + - Wit, Frederik de + personal_name_tesim: + - Wit, Frederik de + personal_name_ssm: + - Wit, Frederik de + origin_place_term_ssim: + - "[S.l.]" + origin_place_term_tesim: + - "[S.l.]" + origin_place_term_ssm: + - "[S.l.]" + origin_date_created_ssim: + - '1660' + - '1660' + origin_date_created_tesim: + - '1660' + - '1660' + origin_date_created_ssm: + - '1660' + - '1660' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 1_tesim: + - Date, 1660, within title cartouche; 'f.o 2' (top right) + note_State 2_tesim: + - With '2'(or possibly '3') instead of 'f.o 2' (top right) + note_State 3_tesim: + - With date erased, and with '2'(or possibly '3') + note_[]_tesim: + - 'Wagner 385b; Tooley 18 (Plate 34; state 1); Leighly 40; Koeman,III,p.212; Jonathan + Potter''s selection of fine, decorative and rare old maps, the World and North + America, Autumn 1985, Item #78.' + - California as a large island on second Sanson model with indented northern coast. + A peninsula on mainland near northern tip is named "Agubela de Cato". Title cartouche + (upper left) topped with female native riding large armadillo. Copied from Visscher's + map of 1636. Also found on Allard's map of [1705]. Map is based on Kaerius' map + of 1614 and Visscher's map, but the west coast is revised and now shows California + as an island. Top border is decorated with birds-eye views of Cusco, Mexico [City], + Olinda in Pharnambuco, Havana Portus, S. Domingo and Cartagena. Side borders have + costumed native figures; 4 on each side. Includes vignette of Neptune and his + queen on sea horses amidst mermaids (lower left). Separately published. + note_Statement of responsibility_tesim: + - Auct. F.de Wit. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:45,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:45,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '24' + - 24-03 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '24' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 24-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - tg729zw9405_05_0001 + content_metadata_first_image_width_ssm: + - '14491' + content_metadata_first_image_height_ssm: + - '11832' + content_metadata_image_file_name_ssm: + - tg729zw9405_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/tg729zw9405%2Ftg729zw9405_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/tg729zw9405/tg729zw9405_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/tg729zw9405/tg729zw9405_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/tg729zw9405/tg729zw9405_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/tg729zw9405/tg729zw9405_05_0001_full +- :id: yn959jw9550 + :druid_ssi: yn959jw9550 + mods_xml_ssm: + - | + + + 225-02 + 225 + + A New Map of North AMERICA According to the Newest Observations. + + cartographic + + 1741 + + [London] + + 1741 + + + + creator + + Moll, Herman, d. 1732 + + + 17.7 x 25 cm. including border. + digitized other analog + + + Lyberteam Metadata ToolKit + + Nordenskiöld Collection, 3, Vol.I, 610 (1, State 2); Nordenskiöld Collection, 3, 398 Vol.II (11, State 3); UCB (State 6). + First issued in: The British Empire in America ... / John Oldmixon. -- London, 1708. Issued in his: Forty-two new maps of Asia, Africa, and America ... -- London, 1716. Issued in his: Atlas geographicus: or, a compleat system of geography, ancient and modern. Vol. 5, [p. 22a] / by Herman Moll. -- [London]: J. Nutt, 1711-1717. + California on second Sanson model, and with "Straits of Annian" and "Mozeemlek" to north; "Gulf of California" to east. + See general notes. + With "Vol.I.Tit. Page. 200 Degrees from Ferro Island" (top left). Issued in his Atlas geographicus: or, a compleat system of geography, (ancient and modern) for America. -- In the Savoy: Printed by Eliz. Nutt, for John Nicholson, 1717. Issued in: The British Empire in America ... / John Oldmixon. -- London, 1741. + With "page.733.V.2". Issued in: A collection of voyages and travels, consisting of authentic writers in our own tongue... Printed for and sold by Thomas Osborne... / Thomas Osborne. -- London, 1745. Preceeds "A short discovery of the coast and continent of America" by William Castle. + With “Printed for Carington Bowles in London.” (below title cartouche). + In Dutch, with new title: Nieuwe Kaart van NOORD AMERIKA volgens de Nieuwste waarnemingen. / door H. Mol.(sic.). "I.Deel, Bladz.279." (top right). "J. Kyser f:" (bottom right). + In German, with new title: Eine Neue Charte von AMERICA Nach den Neusten Observa- tionen / Von H. Moll Geograph. “(13)” (top right). “Vol. I. Tit Pag. (top left). Issued in Das Britische Reich in America ... / John Oldmixon. -- Lemko : bey Johann Heinrich Meyer, 1744. + By H. Moll Geographer. + + + [ca. 1:55,000,000]. + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - A New Map of North AMERICA According to the Newest Observations. + full_title_tesim: + - A New Map of North AMERICA According to the Newest Observations. + sort_title_tesim: + - A New Map of North AMERICA According to the Newest Observations. + sort_title_ssi: A New Map of North AMERICA According to the Newest Observations. + personal_name_ssim: + - Moll, Herman, d. 1732 + personal_name_tesim: + - Moll, Herman, d. 1732 + personal_name_ssm: + - Moll, Herman, d. 1732 + origin_place_term_ssim: + - "[London]" + origin_place_term_tesim: + - "[London]" + origin_place_term_ssm: + - "[London]" + origin_date_created_ssim: + - '1741' + - '1741' + origin_date_created_tesim: + - '1741' + - '1741' + origin_date_created_ssm: + - '1741' + - '1741' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_[]_tesim: + - Nordenskiöld Collection, 3, Vol.I, 610 (1, State 2); Nordenskiöld Collection, + 3, 398 Vol.II (11, State 3); UCB (State 6). + - 'First issued in: The British Empire in America ... / John Oldmixon. -- London, + 1708. Issued in his: Forty-two new maps of Asia, Africa, and America ... -- London, + 1716. Issued in his: Atlas geographicus: or, a compleat system of geography, ancient + and modern. Vol. 5, [p. 22a] / by Herman Moll. -- [London]: J. Nutt, 1711-1717.' + - California on second Sanson model, and with "Straits of Annian" and "Mozeemlek" + to north; "Gulf of California" to east. + note_State 1_tesim: + - See general notes. + note_State 2_tesim: + - 'With "Vol.I.Tit. Page. 200 Degrees from Ferro Island" (top left). Issued in his + Atlas geographicus: or, a compleat system of geography, (ancient and modern) for + America. -- In the Savoy: Printed by Eliz. Nutt, for John Nicholson, 1717. Issued + in: The British Empire in America ... / John Oldmixon. -- London, 1741.' + note_State 3_tesim: + - 'With "page.733.V.2". Issued in: A collection of voyages and travels, consisting + of authentic writers in our own tongue... Printed for and sold by Thomas Osborne... + / Thomas Osborne. -- London, 1745. Preceeds "A short discovery of the coast and + continent of America" by William Castle.' + note_State 4_tesim: + - With “Printed for Carington Bowles in London.” (below title cartouche). + note_State 5_tesim: + - 'In Dutch, with new title: Nieuwe Kaart van NOORD AMERIKA volgens de Nieuwste + waarnemingen. / door H. Mol.(sic.). "I.Deel, Bladz.279." (top right). "J. Kyser + f:" (bottom right).' + note_State 6_tesim: + - 'In German, with new title: Eine Neue Charte von AMERICA Nach den Neusten Observa- + tionen / Von H. Moll Geograph. “(13)” (top right). “Vol. I. Tit Pag. (top left). + Issued in Das Britische Reich in America ... / John Oldmixon. -- Lemko : bey Johann + Heinrich Meyer, 1744.' + note_Statement of responsibility_tesim: + - By H. Moll Geographer. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n [ca. 1:55,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca. 1:55,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - 225-02 + - '225' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 225-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '225' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - yn959jw9550_05_0001 + content_metadata_first_image_width_ssm: + - '6711' + content_metadata_first_image_height_ssm: + - '4834' + content_metadata_image_file_name_ssm: + - yn959jw9550_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/yn959jw9550%2Fyn959jw9550_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/yn959jw9550/yn959jw9550_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/yn959jw9550/yn959jw9550_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/yn959jw9550/yn959jw9550_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/yn959jw9550/yn959jw9550_05_0001_full +- :id: zn845sh3664 + :druid_ssi: zn845sh3664 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + TP12 + + PLANISPHERE REPRESENTANT TOUTE L'ETENDUE DU MONDE. DANS L'ORDRE QU'ON A SUIVI DANS CE LIVRE. NB. LES CHIFFRES SE RAPORTENT AUX CARTES ET AUX PAGES DES DESCRIPTIONS. + + + 1715 + + A AMSTERDAM + + 1715 + + TP12-01 + + Title page; hand col.; 43.8 x 26.4 cm. on sheet 51.8 x 32.5 cm.; map diam. 25.8 cm. + + + + creator + + Renard, Louis, b. ca. 1678. + + See general notes. + With imprint erased. Issued in: Atlas / Amstelaedami Chés I.B. Elwe, 1792. + Jonathan Potter's selection of fine, decorative and rare old maps, the World and North America, Autumn 1985, Item #52; Koeman II,El2(1); Koeman IV,Ren1(1)&Ren2. + "Chez LOUIS RENARD, Avec Privilege de Nosseigneurs les Etats de Hollande et de Westfrise." + Issued in his: Atlas de la navigation et du commerce qui se fait dans toutes les parties du monde, Amsterdam, 1715. Reissued 1739. + California shown as large island on this map, and is labeled California Isle; Terres Inconnues to north, and sea passage between the two. Figure of Atlas at page bottom holding the map: north polar azimuthal projection with equidistant concentric circle of latitude; also known as Turquet's projection. + + California as an island--Maps + + + World--Maps + + + + [ca.1:140,000,000]. + (W 0° --E 0°/N 90° --N 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - PLANISPHERE REPRESENTANT TOUTE L'ETENDUE DU MONDE. DANS L'ORDRE QU'ON A SUIVI + DANS CE LIVRE. NB. LES CHIFFRES SE RAPORTENT AUX CARTES ET AUX PAGES DES DESCRIPTIONS. + full_title_tesim: + - PLANISPHERE REPRESENTANT TOUTE L'ETENDUE DU MONDE. DANS L'ORDRE QU'ON A SUIVI + DANS CE LIVRE. NB. LES CHIFFRES SE RAPORTENT AUX CARTES ET AUX PAGES DES DESCRIPTIONS. + sort_title_tesim: + - PLANISPHERE REPRESENTANT TOUTE L'ETENDUE DU MONDE. DANS L'ORDRE QU'ON A SUIVI + DANS CE LIVRE. NB. LES CHIFFRES SE RAPORTENT AUX CARTES ET AUX PAGES DES DESCRIPTIONS. + sort_title_ssi: PLANISPHERE REPRESENTANT TOUTE L'ETENDUE DU MONDE. DANS L'ORDRE + QU'ON A SUIVI DANS CE LIVRE. NB. LES CHIFFRES SE RAPORTENT AUX CARTES ET AUX PAGES + DES DESCRIPTIONS. + personal_name_ssim: + - Renard, Louis, b. ca. 1678. + personal_name_tesim: + - Renard, Louis, b. ca. 1678. + personal_name_ssm: + - Renard, Louis, b. ca. 1678. + origin_place_term_ssim: + - A AMSTERDAM + origin_place_term_tesim: + - A AMSTERDAM + origin_place_term_ssm: + - A AMSTERDAM + origin_date_created_ssim: + - '1715' + - '1715' + origin_date_created_tesim: + - '1715' + - '1715' + origin_date_created_ssm: + - '1715' + - '1715' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 0° --E 0°/N 90° --N 90°)" + point_bbox: + - "-0.0 90.0 0.0 90.0" + note_State 1_tesim: + - See general notes. + note_State 2_tesim: + - 'With imprint erased. Issued in: Atlas / Amstelaedami Chés I.B. Elwe, 1792.' + note_[]_tesim: + - 'Jonathan Potter''s selection of fine, decorative and rare old maps, the World + and North America, Autumn 1985, Item #52; Koeman II,El2(1); Koeman IV,Ren1(1)&Ren2.' + - 'Issued in his: Atlas de la navigation et du commerce qui se fait dans toutes + les parties du monde, Amsterdam, 1715. Reissued 1739.' + - 'California shown as large island on this map, and is labeled California Isle; + Terres Inconnues to north, and sea passage between the two. Figure of Atlas at + page bottom holding the map: north polar azimuthal projection with equidistant + concentric circle of latitude; also known as Turquet''s projection.' + note_Statement of responsibility_tesim: + - '"Chez LOUIS RENARD, Avec Privilege de Nosseigneurs les Etats de Hollande et de + Westfrise."' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - World--Maps + subject_topic_tesim: + - California as an island--Maps + - World--Maps + subject_cartographics_ssim: + - "\n [ca.1:140,000,000].\n (W 0° --E 0°/N 90° --N 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:140,000,000].\n (W 0° --E 0°/N 90° --N 90°)\n " + identifier_tesim: + - TP12 + - TP12-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - TP12 + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - TP12-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zn845sh3664_05_0001 + content_metadata_first_image_width_ssm: + - '8432' + content_metadata_first_image_height_ssm: + - '12769' + content_metadata_image_file_name_ssm: + - zn845sh3664_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zn845sh3664%2Fzn845sh3664_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zn845sh3664/zn845sh3664_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zn845sh3664/zn845sh3664_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zn845sh3664/zn845sh3664_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zn845sh3664/zn845sh3664_05_0001_full +- :id: rz818vx8201 + :druid_ssi: rz818vx8201 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 1 + + 't Noorder deel van WEST-INDIEN + + + 1643 + + [Amsterdam] + + 1643 + + 1-02 + + 17.1 x 26.5 cm, 18.8 x 28.1 cm. including border. + + + + creator + + Goos, Abraham + + Separate Map + With “Fol 65” (top left). Issued in: West-Indische Spieghel / Athanasium Inga. -- Amsterdam, 1624. + With “Fol 51” (top left). Issued in: Journalen van drie Voyagien,: te weten: 1. Van Mr. Thomas Candish...2. Vande Heer Fransoys Draeck... 3. ... vanden Admirael Iaques L'Heremite. -- Amsterdam: Iacob Pietersz Wachter, 1643. + Wagner 292; Leighly 3 (Plate II); UCB; Burden 210 (Plate 210); Sabin 34722. + California with broad, flat northern coast, and coastal place names. Suggestion of an unnamed passage to north. First map to name the Hudson River, Martha's Vineyard, New Mexico, Monterey and San Diego, California. First use of: Po Sr. Francisco Drac. instead of Bahia de San Francisco. Engraved by: A. Goos sculpsit (lower right). Unusual feature: Although the map is in Latin, it includes English around Hudson’s Bay: “Here Hudson Anno ibit wintered” and “the Bay of Gods Mercies” (possibly elsewhere). + + California as an island--Maps + + + North America--Maps + + + + [ca.1:60,000,000] + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "'t Noorder deel van WEST-INDIEN" + full_title_tesim: + - "'t Noorder deel van WEST-INDIEN" + sort_title_tesim: + - "'t Noorder deel van WEST-INDIEN" + sort_title_ssi: "'t Noorder deel van WEST-INDIEN" + personal_name_ssim: + - Goos, Abraham + personal_name_tesim: + - Goos, Abraham + personal_name_ssm: + - Goos, Abraham + origin_place_term_ssim: + - "[Amsterdam]" + origin_place_term_tesim: + - "[Amsterdam]" + origin_place_term_ssm: + - "[Amsterdam]" + origin_date_created_ssim: + - '1643' + - '1643' + origin_date_created_tesim: + - '1643' + - '1643' + origin_date_created_ssm: + - '1643' + - '1643' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 1_tesim: + - 'With “Fol 65” (top left). Issued in: West-Indische Spieghel / Athanasium Inga. + -- Amsterdam, 1624.' + note_State 2_tesim: + - 'With “Fol 51” (top left). Issued in: Journalen van drie Voyagien,: te weten: + 1. Van Mr. Thomas Candish...2. Vande Heer Fransoys Draeck... 3. ... vanden Admirael + Iaques L''Heremite. -- Amsterdam: Iacob Pietersz Wachter, 1643.' + note_[]_tesim: + - Wagner 292; Leighly 3 (Plate II); UCB; Burden 210 (Plate 210); Sabin 34722. + - 'California with broad, flat northern coast, and coastal place names. Suggestion + of an unnamed passage to north. First map to name the Hudson River, Martha''s + Vineyard, New Mexico, Monterey and San Diego, California. First use of: Po Sr. + Francisco Drac. instead of Bahia de San Francisco. Engraved by: A. Goos sculpsit + (lower right). Unusual feature: Although the map is in Latin, it includes English + around Hudson’s Bay: “Here Hudson Anno ibit wintered” and “the Bay of Gods Mercies” + (possibly elsewhere).' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca.1:60,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1:60,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '1' + - 1-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '1' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 1-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - rz818vx8201_05_0001 + content_metadata_first_image_width_ssm: + - '7362' + content_metadata_first_image_height_ssm: + - '4788' + content_metadata_image_file_name_ssm: + - rz818vx8201_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/rz818vx8201%2Frz818vx8201_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/rz818vx8201/rz818vx8201_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/rz818vx8201/rz818vx8201_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/rz818vx8201/rz818vx8201_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/rz818vx8201/rz818vx8201_05_0001_full +- :id: sw106rc9347 + :druid_ssi: sw106rc9347 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 505 + + AMERIQUE SEPTENTRIONALE + + + 1695 + + [Paris] + + 1695 + + 505-01 + + 13.4 x 21.6 cm., 14.8 x 23 cm. including border. + + + + creator + + Ganière, Pierre, 1663-1721 + + Separate Map + tom 2. P296 (top right, within border) + “tom 2” with remainder of writing crudely erased (top right, within border.) Issued in: Le Parfait Geographe, ou methode pour apprendre aise’ment la geographie ... Quatrie’me Edition. / M. Le Coq. -- A Paris ru S. Jacques, Chez Guilleaume Cavelier fils, au Lys d’or. M.DCCXXIII. (1723). Issued with double hemisphere world map (Entry 1007). + T. Rowlson, correspondence, 1997. + Issued in: Le Parfait Geographe, ou l’art d’apprendre aisement la geographie et l’histoire, par demandes et par reponses, Tome Second / M. Le Coq. -- A Paris, Chez Pierre et Imbert DeBats, ruë Saint Iacques, prés la Fontaine Saint Severin, à Saint François, M.DC.XCV. (1695). Book is dedicated to Monseigneur Le Chancelier. Unknown if map appeared in first edition. Issued with world hemisphere map (Entry 1007). + California as a large island labeled I. DE CALIFORNIE and with indented northern coast and no place names. Western coastline of North America continues north to about 49˚ with a peninsula to California’s north. Great Lakes are complete. B. DE HUDSON is shown, as is a large body of water to its west, with broken coastline, possibly passage westward. Mississippi River is drawn incorrectly entering G. du Mexique at 275 deg. west. Title within simple line border (bottom left). P.G (bottom right, within border). + + California as an island--Maps--1695 + + + North America--Maps + + + + [ca. 1: 44,000,000]. + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERIQUE SEPTENTRIONALE + full_title_tesim: + - AMERIQUE SEPTENTRIONALE + sort_title_tesim: + - AMERIQUE SEPTENTRIONALE + sort_title_ssi: AMERIQUE SEPTENTRIONALE + personal_name_ssim: + - Ganière, Pierre, 1663-1721 + personal_name_tesim: + - Ganière, Pierre, 1663-1721 + personal_name_ssm: + - Ganière, Pierre, 1663-1721 + origin_place_term_ssim: + - "[Paris]" + origin_place_term_tesim: + - "[Paris]" + origin_place_term_ssm: + - "[Paris]" + origin_date_created_ssim: + - '1695' + - '1695' + origin_date_created_tesim: + - '1695' + - '1695' + origin_date_created_ssm: + - '1695' + - '1695' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 1_tesim: + - tom 2. P296 (top right, within border) + note_State 2_tesim: + - "“tom 2” with remainder of writing crudely erased (top right, within border.) + Issued in: Le Parfait Geographe, ou methode pour apprendre aise’ment la geographie + ... Quatrie’me Edition. / M. Le Coq. -- A Paris ru S. Jacques, Chez Guilleaume + Cavelier fils, au Lys d’or. M.DCCXXIII. (1723). Issued with double hemisphere + world map (Entry 1007)." + note_[]_tesim: + - T. Rowlson, correspondence, 1997. + - 'Issued in: Le Parfait Geographe, ou l’art d’apprendre aisement la geographie + et l’histoire, par demandes et par reponses, Tome Second / M. Le Coq. -- A Paris, + Chez Pierre et Imbert DeBats, ruë Saint Iacques, prés la Fontaine Saint Severin, + à Saint François, M.DC.XCV. (1695). Book is dedicated to Monseigneur Le Chancelier. + Unknown if map appeared in first edition. Issued with world hemisphere map (Entry + 1007).' + - California as a large island labeled I. DE CALIFORNIE and with indented northern + coast and no place names. Western coastline of North America continues north to + about 49˚ with a peninsula to California’s north. Great Lakes are complete. B. + DE HUDSON is shown, as is a large body of water to its west, with broken coastline, + possibly passage westward. Mississippi River is drawn incorrectly entering G. + du Mexique at 275 deg. west. Title within simple line border (bottom left). P.G + (bottom right, within border). + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps--1695 + - North America--Maps + subject_topic_tesim: + - California as an island--Maps--1695 + - North America--Maps + subject_cartographics_ssim: + - "\n [ca. 1: 44,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca. 1: 44,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '505' + - 505-01 + identifier_local_Post publication map number_tesim: + - '505' + identifier_local_Post publication map number with latest state information_tesim: + - 505-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sw106rc9347_05_0001 + content_metadata_first_image_width_ssm: + - '6023' + content_metadata_first_image_height_ssm: + - '3969' + content_metadata_image_file_name_ssm: + - sw106rc9347_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sw106rc9347%2Fsw106rc9347_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sw106rc9347/sw106rc9347_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sw106rc9347/sw106rc9347_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sw106rc9347/sw106rc9347_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sw106rc9347/sw106rc9347_05_0001_full +- :id: sp821gh4463 + :druid_ssi: sp821gh4463 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 1005 + + [World] + + + 1732 + + Istanbul + + + 1005-02 + + 15.6 x 30.5 cm., 18.6 x 30.7 to the border. + + + + creator + + İbrahim Müteferrika, 1674?-1745 + + Separate Map + With seven astronomical charts surrounding the map. Longitude and latitude lines marked along the equator and the center latitude line, respectively. + Map derived from the Mercator-Hondius Atlas Minor. + World on an oval projection. + Square title cartouche above the map. + In Ottoman Turkish. + Goodrich (Figure 19, Map #18); Koeman II, p. 549. + California with a rounded coast and labeled. + Issued in Cihanüma (Mirror of the World) / Kâtib Çelebi. + + California as an island--Maps + + + World Maps + + + + [ca. 1:140,000,000]. + (W 180° --E 180°/N 85° --S 85°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[World]" + full_title_tesim: + - "[World]" + sort_title_tesim: + - "[World]" + sort_title_ssi: "[World]" + personal_name_ssim: + - İbrahim Müteferrika, 1674?-1745 + personal_name_tesim: + - İbrahim Müteferrika, 1674?-1745 + personal_name_ssm: + - İbrahim Müteferrika, 1674?-1745 + origin_place_term_ssim: + - Istanbul + origin_place_term_tesim: + - Istanbul + origin_place_term_ssm: + - Istanbul + origin_date_created_ssim: + - '1732' + origin_date_created_tesim: + - '1732' + origin_date_created_ssm: + - '1732' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 180° --E 180°/N 85° --S 85°)" + point_bbox: + - "-180.0 -85.0 180.0 85.0" + note_State 2_tesim: + - With seven astronomical charts surrounding the map. Longitude and latitude lines + marked along the equator and the center latitude line, respectively. + note_[]_tesim: + - Map derived from the Mercator-Hondius Atlas Minor. + - World on an oval projection. + - Square title cartouche above the map. + - In Ottoman Turkish. + - 'Goodrich (Figure 19, Map #18); Koeman II, p. 549.' + - California with a rounded coast and labeled. + - Issued in Cihanüma (Mirror of the World) / Kâtib Çelebi. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - World Maps + subject_topic_tesim: + - California as an island--Maps + - World Maps + subject_cartographics_ssim: + - "\n [ca. 1:140,000,000].\n (W 180° --E 180°/N 85° --S 85°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:140,000,000].\n (W 180° --E 180°/N 85° --S 85°)\n " + identifier_tesim: + - '1005' + - 1005-02 + identifier_local_Post publication map number_tesim: + - '1005' + identifier_local_Post publication map number with latest state information_tesim: + - 1005-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - sp821gh4463_05_0001 + content_metadata_first_image_width_ssm: + - '6343' + content_metadata_first_image_height_ssm: + - '5094' + content_metadata_image_file_name_ssm: + - sp821gh4463_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/sp821gh4463%2Fsp821gh4463_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/sp821gh4463/sp821gh4463_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/sp821gh4463/sp821gh4463_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/sp821gh4463/sp821gh4463_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/sp821gh4463/sp821gh4463_05_0001_full +- :id: cz507zk0531 + :druid_ssi: cz507zk0531 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 69 + + NEW MEXICO + + + 1679 + + [London] + + 1679 + + + 1 map : 7.5 x 5.4 cm. + + + + creator + + Seller, John, fl. 1658-1698 + + California as an island with flat northern coast and place names including Pt. Sr. Franc Draco, C. Mendocino at northnmost place on island, and Anian to the distant north. In: Atlas Minimus or A Book of Geography Shewing all the Empires, Monarchies Kingdomes, Regions Dominions Principalities and Countries, in the whole World , Map [47]/ by John Seller, Hydrographer to the King. -- Scales differ. -- And are Sold at his House at the Hermitage in Wapping, and in Pope's head Alley in Cornhill London : John Seller,[1679]. 1 miniature atlas (109 p.) : [53] maps ; 11.2 x 7.6 cm. + Wagner p.133; L.C. 490. + In: Atlas Minimus or A Book of Geography Shewing all the Empires, Monarchies Kingdomes, Regions Dominions Principalities and Countries, in the whole World , Map [47]/ by John Seller, Hydrographer to the King. -- Scales differ. -- And are Sold at his House at the Hermitage in Wapping, and in Pope's head Alley in Cornhill London : John Seller,[1679]. 1 miniature atlas (109 p.) : [53] maps ; 11.2 x 7.6 cm. + [John Seller]. + + Atlases--Early works to 1800 + + + California as an island--Maps + + + + indeterminable. + (W 125° --W 110°/N 47° --N 31°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - NEW MEXICO + full_title_tesim: + - NEW MEXICO + sort_title_tesim: + - NEW MEXICO + sort_title_ssi: NEW MEXICO + personal_name_ssim: + - Seller, John, fl. 1658-1698 + personal_name_tesim: + - Seller, John, fl. 1658-1698 + personal_name_ssm: + - Seller, John, fl. 1658-1698 + origin_place_term_ssim: + - "[London]" + origin_place_term_tesim: + - "[London]" + origin_place_term_ssm: + - "[London]" + origin_date_created_ssim: + - '1679' + - '1679' + origin_date_created_tesim: + - '1679' + - '1679' + origin_date_created_ssm: + - '1679' + - '1679' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 125° --W 110°/N 47° --N 31°)" + point_bbox: + - "-125.0 31.0 -110.0 47.0" + note_[]_tesim: + - 'California as an island with flat northern coast and place names including Pt. + Sr. Franc Draco, C. Mendocino at northnmost place on island, and Anian to the + distant north. In: Atlas Minimus or A Book of Geography Shewing all the Empires, + Monarchies Kingdomes, Regions Dominions Principalities and Countries, in the whole + World , Map [47]/ by John Seller, Hydrographer to the King. -- Scales differ. + -- And are Sold at his House at the Hermitage in Wapping, and in Pope''s head + Alley in Cornhill London : John Seller,[1679]. 1 miniature atlas (109 p.) : [53] + maps ; 11.2 x 7.6 cm.' + - Wagner p.133; L.C. 490. + - 'In: Atlas Minimus or A Book of Geography Shewing all the Empires, Monarchies + Kingdomes, Regions Dominions Principalities and Countries, in the whole World + , Map [47]/ by John Seller, Hydrographer to the King. -- Scales differ. -- And + are Sold at his House at the Hermitage in Wapping, and in Pope''s head Alley in + Cornhill London : John Seller,[1679]. 1 miniature atlas (109 p.) : [53] maps ; + 11.2 x 7.6 cm.' + note_Statement of responsibility_tesim: + - "[John Seller]." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - Atlases--Early works to 1800 + - California as an island--Maps + subject_topic_tesim: + - Atlases--Early works to 1800 + - California as an island--Maps + subject_cartographics_ssim: + - "\n indeterminable.\n (W 125° --W 110°/N 47° --N 31°)\n " + subject_cartographics_tesim: + - "\n indeterminable.\n (W 125° --W 110°/N 47° --N 31°)\n " + identifier_tesim: + - '69' + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '69' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - cz507zk0531_05_0001 + content_metadata_first_image_width_ssm: + - '2047' + content_metadata_first_image_height_ssm: + - '2978' + content_metadata_image_file_name_ssm: + - cz507zk0531_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/cz507zk0531%2Fcz507zk0531_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/cz507zk0531/cz507zk0531_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/cz507zk0531/cz507zk0531_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/cz507zk0531/cz507zk0531_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/cz507zk0531/cz507zk0531_05_0001_full +- :id: wb806ct0449 + :druid_ssi: wb806ct0449 + mods_xml_ssm: + - | + + + 201 + 201-02 + + A Generall Chart of the | SOUTH SEA | from the River of Plate to | Dampiers Streights on ye Coast | of NEW GUINEA + + cartographic + + 1721 + + + image/tiff + digitized other analog + + + Lyberteam Metadata ToolKit + + Early Maps + Digital Maps + + + [ca. 31,000,000] + (E 110° --W 70°/N 63° --S 53°) + + + Includes bibliographical references (p. xv-xvi) and indexes. + Glen McLaughlin with Nancy H. Mayo. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - A Generall Chart of the | SOUTH SEA | from the River of Plate to | Dampiers Streights + on ye Coast | of NEW GUINEA + full_title_tesim: + - A Generall Chart of the | SOUTH SEA | from the River of Plate to | Dampiers Streights + on ye Coast | of NEW GUINEA + sort_title_tesim: + - A Generall Chart of the | SOUTH SEA | from the River of Plate to | Dampiers Streights + on ye Coast | of NEW GUINEA + sort_title_ssi: A Generall Chart of the | SOUTH SEA | from the River of Plate to + | Dampiers Streights on ye Coast | of NEW GUINEA + origin_date_created_ssim: + - '1721' + origin_date_created_tesim: + - '1721' + origin_date_created_ssm: + - '1721' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - Early Maps + - Digital Maps + genre_tesim: + - Early Maps + - Digital Maps + coordinates_tesim: + - "(E 110° --W 70°/N 63° --S 53°)" + point_bbox: + - 110.0 -53.0 -70.0 63.0 + note_[]_tesim: + - Includes bibliographical references (p. xv-xvi) and indexes. + note_Statement of responsibility_tesim: + - Glen McLaughlin with Nancy H. Mayo. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n [ca. 31,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + subject_cartographics_tesim: + - "\n [ca. 31,000,000]\n (E 110° --W 70°/N 63° --S 53°)\n " + identifier_tesim: + - '201' + - 201-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '201' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 201-02 + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - wb806ct0449_05_0001 + content_metadata_first_image_width_ssm: + - '10111' + content_metadata_first_image_height_ssm: + - '8667' + content_metadata_image_file_name_ssm: + - wb806ct0449_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/wb806ct0449%2Fwb806ct0449_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/wb806ct0449/wb806ct0449_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/wb806ct0449/wb806ct0449_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/wb806ct0449/wb806ct0449_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/wb806ct0449/wb806ct0449_05_0001_full +- :id: rc221bv1386 + :druid_ssi: rc221bv1386 + mods_xml_ssm: + - | + + + + [Armenian map of the world] + + cartographic + map + Early maps. + Digital maps. + Maps. + + + ai + + + [s.l + + s.n. + 17--?] + 17uu + monographic + + + arm + + + 1 map ; 2 hemispheres each 8.8 cm in diam., on sheet 26 x 41 cm. + + + Relief shown pictorially. + California shown as a long, labeled island with no place names and an indented northern coast. + Title in banner across top. Decorative border around map. "156" at top left. "259" at top right. + Partial coastlines of New Zealand and Australia are shown. The Great Lakes are complete. The Great Wall of China is shown. Includes small ships and compass roses. + McLaughlin map number 1165. + + + Scale not given + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + aacr + CSt-ES + 121218 + a9855801 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - "[Armenian map of the world]" + full_title_tesim: + - "[Armenian map of the world]" + sort_title_tesim: + - "[Armenian map of the world]" + sort_title_ssi: "[Armenian map of the world]" + language_ssim: + - Armenian + language_tesim: + - Armenian + language_ssm: + - Armenian + origin_place_term_ssim: + - ai + - "[s.l" + origin_place_term_tesim: + - ai + - "[s.l" + origin_place_term_ssm: + - ai + - "[s.l" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - '' + - Relief shown pictorially. + - California shown as a long, labeled island with no place names and an indented + northern coast. + - Title in banner across top. Decorative border around map. "156" at top left. "259" + at top right. + - Partial coastlines of New Zealand and Australia are shown. The Great Lakes are + complete. The Great Wall of China is shown. Includes small ships and compass roses. + note_Local note_tesim: + - McLaughlin map number 1165. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale not given\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scale not given\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - rc221bv1386_05_0001 + content_metadata_first_image_width_ssm: + - '9869' + content_metadata_first_image_height_ssm: + - '6278' + content_metadata_image_file_name_ssm: + - rc221bv1386_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/rc221bv1386%2Frc221bv1386_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/rc221bv1386/rc221bv1386_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/rc221bv1386/rc221bv1386_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/rc221bv1386/rc221bv1386_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/rc221bv1386/rc221bv1386_05_0001_full +- :id: zr014mj0786 + :druid_ssi: zr014mj0786 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + + A New and Exact Map of ASIA According to the Best Observations + + + + [ca. 1:25,000,000]. + (W 21° --E 159°/N 90° --S 90°) + + + + 1706 + + London + + 1706 + + 1111 + + 1 map : hand col.; 46 x 54.1 cm., 47.4 x 55.6 cm. including border. + + + + creator + + Overton, Henry, fl. 1751-1764. + + + Asia--Maps + + Asian continent, including eastern Mediterranean Sea, and northern part of Australia. + Title with vignette to its right of Asian natives working with bundled goods; one person with camel. (bottom left). + Part of a set of four continental maps. The other 3 titles are: A New and Exact Map of AFRICA according to the Best Observations, EUROPE Divided into its Principall States which are Subdivided into their Principall Provinces (banner title: A NEW MAP OF EUROPE DIVIDED INTO ITS PRINCIPALL KINGDOMS AND COUNTRIES Described By Sanson Geogr to Ye French King)(dated 1706), and A NEW MAP OF AMERICA according to the Best and Latest Observations. + Henry Overton. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - A New and Exact Map of ASIA According to the Best Observations + full_title_tesim: + - A New and Exact Map of ASIA According to the Best Observations + sort_title_tesim: + - A New and Exact Map of ASIA According to the Best Observations + sort_title_ssi: A New and Exact Map of ASIA According to the Best Observations + personal_name_ssim: + - Overton, Henry, fl. 1751-1764. + personal_name_tesim: + - Overton, Henry, fl. 1751-1764. + personal_name_ssm: + - Overton, Henry, fl. 1751-1764. + origin_place_term_ssim: + - London + origin_place_term_tesim: + - London + origin_place_term_ssm: + - London + origin_date_created_ssim: + - '1706' + - '1706' + origin_date_created_tesim: + - '1706' + - '1706' + origin_date_created_ssm: + - '1706' + - '1706' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 21° --E 159°/N 90° --S 90°)" + point_bbox: + - "-21.0 -90.0 159.0 90.0" + note_[]_tesim: + - Asian continent, including eastern Mediterranean Sea, and northern part of Australia. + - Title with vignette to its right of Asian natives working with bundled goods; + one person with camel. (bottom left). + - 'Part of a set of four continental maps. The other 3 titles are: A New and Exact + Map of AFRICA according to the Best Observations, EUROPE Divided into its Principall + States which are Subdivided into their Principall Provinces (banner title: A NEW + MAP OF EUROPE DIVIDED INTO ITS PRINCIPALL KINGDOMS AND COUNTRIES Described By + Sanson Geogr to Ye French King)(dated 1706), and A NEW MAP OF AMERICA according + to the Best and Latest Observations.' + note_Statement of responsibility_tesim: + - Henry Overton. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - Asia--Maps + subject_topic_tesim: + - Asia--Maps + subject_cartographics_ssim: + - "\n [ca. 1:25,000,000].\n (W 21° --E 159°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:25,000,000].\n (W 21° --E 159°/N 90° --S 90°)\n " + identifier_tesim: + - '1111' + identifier_local_Post publication map number_tesim: + - '1111' + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - zr014mj0786_05_0001 + content_metadata_first_image_width_ssm: + - '16829' + content_metadata_first_image_height_ssm: + - '13805' + content_metadata_image_file_name_ssm: + - zr014mj0786_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/zr014mj0786%2Fzr014mj0786_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/zr014mj0786/zr014mj0786_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/zr014mj0786/zr014mj0786_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/zr014mj0786/zr014mj0786_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/zr014mj0786/zr014mj0786_05_0001_full +- :id: jr961xz9944 + :druid_ssi: jr961xz9944 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 108 + 108-01 + + AMERICA SEPTENTRIONALIS + + + 1692 + 1692 + + + 1 map : hand col.; 6.2 x 7.6 cm. including border. + + + + creator + + Müller, Johann Ulrich + + Pagination above map: "III.c". No text below map. Issued in his: Kurtz-bündige Abbildund Vorstellung der Gantzen Welt, Ulm, Georg Wilhelm Kühnen, 1692 + Reissued, [1692], with text below map: "Das mitternachtige America theilet sich: ..." , and pagination above map "III.c" + Reissued, [1692], with text below map: "Das Mitternachtische America. ..." , and pagination above map "III". + California as an island of Briggs type and labelled "I. California". Engraved by: [Gabriel Bodenehr]. + L.C. 512; Shirley 555. + + California as an island--Maps + + + North America--Maps + + + + [ca.1:130,000,000] + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICA SEPTENTRIONALIS + full_title_tesim: + - AMERICA SEPTENTRIONALIS + sort_title_tesim: + - AMERICA SEPTENTRIONALIS + sort_title_ssi: AMERICA SEPTENTRIONALIS + personal_name_ssim: + - Müller, Johann Ulrich + personal_name_tesim: + - Müller, Johann Ulrich + personal_name_ssm: + - Müller, Johann Ulrich + origin_date_created_ssim: + - '1692' + - '1692' + origin_date_created_tesim: + - '1692' + - '1692' + origin_date_created_ssm: + - '1692' + - '1692' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_State 1_tesim: + - 'Pagination above map: "III.c". No text below map. Issued in his: Kurtz-bündige + Abbildund Vorstellung der Gantzen Welt, Ulm, Georg Wilhelm Kühnen, 1692' + note_State 2_tesim: + - 'Reissued, [1692], with text below map: "Das mitternachtige America theilet sich: + ..." , and pagination above map "III.c"' + note_State 3_tesim: + - 'Reissued, [1692], with text below map: "Das Mitternachtische America. ..." , + and pagination above map "III".' + note_[]_tesim: + - 'California as an island of Briggs type and labelled "I. California". Engraved + by: [Gabriel Bodenehr].' + - L.C. 512; Shirley 555. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca.1:130,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1:130,000,000]\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '108' + - 108-01 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '108' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 108-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - jr961xz9944_05_0001 + content_metadata_first_image_width_ssm: + - '2301' + content_metadata_first_image_height_ssm: + - '2497' + content_metadata_image_file_name_ssm: + - jr961xz9944_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/jr961xz9944%2Fjr961xz9944_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/jr961xz9944/jr961xz9944_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/jr961xz9944/jr961xz9944_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/jr961xz9944/jr961xz9944_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/jr961xz9944/jr961xz9944_05_0001_full +- :id: np731wc7689 + :druid_ssi: np731wc7689 + mods_xml_ssm: + - | + + + cartographic + map + + L'AMERIQUE | Suivant les dernieres | Observations de l'Acade= | mie Royale des Sciences + Seventh of 18 States + + + + creator + + Gravé par Denise Macquart. + + + + [ca.1:90,000,000], [173] + + + + + France and Italy + + 1730 + + + 16.3 x 12.6 cm; 17.5 x 13.7 cm. including border. + + + Buffier, Claude + + California with indented northern coastline and without place names, except on State 9, which is engraved by H. van Loon. Mainland coastline continues northwest to 55 deg. N. The States and Variants listed identify differences between very similar maps and may, with additional research, be re-arranged. + French text:. With "Gravé par Denise Macquart" (within title cartouche). "P.289" (top right); with Leon diagonally labeled off coast above Panama; Mexi on mainland of Mexico; Zélande; Cercle du Tropique de Capricorne; and N york, Boston and Virginie labelled; MER DU NOR (missing the 'd'); and with NOUXau MIXIQUE. Dimensions: 16.4 x 12.9 cm.; 17.8 x 14 cm. including border. + French text:. With changed title: L'AMERIQUE | Suivant les dernieres | observations de l'Acad. | Royale des Sciences. Without engraver’s name or pagination. California labeled CALIFORNIE and without any place names. Laon and Mexique are labeled on diagonal on mainland. Includes Zelande, Tropique du Capricorne, N York, Baston, Virginie, MER DU NORD, NOUVELLE ESPAGNE. Most similar to State 3. + French text: With changed title: L'AMERIQUE | Suivant les dernieres | observations de l'Acad. | Royale des Sciences. / faure Sculp.t. “Page 841” (top right). California labeled CALIFORNIE and without any place names. Laon and Mexique are labeled on mainland. Includes Zelande, Tropique du Capricorne, N York, Baston, Virginie, MER DU NORD, NOUVELLE ESPAGNE. + French text:. With unchanged title cartouche. With “P.329” (top right); with Leon diagonally labeled off coast above Panama; Mexi on mainland of Mexico; Zélande; Cercle du Tropique de Capricorne; and N york, Boston and Virginie labelled; MER DU NORD; and with NOUXau MEXIQUE. Dimensions: 17 x 12.6 cm; 17.8 x 13.8 cm including border. + French text:. With changed title and imprint: L'AMERIQUE | Suivant les derniéres | observations de l'Acad. | Royale des Sciences. / Desbruslins Sculpsit.“pag.333” (top left); with Leon on mainland; Mexi now spelled Mexique on mainland; Zelande; Tropique du Capricorne; and N York, Baston and Virginie labeled; and with NOUVELLE ESPAGNE.Issued in: Geographie universelle, exposee d’ans les differentes métodes qui peuvent abréger l'étude ..., Sixiéme édition. -- Par le P. Buffier de la Compagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, à l’image Sainte Thérese, M.DCC.XXXIX(1739).[[VARIANT]]Variant of State 3With “Desbruslins Sculpsit” erased. Dimensions: 16.4 x 12.5 cm; 17.7 x 13.8 cm. including border. + French text:. With changed title and imprint: L'AMERIQUE | Suivant les dernieres | Observations de l'Acad | emie Royale des Siences / Gravé par Denise Macquart."P 329" (top right); Leon diagonally labeled off coast above Panama; Mexi on mainland of Mexico; Zélande unlabeled; Cercle du Tropique de Capricorne; and N york, Boston and Virginie labeled; and with NOUau MIXIQUE.Issued in: Geographie universelle, exposee d’ans les differentes métodes qui peuvent abréger l'étude ..., Sixiéme édition. -- Par le P. Buffier de la Compagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, à Sainte Thérese, M.DCC.LIX(1759). Dimensions: 16.2 x 12.4 cm; 17.5 x 13.8 cm. including border. + French text:. With changed title: L'AMERIQUE | Suivant les dernieres | observations de l'Acad. | Royale des Sciences. Without engraver’s name. No pagination except for “E” below map (bottom right). Leon on mainland; Mexique on mainland of Mexico; Zelande labeled; Tropique du Capricorne; and N York, Baston and Virginie labeled; and with NOUVau MEXIQUE. Dimensions: 16.2 x 12.4 cm; 17.5 x 13.8 cm. including border. + French text:. With title same as that of State 3. With added engraver’s name following title: faure Sculp.t. "Page 296." or “Page. 289” (top right); Leon and Mexique labelled on mainland; Zealande; Tropique du Capricorne; N York, Aston (Boston misspelled), and Virginie labeled; and with NOUVau MEXIQUE. Dimensions: 16.1 x 12.3 cm; 17.4 x 13.7 cm. including border.Map with “Page. 289” issued in: Géographie universelle, exposee dans les differentes m´thodes qui peuvent abreger l'étude ..., Huitieme edition. -- Par le P. Buffier, de la Coompagnie de Jesus. -- A Par[is] : Chez Pierre-François Giffart, rue S. Jacques, à Sainte Thérèse, M.DCC.LXVII (1767). (Curious date) + French text:. With changed title: L'AMERIQUE | Suivant les dernieres | observations de l'Academie | Royale des Sciences. and no engraver's name."pag.333" (top left); Leon horizontally labeled off coast above Panama; Mexique off coast of Mexico; Zelande; Tropique du Capricorne; and N. Yore, Boston and Virginie labeled; and with NOUVau MEXIQUE.Issued in: Géographie universelle, exposee dans les differentes m´thodes qui peuvent abreger l'étude ..., Neuviéme édition. -- Par le P. Buffier, de la Coompagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, à Sainte Thérèse, M.DCC.LX(1760). Dimensions: 16.3 x 12.6 cm; 17.5 x 13.7 cm. including border. + French text:. With changed title: L'AMERIQUE, | Suivant les dernieres | Observations de l'Acadé: | mie Royale des Sciences. / Par H. van Loon Geographe, et Graveur. California now with with place names: C. Mendocin, C. Blanco, and I. Cedros. “Pag.301” (top right). Leon diagonally labeled off coast; Mexi labeled on mainland; Zealande unlabeled; Cercle du Tropique de Capricorne; N York and Virginie labeled; Boston unlabeled; and with NOUVau MEXIQUE. Issued in: Geographie Universele en vers artificiels / [by] le Pere Buffier, de la Compagnie de Jesus M DC[CLX]XV (1775).Reproduced in: Letter in TMC, Winter 1991, No.59, p.50. + French text:. With changed title: L'AMERIQUE | Suivant les dernieres | observations de l'Academie | Royale des Sciences. and no engraver's name."pag.333" (top left); Leon horizontally labeled off coast above Panama; Mexique off coast of Mexico; Zelande; Tropique du Capricorne; and N. Yore, Boston and Virginie labeled; and with NOUVau MEXIQUE.Issued in: Géographie universelle, exposee dans les differentes m´thodes qui peuvent abreger l'étude ..., Neuviéme édition. -- Par le P. Buffier, de la Coompagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, à Sainte Thérèse, M.DCC.LX(1760). Dimensions: 16.3 x 12.6 cm; 17.5 x 13.7 cm. including border. + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - L'AMERIQUE | Suivant les dernieres | Observations de l'Acade= | mie Royale des + Sciences + full_title_tesim: + - L'AMERIQUE | Suivant les dernieres | Observations de l'Acade= | mie Royale des + Sciences Seventh of 18 States + sort_title_tesim: + - L'AMERIQUE | Suivant les dernieres | Observations de l'Acade= | mie Royale des + Sciences Seventh of 18 States + sort_title_ssi: L'AMERIQUE | Suivant les dernieres | Observations de l'Acade= | + mie Royale des Sciences Seventh of 18 States + personal_name_ssim: + - Gravé par Denise Macquart. + - Buffier, Claude + personal_name_tesim: + - Gravé par Denise Macquart. + - Buffier, Claude + personal_name_ssm: + - Gravé par Denise Macquart. + - Buffier, Claude + origin_place_term_ssim: + - France and Italy + origin_place_term_tesim: + - France and Italy + origin_place_term_ssm: + - France and Italy + origin_date_created_ssim: + - '1730' + origin_date_created_tesim: + - '1730' + origin_date_created_ssm: + - '1730' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + genre_tesim: + - map + note_[]_tesim: + - California with indented northern coastline and without place names, except on + State 9, which is engraved by H. van Loon. Mainland coastline continues northwest + to 55 deg. N. The States and Variants listed identify differences between very + similar maps and may, with additional research, be re-arranged. + note_State 1_tesim: + - 'French text:. With "Gravé par Denise Macquart" (within title cartouche). "P.289" + (top right); with Leon diagonally labeled off coast above Panama; Mexi on mainland + of Mexico; Zélande; Cercle du Tropique de Capricorne; and N york, Boston and Virginie + labelled; MER DU NOR (missing the ''d''); and with NOUXau MIXIQUE. Dimensions: + 16.4 x 12.9 cm.; 17.8 x 14 cm. including border.' + note_State 2_tesim: + - 'French text:. With changed title: L''AMERIQUE | Suivant les dernieres | observations + de l''Acad. | Royale des Sciences. Without engraver’s name or pagination. California + labeled CALIFORNIE and without any place names. Laon and Mexique are labeled + on diagonal on mainland. Includes Zelande, Tropique du Capricorne, N York, Baston, + Virginie, MER DU NORD, NOUVELLE ESPAGNE. Most similar to State 3.' + note_State 3_tesim: + - 'French text: With changed title: L''AMERIQUE | Suivant les dernieres | observations + de l''Acad. | Royale des Sciences. / faure Sculp.t. “Page 841” (top right). California + labeled CALIFORNIE and without any place names. Laon and Mexique are labeled + on mainland. Includes Zelande, Tropique du Capricorne, N York, Baston, Virginie, + MER DU NORD, NOUVELLE ESPAGNE.' + note_State 4_tesim: + - 'French text:. With unchanged title cartouche. With “P.329” (top right); with + Leon diagonally labeled off coast above Panama; Mexi on mainland of Mexico; Zélande; + Cercle du Tropique de Capricorne; and N york, Boston and Virginie labelled; MER + DU NORD; and with NOUXau MEXIQUE. Dimensions: 17 x 12.6 cm; 17.8 x 13.8 cm including + border.' + note_State 5_tesim: + - 'French text:. With changed title and imprint: L''AMERIQUE | Suivant les derniéres + | observations de l''Acad. | Royale des Sciences. / Desbruslins Sculpsit.“pag.333” + (top left); with Leon on mainland; Mexi now spelled Mexique on mainland; Zelande; + Tropique du Capricorne; and N York, Baston and Virginie labeled; and with NOUVELLE + ESPAGNE.Issued in: Geographie universelle, exposee d’ans les differentes métodes + qui peuvent abréger l''étude ..., Sixiéme édition. -- Par le P. Buffier de la + Compagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, + à l’image Sainte Thérese, M.DCC.XXXIX(1739).[[VARIANT]]Variant of State 3With + “Desbruslins Sculpsit” erased. Dimensions: 16.4 x 12.5 cm; 17.7 x 13.8 cm. including + border.' + note_State 6_tesim: + - 'French text:. With changed title and imprint: L''AMERIQUE | Suivant les dernieres + | Observations de l''Acad | emie Royale des Siences / Gravé par Denise Macquart."P + 329" (top right); Leon diagonally labeled off coast above Panama; Mexi on mainland + of Mexico; Zélande unlabeled; Cercle du Tropique de Capricorne; and N york, Boston + and Virginie labeled; and with NOUau MIXIQUE.Issued in: Geographie universelle, + exposee d’ans les differentes métodes qui peuvent abréger l''étude ..., Sixiéme + édition. -- Par le P. Buffier de la Compagnie de Jesus. -- A Paris : Chez Pierre-François + Giffart, rue S. Jacques, à Sainte Thérese, M.DCC.LIX(1759). Dimensions: 16.2 + x 12.4 cm; 17.5 x 13.8 cm. including border.' + note_State 7_tesim: + - 'French text:. With changed title: L''AMERIQUE | Suivant les dernieres | observations + de l''Acad. | Royale des Sciences. Without engraver’s name. No pagination except + for “E” below map (bottom right). Leon on mainland; Mexique on mainland of Mexico; + Zelande labeled; Tropique du Capricorne; and N York, Baston and Virginie labeled; + and with NOUVau MEXIQUE. Dimensions: 16.2 x 12.4 cm; 17.5 x 13.8 cm. including + border.' + note_State 8_tesim: + - 'French text:. With title same as that of State 3. With added engraver’s name + following title: faure Sculp.t. "Page 296." or “Page. 289” (top right); Leon + and Mexique labelled on mainland; Zealande; Tropique du Capricorne; N York, Aston + (Boston misspelled), and Virginie labeled; and with NOUVau MEXIQUE. Dimensions: + 16.1 x 12.3 cm; 17.4 x 13.7 cm. including border.Map with “Page. 289” issued in: + Géographie universelle, exposee dans les differentes m´thodes qui peuvent abreger + l''étude ..., Huitieme edition. -- Par le P. Buffier, de la Coompagnie de Jesus. + -- A Par[is] : Chez Pierre-François Giffart, rue S. Jacques, à Sainte Thérèse, + M.DCC.LXVII (1767). (Curious date)' + note_State 9_tesim: + - 'French text:. With changed title: L''AMERIQUE | Suivant les dernieres | observations + de l''Academie | Royale des Sciences. and no engraver''s name."pag.333" (top left); + Leon horizontally labeled off coast above Panama; Mexique off coast of Mexico; + Zelande; Tropique du Capricorne; and N. Yore, Boston and Virginie labeled; and + with NOUVau MEXIQUE.Issued in: Géographie universelle, exposee dans les differentes + m´thodes qui peuvent abreger l''étude ..., Neuviéme édition. -- Par le P. Buffier, + de la Coompagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, + à Sainte Thérèse, M.DCC.LX(1760). Dimensions: 16.3 x 12.6 cm; 17.5 x 13.7 cm. + including border.' + note_State 11_tesim: + - 'French text:. With changed title: L''AMERIQUE, | Suivant les dernieres | Observations + de l''Acadé: | mie Royale des Sciences. / Par H. van Loon Geographe, et Graveur. + California now with with place names: C. Mendocin, C. Blanco, and I. Cedros. “Pag.301” + (top right). Leon diagonally labeled off coast; Mexi labeled on mainland; Zealande + unlabeled; Cercle du Tropique de Capricorne; N York and Virginie labeled; Boston + unlabeled; and with NOUVau MEXIQUE. Issued in: Geographie Universele en vers + artificiels / [by] le Pere Buffier, de la Compagnie de Jesus M DC[CLX]XV (1775).Reproduced + in: Letter in TMC, Winter 1991, No.59, p.50.' + note_State 10_tesim: + - 'French text:. With changed title: L''AMERIQUE | Suivant les dernieres | observations + de l''Academie | Royale des Sciences. and no engraver''s name."pag.333" (top left); + Leon horizontally labeled off coast above Panama; Mexique off coast of Mexico; + Zelande; Tropique du Capricorne; and N. Yore, Boston and Virginie labeled; and + with NOUVau MEXIQUE.Issued in: Géographie universelle, exposee dans les differentes + m´thodes qui peuvent abreger l''étude ..., Neuviéme édition. -- Par le P. Buffier, + de la Coompagnie de Jesus. -- A Paris : Chez Pierre-François Giffart, rue S. Jacques, + à Sainte Thérèse, M.DCC.LX(1760). Dimensions: 16.3 x 12.6 cm; 17.5 x 13.7 cm. + including border.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n [ca.1:90,000,000], [173]\n " + subject_cartographics_tesim: + - "\n [ca.1:90,000,000], [173]\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - np731wc7689_05_0001 + content_metadata_first_image_width_ssm: + - '4607' + content_metadata_first_image_height_ssm: + - '5282' + content_metadata_image_file_name_ssm: + - np731wc7689_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/np731wc7689%2Fnp731wc7689_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/np731wc7689/np731wc7689_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/np731wc7689/np731wc7689_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/np731wc7689/np731wc7689_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/np731wc7689/np731wc7689_05_0001_full +- :id: gt736xf9712 + :druid_ssi: gt736xf9712 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + 1016 + + HEMISPHERE OCCIDENTAL DU GLOBE TERRESTRE contenant L'AMERIQUE SEPTENT.LE et L'AMERIQUE M.LE et P.tie des TERRES ARCTIQUES et ANTARCTIQUES Subdivisées en leurs Regions. + + + 1707 + 1707 + + [S.l.] + + + 1016-03 + + 19.5 cm diameter. + + + + creator + + Moulart-Sanson, Pierre, d. 1730 + + Early Maps + On single undated sheet or two sheets, with "fol.21" (top right). "Page 21. | I.re partie | de L'Introduction" (bottom right). Single sheet includes “La Sphere Droite” outside of hemisphere on left side. Issued in: Introduction a la geographie in plusieurs cartes avec leur explication. / Par Les Srs Sanson, Geographes ordinaires du Roy. -- A Paris : Dans le cloitre de St. Nicolas du Louvre, MDCCVII [1707]. + With additional text above the title: Hemisphere Occidental du Globe Terrestre Veu en plan Cette Carte Sert de Contr ‘Epreuve a la precedente fol. 19... + Below map: Par le Sieur PIERRE MOULLART-SANSON Geographe Ordinaire du Roi. + Column of text to left of map, entitled: Des differentes manieres de representer le globe terrestre en plan. + None found, see McLaughlin 125,126; Shirley 591, 592. + California as a large island with indented northern coast. D. d'Anian and Terre de Iesso to northwest. Includes lines of eclipses. + + California as an island--Maps + + + Western Hemisphere--Maps + + + + [ca.1:140,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - HEMISPHERE OCCIDENTAL DU GLOBE TERRESTRE contenant L'AMERIQUE SEPTENT.LE et L'AMERIQUE + M.LE et P.tie des TERRES ARCTIQUES et ANTARCTIQUES Subdivisées en leurs Regions. + full_title_tesim: + - HEMISPHERE OCCIDENTAL DU GLOBE TERRESTRE contenant L'AMERIQUE SEPTENT.LE et L'AMERIQUE + M.LE et P.tie des TERRES ARCTIQUES et ANTARCTIQUES Subdivisées en leurs Regions. + sort_title_tesim: + - HEMISPHERE OCCIDENTAL DU GLOBE TERRESTRE contenant L'AMERIQUE SEPTENT.LE et L'AMERIQUE + M.LE et P.tie des TERRES ARCTIQUES et ANTARCTIQUES Subdivisées en leurs Regions. + sort_title_ssi: HEMISPHERE OCCIDENTAL DU GLOBE TERRESTRE contenant L'AMERIQUE SEPTENT.LE + et L'AMERIQUE M.LE et P.tie des TERRES ARCTIQUES et ANTARCTIQUES Subdivisées en + leurs Regions. + personal_name_ssim: + - Moulart-Sanson, Pierre, d. 1730 + personal_name_tesim: + - Moulart-Sanson, Pierre, d. 1730 + personal_name_ssm: + - Moulart-Sanson, Pierre, d. 1730 + origin_place_term_ssim: + - "[S.l.]" + origin_place_term_tesim: + - "[S.l.]" + origin_place_term_ssm: + - "[S.l.]" + origin_date_created_ssim: + - '1707' + - '1707' + origin_date_created_tesim: + - '1707' + - '1707' + origin_date_created_ssm: + - '1707' + - '1707' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 2_tesim: + - 'On single undated sheet or two sheets, with "fol.21" (top right). "Page 21. | + I.re partie | de L''Introduction" (bottom right). Single sheet includes “La Sphere + Droite” outside of hemisphere on left side. Issued in: Introduction a la geographie + in plusieurs cartes avec leur explication. / Par Les Srs Sanson, Geographes ordinaires + du Roy. -- A Paris : Dans le cloitre de St. Nicolas du Louvre, MDCCVII [1707].' + note_State 3_tesim: + - 'With additional text above the title: Hemisphere Occidental du Globe Terrestre + Veu en plan Cette Carte Sert de Contr ‘Epreuve a la precedente fol. 19...' + note_[]_tesim: + - 'Below map: Par le Sieur PIERRE MOULLART-SANSON Geographe Ordinaire du Roi.' + - 'Column of text to left of map, entitled: Des differentes manieres de representer + le globe terrestre en plan.' + - None found, see McLaughlin 125,126; Shirley 591, 592. + - California as a large island with indented northern coast. D. d'Anian and Terre + de Iesso to northwest. Includes lines of eclipses. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - Western Hemisphere--Maps + subject_topic_tesim: + - California as an island--Maps + - Western Hemisphere--Maps + subject_cartographics_ssim: + - "\n [ca.1:140,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:140,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '1016' + - 1016-03 + identifier_local_Post publication map number_tesim: + - '1016' + identifier_local_Post publication map number with latest state information_tesim: + - 1016-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - gt736xf9712_05_0001 + content_metadata_first_image_width_ssm: + - '5097' + content_metadata_first_image_height_ssm: + - '4314' + content_metadata_image_file_name_ssm: + - gt736xf9712_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/gt736xf9712%2Fgt736xf9712_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/gt736xf9712/gt736xf9712_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/gt736xf9712/gt736xf9712_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/gt736xf9712/gt736xf9712_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/gt736xf9712/gt736xf9712_05_0001_full +- :id: nr766vt0518 + :druid_ssi: nr766vt0518 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 208 + + GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH WYS EN SLAG WERK + + + 1705 + + Nürnberg + + 1705 + + 208-03 + + 49 x 58 cm. including text and borders. + + + + creator + + Homann, Johann Baptist, 1663-1724 + + LC 539; Tooley/1(53); Maritime 460;Tom Suarez, correspondence, 1995 + North polar projection with California as an island with rounded northern coastline. Surrounded by sky, half lit by sun, and a ring of the zodiac figures with names of the months. All within drawing of 24-hour table clock. Mountain ranges shown in America. Another example observed with bannered title: Nulla dies abeat, quin linea ducta supersit. (above map) and with Johannes Georgio Eberspergerg fecit (below map). Probably cut from a title page of the Atlas series (Title Page Entry 15). Text to clock left and right entitled "Bericht vom Nutzen und Gebrauch diser Uhr". + With compressed text in German to clock left and in Dutch to clock right. Title in both German and Dutch: GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH WYS EN SLAG WERK. No mountain ranges in America shown. No imprint. Text above title mentions Zacharias Landteck. + + + (W 0° --E 0°/N 90° --N 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - 'GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH WYS EN SLAG + WERK' + full_title_tesim: + - 'GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH WYS EN SLAG + WERK' + sort_title_tesim: + - 'GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH WYS EN SLAG + WERK' + sort_title_ssi: 'GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH + WYS EN SLAG WERK' + personal_name_ssim: + - Homann, Johann Baptist, 1663-1724 + personal_name_tesim: + - Homann, Johann Baptist, 1663-1724 + personal_name_ssm: + - Homann, Johann Baptist, 1663-1724 + origin_place_term_ssim: + - Nürnberg + origin_place_term_tesim: + - Nürnberg + origin_place_term_ssm: + - Nürnberg + origin_date_created_ssim: + - '1705' + - '1705' + origin_date_created_tesim: + - '1705' + - '1705' + origin_date_created_ssm: + - '1705' + - '1705' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 0° --E 0°/N 90° --N 90°)" + point_bbox: + - "-0.0 90.0 0.0 90.0" + note_[]_tesim: + - LC 539; Tooley/1(53); Maritime 460;Tom Suarez, correspondence, 1995 + - 'North polar projection with California as an island with rounded northern coastline. + Surrounded by sky, half lit by sun, and a ring of the zodiac figures with names + of the months. All within drawing of 24-hour table clock. Mountain ranges shown + in America. Another example observed with bannered title: Nulla dies abeat, quin + linea ducta supersit. (above map) and with Johannes Georgio Eberspergerg fecit + (below map). Probably cut from a title page of the Atlas series (Title Page Entry + 15). Text to clock left and right entitled "Bericht vom Nutzen und Gebrauch diser + Uhr".' + note_State 3_tesim: + - 'With compressed text in German to clock left and in Dutch to clock right. Title + in both German and Dutch: GEOGRAPHISCHE UNIVERSAL - ZEIG UND SCHLAG-UHR : WEERELD-BEELDIGH + WYS EN SLAG WERK. No mountain ranges in America shown. No imprint. Text above + title mentions Zacharias Landteck.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_cartographics_ssim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + subject_cartographics_tesim: + - "\n (W 0° --E 0°/N 90° --N 90°)\n " + identifier_tesim: + - '208' + - 208-03 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '208' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 208-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - nr766vt0518_05_0001 + content_metadata_first_image_width_ssm: + - '10386' + content_metadata_first_image_height_ssm: + - '8704' + content_metadata_image_file_name_ssm: + - nr766vt0518_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/nr766vt0518%2Fnr766vt0518_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/nr766vt0518/nr766vt0518_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/nr766vt0518/nr766vt0518_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/nr766vt0518/nr766vt0518_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/nr766vt0518/nr766vt0518_05_0001_full +- :id: qt469cf8909 + :druid_ssi: qt469cf8909 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 21 + + Pascaart vertoonende de Zeecusten van Chili, Peru, Hispania, Nova, Nova Granada, en California. + + + 1660 + + 't Amsterdam + + 1660 + + 21-02 + + 1 map : hand col.; 42.4 x 54.4 cm., 43.1 x 54.4 cm. including border + + + + creator + + Doncker, Hendrick, 1626-1699 + + See general notes. + With added outline of Yucatan Peninsula and east coast of Central America. + "Duytsche mylen 15 in een graadt. " + By Hendrick Doncker. Boeckverkooper inde Nieuwe brugh steegh in 't stuiermans gereedt: schap + Wagner 382 & 407; Tooley 17 (Plate 33; state 2); Leighly 36; Koeman,IV,Don2(21); The mapping of North America, three centuries of map-making 1500-1860, by John Goss, The Wellfleet Press, New Jersey, 1990 (Map 35; state 1). + Issued in: De Zee-Atlas ofte water-waereld, vertoonende all de Zee-Kusten van het bekende deel des aerdbodems... / By Hendrik Doncker, 1660. Reissued 1665, 1666, and 1672 (with title changed). + Map is oriented with north to the left. California as an island on second Sanson model, with indented northern coast. Agubela de Cato is peninsula to its north. Insets of Zeelandia Nova, Islas de las Velas alias Ladrones, and Iapan and Yedso, each oriented with north at top and decoratively outlined, cover the upper left corner of map. Title cartouche (top left) with ornamental scrollwork. Scale given in Duytsche mylen (bottom left). Copied from Blaeu's map of 1648, with errors. P. de Sr Francisco Draco is omitted. + + California as an island--Maps + + + Pacific Ocean--Maps + + + + [ca.1: 19,000,000] + (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Pascaart vertoonende de Zeecusten van Chili, Peru, Hispania, Nova, Nova Granada, + en California. + full_title_tesim: + - Pascaart vertoonende de Zeecusten van Chili, Peru, Hispania, Nova, Nova Granada, + en California. + sort_title_tesim: + - Pascaart vertoonende de Zeecusten van Chili, Peru, Hispania, Nova, Nova Granada, + en California. + sort_title_ssi: Pascaart vertoonende de Zeecusten van Chili, Peru, Hispania, Nova, + Nova Granada, en California. + personal_name_ssim: + - Doncker, Hendrick, 1626-1699 + personal_name_tesim: + - Doncker, Hendrick, 1626-1699 + personal_name_ssm: + - Doncker, Hendrick, 1626-1699 + origin_place_term_ssim: + - "'t Amsterdam" + origin_place_term_tesim: + - "'t Amsterdam" + origin_place_term_ssm: + - "'t Amsterdam" + origin_date_created_ssim: + - '1660' + - '1660' + origin_date_created_tesim: + - '1660' + - '1660' + origin_date_created_ssm: + - '1660' + - '1660' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)" + point_bbox: + - "-92.25 7.166666666666667 -77.16666666666667 18.5" + note_State 1_tesim: + - See general notes. + note_State 2_tesim: + - With added outline of Yucatan Peninsula and east coast of Central America. + note_[]_tesim: + - '"Duytsche mylen 15 in een graadt. "' + - Wagner 382 & 407; Tooley 17 (Plate 33; state 2); Leighly 36; Koeman,IV,Don2(21); + The mapping of North America, three centuries of map-making 1500-1860, by John + Goss, The Wellfleet Press, New Jersey, 1990 (Map 35; state 1). + - 'Issued in: De Zee-Atlas ofte water-waereld, vertoonende all de Zee-Kusten van + het bekende deel des aerdbodems... / By Hendrik Doncker, 1660. Reissued 1665, + 1666, and 1672 (with title changed).' + - Map is oriented with north to the left. California as an island on second Sanson + model, with indented northern coast. Agubela de Cato is peninsula to its north. + Insets of Zeelandia Nova, Islas de las Velas alias Ladrones, and Iapan and Yedso, + each oriented with north at top and decoratively outlined, cover the upper left + corner of map. Title cartouche (top left) with ornamental scrollwork. Scale given + in Duytsche mylen (bottom left). Copied from Blaeu's map of 1648, with errors. + P. de Sr Francisco Draco is omitted. + note_Statement of responsibility_tesim: + - 'By Hendrick Doncker. Boeckverkooper inde Nieuwe brugh steegh in ''t stuiermans + gereedt: schap' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - Pacific Ocean--Maps + subject_topic_tesim: + - California as an island--Maps + - Pacific Ocean--Maps + subject_cartographics_ssim: + - "\n [ca.1: 19,000,000]\n (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca.1: 19,000,000]\n (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '21' + - 21-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '21' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 21-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - qt469cf8909_05_0001 + content_metadata_first_image_width_ssm: + - '9275' + content_metadata_first_image_height_ssm: + - '7622' + content_metadata_image_file_name_ssm: + - qt469cf8909_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/qt469cf8909%2Fqt469cf8909_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/qt469cf8909/qt469cf8909_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/qt469cf8909/qt469cf8909_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/qt469cf8909/qt469cf8909_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/qt469cf8909/qt469cf8909_05_0001_full +- :id: kw703rh2327 + :druid_ssi: kw703rh2327 + mods_xml_ssm: + - | + + + + Mappe-monde pour connoitre les progŕes & les conquestes les plus remarquables des Provinces-Vnies, ainsy que celles des Compagnies d'Orient et d'Occident et les païs quelles possédent dans l'un et dans l'autre hemisphere + + + Atlas historique, ou, nouvelle introduction à l’histoire, à la chronologie & à la géographie ancienne & moderne + + + Chatelain, Henri Abraham + + cartographic + map + Early maps. + Digital maps. + Maps. + + + fr + + + [Amsterdam + + Henri Abraham Chatelain + 1708?] + 1705 + monographic + + + fre + + + 1 map ; 2 hemispheres each 23 cm. in diam. + + + California shown as an unlabeled island with an indented northern coast and no place names. The Great Lakes are open-ended to the west. + Double hemisphere map with extensive text in French describing explorations and discoveries of the Dutch. An overlaid framed grid surrounds the principal continents of the world. The tables surrounding the map use the grid coordinates to identify significant geographic locations. The numbers 1 to 34 refer to Dutch voyages from 1594 to 1665. Colonial possessions of "la Compagnie" in Asia are noted in items 35-47. Circumnavigation routes are also shown. "Avec privilege des etats de Hollande et West frise." at lower center. + Based on an anonymous map from c. 1670. The text has not been amended. Numerous decorative elements have been added: Below the map is a drawing of a woman holding a horn of plenty in one hand and a cap atop a staff in the other. A lion holding a sword and a bunch of arrows stands in front of her. Both are enclosed in a pen. The same lion is depicted above the maps. Sailing ships are on either side of the hemispheres. + McLaughlin map number 1042-01. + State 1 - No. 43 (top right). Issued in his: Atlas historique, ou, nouvelle introduction à l'histoire, à la chronologie & à la géographie ancienne & moderne ..., Vol. 1 [Map 43]. -- Amsterdam, 1705-20. Vol 1. dated 1705. Reissued in 1721. + State 2 - [1739], Tom. 1. No. 45. (top right). Issued in his: Atlas historique, ou, nouvelle introduction à l'histoire, à la chronologie & à la géographie ancienne & moderne ..., Vol. 1 [Map 12]. -- Amsterdam, 1732-39. Final edition of Vol 1. dated 1739. + + + Scale [ca. 1:60,000,000] + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + + Shirley, R.W. Mapping the world (4th ed.), + + 447 + + + + Phillips, + + 548, 579 + + + + Koeman, C. Atlantes Neerlandici, + + Ch.1(16), 2 + + + aacr + CSt-ES + 130122 + a9335266 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Mappe-monde pour connoitre les progŕes & les conquestes les plus remarquables + des Provinces-Vnies, ainsy que celles des Compagnies d'Orient et d'Occident et + les païs quelles possédent dans l'un et dans l'autre hemisphere + full_title_tesim: + - Mappe-monde pour connoitre les progŕes & les conquestes les plus remarquables + des Provinces-Vnies, ainsy que celles des Compagnies d'Orient et d'Occident et + les païs quelles possédent dans l'un et dans l'autre hemisphere + - Atlas historique, ou, nouvelle introduction à l’histoire, à la chronologie & à + la géographie ancienne & moderne + alternative_title_tesim: + - Atlas historique, ou, nouvelle introduction à l’histoire, à la chronologie & à + la géographie ancienne & moderne + sort_title_tesim: + - Mappe-monde pour connoitre les progŕes & les conquestes les plus remarquables + des Provinces-Vnies, ainsy que celles des Compagnies d'Orient et d'Occident et + les païs quelles possédent dans l'un et dans l'autre hemisphere + sort_title_ssi: Mappe-monde pour connoitre les progŕes & les conquestes les plus + remarquables des Provinces-Vnies, ainsy que celles des Compagnies d'Orient et + d'Occident et les païs quelles possédent dans l'un et dans l'autre hemisphere + personal_name_ssim: + - Chatelain, Henri Abraham + personal_name_tesim: + - Chatelain, Henri Abraham + personal_name_ssm: + - Chatelain, Henri Abraham + language_ssim: + - French + language_tesim: + - French + language_ssm: + - French + origin_place_term_ssim: + - fr + - "[Amsterdam" + origin_place_term_tesim: + - fr + - "[Amsterdam" + origin_place_term_ssm: + - fr + - "[Amsterdam" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - '' + - California shown as an unlabeled island with an indented northern coast and no + place names. The Great Lakes are open-ended to the west. + - Double hemisphere map with extensive text in French describing explorations and + discoveries of the Dutch. An overlaid framed grid surrounds the principal continents + of the world. The tables surrounding the map use the grid coordinates to identify + significant geographic locations. The numbers 1 to 34 refer to Dutch voyages from + 1594 to 1665. Colonial possessions of "la Compagnie" in Asia are noted in items + 35-47. Circumnavigation routes are also shown. "Avec privilege des etats de Hollande + et West frise." at lower center. + - 'Based on an anonymous map from c. 1670. The text has not been amended. Numerous + decorative elements have been added: Below the map is a drawing of a woman holding + a horn of plenty in one hand and a cap atop a staff in the other. A lion holding + a sword and a bunch of arrows stands in front of her. Both are enclosed in a pen. + The same lion is depicted above the maps. Sailing ships are on either side of + the hemispheres.' + note_Local note_tesim: + - McLaughlin map number 1042-01. + - 'State 1 - No. 43 (top right). Issued in his: Atlas historique, ou, nouvelle introduction + à l''histoire, à la chronologie & à la géographie ancienne & moderne ..., Vol. + 1 [Map 43]. -- Amsterdam, 1705-20. Vol 1. dated 1705. Reissued in 1721.' + - 'State 2 - [1739], Tom. 1. No. 45. (top right). Issued in his: Atlas historique, + ou, nouvelle introduction à l''histoire, à la chronologie & à la géographie ancienne + & moderne ..., Vol. 1 [Map 12]. -- Amsterdam, 1732-39. Final edition of Vol 1. + dated 1739.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale [ca. 1:60,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:60,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - kw703rh2327_05_0001 + content_metadata_first_image_width_ssm: + - '8484' + content_metadata_first_image_height_ssm: + - '7195' + content_metadata_image_file_name_ssm: + - kw703rh2327_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/kw703rh2327%2Fkw703rh2327_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/kw703rh2327/kw703rh2327_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/kw703rh2327/kw703rh2327_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/kw703rh2327/kw703rh2327_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/kw703rh2327/kw703rh2327_05_0001_full +- :id: pm812zf5263 + :druid_ssi: pm812zf5263 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 110 + + AMERICÆ + + + 1709 + + [Antwerp] + + 1709 + + 110-02 + + 1 map : hand col.; 14 x 17 cm., 15 x 18.4 cm. + + + + creator + + Peeters, Jacques, 1637-1695 + + With place names: C. Blanco, P. de Monte Rÿ, Canala d. s. Barbara, I. d. s. Catalina, s. Clement, I. d. Pararos, P. d. s. Apolline, and C. Lucas. With "MARE" above and to the right of PACIFI", and "Mare Canadense sive Novæ Franciæ" lettering entirely to left of Azores. Has the name "Harrewyn f:" (bottom left) and "I.P." below seated chief within title cartouche. + California with indented northern coast and place names. Terra Esonis, Fretum Aniani, and Agubela de Cato to north. Title cartouche/vignette with palm trees and Natives and Europeans in discussion. (bottom left). + Faupel's Americana 90(45); L.C. 513; Mapas de America en los libros españoles de los siglos XVI AL XVIII (1503-1798), p.150 / Francisco Vindel. -- Madrid, 1955 (state 2); Jason Hubbard correspondence 1997. + Possibly issued in: Geographia o moderna descripcion del Mundo, y sus partes, dividida en dos tomos, y compuesta por don Sebastian Fernandez de Medrano, Tomo Primero / Sebastian Fernandez de Medrano. -- Amberes [Antwerp] : Por Henrico y Cornelio Verdussen, Mercaderes de Libros, 1709. Issued in: El Atlas Abreviado, o compendiosa Geografia del Mundo Antiguo y nuevo / [Afferden (F. De)] por Antonio Gonzales de Reyes ... acosta de Francisco Laso. -- Madrid, 1709 and 1725. Possibly included in 1711 edition. + + America--Maps + + + California as an island--Maps + + + + [ca.1:150,000,000] + (W 160° --E 20°/N 90° --S 90°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERICÆ + full_title_tesim: + - AMERICÆ + sort_title_tesim: + - AMERICÆ + sort_title_ssi: AMERICÆ + personal_name_ssim: + - Peeters, Jacques, 1637-1695 + personal_name_tesim: + - Peeters, Jacques, 1637-1695 + personal_name_ssm: + - Peeters, Jacques, 1637-1695 + origin_place_term_ssim: + - "[Antwerp]" + origin_place_term_tesim: + - "[Antwerp]" + origin_place_term_ssm: + - "[Antwerp]" + origin_date_created_ssim: + - '1709' + - '1709' + origin_date_created_tesim: + - '1709' + - '1709' + origin_date_created_ssm: + - '1709' + - '1709' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 160° --E 20°/N 90° --S 90°)" + point_bbox: + - "-160.0 -90.0 20.0 90.0" + note_State 2_tesim: + - 'With place names: C. Blanco, P. de Monte Rÿ, Canala d. s. Barbara, I. d. s. Catalina, + s. Clement, I. d. Pararos, P. d. s. Apolline, and C. Lucas. With "MARE" above + and to the right of PACIFI", and "Mare Canadense sive Novæ Franciæ" lettering + entirely to left of Azores. Has the name "Harrewyn f:" (bottom left) and "I.P." + below seated chief within title cartouche.' + note_[]_tesim: + - California with indented northern coast and place names. Terra Esonis, Fretum + Aniani, and Agubela de Cato to north. Title cartouche/vignette with palm trees + and Natives and Europeans in discussion. (bottom left). + - Faupel's Americana 90(45); L.C. 513; Mapas de America en los libros españoles + de los siglos XVI AL XVIII (1503-1798), p.150 / Francisco Vindel. -- Madrid, 1955 + (state 2); Jason Hubbard correspondence 1997. + - 'Possibly issued in: Geographia o moderna descripcion del Mundo, y sus partes, + dividida en dos tomos, y compuesta por don Sebastian Fernandez de Medrano, Tomo + Primero / Sebastian Fernandez de Medrano. -- Amberes [Antwerp] : Por Henrico y + Cornelio Verdussen, Mercaderes de Libros, 1709. Issued in: El Atlas Abreviado, + o compendiosa Geografia del Mundo Antiguo y nuevo / [Afferden (F. De)] por Antonio + Gonzales de Reyes ... acosta de Francisco Laso. -- Madrid, 1709 and 1725. Possibly + included in 1711 edition.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - America--Maps + - California as an island--Maps + subject_topic_tesim: + - America--Maps + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca.1:150,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + subject_cartographics_tesim: + - "\n [ca.1:150,000,000]\n (W 160° --E 20°/N 90° --S 90°)\n " + identifier_tesim: + - '110' + - 110-02 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '110' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 110-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - pm812zf5263_05_0001 + content_metadata_first_image_width_ssm: + - '4913' + content_metadata_first_image_height_ssm: + - '4303' + content_metadata_image_file_name_ssm: + - pm812zf5263_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/pm812zf5263%2Fpm812zf5263_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/pm812zf5263/pm812zf5263_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/pm812zf5263/pm812zf5263_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/pm812zf5263/pm812zf5263_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/pm812zf5263/pm812zf5263_05_0001_full +- :id: pt603pv6417 + :druid_ssi: pt603pv6417 + mods_xml_ssm: + - "\n\n cartographic\n + \ map\n \n A + Map of the WORLD with the Ships DUKE & DUTCHESS Tract Round it, from 1708 + to 1711.\n Second of 2 States\n + \ \n \n \n + \ creator\n + \ \n [Woodes Rogers].\n \n + \ \n \n London\n + \ \n 1698/1715\n + \ \n \n Two hemispheres, + ea. 17.1 cm. in diam., on sheet 20.3 x 35.7 cm.\n \n + \ \n Rogers, + Woodes\n \n \n + \ Rogers, Woodes\n \n \n Bell, Andrew\n + \ \n \n Lintot, + Bernard\n \n \n + \ Moll, Herman (d. 1732)\n \n \n Dampier, William\n + \ \n \n Oosterwyk, + Johannes\n \n \n + \ Gaete, Hendrik van de\n \n \n Sewel, W.\n + \ \n \n Hondt, + Abraham de\n \n Book Map\n + \ California shown with a rounded northern coastline and labeled California. + \ Island curves sharply to the east giving the appearance of a long nearly flat + southern coast. “By Herman Moll Geographer” (below title, center).Issued in his: + A Cruising Voyage round the World / By Captain Woodes Rogers. -- London : Printed + for A. Bell and B. Lintot, \tMDCCXII (1712).Reissued in his: A Cruising Voyage + round the World / By Captain Woodes Rogers. Second Edition, Corrected. -- London + : Printed \tfor Andrew Bell and Bernard Lintot, MDCCXVIII (1718).\n + \ Streeter 2429.\n As + above.\n In English and Dutch, + with title: WERELD ~ KAART, aanweizende de koers van Mr. ROGERS reistogt rondom + den Aardkloot van’t Jaar 1708 tot 1711. Pag: 1. (top right, outside border). ¶ + Issued in his: Nieuwe reize naa de Zuid Zee, van daar naa Oost-\tIndien, en verder + Rondom de Waereld / Gedaan onder het bestier van William Dampier. In’t Engels + \tbeschreven door Woodes Rogers. --\t T’Amsterdam, By Johannes Oosterwyk en Hendrik + van de Gaete, 1715. [bound together with] Nieuwe reystogt rondom de werreld / + In’t Engelsch beschreeven door William Dampier, en daarupt bertaald door W. Sewel. + -- In’s Gravenhage : by Abraham de Hondt, 1698.\n \n + \ World--Maps--1718\n \n \n + \ World--Maps--to 180\n \n \n + \ California as an island--Maps--1718\n \n + \ \n \n [ca. 1:140,000,000].\n + \ (W 180° --E 180°/N 85° --S 85°)\n \n + \ \n \n \n + \ The Glen McLaughlin Map Collection of California as an Island\n + \ \n http://purl.stanford.edu/zb871zd0767\n + \ \n \n Image from the Glen McLaughlin Map Collection courtesy + Stanford University Libraries. Images may be reproduced or transmitted, but not + for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu.\n + \ Property rights reside with the repository. + Copyright © Stanford University. All Rights Reserved.\n + \ CC by-nc: This work is licensed under + a Creative Commons Attribution-NonCommercial 3.0 Unported License\n\n" + short_title_tesim: + - A Map of the WORLD with the Ships DUKE & DUTCHESS Tract Round it, from 1708 to + 1711. + full_title_tesim: + - A Map of the WORLD with the Ships DUKE & DUTCHESS Tract Round it, from 1708 to + 1711. Second of 2 States + sort_title_tesim: + - A Map of the WORLD with the Ships DUKE & DUTCHESS Tract Round it, from 1708 to + 1711. Second of 2 States + sort_title_ssi: A Map of the WORLD with the Ships DUKE & DUTCHESS Tract Round it, + from 1708 to 1711. Second of 2 States + personal_name_ssim: + - "[Woodes Rogers]." + - Rogers, Woodes + - Rogers, Woodes + - Bell, Andrew + - Lintot, Bernard + - Moll, Herman (d. 1732) + - Dampier, William + - Oosterwyk, Johannes + - Gaete, Hendrik van de + - Sewel, W. + - Hondt, Abraham de + personal_name_tesim: + - "[Woodes Rogers]." + - Rogers, Woodes + - Rogers, Woodes + - Bell, Andrew + - Lintot, Bernard + - Moll, Herman (d. 1732) + - Dampier, William + - Oosterwyk, Johannes + - Gaete, Hendrik van de + - Sewel, W. + - Hondt, Abraham de + personal_name_ssm: + - "[Woodes Rogers]." + - Rogers, Woodes + - Rogers, Woodes + - Bell, Andrew + - Lintot, Bernard + - Moll, Herman (d. 1732) + - Dampier, William + - Oosterwyk, Johannes + - Gaete, Hendrik van de + - Sewel, W. + - Hondt, Abraham de + origin_place_term_ssim: + - London + origin_place_term_tesim: + - London + origin_place_term_ssm: + - London + origin_date_created_ssim: + - 1698/1715 + origin_date_created_tesim: + - 1698/1715 + origin_date_created_ssm: + - 1698/1715 + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Book Map + genre_tesim: + - map + - Book Map + coordinates_tesim: + - "(W 180° --E 180°/N 85° --S 85°)" + point_bbox: + - "-180.0 -85.0 180.0 85.0" + note_[]_tesim: + - "California shown with a rounded northern coastline and labeled California. Island + curves sharply to the east giving the appearance of a long nearly flat southern + coast. “By Herman Moll Geographer” (below title, center).Issued in his: A Cruising + Voyage round the World / By Captain Woodes Rogers. -- London : Printed for A. + Bell and B. Lintot, \tMDCCXII (1712).Reissued in his: A Cruising Voyage round + the World / By Captain Woodes Rogers. Second Edition, Corrected. -- London : + Printed \tfor Andrew Bell and Bernard Lintot, MDCCXVIII (1718)." + - Streeter 2429. + note_State 1_tesim: + - As above. + note_State 4_tesim: + - "In English and Dutch, with title: WERELD ~ KAART, aanweizende de koers van Mr. + ROGERS reistogt rondom den Aardkloot van’t Jaar 1708 tot 1711. Pag: 1. (top right, + outside border). ¶ Issued in his: Nieuwe reize naa de Zuid Zee, van daar naa Oost-\tIndien, + en verder Rondom de Waereld / Gedaan onder het bestier van William Dampier. In’t + Engels \tbeschreven door Woodes Rogers. --\t T’Amsterdam, By Johannes Oosterwyk + en Hendrik van de Gaete, 1715. [bound together with] Nieuwe reystogt rondom de + werreld / In’t Engelsch beschreeven door William Dampier, en daarupt bertaald + door W. Sewel. -- In’s Gravenhage : by Abraham de Hondt, 1698." + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World--Maps--1718 + - World--Maps--to 180 + - California as an island--Maps--1718 + subject_topic_tesim: + - World--Maps--1718 + - World--Maps--to 180 + - California as an island--Maps--1718 + subject_cartographics_ssim: + - "\n [ca. 1:140,000,000].\n (W 180° --E 180°/N 85° --S 85°)\n " + subject_cartographics_tesim: + - "\n [ca. 1:140,000,000].\n (W 180° --E 180°/N 85° --S 85°)\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - pt603pv6417_05_0001 + content_metadata_first_image_width_ssm: + - '5821' + content_metadata_first_image_height_ssm: + - '3941' + content_metadata_image_file_name_ssm: + - pt603pv6417_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/pt603pv6417%2Fpt603pv6417_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/pt603pv6417/pt603pv6417_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/pt603pv6417/pt603pv6417_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/pt603pv6417/pt603pv6417_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/pt603pv6417/pt603pv6417_05_0001_full +- :id: ds525vw8509 + :druid_ssi: ds525vw8509 + mods_xml_ssm: + - | + + + + Mappa mondo + + + Figura prima del capitolo IV., ossia della divisione della terra + + cartographic + map + Early maps. + Digital maps. + Maps. + + + it + + + [Italy] + + [s.n.] + 1806 + monographic + + + ita + + + 1 map : woodcut; 2 hemispheres each 9.2 cm. in diam., on sheet 25.5 x 32.3 cm. + + + California shown as unlabeled island with a flat northern coastline. + Shows simple labeled outlines of continents with no place names. Includes the beginning of New Zealand's coastline. + Includes text below. + Text in Italian. + McLaughlin map number 1241. + + + Scale [ca. 1:200,000,000] + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + + + aacr + CSt-ES- + 121121 + a9756440 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Mappa mondo + full_title_tesim: + - Mappa mondo + - Figura prima del capitolo IV., ossia della divisione della terra + alternative_title_tesim: + - Figura prima del capitolo IV., ossia della divisione della terra + sort_title_tesim: + - Mappa mondo + sort_title_ssi: Mappa mondo + language_ssim: + - Italian + language_tesim: + - Italian + language_ssm: + - Italian + origin_place_term_ssim: + - it + - "[Italy]" + origin_place_term_tesim: + - it + - "[Italy]" + origin_place_term_ssm: + - it + - "[Italy]" + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - '' + - California shown as unlabeled island with a flat northern coastline. + - Shows simple labeled outlines of continents with no place names. Includes the + beginning of New Zealand's coastline. + - Includes text below. + - Text in Italian. + note_Local note_tesim: + - McLaughlin map number 1241. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_cartographics_ssim: + - "\n Scale [ca. 1:200,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:200,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - ds525vw8509_05_0001 + content_metadata_first_image_width_ssm: + - '5448' + content_metadata_first_image_height_ssm: + - '4318' + content_metadata_image_file_name_ssm: + - ds525vw8509_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/ds525vw8509%2Fds525vw8509_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/ds525vw8509/ds525vw8509_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/ds525vw8509/ds525vw8509_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/ds525vw8509/ds525vw8509_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/ds525vw8509/ds525vw8509_05_0001_full +- :id: rj993fh5469 + :druid_ssi: rj993fh5469 + mods_xml_ssm: + - | + + + Relief shown pictorially. Two hemispheres. Pacific ocean labeled “The Great South Sea” and Atlantic labeled: “Atlantick Ocean”. Great lakes complete. California as a labeled island with an indented northern coast. + 1231 + 1231-02 + + A New Map of the World Shewing the Course of Sr. Francis Drake, William Shouten and Capt. William Dampiers Voyages Round it. + + cartographic + + + [London] + + 1700 + + + Moll, Herman, -1732 + + creator + + + Digital Maps + Early Maps + map + + image/tiff + 1 map: hand col.; 2 hemispheres on sheet ca. 50 x 30 cm. + digitized other analog + + + Lyberteam Metadata ToolKit + + Addition to title : A new map of the world shewing the course of Sr. Francis Drake, William Schouten and Capt. William Dampiers voyages Round it. Traces expeditions around world. Additional islands and place names added in Pacific Ocean on the western hemisphere as well as on the eastern hemisphere in Asia and around Australia. California now includes the label N. Albion. + + California as an island--Maps + + + World maps + + + + (W 180° --E 180°/N 85° --S 85°) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - A New Map of the World Shewing the Course of Sr. Francis Drake, William Shouten + and Capt. William Dampiers Voyages Round it. + full_title_tesim: + - A New Map of the World Shewing the Course of Sr. Francis Drake, William Shouten + and Capt. William Dampiers Voyages Round it. + sort_title_tesim: + - A New Map of the World Shewing the Course of Sr. Francis Drake, William Shouten + and Capt. William Dampiers Voyages Round it. + sort_title_ssi: A New Map of the World Shewing the Course of Sr. Francis Drake, + William Shouten and Capt. William Dampiers Voyages Round it. + personal_name_ssim: + - Moll, Herman, -1732 + personal_name_tesim: + - Moll, Herman, -1732 + personal_name_ssm: + - Moll, Herman, -1732 + origin_place_term_ssim: + - "[London]" + origin_place_term_tesim: + - "[London]" + origin_place_term_ssm: + - "[London]" + origin_date_created_ssim: + - '1700' + origin_date_created_tesim: + - '1700' + origin_date_created_ssm: + - '1700' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - Digital Maps + - Early Maps + - map + genre_tesim: + - Digital Maps + - Early Maps + - map + coordinates_tesim: + - "(W 180° --E 180°/N 85° --S 85°)" + point_bbox: + - "-180.0 -85.0 180.0 85.0" + note_[]_tesim: + - 'Relief shown pictorially. Two hemispheres. Pacific ocean labeled “The Great South + Sea” and Atlantic labeled: “Atlantick Ocean”. Great lakes complete. California + as a labeled island with an indented northern coast.' + note_State 2_tesim: + - 'Addition to title : A new map of the world shewing the course of Sr. Francis + Drake, William Schouten and Capt. William Dampiers voyages Round it. Traces expeditions + around world. Additional islands and place names added in Pacific Ocean on the + western hemisphere as well as on the eastern hemisphere in Asia and around Australia. + California now includes the label N. Albion.' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - World maps + subject_topic_tesim: + - California as an island--Maps + - World maps + subject_cartographics_ssim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + subject_cartographics_tesim: + - "\n (W 180° --E 180°/N 85° --S 85°)\n " + identifier_tesim: + - '1231' + - 1231-02 + identifier_local_Post publication map number_tesim: + - '1231' + identifier_local_Post publication map number with latest state information_tesim: + - 1231-02 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - rj993fh5469_05_0001 + content_metadata_first_image_width_ssm: + - '16616' + content_metadata_first_image_height_ssm: + - '10890' + content_metadata_image_file_name_ssm: + - rj993fh5469_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/rj993fh5469%2Frj993fh5469_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/rj993fh5469/rj993fh5469_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/rj993fh5469/rj993fh5469_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/rj993fh5469/rj993fh5469_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/rj993fh5469/rj993fh5469_05_0001_full +- :id: mw236cd6430 + :druid_ssi: mw236cd6430 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 55 + + AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + + + + Paris + + 1692 + + 55-03 + + 1 map : hand col., 52 x 84.7 cm., 56.5 x 86.7 cm. including border and added title. + + + + creator + + Jaillot, Alexis Hubert, 1632?-1712 + + First issued in 1674. Reissued 1685, 1690, 1692, and 1695. Of these, only the 1692 issue has been seen and listed as a separate state; if the others include a changed imprint, they could also be listed as separate states. A Latin edition was issued in [1676?] by Johannes Hoffman (Entry 57). An English edition was issued in 1680 by William Berry (Entry 74). Issued in: Atlas nouveau, contenant toutes les parties du monde ... / H. Iaillot. -- Paris, 1692. + Separate Map + Issued 1674, as in general notes. + Issued 1679 with new title piece. + Issued 1692, with imprint at base of scale cartouche: A Paris Chez H. Iaillot joignant les grands Augustins, aux deux Globes Avec Privilege du Roy pour vingt Ans. 1692. Title along map top shows 1692 also. + Issued 1700, with imprint at base of scale cartouche: A Amsterdam Chez PIERRE MORTIER et Compag.nie Avec Privilege (undated). + Issued 1719, with California left undecided as to insular or peninsular, and with imprint at base of scale cartouche: A Paris Chez H. Iaillot joignant les. + On smaller scale, 54.5 x 64 cm., with new titlepiece and scale of miles. Issued 169-?, 1694, and in Amsterdam by R&J Ottens. + A later reproduction probably copied from the first (1674) state. Based upon the cartography and the dating, it appears to have been produced between 1674 and 1690. The lettering is crude, and the cartography is slightly less detailed. It is possibly Italian in origin. Title (in cartouche) spelling changed from S. Sanson to Sr. Sanson. Spelling variants include V instead of U. + Wagner 409b; Wheat 58; Tooley 37 (Plate 44, State 1) & 38; Leighly 64; BN Jaillot,I,Aa(5); UCB; Philip Burden correspondence. + Dedication (within title cartouche): Presentée a Monseigneur le Davphin, Parson tres-humble, tres obeissant, et tres fidele Seruiteur, Herbert Iaillot. Title along map top: L'Amerique Septentrionale divisée en ses principales parties, scauoir Les Terres Arctiques, Le Canada ou Nouvelle France, Le Mexique ou Nouvelle Espagne, Le Nouveau Mexique, Les Isles de Terre Neuve de Californie, et | Antilles, ou sont distingués les uns des autres, Les Estats, comme Ils sont possedés presentement par Les François, Castillans, Anglois, Sued Ois, Danois, et par Les Estats Generaux des Provinces Vnies ou Hollandois. Tirée des Relations de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy, 1674. California copied from Sanson's 1656 map, and labelled Isle de Californie. Agubela de Gato as peninsula on mainland to north. Terre de Iesso ou Ieco to west. Great Lakes open to west. Decorative title cartouche (upper left) with crown and arms of the Dauphin. Multiple scales given within decorative cartouche (lower left). + Hubert Iaillot. + + California as an island--Maps + + + North America--Maps + + + + [ca. 1:16,000,000]. + (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ) + + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + full_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + sort_title_tesim: + - AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont distingués + les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet aux FRANÇOIS, + CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations de toutes + ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + sort_title_ssi: AMERIQUE SEPTENTRIONALE divisée en ses principales parties, ou sont + distingués les vns des autres LES ESTATS suivant qu'ils appartiennent presentemet + aux FRANÇOIS, CASTILLANS, ANGLOIS, SUEDOIS, DANOIS, HOLLANDOIS. Tirée des Relations + de toutes ces Nations Par le Sr. Sanson, Geographe Ordinaire du Roy + personal_name_ssim: + - Jaillot, Alexis Hubert, 1632?-1712 + personal_name_tesim: + - Jaillot, Alexis Hubert, 1632?-1712 + personal_name_ssm: + - Jaillot, Alexis Hubert, 1632?-1712 + origin_place_term_ssim: + - Paris + origin_place_term_tesim: + - Paris + origin_place_term_ssm: + - Paris + origin_date_created_ssim: + - '1692' + origin_date_created_tesim: + - '1692' + origin_date_created_ssm: + - '1692' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + - Separate Map + genre_tesim: + - map + - Digital Maps + - Early Maps + - Separate Map + coordinates_tesim: + - "(W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)" + point_bbox: + - "-173.0 7.166666666666667 -10.0 84.0" + note_[]_tesim: + - 'First issued in 1674. Reissued 1685, 1690, 1692, and 1695. Of these, only the + 1692 issue has been seen and listed as a separate state; if the others include + a changed imprint, they could also be listed as separate states. A Latin edition + was issued in [1676?] by Johannes Hoffman (Entry 57). An English edition was issued + in 1680 by William Berry (Entry 74). Issued in: Atlas nouveau, contenant toutes + les parties du monde ... / H. Iaillot. -- Paris, 1692.' + - Wagner 409b; Wheat 58; Tooley 37 (Plate 44, State 1) & 38; Leighly 64; BN Jaillot,I,Aa(5); + UCB; Philip Burden correspondence. + - 'Dedication (within title cartouche): Presentée a Monseigneur le Davphin, Parson + tres-humble, tres obeissant, et tres fidele Seruiteur, Herbert Iaillot. Title + along map top: L''Amerique Septentrionale divisée en ses principales parties, + scauoir Les Terres Arctiques, Le Canada ou Nouvelle France, Le Mexique ou Nouvelle + Espagne, Le Nouveau Mexique, Les Isles de Terre Neuve de Californie, et | Antilles, + ou sont distingués les uns des autres, Les Estats, comme Ils sont possedés presentement + par Les François, Castillans, Anglois, Sued Ois, Danois, et par Les Estats Generaux + des Provinces Vnies ou Hollandois. Tirée des Relations de toutes ces Nations Par + le Sr. Sanson, Geographe Ordinaire du Roy, 1674. California copied from Sanson''s + 1656 map, and labelled Isle de Californie. Agubela de Gato as peninsula on mainland + to north. Terre de Iesso ou Ieco to west. Great Lakes open to west. Decorative + title cartouche (upper left) with crown and arms of the Dauphin. Multiple scales + given within decorative cartouche (lower left).' + note_State 1_tesim: + - Issued 1674, as in general notes. + note_State 2_tesim: + - Issued 1679 with new title piece. + note_State 3_tesim: + - 'Issued 1692, with imprint at base of scale cartouche: A Paris Chez H. Iaillot + joignant les grands Augustins, aux deux Globes Avec Privilege du Roy pour vingt + Ans. 1692. Title along map top shows 1692 also.' + note_State 4_tesim: + - 'Issued 1700, with imprint at base of scale cartouche: A Amsterdam Chez PIERRE + MORTIER et Compag.nie Avec Privilege (undated).' + note_State 5_tesim: + - 'Issued 1719, with California left undecided as to insular or peninsular, and + with imprint at base of scale cartouche: A Paris Chez H. Iaillot joignant les.' + note_State 6_tesim: + - On smaller scale, 54.5 x 64 cm., with new titlepiece and scale of miles. Issued + 169-?, 1694, and in Amsterdam by R&J Ottens. + note_State 7_tesim: + - A later reproduction probably copied from the first (1674) state. Based upon the + cartography and the dating, it appears to have been produced between 1674 and + 1690. The lettering is crude, and the cartography is slightly less detailed. It + is possibly Italian in origin. Title (in cartouche) spelling changed from S. Sanson + to Sr. Sanson. Spelling variants include V instead of U. + note_Statement of responsibility_tesim: + - Hubert Iaillot. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + - North America--Maps + subject_topic_tesim: + - California as an island--Maps + - North America--Maps + subject_cartographics_ssim: + - "\n [ca. 1:16,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca. 1:16,000,000].\n (W 173°00ʹ --W 10°00ʹ/N 84°00ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '55' + - 55-03 + identifier_local_Original McLaughlin Book Number (1995 edition)_tesim: + - '55' + identifier_local_Original McLaughlin book number (1995 edition) with latest state information_tesim: + - 55-03 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - mw236cd6430_05_0001 + content_metadata_first_image_width_ssm: + - '22654' + content_metadata_first_image_height_ssm: + - '15035' + content_metadata_image_file_name_ssm: + - mw236cd6430_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/mw236cd6430%2Fmw236cd6430_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/mw236cd6430/mw236cd6430_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/mw236cd6430/mw236cd6430_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/mw236cd6430/mw236cd6430_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/mw236cd6430/mw236cd6430_05_0001_full +- :id: xd327cm9378 + :druid_ssi: xd327cm9378 + mods_xml_ssm: + - | + + + + Mapa mundi, con los meridianos, y paralelos, iguales como los del globo tere- y arreglado a las mejores, y ultimas relaciones + + + Minguet é Irol, Pablo + d. 1801? + + cartographic + map + Early maps. + Digital maps. + Maps. + + + sp + + + Madrid + + Pablo Minguet + 1760 + monographic + + + spa + + + 1 map : hand col. ; 2 hemispheres each 8.4 cm. in diam., on sheet 30 x 20.1 cm. + 1 page. + + por Pablo Minguet, Gravador de Sellos, Laminas, Firmas, y otras cosas. + California shown as a labeled island with a rounded oblong shape. Include place name G. Mendocino. + Includes 4 solar charts at bottom--Ptolomeo, Copérnico, Tycho Brahe and Capela. + Includes 2 wind charts between hemispheres--Ocean and Mediterranean. + Text in Spanish below and on second page. Top of text on page 1. "Explicacion del globo terrestre, de los mapas, de lost sixtemas, y otras curiosidades." Top of text on page 2. "Plan historico de las noticias mas curiosas de la Africa, y la America." + Text in Spanish. + McLaughlin map number 1176. + + + Scale [ca. 1:300,000,000] + (W 180°--E 180°/N 90°--S 90°). + + + + World maps + Early works to 1800 + + + aacr + CSt-ES + 121126 + a9757630 + Converted from MARCXML to MODS version 3.4 using MARC21slim2MODS3-4_SDR.xsl (Version 1.2.5 2013/08/11) + + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - Mapa mundi, con los meridianos, y paralelos, iguales como los del globo tere- + y arreglado a las mejores, y ultimas relaciones + full_title_tesim: + - Mapa mundi, con los meridianos, y paralelos, iguales como los del globo tere- + y arreglado a las mejores, y ultimas relaciones + sort_title_tesim: + - Mapa mundi, con los meridianos, y paralelos, iguales como los del globo tere- + y arreglado a las mejores, y ultimas relaciones + sort_title_ssi: Mapa mundi, con los meridianos, y paralelos, iguales como los del + globo tere- y arreglado a las mejores, y ultimas relaciones + personal_name_ssim: + - Minguet é Irol, Pablo + personal_name_tesim: + - Minguet é Irol, Pablo + personal_name_ssm: + - Minguet é Irol, Pablo + language_ssim: + - Spanish; Castilian + language_tesim: + - Spanish; Castilian + language_ssm: + - Spanish; Castilian + origin_place_term_ssim: + - sp + - Madrid + origin_place_term_tesim: + - sp + - Madrid + origin_place_term_ssm: + - sp + - Madrid + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Early maps. + - Digital maps. + - Maps. + genre_tesim: + - map + - Early maps. + - Digital maps. + - Maps. + coordinates_tesim: + - "(W 180°--E 180°/N 90°--S 90°)." + note_[]_tesim: + - por Pablo Minguet, Gravador de Sellos, Laminas, Firmas, y otras cosas. + - California shown as a labeled island with a rounded oblong shape. Include place + name G. Mendocino. + - Includes 4 solar charts at bottom--Ptolomeo, Copérnico, Tycho Brahe and Capela. + - Includes 2 wind charts between hemispheres--Ocean and Mediterranean. + - Text in Spanish below and on second page. Top of text on page 1. "Explicacion + del globo terrestre, de los mapas, de lost sixtemas, y otras curiosidades." Top + of text on page 2. "Plan historico de las noticias mas curiosas de la Africa, + y la America." + - Text in Spanish. + note_Local note_tesim: + - McLaughlin map number 1176. + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - World maps + subject_topic_tesim: + - World maps + subject_genre_ssim: + - Early works to 1800 + subject_genre_tesim: + - Early works to 1800 + subject_cartographics_ssim: + - "\n Scale [ca. 1:300,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + subject_cartographics_tesim: + - "\n Scale [ca. 1:300,000,000]\n (W 180°--E 180°/N 90°--S 90°).\n " + content_metadata_type_ssim: + - image + content_metadata_type_ssm: + - image + content_metadata_first_image_file_name_ssm: + - xd327cm9378_05_0001 + content_metadata_first_image_width_ssm: + - '5184' + content_metadata_first_image_height_ssm: + - '7284' + content_metadata_image_file_name_ssm: + - xd327cm9378_05_0001 + - xd327cm9378_05_0002 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0001/info.json + - https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0002/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_square + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_thumb + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_large + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0001_full + - https://stacks.stanford.edu/image/xd327cm9378/xd327cm9378_05_0002_full +- :id: dy396mt9665 + :druid_ssi: dy396mt9665 + mods_xml_ssm: + - | + + + cartographic + map + Digital Maps + Early Maps + 519 + + a Map of the Middle Part of AMERICA + + + + [ca. 1:33,500,000]. + (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ) + + + + 1697 + + [London] + + 1697 + + 519-01 + + 15.1 x 27.1 cm., 15.3 x 28.4 cm. including border. + + + + creator + + Moll, Herman, d. 1732 + + + California as an island--Maps + + Issued in his: A new voyage round the world / By William Dampier. -- London: Printed for James Knapton, 1697. + Sabin 18373. + Lower portion of California is shown and labeled CALIFORNIA I. Shape of California is unusual, with wide central area coming to a point at the south. Includes region of Amazon River northward to Maryland. Inset map: The Isles of CAPE VERD (top right). + TItle in English. Title cartouche of simple box (top left) + In Dutch, with title: KAART VAN HET MIDDELSTE DEEL van AMERICA. California unchanged. Title cartouche of simple box (top left). Inset map entitled: de Eylanden van CAPO VERDE (top right). Page 20 (to left of inset map). Issued in his: Nieuwe reystogt rondom de werreld, [several volumes bound together] / In’t Engelsch beschreeven door William Dampier, en daarupt bertaald door W. Sewel. -- In’s Gravenhage : by Abraham de Hondt, 1698. [date for first section]. Final section dated 1715. Includes map showing Pacific tradewinds entitled: Een Schets van de Algemene PASSAAD WINDEN in de groote ZUYD ZEE. No. 2, 2.Deel.P.205. Lower part of California is shown. Map seems to be copied by Bellin/Cosmant/Schley in 1747. + In French, with title CARTE De La PARTIE DU MILIEUDE L’AMERIQUE. California unchanged, except labeled CALIFORNIE I. Title cartouche of scrollwork (top left). Inset map entitled: Isles DU CAP[E]. VERD (top left). Pag: 17. (top right, outside border). Issued in his: Nouveau voyage autour du monde. Tome Premier [bound with Tome II] / Par Guillaume Dampier. -- A Amsterdam : Chez Paul Marret, M.DC.XCVIII (1698). [2],616, [4]p., 6 maps, 7 illus., 15.5 cm. + In English, with title as in State 1. Title cartouche of simple box (top left). “Damp. Voy. Vol. I. Plate 2. p. 24.” (lower left). Issued in : A Collection of Voyages. In Four Volumes. / by William Dampier. -- London : Printed for James and John Knapton, at the Crown in St. Paul’s Church-Yard. MDCCXXIX. (1729). + + + The Glen McLaughlin Map Collection of California as an Island + + http://purl.stanford.edu/zb871zd0767 + + + Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. Images may be reproduced or transmitted, but not for commercial use. For commercial use or commercial republication, contact brannerlibrary@stanford.edu. + Property rights reside with the repository. Copyright © Stanford University. All Rights Reserved. + CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License + + short_title_tesim: + - a Map of the Middle Part of AMERICA + full_title_tesim: + - a Map of the Middle Part of AMERICA + sort_title_tesim: + - a Map of the Middle Part of AMERICA + sort_title_ssi: a Map of the Middle Part of AMERICA + personal_name_ssim: + - Moll, Herman, d. 1732 + personal_name_tesim: + - Moll, Herman, d. 1732 + personal_name_ssm: + - Moll, Herman, d. 1732 + origin_place_term_ssim: + - "[London]" + origin_place_term_tesim: + - "[London]" + origin_place_term_ssm: + - "[London]" + origin_date_created_ssim: + - '1697' + - '1697' + origin_date_created_tesim: + - '1697' + - '1697' + origin_date_created_ssm: + - '1697' + - '1697' + type_of_resource_ssim: + - cartographic + type_of_resource_ssm: + - cartographic + genre_ssim: + - map + - Digital Maps + - Early Maps + genre_tesim: + - map + - Digital Maps + - Early Maps + coordinates_tesim: + - "(W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)" + point_bbox: + - "-92.25 7.166666666666667 -77.16666666666667 18.5" + note_[]_tesim: + - 'Issued in his: A new voyage round the world / By William Dampier. -- London: + Printed for James Knapton, 1697.' + - Sabin 18373. + - 'Lower portion of California is shown and labeled CALIFORNIA I. Shape of California + is unusual, with wide central area coming to a point at the south. Includes region + of Amazon River northward to Maryland. Inset map: The Isles of CAPE VERD (top + right).' + note_State 1_tesim: + - TItle in English. Title cartouche of simple box (top left) + note_State 2_tesim: + - 'In Dutch, with title: KAART VAN HET MIDDELSTE DEEL van AMERICA. California unchanged. + Title cartouche of simple box (top left). Inset map entitled: de Eylanden van + CAPO VERDE (top right). Page 20 (to left of inset map). Issued in his: Nieuwe + reystogt rondom de werreld, [several volumes bound together] / In’t Engelsch beschreeven + door William Dampier, en daarupt bertaald door W. Sewel. -- In’s Gravenhage : + by Abraham de Hondt, 1698. [date for first section]. Final section dated 1715. + Includes map showing Pacific tradewinds entitled: Een Schets van de Algemene PASSAAD + WINDEN in de groote ZUYD ZEE. No. 2, 2.Deel.P.205. Lower part of California is + shown. Map seems to be copied by Bellin/Cosmant/Schley in 1747.' + note_State 3_tesim: + - 'In French, with title CARTE De La PARTIE DU MILIEUDE L’AMERIQUE. California unchanged, + except labeled CALIFORNIE I. Title cartouche of scrollwork (top left). Inset map + entitled: Isles DU CAP[E]. VERD (top left). Pag: 17. (top right, outside border). + Issued in his: Nouveau voyage autour du monde. Tome Premier [bound with Tome II] + / Par Guillaume Dampier. -- A Amsterdam : Chez Paul Marret, M.DC.XCVIII (1698). + [2],616, [4]p., 6 maps, 7 illus., 15.5 cm.' + note_State 4_tesim: + - 'In English, with title as in State 1. Title cartouche of simple box (top left). + “Damp. Voy. Vol. I. Plate 2. p. 24.” (lower left). Issued in : A Collection of + Voyages. In Four Volumes. / by William Dampier. -- London : Printed for James + and John Knapton, at the Crown in St. Paul’s Church-Yard. MDCCXXIX. (1729).' + access_condition_tesim: + - Image from the Glen McLaughlin Map Collection courtesy Stanford University Libraries. + Images may be reproduced or transmitted, but not for commercial use. For commercial + use or commercial republication, contact brannerlibrary@stanford.edu. + - Property rights reside with the repository. Copyright © Stanford University. All + Rights Reserved. + - 'CC by-nc: This work is licensed under a Creative Commons Attribution-NonCommercial + 3.0 Unported License' + subject_topic_ssim: + - California as an island--Maps + subject_topic_tesim: + - California as an island--Maps + subject_cartographics_ssim: + - "\n [ca. 1:33,500,000].\n (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)\n + \ " + subject_cartographics_tesim: + - "\n [ca. 1:33,500,000].\n (W 92°15ʹ --W 77°10ʹ/N 18°30ʹ --N 7°10ʹ)\n + \ " + identifier_tesim: + - '519' + - 519-01 + identifier_local_Post publication map number_tesim: + - '519' + identifier_local_Post publication map number with latest state information_tesim: + - 519-01 + content_metadata_type_ssim: + - map + content_metadata_type_ssm: + - map + content_metadata_first_image_file_name_ssm: + - dy396mt9665_05_0001 + content_metadata_first_image_width_ssm: + - '7605' + content_metadata_first_image_height_ssm: + - '4574' + content_metadata_image_file_name_ssm: + - dy396mt9665_05_0001 + content_metadata_image_iiif_info_ssm: + - https://stacks.stanford.edu/image/iiif/dy396mt9665%2Fdy396mt9665_05_0001/info.json + thumbnail_square_url_ssm: + - https://stacks.stanford.edu/image/dy396mt9665/dy396mt9665_05_0001_square + thumbnail_url_ssm: + - https://stacks.stanford.edu/image/dy396mt9665/dy396mt9665_05_0001_thumb + large_image_url_ssm: + - https://stacks.stanford.edu/image/dy396mt9665/dy396mt9665_05_0001_large + full_image_url_ssm: + - https://stacks.stanford.edu/image/dy396mt9665/dy396mt9665_05_0001_full diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/application_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/application_helper_spec.rb new file mode 100644 index 0000000..7f5b701 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/application_helper_spec.rb @@ -0,0 +1,198 @@ +require 'spec_helper' + +describe Spotlight::ApplicationHelper, type: :helper do + describe '#application_name' do + let(:site) { Spotlight::Site.instance } + before do + allow(helper).to receive(:current_site).and_return(site) + end + + it 'includes the exhibit' do + allow(helper).to receive_messages(current_exhibit: double(title: 'My Exhibit')) + expect(helper.application_name).to eq 'My Exhibit - Blacklight' + end + + it "is just the application name if there isn't an exhibit" do + allow(helper).to receive_messages(current_exhibit: nil) + expect(helper.application_name).to eq 'Blacklight' + end + + context 'with a configured site title' do + before do + site.title = 'Some Title' + allow(helper).to receive_messages(current_exhibit: nil) + end + + it 'uses the configured name' do + expect(helper.application_name).to eq 'Some Title' + end + end + end + + describe '#url_to_tag_facet' do + before do + allow(helper).to receive_messages(current_exhibit: FactoryGirl.create(:exhibit)) + allow(helper).to receive_messages(blacklight_config: Blacklight::Configuration.new) + + # controller provided helper. + allow(helper).to receive(:search_action_url) do |*args| + spotlight.exhibit_catalog_index_path(helper.current_exhibit, *args) + end + end + + it 'is a url for a search with the given tag facet' do + allow(SolrDocument).to receive_messages(solr_field_for_tagger: :exhibit_tags) + expected = spotlight.exhibit_catalog_index_path(exhibit_id: helper.current_exhibit, f: { exhibit_tags: ['tag_value'] }) + expect(helper.url_to_tag_facet('tag_value')).to eq expected + end + end + + describe 'search block helpers' do + describe 'selected_search_block_views' do + let(:block) do + SirTrevorRails::Block.new({ type: 'xyz', data: { a: 'on', b: 'off', c: false, d: 'on' } }, 'parent') + end + + it "returns keys with a value of 'on'" do + expect(helper.selected_search_block_views(block)).to eq %w(a d) + end + end + describe 'blacklight_view_config_for_search_block' do + let(:sir_trevor_block) do + SirTrevorRails::Block.new({ type: 'xyz', data: { view: %w(list gallery) } }, 'parent') + end + + let(:config) do + Blacklight::Configuration.new do |config| + config.view.list = {} + config.view.gallery = {} + config.view.slideshow = {} + end + end + before do + allow(helper).to receive_messages(blacklight_config: config) + end + it 'returns a blacklight configuration object that has reduced the views to those that are configured in the block' do + new_config = helper.blacklight_view_config_for_search_block(sir_trevor_block) + expect(new_config.keys).to eq [:list, :gallery] + end + end + end + describe 'render_document_class' do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + let(:document) { SolrDocument.new(some_field: 'Some data') } + before do + allow(helper).to receive_messages(current_exhibit: current_exhibit) + allow(helper).to receive_messages(blacklight_config: Blacklight::Configuration.new do |config| + config.index.display_type_field = :some_field + end) + end + it 'returns blacklight-private when the document is private' do + allow(document).to receive(:private?).with(current_exhibit).and_return(true) + expect(helper.render_document_class(document)).to include 'blacklight-private' + end + it 'prefixs "blacklight-" to the configured type' do + expect(helper.render_document_class(document)).to include 'blacklight-some-data' + end + end + + describe '#add_exhibit_twitter_card_content' do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + before do + allow(helper).to receive_messages(current_exhibit: current_exhibit) + current_exhibit.subtitle = 'xyz' + current_exhibit.description = 'abc' + TopHat.current['twitter_card'] = nil + end + + it 'generates a twitter card for the exhibit' do + allow(helper).to receive(:exhibit_root_url).and_return('some/url') + allow(current_exhibit).to receive(:thumbnail).and_return(double) + allow(current_exhibit).to receive_message_chain(:thumbnail, :image, :thumb, url: '/image') + + helper.add_exhibit_twitter_card_content + + card = helper.twitter_card + expect(card).to have_css "meta[name='twitter:card'][value='summary']", visible: false + expect(card).to have_css "meta[name='twitter:url'][value='some/url']", visible: false + expect(card).to have_css "meta[name='twitter:title'][value='#{current_exhibit.title}']", visible: false + expect(card).to have_css "meta[name='twitter:description'][value='#{current_exhibit.subtitle}']", visible: false + expect(card).to have_css "meta[name='twitter:image'][value='http://test.host/image']", visible: false + end + end + + describe '#carrierwave_url' do + it 'turns a application-relative URI into a path' do + upload = double(url: '/x/y/z') + expect(helper.carrierwave_url(upload)).to eq 'http://test.host/x/y/z' + end + + it 'passes a full URI through' do + upload = double(url: 'http://some.host/x/y/z') + expect(helper.carrierwave_url(upload)).to eq 'http://some.host/x/y/z' + end + end + + describe 'save_search rendering' do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + before { allow(helper).to receive_messages(current_exhibit: current_exhibit) } + describe 'render_save_this_search?' do + it 'returns false if we are on the items admin screen' do + allow(helper).to receive(:"can?").with(:curate, current_exhibit).and_return(true) + allow(helper).to receive(:params).and_return(controller: 'spotlight/catalog', action: 'admin') + expect(helper.render_save_this_search?).to be_falsey + end + it 'returns true if we are not on the items admin screen' do + allow(helper).to receive(:"can?").with(:curate, current_exhibit).and_return(true) + allow(helper).to receive(:params).and_return(controller: 'spotlight/catalog', action: 'index') + expect(helper.render_save_this_search?).to be_truthy + end + it 'returns false if a user cannot curate the object' do + allow(helper).to receive(:"can?").with(:curate, current_exhibit).and_return(false) + expect(helper.render_save_this_search?).to be_falsey + end + end + end + + describe '#uploaded_field_label' do + let :field do + OpenStruct.new field_name: 'x' + end + + let :blacklight_config do + Blacklight::Configuration.new + end + + before do + allow(helper).to receive_messages(blacklight_config: blacklight_config) + end + + it 'uses the configuration-provided label' do + field.label = 'label x' + expect(helper.uploaded_field_label(field)).to eq 'label x' + end + + it 'pulls the label from the solr field' do + blacklight_config.add_index_field 'x', label: 'solr x' + expect(helper.uploaded_field_label(field)).to eq 'solr x' + end + end + + describe '#available_view_fields' do + let :blacklight_config do + Blacklight::Configuration.new + end + + before do + allow(helper).to receive_message_chain(:current_exhibit, :blacklight_configuration, default_blacklight_config: blacklight_config) + end + + it 'excludes view fields that are never visible (e.g. atom, rss)' do + blacklight_config.view.a.if = true + blacklight_config.view.b.if = false + + expect(helper.available_view_fields).to include :a + expect(helper.available_view_fields).to_not include :b + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/browse_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/browse_helper_spec.rb new file mode 100644 index 0000000..6f89b62 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/browse_helper_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe Spotlight::BrowseHelper, type: :helper do + it 'defaults to the gallery' do + allow(helper).to receive_messages(blacklight_config: double(view: { gallery: true })) + expect(helper.default_document_index_view_type).to eq :gallery + end + + it "uses the blacklight default if gallery isn't available" do + allow(helper).to receive_messages(blacklight_config: double(view: { list: true })) + expect(helper.default_document_index_view_type).to eq :list + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/crud_link_helpers_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/crud_link_helpers_spec.rb new file mode 100644 index 0000000..713af03 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/crud_link_helpers_spec.rb @@ -0,0 +1,133 @@ +require 'spec_helper' + +module Spotlight + describe CrudLinkHelpers, type: :helper do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:some_model) { Spotlight::FeaturePage.create! exhibit: exhibit } + describe '#cancel_link' do + it 'is a model-specific cancel link' do + expect(helper).to receive(:action_default_value).with(:my_model, :cancel).and_return 'Cancel' + expect(helper.cancel_link(:my_model, '#')).to have_link 'Cancel', href: '#' + end + end + + describe '#exhibit_view_link' do + before do + allow(helper).to receive_messages action_default_value: 'View' + end + + it 'is a model-specific view link' do + expect(helper).to receive(:action_default_value).with(some_model, :view).and_return 'View' + expect(helper.exhibit_view_link(some_model)).to have_link 'View', href: spotlight.exhibit_feature_page_path(some_model.exhibit, some_model) + end + + it 'accepts an explicit link' do + expect(helper.exhibit_view_link(some_model, '#')).to have_link 'View', href: '#' + end + + it 'accepts link_to options' do + expect(helper.exhibit_view_link(some_model, '#', class: 'btn')).to have_selector 'a.btn' + end + end + + describe '#exhibit_create_link' do + let(:some_model) { Spotlight::FeaturePage.new } + before do + allow(helper).to receive_messages(current_exhibit: exhibit) + allow(helper).to receive_messages action_default_value: 'Create' + end + + it 'is a model-specific view link' do + expect(helper).to receive(:action_default_value).with(some_model).and_return 'Create' + expect(helper.exhibit_create_link(some_model)).to have_link 'Create', href: spotlight.new_exhibit_feature_page_path(exhibit) + end + + it 'accepts an explicit link' do + expect(helper.exhibit_create_link(some_model, '#')).to have_link 'Create', href: '#' + end + + it 'accepts link_to options' do + expect(helper.exhibit_create_link(some_model, '#', class: 'btn')).to have_selector 'a.btn' + end + end + + describe '#exhibit_edit_link' do + let(:some_model) { Spotlight::FeaturePage.create! exhibit: exhibit } + before do + allow(helper).to receive_messages(current_exhibit: exhibit) + allow(helper).to receive_messages action_default_value: 'Edit' + end + + it 'is a model-specific edit link' do + expect(helper).to receive(:action_default_value).with(some_model).and_return 'Edit' + expect(helper.exhibit_edit_link(some_model)).to have_link 'Edit', href: spotlight.edit_exhibit_feature_page_path(exhibit, some_model) + end + + it 'accepts an explicit link' do + expect(helper.exhibit_edit_link(some_model, '#')).to have_link 'Edit', href: '#' + end + + it 'accepts link_to options' do + expect(helper.exhibit_edit_link(some_model, '#', class: 'btn')).to have_selector 'a.btn' + end + end + + describe '#exhibit_delete_link' do + before do + allow(helper).to receive_messages action_default_value: 'Delete' + end + + it 'is a model-specific view link' do + expect(helper).to receive(:action_default_value).with(some_model, :destroy).and_return 'Delete' + expect(helper.exhibit_delete_link(some_model)).to have_link 'Delete', href: spotlight.exhibit_feature_page_path(some_model.exhibit, some_model) + end + + it 'accepts an explicit link' do + expect(helper.exhibit_delete_link(some_model, '#')).to have_link 'Delete', href: '#' + end + + it 'accepts link_to options' do + expect(helper.exhibit_delete_link(some_model, '#', class: 'btn')).to have_selector 'a.btn' + end + end + + describe '#action_label' do + it 'returns the label for an action on a model' do + some_model = double + expect(helper).to receive(:action_default_value).with(some_model, :action).and_return 'xyz' + expect(helper.action_label(some_model, :action)).to eq 'xyz' + end + end + + describe '#action_default_value' do + it 'attempts i18n lookups for models' do + expect(I18n).to receive(:t).with(:'helpers.action.spotlight/feature_page.edit', + model: some_model.class.model_name.human, + default: [:'helpers.action.edit', 'Edit Feature page']) + expect(helper.send(:action_default_value, some_model)) + end + + it 'attempts i18n lookups for unpersisted models' do + some_model = Spotlight::FeaturePage.new + expect(I18n).to receive(:t).with(:'helpers.action.spotlight/feature_page.create', + model: some_model.class.model_name.human, + default: [:'helpers.action.create', 'Create Feature page']) + expect(helper.send(:action_default_value, some_model)) + end + + it 'attempts i18n lookups for models with an explicit action' do + expect(I18n).to receive(:t).with(:'helpers.action.spotlight/feature_page.custom_action', + model: some_model.class.model_name.human, + default: [:'helpers.action.custom_action', 'Custom action Feature page']) + expect(helper.send(:action_default_value, some_model, :custom_action)) + end + + it 'attempts i18n lookups for symbols' do + expect(I18n).to receive(:t).with(:'helpers.action.my_thing.custom_action', + model: :my_thing, + default: [:'helpers.action.custom_action', 'Custom action my_thing']) + expect(helper.send(:action_default_value, :my_thing, :custom_action)) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/jcrop_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/jcrop_helper_spec.rb new file mode 100644 index 0000000..9a2e432 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/jcrop_helper_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +describe Spotlight::JcropHelper do + describe '.default_thumbnail_jcrop_options' do + it 'produces a 4:3 aspect ratio by default' do + expect(helper.default_thumbnail_jcrop_options[:aspect_ratio]).to eq 4.0 / 3.0 + end + + context 'with a custom thumbnail size' do + before do + allow(Spotlight::Engine.config).to receive(:featured_image_thumb_size).and_return([7, 5]) + end + + it 'produces a 7:5 aspect ratio' do + expect(helper.default_thumbnail_jcrop_options[:aspect_ratio]).to eq 7.0 / 5.0 + end + end + end + + describe '.default_site_thumbnail_jcrop_options' do + it 'produces a 1:1 aspect ratio by default' do + expect(helper.default_site_thumbnail_jcrop_options[:aspect_ratio]).to eq 1 + end + + context 'with a custom square thumbnail size' do + before do + allow(Spotlight::Engine.config).to receive(:featured_image_square_size).and_return([3, 2]) + end + + it 'produces a 3:2 aspect ratio' do + expect(helper.default_site_thumbnail_jcrop_options[:aspect_ratio]).to eq 3.0 / 2.0 + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/main_app_helpers_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/main_app_helpers_spec.rb new file mode 100644 index 0000000..fc16bb2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/main_app_helpers_spec.rb @@ -0,0 +1,102 @@ +require 'spec_helper' + +describe Spotlight::MainAppHelpers, type: :helper do + describe '#show_contact_form?' do + subject { helper } + let(:exhibit) { FactoryGirl.create :exhibit } + let(:exhibit_with_contacts) { FactoryGirl.create :exhibit } + context 'with an exhibit with confirmed contacts' do + before do + exhibit_with_contacts.contact_emails.create(email: 'cabeer@stanford.edu').tap do |e| + if e.respond_to? :confirm + e.confirm + else + e.confirm! + end + end + end + before { allow(helper).to receive_messages current_exhibit: exhibit_with_contacts } + its(:show_contact_form?) { should be_truthy } + end + + context 'with an exhibit with only unconfirmed contacts' do + before { exhibit_with_contacts.contact_emails.build email: 'cabeer@stanford.edu' } + before { allow(helper).to receive_messages current_exhibit: exhibit_with_contacts } + its(:show_contact_form?) { should be_falsey } + end + + context 'with an exhibit without contacts' do + before { allow(helper).to receive_messages current_exhibit: exhibit } + its(:show_contact_form?) { should be_falsey } + end + + context 'outside the context of an exhibit' do + before { allow(helper).to receive_messages current_exhibit: nil } + its(:show_contact_form?) { should be_falsey } + end + end + + describe '#field_enabled?' do + let(:field) { FactoryGirl.create(:custom_field) } + let(:controller) { OpenStruct.new } + before do + controller.extend(Blacklight::Catalog) + allow(helper).to receive(:controller).and_return(controller) + allow(helper).to receive(:document_index_view_type).and_return(nil) + allow(field).to receive(:enabled).and_return(true) + end + context 'for sort fields' do + let(:field) { Blacklight::Configuration::SortField.new enabled: true } + it 'uses the enabled property for sort fields' do + expect(helper.field_enabled?(field)).to eq true + end + end + + context 'for search fields' do + let(:field) { Blacklight::Configuration::SearchField.new enabled: true } + it 'uses the enabled property for search fields' do + expect(helper.field_enabled?(field)).to eq true + end + end + + it 'returns the value of field#show if the action_name is "show"' do + allow(field).to receive(:show).and_return(:value) + allow(helper).to receive(:action_name).and_return('show') + expect(helper.field_enabled?(field)).to eq :value + end + it 'returns the value of field#show if the action_name is "edit"' do + allow(field).to receive(:show).and_return(:value) + allow(helper).to receive(:action_name).and_return('edit') + expect(helper.field_enabled?(field)).to eq :value + end + it 'returns the value of the original if condition' do + allow(field).to receive(:upstream_if).and_return false + expect(helper.field_enabled?(field)).to eq false + end + end + + describe '#enabled_in_spotlight_view_type_configuration?' do + let(:controller) { OpenStruct.new } + let(:view) { OpenStruct.new } + before do + controller.extend(Blacklight::Catalog) + allow(helper).to receive(:controller).and_return(controller) + end + + it 'respects the original if condition' do + view.upstream_if = false + expect(helper.enabled_in_spotlight_view_type_configuration?(view)).to eq false + end + + it 'is true if there is no exhibit context' do + allow(helper).to receive(:current_exhibit).and_return(nil) + expect(helper.enabled_in_spotlight_view_type_configuration?(view)).to eq true + end + + it "is true if we're in a page context" do + allow(helper).to receive(:current_exhibit).and_return(nil) + allow(controller).to receive(:is_a?).with(Spotlight::PagesController).and_return(true) + expect(helper.enabled_in_spotlight_view_type_configuration?(view)).to eq true + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/navbar_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/navbar_helper_spec.rb new file mode 100644 index 0000000..5900e3b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/navbar_helper_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +module Spotlight + describe NavbarHelper, type: :helper do + describe '#should_render_search_bar?' do + before do + allow(helper).to receive_messages(current_exhibit: nil) + allow(helper).to receive_messages(exhibit_masthead?: true) + end + it 'returns false when there is no exhibit context' do + expect(helper.should_render_spotlight_search_bar?).to be_falsey + end + it 'returns true if searchable' do + allow(helper).to receive_messages(current_exhibit: double(searchable?: true)) + expect(helper.should_render_spotlight_search_bar?).to be_truthy + end + it 'returns false if currently under an "Exhibity" browse category' do + allow(helper).to receive_messages(exhibit_masthead?: false) + expect(helper.should_render_spotlight_search_bar?).to be_falsey + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/pages_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/pages_helper_spec.rb new file mode 100644 index 0000000..570288f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/pages_helper_spec.rb @@ -0,0 +1,98 @@ +require 'spec_helper' + +module Spotlight + describe PagesHelper, type: :helper do + let(:blacklight_config) { Blacklight::Configuration.new { |config| config.show.title_field = :abc } } + let(:titled_document) { blacklight_config.document_model.new(abc: 'value') } + let(:untitled_document) { blacklight_config.document_model.new(id: '1234') } + let!(:current_exhibit) { FactoryGirl.create(:exhibit) } + let!(:home_page) { current_exhibit.home_page } + let!(:search) { FactoryGirl.create(:search, exhibit: current_exhibit, query_params: { 'q' => 'query' }, published: true) } + + before(:each) do + allow(helper).to receive_messages(blacklight_config: blacklight_config) + end + + describe 'available_index_fields' do + before do + blacklight_config.index.title_field = :title_field + blacklight_config.add_index_field 'x', label: 'X' + end + + it 'lists the configured index fields' do + expect(helper.available_index_fields).to include key: 'x', label: 'X' + end + + it 'adds the title field if necessary' do + expect(helper.available_index_fields).to include key: :title_field, label: 'Title' + end + end + + describe 'disable_save_pages_button?' do + it 'returns true if there are no pages and we are on the about pages page' do + expect(helper).to receive(:page_collection_name).and_return('about_pages') + assign(:pages, []) + expect(helper.disable_save_pages_button?).to be_truthy + end + it 'returns false if there are about pages' do + expect(helper).to receive(:page_collection_name).and_return('about_pages') + assign(:pages, [{}]) + expect(helper.disable_save_pages_button?).to be_falsey + end + it 'returns false if on the feature pages page' do + expect(helper).to receive(:page_collection_name).and_return('feature_pages') + assign(:pages, []) + expect(helper.disable_save_pages_button?).to be_falsey + end + end + describe 'get_search_widget_search_results' do + let(:good) do + content = { type: 'xyz', data: { 'item' => { search.slug => { id: search.slug, display: 'true' } } } } + SirTrevorRails::Blocks::SearchResultsBlock.new(content, home_page) + end + + let(:bad) do + content = { type: 'xyz', data: { 'item' => { 'garbage' => { id: 'missing', display: 'true' } } } } + SirTrevorRails::Blocks::SearchResultsBlock.new(content, home_page) + end + + let(:search_result) { [double('response'), double('documents')] } + + it 'returns the results for a given search browse category' do + allow(helper).to receive(:search_params_logic).and_return([]) + expect(helper).to receive(:search_results).with({ 'q' => 'query' }, []).and_return(search_result) + expect(helper.get_search_widget_search_results(good)).to eq search_result + end + it "returns an empty array when requesting a search that doesn't exist" do + expect(helper.get_search_widget_search_results(bad)).to be_empty + end + end + + describe 'nestable helpers' do + describe 'nestable data attributes' do + it 'returns the appropriate attributes for feature pages' do + expect(helper.nestable_data_attributes('feature_pages')).to eq "data-max-depth='2' data-expand-btn-HTML='' data-collapse-btn-HTML=''" + end + it 'returns the appropriate attributes for about pages' do + expect(helper.nestable_data_attributes('about_pages')).to eq "data-max-depth='1'" + end + it 'returns a blank string if the type is not valid' do + expect(helper.nestable_data_attributes('something_else')).to eq '' + end + end + describe 'nestable data attributes hash' do + it 'returns the appropriate hash for feature pages' do + expect(helper.nestable_data_attributes_hash('feature_pages')).to eq('data-max-depth' => '2', + 'data-expand-btn-HTML' => '', + 'data-collapse-btn-HTML' => '') + end + it 'returns the appropriate hash for about pages' do + expect(helper.nestable_data_attributes_hash('about_pages')).to eq 'data-max-depth' => '1' + end + it 'returns an empty hash if the type is not valid' do + expect(helper.nestable_data_attributes_hash('something_else')).to eq({}) + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/roles_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/roles_helper_spec.rb new file mode 100644 index 0000000..aa02eba --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/roles_helper_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe Spotlight::RolesHelper, type: :helper do + it 'is a list of options' do + expect(helper.roles_for_select).to eq('Admin' => 'admin', 'Curator' => 'curator') + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/search_configurations_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/search_configurations_helper_spec.rb new file mode 100644 index 0000000..dbfeb64 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/search_configurations_helper_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe Spotlight::SearchConfigurationsHelper, type: :helper do + describe '#translate_sort_fields' do + let(:sort_config) do + Blacklight::OpenStructWithHashAccess.new(sort: 'score asc, sort_title_ssi desc') + end + + it 'translates sort fields' do + expect(translate_sort_fields(sort_config)).to eq 'relevancy score ascending and title descending' + end + + it 'humanizes untranslatable sort fields' do + sort_config.sort = 'some_other_field desc' + + expect(translate_sort_fields(sort_config)).to eq 'some other field descending' + end + + it 'supports explicit sort descriptions' do + sort_config.sort_description = 'xyz' + expect(translate_sort_fields(sort_config)).to eq 'xyz' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/helpers/spotlight/title_helper_spec.rb b/tmp/blacklight-spotlight/spec/helpers/spotlight/title_helper_spec.rb new file mode 100644 index 0000000..dd4c12c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/helpers/spotlight/title_helper_spec.rb @@ -0,0 +1,50 @@ +require 'spec_helper' + +describe Spotlight::TitleHelper, type: :helper do + before do + allow(helper).to receive_messages(application_name: 'Application') + end + + describe '#page_title' do + it 'sets the @page_title ivar' do + helper.page_title('Section', 'Title') + title = helper.instance_variable_get(:@page_title) + expect(title).to eq 'Section - Title | Application' + end + + it 'renders the section title and the page title' do + title = helper.page_title('Section', 'Title') + expect(title).to have_selector 'h1', text: 'Section' + expect(title).to have_selector 'h1 small', text: 'Title' + end + end + + describe '#set_html_page_title' do + it 'assigns the @page_title ivar' do + allow(helper).to receive_messages(application_name: 'B') + helper.set_html_page_title 'A' + title = helper.instance_variable_get(:@page_title) + expect(title).to eq 'A | B' + end + it 'strips out any HTML tags' do + allow(helper).to receive_messages(application_name: 'B') + expect(helper.set_html_page_title('text should not include HTML')).to eq 'text should not include HTML | B' + end + end + + describe '#curation_page_title' do + it 'renders a page title in the curation section' do + title = helper.curation_page_title 'Some title' + expect(title).to have_selector 'h1', text: 'Curation' + expect(title).to have_selector 'h1 small', text: 'Some title' + end + end + + describe '#configuration_page_title' do + it 'renders a page title in the configuration section' do + title = helper.configuration_page_title 'Some title' + expect(title).to have_selector 'h1', text: 'Configuration' + expect(title).to have_selector 'h1 small', text: 'Some title' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/jobs/spotlight/default_thumbnail_job_spec.rb b/tmp/blacklight-spotlight/spec/jobs/spotlight/default_thumbnail_job_spec.rb new file mode 100644 index 0000000..db39bac --- /dev/null +++ b/tmp/blacklight-spotlight/spec/jobs/spotlight/default_thumbnail_job_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe Spotlight::DefaultThumbnailJob do + let(:thumbnailable) { double('Thumbnailable') } + subject { described_class.new(thumbnailable) } + + it 'calls #set_default_thumbnail on the object passed in and saves' do + expect(thumbnailable).to receive(:set_default_thumbnail) + expect(thumbnailable).to receive(:save) + + subject.perform_now + end +end diff --git a/tmp/blacklight-spotlight/spec/jobs/spotlight/reindex_job_spec.rb b/tmp/blacklight-spotlight/spec/jobs/spotlight/reindex_job_spec.rb new file mode 100644 index 0000000..ec8ef94 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/jobs/spotlight/reindex_job_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe Spotlight::ReindexJob do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:resource) { FactoryGirl.create(:resource) } + + before do + allow_any_instance_of(Spotlight::Resource).to receive(:reindex) + end + + context 'with an exhibit' do + subject { described_class.new(exhibit) } + + before do + exhibit.resources << resource + exhibit.save + end + it 'attempts to reindex every resource in the exhibit' do + # ActiveJob will reload the collection, so we go through a little trouble: + expect_any_instance_of(Spotlight::Resource).to receive(:reindex) do |thingy| + expect(exhibit.resources).to include thingy + end + + subject.perform_now + end + end + + context 'with a resource' do + subject { described_class.new(resource) } + + it 'attempts to reindex every resource in the exhibit' do + expect(resource).to receive(:reindex) + subject.perform_now + end + end +end diff --git a/tmp/blacklight-spotlight/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb b/tmp/blacklight-spotlight/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb new file mode 100644 index 0000000..6ec636e --- /dev/null +++ b/tmp/blacklight-spotlight/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe Spotlight::RenameSidecarFieldJob do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:sidecar) { SolrDocument.new(id: 'test').sidecar(exhibit).tap(&:save!) } + + it 'updates the sidecar data and reindex affected documents' do + expect_any_instance_of(::SolrDocument).to receive(:reindex) + + sidecar.data['old_field'] = 'some value' + sidecar.save! + + described_class.perform_later(exhibit, 'old_field', 'new_field') + + sidecar.reload + expect(sidecar.data['new_field']).to eq 'some value' + end + + it 'does not touch unaffected documents' do + expect_any_instance_of(::SolrDocument).not_to receive(:reindex) + + sidecar.data['other_field'] = 'some value' + sidecar.save! + + described_class.perform_later(exhibit, 'old_field', 'new_field') + end +end diff --git a/tmp/blacklight-spotlight/spec/lib/spotlight/catalog/access_controls_enforcement_spec.rb b/tmp/blacklight-spotlight/spec/lib/spotlight/catalog/access_controls_enforcement_spec.rb new file mode 100644 index 0000000..72d3850 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/lib/spotlight/catalog/access_controls_enforcement_spec.rb @@ -0,0 +1,93 @@ +require 'spec_helper' + +describe Spotlight::Catalog::AccessControlsEnforcement do + class MockSearchBuilder < Blacklight::SearchBuilder + attr_reader :blacklight_params, :scope + def initialize(blacklight_params, scope) + @blacklight_params = blacklight_params + @scope = scope + end + include Spotlight::Catalog::AccessControlsEnforcement::SearchBuilder + include Blacklight::Solr::SearchBuilderBehavior + + def blacklight_config + scope.current_exhibit.blacklight_config + end + end + + subject { MockSearchBuilder.new blacklight_params, scope } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:scope) { double(current_exhibit: exhibit) } + let(:solr_request) { Blacklight::Solr::Request.new } + let(:blacklight_params) { Hash.new } + + describe '.search_params_logic' do + class MockCatalogController + include Blacklight::SearchHelper + include Spotlight::Catalog::AccessControlsEnforcement + end + + subject { MockCatalogController.new } + + it 'adds the filter to the params logic' do + expect(subject.search_params_logic).to include :apply_permissive_visibility_filter + end + end + + describe '#apply_permissive_visibility_filter' do + it 'allows curators to view everything' do + allow(scope).to receive(:can?).and_return(true) + subject.apply_permissive_visibility_filter(solr_request) + expect(solr_request.to_hash).to be_empty + end + + it 'restricts searches to public items' do + allow(scope).to receive(:can?).and_return(false) + + subject.apply_permissive_visibility_filter(solr_request) + expect(solr_request).to include :fq + expect(solr_request[:fq]).to include "-exhibit_#{exhibit.slug}_public_bsi:false" + end + + it 'does not filter resources to just those created by the exhibit' do + allow(subject).to receive(:can?).and_return(true) + subject.apply_permissive_visibility_filter(solr_request) + expect(solr_request).to include :fq + expect(solr_request[:fq]).not_to include "spotlight_exhibit_slug_#{exhibit.slug}_bsi:true" + end + end + + describe '#apply_exhibit_resources_filter' do + context 'with filter_resources_by_exhibit' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true) + end + + it 'filters resources to just those created by the exhibit' do + allow(scope).to receive(:can?).and_return(true) + + subject.apply_exhibit_resources_filter(solr_request) + + expect(solr_request).to include :fq + expect(solr_request[:fq]).to include "spotlight_exhibit_slug_#{exhibit.slug}_bsi:true" + end + end + + context 'with a custom exhibit filter' do + let(:filter) { exhibit.filters.first_or_initialize } + + before do + filter.update(field: 'author_ssim', value: 'Coyne, Justin') + end + + it 'filters resources to just those identified by the exhibit filter' do + allow(scope).to receive(:can?).and_return(true) + + subject.apply_exhibit_resources_filter(solr_request) + + expect(solr_request).to include :fq + expect(solr_request[:fq]).to include '{!raw f=author_ssim}Coyne, Justin' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/lib/spotlight/catalog_spec.rb b/tmp/blacklight-spotlight/spec/lib/spotlight/catalog_spec.rb new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/spec/lib/spotlight/controller_spec.rb b/tmp/blacklight-spotlight/spec/lib/spotlight/controller_spec.rb new file mode 100644 index 0000000..1c680e5 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/lib/spotlight/controller_spec.rb @@ -0,0 +1,86 @@ +require 'spec_helper' + +describe Spotlight::Controller do + class MockController < ActionController::Base + include Spotlight::Controller + end + + subject { MockController.new } + + before do + allow(subject).to receive_messages(params: { action: 'show' }) + end + + describe '#current_exhibit' do + it 'is nil by default' do + expect(subject.current_exhibit).to be_nil + end + end + + describe '#exhibit_masthead?' do + let(:masthead) { double('masthead', display?: true) } + + before do + allow(subject).to receive_messages(current_exhibit: nil, current_masthead: nil) + end + + it 'is false if there is no exhibit' do + expect(subject.exhibit_masthead?).to be_falsey + end + + it 'is false if there is no custom exhibit masthead' do + allow(subject).to receive_messages(current_exhibit: double(masthead: nil), current_masthead: nil) + expect(subject.exhibit_masthead?).to be_falsey + end + + it 'is true if there is an exhibit masthead, but it is not set to display' do + allow(subject).to receive_messages(current_exhibit: double(masthead: double(display?: false))) + expect(subject.exhibit_masthead?).to be_falsey + end + + it 'is true if there is an exhibit masthead' do + allow(subject).to receive_messages(current_exhibit: double(masthead: double(display?: true))) + expect(subject.exhibit_masthead?).to be_truthy + end + end + + describe '#current_masthead' do + let(:search_masthead) { double('search-masthead', display?: true) } + let(:no_display_search_masthead) { double('no-display-search-masthead', display?: false) } + let(:exhibit_masthead) { double('exhibit-masthead', display?: true) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:search) { FactoryGirl.create(:search) } + + it 'is nil by default' do + expect(subject.current_masthead).to be_nil + end + + it 'returns the exhibit masthead if available' do + allow(exhibit).to receive_messages(masthead: exhibit_masthead) + subject.instance_variable_set(:@exhibit, exhibit) + expect(subject.current_masthead).to eq exhibit_masthead + end + + it 'allows the masthead to be set' do + subject.current_masthead = search_masthead + expect(subject.current_masthead).to eq search_masthead + end + + context 'with a resource masthead' do + before do + allow(subject).to receive(:resource_masthead?).and_return(true) + end + + it 'checks if the current resource has a masthead' do + pending + expect(subject.current_masthead).to eq search_masthead + end + end + end + + describe '#resource_masthead?' do + it 'is false by default' do + expect(subject.resource_masthead?).to eq false + end + end +end diff --git a/tmp/blacklight-spotlight/spec/mailers/spotlight/indexing_complete_mailer_spec.rb b/tmp/blacklight-spotlight/spec/mailers/spotlight/indexing_complete_mailer_spec.rb new file mode 100644 index 0000000..f810e1f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/mailers/spotlight/indexing_complete_mailer_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe Spotlight::IndexingCompleteMailer do + let(:user) { double(email: 'test@example.com') } + let(:exhibit) { double(title: 'Exhibit title') } + subject { described_class.documents_indexed [1, 2, 3], exhibit, user } + + it 'renders the receiver email' do + expect(subject.to).to eql([user.email]) + end + + it 'includes a title' do + expect(subject.body.encoded).to match 'Your CSV file has just finished being processed' + end + + it 'describes how many documents were indexed' do + expect(subject.body.encoded).to match '3 documents' + end + + context 'single item' do + subject { described_class.documents_indexed [1], exhibit, user } + + it 'handles pluralization when only a single item was indexed' do + expect(subject.body.encoded).to match '1 document has' + end + end + + it 'includes the exhibit title' do + expect(subject.body.encoded).to match exhibit.title + end +end diff --git a/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb b/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb new file mode 100644 index 0000000..fa40d57 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe SirTrevorRails::Blocks::SolrDocumentsBlock do + let(:page) { FactoryGirl.create(:feature_page) } + let(:block_data) { {} } + subject { described_class.new({ type: '', data: block_data }, page) } + + describe '#text' do + it "is the block's text data" do + block_data[:text] = 'abc' + + expect(subject.text).to eq 'abc' + end + + it "squelches sir-trevor's placeholder values" do + block_data[:text] = '


    ' + expect(subject.text).to be_blank + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/textable_spec.rb b/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/textable_spec.rb new file mode 100644 index 0000000..5797226 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/sir_trevor_rails/blocks/textable_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe SirTrevorRails::Blocks::Textable do + class TextableTestClass + include SirTrevorRails::Blocks::Textable + attr_accessor :text + end + let(:subject) { TextableTestClass.new } + let(:st_blank_text) { '


    ' } + describe '#text?' do + it 'returns false when there is no text' do + expect(subject.text?).to be_falsey + end + it 'returns true false when the text is the default sir-trevor text' do + allow(subject).to receive_messages(text: st_blank_text) + expect(subject.text?).to be_truthy + end + end + describe '#text_align' do + it 'proxies the sir-trevor text-align attribute' do + allow(subject).to receive_messages('text-align' => 'text-align-value') + expect(subject.text_align).to eq 'text-align-value' + end + end + describe '#content_align' do + it 'is the reverse of text-align' do + allow(subject).to receive_messages(text: 'TextContent') + allow(subject).to receive_messages(text_align: 'left') + expect(subject.content_align).to eq 'right' + allow(subject).to receive_messages(text_align: 'right') + expect(subject.content_align).to eq 'left' + end + it 'does not have any alignment if there is no text' do + expect(subject.content_align).to be_nil + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/solr_document_spec.rb b/tmp/blacklight-spotlight/spec/models/solr_document_spec.rb new file mode 100644 index 0000000..c90f214 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/solr_document_spec.rb @@ -0,0 +1,179 @@ +require 'spec_helper' + +describe SolrDocument, type: :model do + subject { described_class.new(id: 'abcd123') } + its(:to_key) { should == ['abcd123'] } + its(:persisted?) { should be_truthy } + before do + allow(subject).to receive_messages(reindex: nil) + end + + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:exhibit_alt) { FactoryGirl.create(:exhibit) } + + it 'has tags on the exhibit' do + expect(subject.tags_from(exhibit)).to be_empty + end + + it 'is able to add tags' do + expect do + exhibit.tag(subject, with: 'paris, normandy', on: :tags) + end.to change { ActsAsTaggableOn::Tag.count }.by(2) + expect(subject.tags_from(exhibit)).to eq %w(paris normandy) + end + + it 'has find' do + expect(described_class.find('dq287tq6352')).to be_kind_of described_class + end + + it 'has ==' do + expect(described_class.find('dq287tq6352')).to eq described_class.find('dq287tq6352') + end + + describe 'GlobalID' do + let(:doc_id) { 'dq287tq6352' } + it 'responds to #to_global_id' do + expect(described_class.find(doc_id).to_global_id.to_s).to eq "gid://internal/SolrDocument/#{doc_id}" + end + it 'is able to locate SolrDocuments by their GlobalID' do + expect(GlobalID::Locator.locate( + described_class.find(doc_id).to_global_id + )['id']).to eq doc_id + end + end + + describe '#sidecar' do + it 'returns a sidecar for adding exhibit-specific fields' do + expect(subject.sidecar(exhibit)).to be_kind_of Spotlight::SolrDocumentSidecar + expect(subject.sidecar(exhibit).exhibit).to eq exhibit + end + + it 'keeps distinct sidecars for each exhibit' do + expect(subject.sidecar(exhibit).exhibit).to eq exhibit + expect(subject.sidecar(exhibit_alt).exhibit).to eq exhibit_alt + end + end + + describe '#update' do + it 'stores sidecar data on the sidecar object' do + mock_sidecar = double + allow(subject).to receive_messages(sidecar: mock_sidecar) + expect(mock_sidecar).to receive(:update).with(data: { 'a' => 1 }) + subject.update exhibit, sidecar: { data: { 'a' => 1 } } + end + it 'stores tags' do + subject.update exhibit, exhibit_tag_list: 'paris, normandy' + expect(subject.tags_from(exhibit)).to eq %w(paris normandy) + end + end + + describe '#to_solr' do + before do + Spotlight::SolrDocumentSidecar.create! document: subject, exhibit: exhibit, + data: { 'a_tesim' => 1, 'b_tesim' => 2, 'c_tesim' => 3 } + end + + it 'includes the doc id' do + expect(subject.to_solr[:id]).to eq 'abcd123' + end + + it 'includes exhibit-specific tags' do + exhibit.tag(subject, with: 'paris', on: :tags) + + expect(subject.to_solr).to include :"exhibit_#{exhibit.slug}_tags_ssim" + expect(subject.to_solr[:"exhibit_#{exhibit.slug}_tags_ssim"]).to include 'paris' + end + + it "includes placeholders for all exhibits' tags" do + expect(subject.to_solr).to include :"exhibit_#{exhibit.slug}_tags_ssim" + expect(subject.to_solr[:"exhibit_#{exhibit.slug}_tags_ssim"]).to eq nil + end + + it 'includes sidecar fields' do + expect(subject.to_solr).to include('a_tesim' => 1, 'b_tesim' => 2, 'c_tesim' => 3) + end + end + + describe '#public?' do + it 'defaults to public' do + expect(subject).to be_public exhibit + end + end + + describe '#private?' do + it 'defaults to public' do + expect(subject).not_to be_private exhibit + end + end + + describe '#make_public!' do + it 'sets the object to public' do + allow(subject).to receive(:reindex) + subject.make_public! exhibit + expect(subject).not_to be_private exhibit + end + + it 'augments existing sidecar data' do + allow(subject).to receive(:reindex) + + subject.update exhibit, sidecar: { data: { a: 1 } } + subject.make_public! exhibit + expect(subject.sidecar(exhibit).data[:a]).to eq 1 + end + end + + describe '#make_private!' do + it 'sets the object to private' do + allow(subject).to receive(:reindex) + subject.make_private! exhibit + expect(subject).to be_private exhibit + end + end + + describe 'uploaded resources' do + let(:uploaded_resource) do + described_class.new( + spotlight_resource_type_ssim: 'spotlight/resources/uploads' + ) + end + it 'does not include Spotlight::SolrDocument::UploadedResource when the correct fields are present' do + expect(subject).to_not be_kind_of Spotlight::SolrDocument::UploadedResource + end + it 'includes Spotlight::SolrDocument::UploadedResource when the correct fields are present' do + expect(uploaded_resource).to be_kind_of Spotlight::SolrDocument::UploadedResource + end + describe '#uploaded_resource?' do + it 'returns false if the correct fields are not present' do + expect(subject).to_not be_uploaded_resource + end + it 'returns true when the correct fields are present' do + expect(uploaded_resource).to be_uploaded_resource + end + end + end + + describe '.find_each' do + it 'enumerates the documents in the exhibit' do + expect(described_class.find_each).to be_a Enumerable + end + + it 'pages through the index' do + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(start: 0)).and_return(double(documents: [1, 2, 3])) + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(start: 3)).and_return(double(documents: [4, 5, 6])) + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(start: 6)).and_return(double(documents: [])) + + expect(described_class.find_each.to_a).to match_array [1, 2, 3, 4, 5, 6] + end + end + + describe '.reindex_all' do + let(:doc) { described_class.new id: 1 } + + it 'reindexes all solr documents' do + expect(described_class).to receive(:find_each).and_yield(doc) + expect(doc).to receive(:reindex) + + described_class.reindex_all + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/ability_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/ability_spec.rb new file mode 100644 index 0000000..92c9656 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/ability_spec.rb @@ -0,0 +1,77 @@ +require 'spec_helper' +require 'cancan/matchers' + +describe Spotlight::Ability, type: :model do + before do + allow_any_instance_of(Spotlight::Search).to receive(:set_default_featured_image) + end + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:search) { FactoryGirl.create(:published_search, exhibit: exhibit) } + let(:unpublished_search) { FactoryGirl.create(:search, exhibit: exhibit) } + let(:page) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + subject { Ability.new(user) } + + describe 'a user with no roles' do + let(:user) { nil } + it { is_expected.not_to be_able_to(:create, exhibit) } + it { is_expected.to be_able_to(:read, exhibit) } + it { is_expected.to be_able_to(:read, page) } + it { is_expected.not_to be_able_to(:create, Spotlight::Page.new(exhibit: exhibit)) } + it { is_expected.to be_able_to(:read, search) } + it { is_expected.not_to be_able_to(:read, unpublished_search) } + it { is_expected.not_to be_able_to(:tag, exhibit) } + end + + describe 'a superadmin' do + let(:user) { FactoryGirl.create(:site_admin) } + + it { is_expected.to be_able_to(:create, Spotlight::Exhibit) } + end + + describe 'a user with admin role' do + let(:user) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) } + let(:role) { FactoryGirl.create(:role, resource: exhibit) } + + it { is_expected.to be_able_to(:update, exhibit) } + + it { is_expected.to be_able_to(:index, role) } + it { is_expected.to be_able_to(:destroy, role) } + it { is_expected.to be_able_to(:update, role) } + it { is_expected.to be_able_to(:create, Spotlight::Role) } + it { is_expected.not_to be_able_to(:create, Spotlight::Exhibit) } + it { is_expected.to be_able_to(:import, exhibit) } + it { is_expected.to be_able_to(:process_import, exhibit) } + it { is_expected.to be_able_to(:destroy, exhibit) } + + let(:blacklight_config) { exhibit.blacklight_configuration } + end + + describe 'a user with curate role' do + let(:user) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) } + + it { is_expected.not_to be_able_to(:update, exhibit) } + it { is_expected.to be_able_to(:curate, exhibit) } + it { is_expected.to be_able_to(:read, exhibit) } + + it { is_expected.to be_able_to(:create, Spotlight::Search) } + it { is_expected.to be_able_to(:update_all, Spotlight::Search) } + it { is_expected.to be_able_to(:update, search) } + it { is_expected.to be_able_to(:destroy, search) } + + it { is_expected.to be_able_to(:create, Spotlight::Page) } + it { is_expected.to be_able_to(:update_all, Spotlight::Page) } + it { is_expected.to be_able_to(:update, page) } + it { is_expected.to be_able_to(:destroy, page) } + + it { is_expected.to be_able_to(:tag, exhibit) } + + let(:contact) { FactoryGirl.create(:contact, exhibit: exhibit) } + + it { is_expected.to be_able_to(:edit, contact) } + it { is_expected.to be_able_to(:new, contact) } + it { is_expected.to be_able_to(:create, contact) } + it { is_expected.to be_able_to(:destroy, contact) } + + let(:blacklight_config) { exhibit.blacklight_configuration } + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/about_page_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/about_page_spec.rb new file mode 100644 index 0000000..2c1e14a --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/about_page_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe Spotlight::AboutPage, type: :model do + let(:page) { described_class.create! exhibit: FactoryGirl.create(:exhibit) } + it { is_expected.not_to be_feature_page } + it { is_expected.to be_about_page } + it 'displays the sidebar' do + expect(page.display_sidebar?).to be_truthy + end + it 'forces the sidebar to display (we do not provide an interface for setting this to false)' do + expect(page.display_sidebar?).to be_truthy + page.display_sidebar = false + page.save + expect(page.display_sidebar?).to be_truthy + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/analytics/ga_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/analytics/ga_spec.rb new file mode 100644 index 0000000..d263429 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/analytics/ga_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe Spotlight::Analytics::Ga do + it 'does not be enabled without configuration' do + expect(described_class.enabled?).to be_falsey + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/blacklight_configuration_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/blacklight_configuration_spec.rb new file mode 100644 index 0000000..fa4a5df --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/blacklight_configuration_spec.rb @@ -0,0 +1,533 @@ +require 'spec_helper' + +describe Spotlight::BlacklightConfiguration, type: :model do + subject { described_class.new } + let(:blacklight_config) { Blacklight::Configuration.new } + + before :each do + blacklight_config.configure do |config| + config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: 'Relevance' + config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: 'Title' + config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: 'Type' + config.add_sort_field 'date', sort: 'sort_date_dtsi asc', label: 'Date' + config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: 'Source' + config.add_sort_field 'identifier', sort: 'id asc', label: 'Identifier' + end + allow(subject).to receive_messages default_blacklight_config: blacklight_config + subject.exhibit = FactoryGirl.create(:exhibit) + end + + it 'touches the exhibit' do + expect(subject.exhibit).to receive :touch + subject.save! + end + + it 'adds a default thumbnail field' do + expect(subject.blacklight_config.index.thumbnail_field).to eq Spotlight::Engine.config.thumbnail_field + end + + describe 'facet fields' do + it 'has facet fields' do + expect(subject.facet_fields).to be_empty + subject.facet_fields['title_facet'] = {} + subject.facet_fields['author_facet'] = {} + expect(subject.facet_fields.keys).to eq %w(title_facet author_facet) + end + + it 'filters blank values' do + subject.facet_fields['title_facet'] = { something: '' } + subject.valid? + expect(subject.facet_fields['title_facet'].keys).to_not include :something + end + + it 'filters the upstream blacklight config' do + subject.facet_fields['a'] = { show: true } + subject.facet_fields['b'] = { show: false } + subject.facet_fields['d'] = { show: true } + + blacklight_config.add_facet_field 'a' + blacklight_config.add_facet_field 'b' + blacklight_config.add_facet_field 'c' + + expect(subject.blacklight_config.facet_fields['a'].show).to be_truthy + expect(subject.blacklight_config.facet_fields['a'].enabled).to be_truthy + expect(subject.blacklight_config.facet_fields['b'].show).to be_falsey + expect(subject.blacklight_config.facet_fields['b'].enabled).to be_falsey + expect(subject.blacklight_config.facet_fields['d']).to be_nil + end + + it 'orders the fields by weight' do + subject.facet_fields['a'] = { show: true, weight: 3 } + subject.facet_fields['b'] = { show: true, weight: 5 } + subject.facet_fields['c'] = { show: true, weight: 1 } + + blacklight_config.add_facet_field 'a' + blacklight_config.add_facet_field 'b' + blacklight_config.add_facet_field 'c' + + expect(subject.blacklight_config.facet_fields.keys).to eq %w(c a b) + end + + it 'allows the facet sort to be configured' do + subject.facet_fields['a'] = { sort: 'count' } + subject.facet_fields['b'] = { sort: 'index' } + + blacklight_config.add_facet_field 'a' + blacklight_config.add_facet_field 'b' + + expect(subject.blacklight_config.facet_fields['a'].sort).to eq 'count' + expect(subject.blacklight_config.facet_fields['b'].sort).to eq 'index' + end + + context 'custom fields' do + it 'includes any custom fields' do + allow(subject).to receive_messages(custom_facet_fields: { 'a' => double(if: nil, :if= => true, merge!: true, validate!: true, normalize!: true) }) + expect(subject.blacklight_config.facet_fields).to include('a') + end + + it 'defaults to not showing a custom field in the facets' do + allow(subject).to receive_messages(custom_facet_fields: { 'a' => Blacklight::Configuration::IndexField.new(field: 'a') }) + expect(subject.blacklight_config.facet_fields).to include('a') + expect(subject.blacklight_config.facet_fields['a'].show).to be_falsey + end + end + + context 'exhibit fields' do + before do + # undo the stubbing we've used elsewhere.. + allow(subject).to receive(:default_blacklight_config).and_call_original + allow(Spotlight::Engine).to receive_messages blacklight_config: blacklight_config + end + it 'injects a tags facet' do + expect(subject.blacklight_config.facet_fields).to include 'exhibit_tags' + end + end + end + + describe 'index fields' do + it 'has index fields' do + expect(subject.index_fields).to be_empty + subject.index_fields['title'] = {} + subject.index_fields['author'] = {} + expect(subject.index_fields.keys).to eq %w(title author) + end + + it 'defaults to displaying all index fields if no exhibit-specific configuration is set' do + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + + expect(subject.blacklight_config.index_fields['a'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['a'].list).to be_truthy + expect(subject.blacklight_config.index_fields['b'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['b'].list).to be_truthy + expect(subject.blacklight_config.index_fields['c'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['c'].list).to be_truthy + end + + it 'filters upstream fields that are always disabled' do + blacklight_config.add_index_field 'a', if: false + expect(subject.blacklight_config.index_fields).not_to have_key 'a' + end + + it 'filters blank values' do + subject.index_fields['title'] = { something: '' } + subject.valid? + expect(subject.index_fields['title'].keys).to_not include :something + end + + it 'filters the upstream blacklight config' do + subject.index_fields['a'] = { enabled: true, list: true } + subject.index_fields['c'] = { enabled: false, list: false } + subject.index_fields['d'] = { enabled: true, list: true } + + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + + expect(subject.blacklight_config.index_fields['a'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['a'].list).to be_truthy + expect(subject.blacklight_config.index_fields['b'].enabled).to be_falsey + expect(subject.blacklight_config.index_fields['b'].list).to be_falsey + expect(subject.blacklight_config.index_fields['d']).to be_nil + end + + it 'includes configured show fields, but disable them for index views' do + blacklight_config.add_show_field 'a' + expect(subject.blacklight_config.index_fields).to have_key 'a' + expect(subject.blacklight_config.index_fields['a'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['a'].show).to be_truthy + expect(subject.blacklight_config.index_fields['a'].list).to be_falsey + end + + it 'filters show fields that are always disabled' do + blacklight_config.add_show_field 'a', if: false + expect(subject.blacklight_config.index_fields).not_to have_key 'a' + end + + it 'includes persisted configurations for show fields' do + subject.index_fields['a'] = { enabled: true, list: true } + blacklight_config.add_show_field 'a' + expect(subject.blacklight_config.index_fields).to have_key 'a' + expect(subject.blacklight_config.index_fields['a'].enabled).to be_truthy + expect(subject.blacklight_config.index_fields['a'].list).to be_truthy + end + + context 'custom fields' do + it 'includes any custom fields' do + subject.index_fields['a'] = { enabled: true, list: true } + allow(subject).to receive_messages(custom_index_fields: { 'a' => double(if: nil, :if= => true, merge!: true, validate!: true, normalize!: true) }) + expect(subject.blacklight_config.index_fields).to include('a') + end + + it 'defaults to showing a custom field on the show view' do + allow(subject).to receive_messages(custom_index_fields: { 'a' => Blacklight::Configuration::IndexField.new(field: 'a') }) + expect(subject.blacklight_config.index_fields).to include('a') + expect(subject.blacklight_config.index_fields['a'].show).to be_truthy + expect(subject.blacklight_config.index_fields['a'].enabled).to be_truthy + end + + it 'uses explicit configuration to override custom field defaults' do + subject.index_fields['a'] = { show: false } + allow(subject).to receive_messages(custom_index_fields: { 'a' => Blacklight::Configuration::IndexField.new(field: 'a') }) + expect(subject.blacklight_config.index_fields).to include('a') + expect(subject.blacklight_config.index_fields['a'].show).to be_falsey + end + end + + it 'prefers the label stored in index fields' do + subject.index_fields['a'] = { enabled: true, list: true, label: 'updated val' } + allow(subject).to receive_messages(custom_index_fields: { 'a' => Blacklight::Configuration::IndexField.new(field: 'a', label: 'Initial value') }) + expect(subject.blacklight_config.index_fields['a'].label).to eq 'updated val' + end + + it 'filters the upstream blacklight config with respect for view types' do + subject.index_fields['a'] = { enabled: true, list: true, gallery: false } + subject.index_fields['b'] = { enabled: true, list: false, gallery: true } + subject.index_fields['c'] = { enabled: false, list: true, gallery: false } + subject.index_fields['d'] = { enabled: true, list: false, gallery: true } + subject.index_fields['e'] = { enabled: true, list: true, gallery: false } + + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + blacklight_config.add_index_field 'd' + + expect(subject.blacklight_config.index_fields.select { |_k, x| x.list }).to include('a') + expect(subject.blacklight_config.index_fields.select { |_k, x| x.gallery }).to include('b', 'd') + expect(subject.blacklight_config.index_fields.select { |_k, x| x.list }).to_not include('b', 'd') + expect(subject.blacklight_config.index_fields.select { |_k, x| x.gallery }).to_not include('a', 'c') + expect(subject.blacklight_config.index_fields.select { |_k, x| x.list }).to have(2).fields + expect(subject.blacklight_config.index_fields.select { |_k, x| x.list && x.enabled }).to have(1).fields + expect(subject.blacklight_config.index_fields.select { |_k, x| x.gallery }).to have(2).fields + end + + it 'filters the upstream blacklight config for show fields' do + subject.index_fields['a'] = { enabled: true, show: true } + subject.index_fields['c'] = { enabled: false, show: false } + subject.index_fields['d'] = { enabled: true, show: false } + + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + + expect(subject.blacklight_config.show_fields.select { |_k, x| x.show && x.enabled }).to include('a') + expect(subject.blacklight_config.show_fields.select { |_k, x| x.show && x.enabled }).to_not include('b', 'd') + expect(subject.blacklight_config.show_fields.select { |_k, x| x.show && x.enabled }).to have(1).fields + end + + it 'includes any custom fields' do + subject.index_fields['a'] = { enabled: true, show: true } + + allow(subject).to receive_messages(custom_index_fields: { 'a' => double(if: nil, :if= => true, merge!: true, validate!: true, normalize!: true) }) + + expect(subject.blacklight_config.show_fields).to include('a') + end + + it 'orders the fields by weight' do + subject.index_fields['a'] = { enabled: true, weight: 3, list: true } + subject.index_fields['b'] = { enabled: true, weight: 5, list: true } + subject.index_fields['c'] = { enabled: true, weight: 1, list: true } + + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + + expect(subject.blacklight_config.index_fields.keys).to eq %w(c a b) + end + + it 'orders the fields by weight' do + subject.index_fields['a'] = { enabled: true, weight: 3, show: true } + subject.index_fields['b'] = { enabled: true, weight: 5, show: true } + subject.index_fields['c'] = { enabled: true, weight: 1, show: true } + + blacklight_config.add_index_field 'a' + blacklight_config.add_index_field 'b' + blacklight_config.add_index_field 'c' + + expect(subject.blacklight_config.show_fields.keys).to eq %w(c a b) + end + end + + describe 'a newly created instance' do + before do + subject.save! + end + describe 'should have default values' do + its(:sort_fields) do + should eq('identifier' => { enabled: true }, + 'relevance' => { enabled: true }, + 'date' => { enabled: true }, + 'source' => { enabled: true }, + 'title' => { enabled: true }, + 'type' => { enabled: true }) + end + its(:search_fields) do + should eq('all_fields' => { enabled: true }, + 'title' => { enabled: true }, + 'author' => { enabled: true }) + end + its(:default_per_page) { should eq 10 } + its(:document_index_view_types) { should match_array ::CatalogController.blacklight_config.view.keys.map(&:to_s) } + end + end + + describe 'sort fields' do + it 'has sort fields' do + expect(subject.sort_fields).to be_empty + subject.sort_fields['title'] = {} + subject.sort_fields['author'] = {} + expect(subject.sort_fields.keys).to eq %w(title author) + end + + it 'filters blank values' do + subject.sort_fields['title'] = { something: '' } + subject.valid? + expect(subject.sort_fields['title'].keys).to_not include :something + end + + it 'filters the upstream blacklight config' do + subject.sort_fields['a'] = { enabled: true } + subject.sort_fields['c'] = { enabled: true } + subject.sort_fields['d'] = { enabled: true } + + blacklight_config.add_sort_field 'a' + blacklight_config.add_sort_field 'b' + blacklight_config.add_sort_field 'c' + + expect(subject.blacklight_config.sort_fields.select { |_k, v| v.enabled == true }).to include('a', 'c') + expect(subject.blacklight_config.sort_fields.select { |_k, v| v.enabled == true }).not_to include('b', 'd') + end + end + + describe 'search fields' do + it 'has search fields' do + expect(subject.search_fields).to be_empty + subject.search_fields['title'] = {} + subject.search_fields['author'] = {} + expect(subject.search_fields.keys).to eq %w(title author) + end + + it 'filters blank values' do + subject.search_fields['title'] = { something: '' } + subject.valid? + expect(subject.search_fields['title'].keys).to_not include :something + end + + it 'filters the upstream blacklight config' do + subject.search_fields['a'] = { enabled: true } + subject.search_fields['c'] = { enabled: true } + subject.search_fields['d'] = { enabled: true } + + blacklight_config.add_search_field 'a' + blacklight_config.add_search_field 'b' + blacklight_config.add_search_field 'c' + + expect(subject.blacklight_config.search_fields.select { |_k, v| v.enabled == true }).to include('a', 'c') + expect(subject.blacklight_config.search_fields.select { |_k, v| v.enabled == true }).not_to include('b', 'd') + end + end + + describe 'per page' do + it 'has per page configuration' do + expect(subject.per_page).to be_empty + subject.per_page << 10 << 50 + expect(subject.per_page).to eq [10, 50] + end + + it 'filters blank values' do + subject.per_page << '' + subject.valid? + expect(subject.per_page).to_not include '' + end + + it 'filters the upstream blacklight config' do + subject.per_page = [10, 50, 1000] + blacklight_config.per_page = [1, 10, 50, 100] + + expect(subject.blacklight_config.per_page).to eq [10, 50] + end + + it 'prepends the default per page' do + blacklight_config.per_page = [1, 10, 50, 100] + subject.default_per_page = 50 + expect(subject.blacklight_config.per_page.first).to eq 50 + end + end + + describe 'document_index_view_types' do + it 'has index view configuration' do + expect(subject.document_index_view_types).to be_empty + subject.document_index_view_types << 'list' << 'gallery' + expect(subject.document_index_view_types).to eq %w(list gallery) + end + + it 'filters blank values' do + subject.document_index_view_types << '' + subject.valid? + expect(subject.document_index_view_types).to_not include '' + end + + it 'filters the upstream blacklight config' do + subject.document_index_view_types = %w(list gallery unknown) + blacklight_config.view.list + blacklight_config.view.gallery + blacklight_config.view.something + + expect(subject.blacklight_config.view.keys).to include :list, :gallery, :something + expect(subject.blacklight_config.view.all? { |k, v| v.key == k && v.if == :enabled_in_spotlight_view_type_configuration? }).to be_truthy + end + + it 'passes through the blacklight configuration when not set' do + blacklight_config.view.list + blacklight_config.view.gallery + blacklight_config.view.something + expect(subject.blacklight_config.view.keys).to include(*blacklight_config.view.keys) + end + end + + describe 'default_solr_params' do + it 'has default solr params configuration' do + expect(subject.default_solr_params).to be_empty + subject.default_solr_params[:qt] = 'custom_request_handler' + expect(subject.default_solr_params[:qt]).to eq 'custom_request_handler' + end + + it 'merges with the blacklight config' do + blacklight_config.default_solr_params = { qt: 'xyz', rows: 10 } + subject.default_solr_params[:qt] = 'abc' + expect(subject.blacklight_config.default_solr_params).to include(:qt, :rows) + expect(subject.blacklight_config.default_solr_params[:qt]).to eq 'abc' + end + end + + describe 'show' do + it 'has show view configuration' do + expect(subject.show).to be_empty + subject.show[:key] = 'some value' + expect(subject.show[:key]).to eq 'some value' + end + + it 'merges with the blacklight config' do + blacklight_config.show.title_field = 'xyz' + subject.show[:title_field] = 'abc' + expect(subject.blacklight_config.show.title_field).to eq 'abc' + end + end + + describe 'index' do + it 'has index view configuration' do + expect(subject.index).to be_empty + subject.index[:key] = 'some value' + expect(subject.index[:key]).to eq 'some value' + end + + it 'merges with the blacklight config' do + blacklight_config.index.title_field = 'xyz' + subject.index[:title_field] = 'abc' + expect(subject.blacklight_config.index.title_field).to eq 'abc' + end + end + + describe '#custom_index_fields' do + it 'converts exhibit-specific fields to Blacklight configurations' do + allow(subject.exhibit).to receive_messages(custom_fields: [ + stub_model(Spotlight::CustomField, field: 'abc', configuration: { a: 1 }, exhibit: subject.exhibit), + stub_model(Spotlight::CustomField, field: 'xyz', configuration: { x: 2 }, exhibit: subject.exhibit) + ]) + + expect(subject.custom_index_fields).to include 'abc', 'xyz' + expect(subject.custom_index_fields['abc']).to be_a_kind_of Blacklight::Configuration::Field + expect(subject.custom_index_fields['abc'].a).to eq 1 + end + end + + describe 'autocomplete configuration' do + before do + # undo the stubbing we've used elsewhere.. + allow(subject).to receive(:default_blacklight_config).and_call_original + blacklight_config.show.title_field = 'x' + allow(Spotlight::Engine).to receive_messages blacklight_config: blacklight_config.deep_copy + end + + context 'with the default search field' do + let(:search_field) do + subject.blacklight_config.search_fields[Spotlight::Engine.config.autocomplete_search_field] + end + + it 'is hidden from the search field selector' do + expect(search_field.if).to eq false + end + + it "uses the engine's autocomplete parameters" do + expect(search_field.solr_parameters).to include Spotlight::Engine.config.default_autocomplete_params + end + + it 'includes the relevant fields' do + Spotlight::Engine.blacklight_config.show.title_field = 'some_field' + expect(search_field.solr_parameters).to have_key :fl + expect(search_field.solr_parameters[:fl]).to include 'id' + expect(search_field.solr_parameters[:fl]).to include 'some_field' + expect(search_field.solr_parameters[:fl]).to include 'full_image_url_ssm' + expect(search_field.solr_parameters[:fl]).to include 'thumbnail_url_ssm' + expect(search_field.solr_parameters[:fl]).to include 'thumbnail_square_url_ssm' + end + end + end + + describe '#document_index_view_types' do + it 'passes arrays through' do + array = [1, 2, 3] + subject.document_index_view_types = array + expect(subject.document_index_view_types).to match_array array + end + + it 'is simplified from a hash to an array' do + checkboxes_from_form = { 'list' => '1', 'gallery' => '1', 'map' => '0' } + subject.document_index_view_types = checkboxes_from_form + expect(subject.document_index_view_types).to match_array %w(list gallery) + end + end + + describe '#document_index_view_types_selected_hash' do + before do + subject.default_blacklight_config.view.list + subject.default_blacklight_config.view.gallery + subject.default_blacklight_config.view.map + subject.default_blacklight_config.view.rss.if = false + subject.document_index_view_types = %w(list gallery rss) + end + + it 'includes selected view types as the value true' do + expect(subject.document_index_view_types_selected_hash.to_h).to include list: true, gallery: true + end + + it 'disabled view types are not included' do + expect(subject.document_index_view_types_selected_hash.to_h).not_to include :map + end + + it 'excludes view types disabled by configuration (not by curator settings)' do + expect(subject.document_index_view_types_selected_hash.to_h).not_to include :rss + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/contact_email_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/contact_email_spec.rb new file mode 100644 index 0000000..2400396 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/contact_email_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe Spotlight::ContactEmail, type: :model do + let(:exhibit) { FactoryGirl.create(:exhibit) } + subject { described_class.new(exhibit: exhibit) } + + it { is_expected.not_to be_valid } + + describe 'with an invalid email set' do + before { subject.email = '@-foo' } + it 'does not be valid' do + expect(subject).to_not be_valid + expect(subject.errors[:email]).to eq ['is not valid'] + end + end + + describe 'with a valid email set' do + before { subject.email = 'foo@example.com' } + it { is_expected.to be_valid } + + describe 'when saved' do + it 'sends a confirmation' do + expect(subject).to receive(:send_devise_notification) + subject.save + end + end + describe '#send_devise_notification' do + it 'sends stuff' do + expect do + subject.send(:send_devise_notification, :confirmation_instructions, 'Q7PEPdLVxymsQL2_s_Rg', {}) + end.to change { ActionMailer::Base.deliveries.count }.by(1) + end + end + end + + describe '.confirmed' do + it 'scopes contacts to only confirmed contacts' do + a = exhibit.contact_emails.create(email: 'a@example.com') + if a.respond_to? :confirm + a.confirm + else + a.confirm! + end + + b = exhibit.contact_emails.create(email: 'b@example.com') + + expect(described_class.confirmed.to_a).to include a + expect(described_class.confirmed.to_a).to_not include b + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/contact_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/contact_spec.rb new file mode 100644 index 0000000..a3af18e --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/contact_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe Spotlight::Contact, type: :model do + context '#show_in_sidebar' do + it 'is an attribute' do + subject.show_in_sidebar = false + subject.save + expect(subject.show_in_sidebar).to be_falsey + end + it 'is published by default' do + subject.save + expect(subject.show_in_sidebar).to be_truthy + end + end + context '#fields' do + it 'show allow new fields to be configured' do + expect(subject.class.fields).to_not have_key(:new_field) + described_class.fields[:new_field] = {} + expect(subject.class.fields).to have_key(:new_field) + end + end + + describe '#contact_info' do + it 'persisted symbolized keys' do + subject.contact_info = { 'some' => 'value' } + subject.save + expect(subject.contact_info).to include some: 'value' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/custom_field_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/custom_field_spec.rb new file mode 100644 index 0000000..4b95626 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/custom_field_spec.rb @@ -0,0 +1,177 @@ +require 'spec_helper' + +describe Spotlight::CustomField, type: :model do + describe '#label' do + subject { described_class.new configuration: { 'label' => 'the configured label' }, field: 'foo_tesim' } + describe "when the exhibit doesn't have a config" do + its(:label) { should eq 'the configured label' } + end + + describe 'when the exhibit has a config' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before { subject.exhibit = exhibit } + describe 'that overrides the label' do + before do + exhibit.blacklight_configuration.index_fields['foo_tesim'] = { 'label' => 'overridden' } + end + its(:label) { should eq 'overridden' } + end + describe "that doesn't override the label" do + its(:label) { should eq 'the configured label' } + end + end + end + + describe '#label=' do + subject { described_class.new field: 'foo_tesim' } + describe "when the exhibit doesn't have a config" do + before { subject.label = 'the configured label' } + its(:configuration) { should eq('label' => 'the configured label') } + end + + describe 'when the exhibit has a config' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before { subject.exhibit = exhibit } + describe 'that overrides the label' do + before do + exhibit.blacklight_configuration.index_fields['foo_tesim'] = { 'label' => 'overridden' } + subject.label = 'edited' + end + it 'has updated the exhibit' do + expect(subject.exhibit.blacklight_configuration.index_fields['foo_tesim']['label']).to eq 'edited' + end + end + end + end + + describe '#field' do + let(:exhibit) { double(to_param: 'a', solr_document_sidecars: Spotlight::SolrDocumentSidecar.none) } + + before do + subject.label = 'xyz' + subject.save + + allow(Spotlight::RenameSidecarFieldJob).to receive(:perform_later) + end + + it 'is auto-generated from the field label' do + expect(subject.field).to start_with 'xyz' + end + + it 'ends in the text suffix if it is a text field' do + subject.field_type = 'text' + subject.save + expect(subject.field).to end_with Spotlight::Engine.config.solr_fields.text_suffix + end + + it 'ends in a string suffix if it is a vocab field' do + subject.field_type = 'vocab' + subject.save + expect(subject.field).to end_with Spotlight::Engine.config.solr_fields.string_suffix + end + end + + describe '#solr_field' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:custom_field) do + described_class.create(exhibit: exhibit, configuration: { 'label' => 'xyz' }) + end + + subject { custom_field.solr_field } + + it 'is auto-generated from the field label' do + expect(subject).to eq "exhibit_#{exhibit.to_param}_xyz_tesim" + end + + context 'with a solr field prefix configured' do + before do + allow(Spotlight::Engine.config.solr_fields).to receive(:prefix).and_return 'prefix_' + end + + it 'uses the solr field prefix' do + expect(subject).to eq "prefix_exhibit_#{exhibit.to_param}_xyz_tesim" + end + end + + context 'for a legacy solr field name' do + before do + custom_field.field = "exhibit_#{exhibit.to_param}_xyz_tesim" + end + + it 'returns the original field name' do + expect(subject).to eq "exhibit_#{exhibit.to_param}_xyz_tesim" + end + end + end + + describe '#configured_to_display?' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + exhibit.blacklight_configuration.blacklight_config.view = { view_name: {} } + subject.exhibit = exhibit + subject.label = 'Label' + subject.field = 'foo_tesim' + end + it 'is truthy when a view has been configured true' do + exhibit.blacklight_configuration.blacklight_config.index_fields['foo_tesim'] = + Blacklight::Configuration::IndexField.new(label: 'Label', enabled: true, view_name: true) + subject.save + + expect(subject).to be_configured_to_display + end + it 'is truthey for show views when enabled' do + exhibit.blacklight_configuration.blacklight_config.index_fields['foo_tesim'] = + Blacklight::Configuration::IndexField.new(label: 'Label', enabled: true, show: true) + subject.save + + expect(subject).to be_configured_to_display + end + it 'is falsey when a few has not been configured true' do + exhibit.blacklight_configuration.blacklight_config.index_fields['foo_tesim'] = + Blacklight::Configuration::IndexField.new(label: 'Label', enabled: true, view_name: false) + subject.save + + expect(subject).to_not be_configured_to_display + end + it 'is falsey when the field is not enabled' do + exhibit.blacklight_configuration.index_fields['foo_tesim'] = { 'label' => 'overridden', enabled: false, view_name: false } + subject.save + + expect(subject).to_not be_configured_to_display + end + end + + describe 'changing the field type' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + subject.label = 'xyz' + subject.exhibit = exhibit + subject.save! + end + + it 'changes the field name for the field' do + expect(subject.field).to end_with 'tesim' + subject.field_type = 'vocab' + subject.save + expect(subject.field).to end_with 'ssim' + end + + it 'copies index field configuration to the new field name' do + subject.exhibit.blacklight_configuration.index_fields_will_change! + subject.exhibit.blacklight_configuration.index_fields[subject.field] = { value: true } + subject.exhibit.blacklight_configuration.save + expect(subject.exhibit.blacklight_configuration.index_fields).to have_key subject.field + + subject.field_type = 'vocab' + subject.save + expect(subject.exhibit.blacklight_configuration.index_fields).to have_key subject.field + expect(subject.exhibit.blacklight_configuration.index_fields[subject.field]).to include value: true + end + + it 'queues a job to reindex any documents with data in the old field' do + expect(Spotlight::RenameSidecarFieldJob).to receive(:perform_later).with(exhibit, subject.field, subject.field.sub('tesim', 'ssim')) + subject.field_type = 'vocab' + subject.save + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/default_thumbnailable_concern_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/default_thumbnailable_concern_spec.rb new file mode 100644 index 0000000..cc47e21 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/default_thumbnailable_concern_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe Spotlight::DefaultThumbnailable do + let(:test_class) { Class.new } + subject { test_class.new } + before { subject.extend(described_class) } + + it 'invokes DefaultThumbnailJob job' do + expect(Spotlight::DefaultThumbnailJob).to receive(:perform_later).with(subject) + subject.send(:fetch_default_thumb_later) + end + + it 'raises a NotImplementedError if the class does not have a set_default_thumbnail method' do + expect do + subject.send(:set_default_thumbnail) + end.to raise_error(NotImplementedError) + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/exhibit_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/exhibit_spec.rb new file mode 100644 index 0000000..7a7af8c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/exhibit_spec.rb @@ -0,0 +1,273 @@ +require 'spec_helper' + +describe Spotlight::Exhibit, type: :model do + subject { FactoryGirl.build(:exhibit, title: 'Sample') } + + it 'has a title' do + subject.title = 'Test title' + expect(subject.title).to eq 'Test title' + end + + it 'has a subtitle' do + subject.subtitle = 'Test subtitle' + expect(subject.subtitle).to eq 'Test subtitle' + end + + it 'has a description that strips html tags' do + subject.description = 'Test description' + subject.save! + expect(subject.description).to eq 'Test description' + end + describe 'contact_emails' do + before do + subject.contact_emails_attributes = [{ 'email' => 'chris@example.com' }, { 'email' => 'jesse@stanford.edu' }] + end + it 'accepts nested contact_emails' do + expect(subject.contact_emails.size).to eq 2 + end + end + + it 'has a #to_s' do + expect(subject.to_s).to eq 'Sample' + subject.title = 'New Title' + expect(subject.to_s).to eq 'New Title' + end + + describe 'that is saved' do + before { subject.save! } + + it 'has a configuration' do + expect(subject.blacklight_configuration).to be_kind_of Spotlight::BlacklightConfiguration + end + + it 'has an unpublished search' do + expect(subject.searches).to have(1).search + expect(subject.searches.published).to be_empty + expect(subject.searches.first.query_params).to be_empty + end + end + + context 'thumbnail' do + it 'calls DefaultThumbnailJob to fetch a default feature image' do + expect(Spotlight::DefaultThumbnailJob).to receive(:perform_later).with(subject.searches.first) + expect(Spotlight::DefaultThumbnailJob).to receive(:perform_later).with(subject) + subject.save! + end + + context '#set_default_thumbnail' do + before { subject.save! } + it 'uses the thubmnail from the first search' do + subject.set_default_thumbnail + expect(subject.thumbnail).not_to be_nil + expect(subject.thumbnail).to eq subject.searches.first.thumbnail + end + end + end + + describe '#main_navigations' do + subject { FactoryGirl.create(:exhibit, title: 'Sample') } + it 'has main navigations' do + expect(subject.main_navigations).to have(3).main_navigations + expect(subject.main_navigations.map(&:label).compact).to be_blank + expect(subject.main_navigations.map(&:weight)).to eq [0, 1, 2] + end + it "uses the engine's configuration for default navigations" do + expect(Spotlight::Engine.config).to receive(:exhibit_main_navigation).and_return([:a, :b]) + expect(subject.main_navigations).to have(2).main_navigations + expect(subject.main_navigations.map(&:nav_type).compact).to match_array %w(a b) + end + end + + describe 'contacts' do + before do + subject.contacts_attributes = [ + { 'show_in_sidebar' => '0', 'name' => 'Justin Coyne', 'contact_info' => { 'email' => 'jcoyne@justincoyne.com', 'title' => '', 'location' => 'US' } }, + { 'show_in_sidebar' => '0', 'name' => '', 'contact_info' => { 'email' => '', 'title' => 'Librarian', 'location' => '' } }] + end + it 'accepts nested contacts' do + expect(subject.contacts.size).to eq 2 + end + end + + describe 'import' do + it 'removes the default browse category' do + subject.save + expect { subject.import({}) }.to change { subject.searches.count }.by(0) + expect { subject.import('searches' => [{ 'title' => 'All Exhibit Items', 'slug' => 'all-exhibit-items' }]) }.to change { subject.searches.count }.by(0) + end + + it 'imports nested attributes from the hash' do + subject.save + subject.import 'title' => 'xyz' + expect(subject.title).to eq 'xyz' + end + + it 'munges taggings so they can be imported easily' do + expect do + subject.import('owned_taggings' => [{ 'taggable_id' => '1', 'taggable_type' => 'SolrDocument', 'context' => 'tags', 'tag' => 'xyz' }]) + subject.save + end.to change { subject.owned_taggings.count }.by(1) + tag = subject.owned_taggings.last + expect(tag.taggable_id).to eq '1' + expect(tag.tag.name).to eq 'xyz' + end + end + + describe '#blacklight_config' do + subject { FactoryGirl.create(:exhibit) } + before do + subject.blacklight_configuration.index = { timestamp_field: 'timestamp_field' } + subject.save! + subject.reload + end + + it 'creates a blacklight_configuration from the database' do + expect(subject.blacklight_config.index.timestamp_field).to eq 'timestamp_field' + end + end + + describe '#solr_data' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + subject { exhibit.solr_data } + + context 'when not filtering by exhibit' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(false) + end + + it 'is blank' do + expect(subject).to be_blank + end + end + + context 'when no filters have been defined' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true) + end + + it 'provides a solr field with the exhibit slug' do + expect(subject).to include("spotlight_exhibit_slug_#{exhibit.slug}_bsi" => true) + end + end + + context 'with a filter' do + before do + exhibit.filters.create(field: 'orcid_ssim', value: '123') + end + it 'uses the provided filter' do + expect(subject).to include('orcid_ssim' => '123') + end + end + end + + describe '#analytics' do + subject { FactoryGirl.create(:exhibit) } + let(:ga_data) { OpenStruct.new(pageviews: 123) } + + before do + allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true) + allow(Spotlight::Analytics::Ga).to receive(:exhibit_data).with(subject, hash_including(:start_date)).and_return(ga_data) + end + + it 'requests analytics data' do + expect(subject.analytics.pageviews).to eq 123 + end + end + + describe '#page_analytics' do + subject { FactoryGirl.create(:exhibit) } + let(:ga_data) { [OpenStruct.new(pageviews: 123)] } + + before do + allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true) + allow(Spotlight::Analytics::Ga).to receive(:page_data).with(subject, hash_including(:start_date)).and_return(ga_data) + end + + it 'requests analytics data' do + expect(subject.page_analytics.length).to eq 1 + expect(subject.page_analytics.first.pageviews).to eq 123 + end + end + + describe '#reindex_later' do + subject { FactoryGirl.create(:exhibit) } + + it 'queues a reindex job for the exhibit' do + expect(Spotlight::ReindexJob).to receive(:perform_later).with(subject) + subject.reindex_later + end + end + + describe '#solr_documents' do + let(:blacklight_config) { Blacklight::Configuration.new } + let(:slug) { 'some_slug' } + let(:filter) do + Spotlight::Filter.new(field: subject.send(:default_filter_field), + value: subject.send(:default_filter_value)) + end + + before do + allow(subject).to receive(:blacklight_config).and_return(blacklight_config) + allow(subject).to receive(:slug).and_return(slug) + allow(subject).to receive(:filters).and_return([filter]) + end + + it 'enumerates the documents in the exhibit' do + expect(subject.solr_documents).to be_a Enumerable + end + + it 'pages through the index' do + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).and_return(double(documents: [1, 2, 3])) + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(start: 3)).and_return(double(documents: [4, 5, 6])) + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(start: 6)).and_return(double(documents: [])) + + expect(subject.solr_documents.to_a).to match_array [1, 2, 3, 4, 5, 6] + end + + context 'with filter_resources_by_exhibit enabled' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true) + end + + it 'filters the solr results using the exhibit filter' do + expected_query_params = { fq: ["spotlight_exhibit_slug_#{subject.slug}_bsi:true"] } + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_including(expected_query_params)).and_return(double(documents: [])) + expect(subject.solr_documents.to_a).to be_blank + end + end + + context 'with filter_resources_by_exhibit disabled' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(false) + end + + it 'does not filters the solr results' do + allow_any_instance_of(Blacklight::Solr::Repository).to receive(:search).with(hash_excluding(fq: [subject.solr_data])).and_return(double(documents: [])) + expect(subject.solr_documents.to_a).to be_blank + end + end + end + + describe '#requested_by' do + context 'with multiple exhibit users' do + let!(:exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: subject) } + let!(:another_exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: subject) } + + it 'is the first listed user' do + expect(subject.requested_by).to eq exhibit_admin + end + end + + context 'if no user has roles on the exhibit' do + it 'is nil' do + expect(subject.requested_by).to be_nil + end + end + end + + describe '#reindex_progress' do + it 'returns a Spotlight::ReindexProgress' do + expect(subject.reindex_progress).to be_a Spotlight::ReindexProgress + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/feature_page_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/feature_page_spec.rb new file mode 100644 index 0000000..cbfbcce --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/feature_page_spec.rb @@ -0,0 +1,79 @@ +require 'spec_helper' + +describe Spotlight::FeaturePage, type: :model do + let(:exhibit) { FactoryGirl.create(:exhibit) } + describe 'default_scope' do + let!(:page1) { FactoryGirl.create(:feature_page, weight: 5, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:feature_page, weight: 1, exhibit: exhibit) } + let!(:page3) { FactoryGirl.create(:feature_page, weight: 10, exhibit: exhibit) } + it 'orders by weight' do + expect(described_class.all.map(&:weight)).to eq [1, 5, 10] + end + end + + describe 'display_sidebar?' do + let(:parent) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let!(:child) { FactoryGirl.create(:feature_page, parent_page: parent, exhibit: exhibit) } + let!(:unpublished_parent) { FactoryGirl.create(:feature_page, published: false, exhibit: exhibit) } + let!(:unpublished_child) { FactoryGirl.create(:feature_page, parent_page: unpublished_parent, published: false, exhibit: exhibit) } + before { unpublished_parent.display_sidebar = false } + it 'is set to true if the page has a published child' do + expect(parent.display_sidebar?).to be_truthy + end + it 'is set to true on the parent of published child pages' do + parent.display_sidebar = false + expect(parent.display_sidebar?).to be_truthy + end + it 'is set to true when publishing a child page' do + expect(unpublished_parent.display_sidebar?).to be_falsey + unpublished_parent.published = true + unpublished_child.published = true + unpublished_child.save + expect(unpublished_parent.display_sidebar?).to be_truthy + end + end + + describe 'weight' do + let(:good_weight) { FactoryGirl.build(:feature_page, weight: 10, exhibit: exhibit) } + let(:low_weight) { FactoryGirl.build(:feature_page, weight: -1, exhibit: exhibit) } + let(:high_weight) { FactoryGirl.build(:feature_page, weight: 51, exhibit: exhibit) } + it 'defaults to 50' do + expect(described_class.new.weight).to eq 50 + end + it 'validates when in the 0 to 50 range' do + expect(good_weight).to be_valid + expect(good_weight.weight).to eq 10 + end + it 'raises an error when outside of the 0 to 50 range' do + expect(low_weight).to_not be_valid + expect(high_weight).to_not be_valid + end + it 'settable valid maximum' do + stub_const('Spotlight::Page::MAX_PAGES', 51) + expect(high_weight).to be_valid + end + end + + it { is_expected.to be_feature_page } + it { is_expected.not_to be_about_page } + + describe 'relationships' do + let(:parent) { FactoryGirl.create(:feature_page, exhibit: exhibit) } + let!(:child1) { FactoryGirl.create(:feature_page, parent_page: parent, exhibit: exhibit) } + let!(:child2) { FactoryGirl.create(:feature_page, parent_page: parent, exhibit: exhibit) } + it 'child pages should have a parent_page' do + [child1, child2].each do |child| + expect(child.parent_page).to eq parent + end + end + it 'parent pages should have child_pages' do + expect(parent.child_pages.length).to eq 2 + expect(parent.child_pages.map(&:id)).to eq [child1.id, child2.id] + end + it 'defines top_level_page? properly' do + expect(parent.top_level_page?).to be_truthy + expect(child1.top_level_page?).to be_falsey + expect(child2.top_level_page?).to be_falsey + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/featured_image_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/featured_image_spec.rb new file mode 100644 index 0000000..0cbff1b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/featured_image_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe Spotlight::FeaturedImage do + context 'with an uploaded resource' do + subject { described_class.new } + let(:document) { double(uploaded_resource?: true) } + + it 'replaces the remote_image_url fragment with the local path to the file' do + allow(document).to receive_message_chain(:uploaded_resource, :url, file: File.open(File.join(FIXTURES_PATH, 'avatar.png'))) + allow(subject).to receive(:document).and_return(document) + + subject.remote_image_url = '/some/path' + expect(subject.remote_image_url).to be_nil + + subject.validate + + expect(subject.image.filename).to eq 'avatar.png' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/field_metadata_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/field_metadata_spec.rb new file mode 100644 index 0000000..27b97eb --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/field_metadata_spec.rb @@ -0,0 +1,65 @@ +require 'spec_helper' + +describe Spotlight::FieldMetadata do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:repository) { double } + let(:blacklight_config) do + Blacklight::Configuration.new do |config| + config.add_facet_field 'a' + config.add_facet_field 'b' + config.add_facet_field 'c' + end + end + + let(:facet_response) do + { + facet_counts: { + facet_fields: { + a: { 'a' => 1, 'b' => 2, 'c' => 3 }, + b: { 'b' => 1 }, + c: { 7 => 1, 8 => 2, 9 => 3 } + }, + + facet_queries: { + 'a:[* TO *]' => 5, + 'b:[* TO *]' => 10, + 'c:[* TO *]' => 15 + } + } + }.with_indifferent_access + end + + subject { described_class.new(exhibit, repository, blacklight_config) } + + before do + allow(repository).to receive(:search).with(an_instance_of(SearchBuilder)).and_return(Blacklight::Solr::Response.new(facet_response, {})) + end + + describe '#field' do + it 'has a document count' do + expect(subject.field('a')[:document_count]).to eq 5 + expect(subject.field('b')[:document_count]).to eq 10 + expect(subject.field('c')[:document_count]).to eq 15 + end + + it 'has a value count' do + expect(subject.field('a')[:value_count]).to eq 3 + expect(subject.field('b')[:value_count]).to eq 1 + expect(subject.field('c')[:value_count]).to eq 3 + end + + it 'gets a list of top terms' do + expect(subject.field('a')[:terms]).to match_array %w(a b c) + expect(subject.field('b')[:terms]).to match_array %w(b) + expect(subject.field('c')[:terms]).to match_array [7, 8, 9] + end + + context 'for a missing field' do + it 'has reasonable default values' do + expect(subject.field('d')[:document_count]).to eq 0 + expect(subject.field('d')[:value_count]).to eq 0 + expect(subject.field('d')[:terms]).to be_empty + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/filter_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/filter_spec.rb new file mode 100644 index 0000000..2f90e68 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/filter_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Spotlight::Filter do + context 'with a simple string field' do + subject { described_class.new(field: 'x', value: 'y') } + + it 'passes the value through' do + expect(subject.to_hash).to eq 'x' => 'y' + end + end + + context 'with a boolean field' do + subject { described_class.new(field: 'x_bsi', value: 'true') } + + it 'casts the value to a boolean' do + expect(subject.to_hash).to eq 'x_bsi' => true + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/home_page_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/home_page_spec.rb new file mode 100644 index 0000000..c691d98 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/home_page_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +describe Spotlight::HomePage, type: :model do + let(:home_page) { FactoryGirl.create(:home_page) } + it { is_expected.not_to be_feature_page } + it { is_expected.not_to be_about_page } + it 'displays the sidebar' do + expect(home_page.display_sidebar?).to be_truthy + end + it 'is published' do + expect(home_page.published).to be_truthy + end + describe 'title' do + it 'includes default text' do + expect(home_page.title).to eq described_class.default_title_text + end + end + describe 'should_display_title?' do + it 'returns the display_title attribute' do + home_page.display_title = true + expect(home_page.should_display_title?).to be_truthy + home_page.display_title = false + expect(home_page.should_display_title?).to be_falsey + end + end + describe 'display_sidebar?' do + it 'is false when the page disabled the display_sidebar' do + home_page.display_sidebar = false + expect(home_page.display_sidebar?).to be_falsey + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/image_derivatives_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/image_derivatives_spec.rb new file mode 100644 index 0000000..2ad71c0 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/image_derivatives_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +class TestSpotlightImageDerivatives + include Spotlight::ImageDerivatives +end + +describe Spotlight::ImageDerivatives do + let(:subject) { TestSpotlightImageDerivatives.new } + describe '#spotlight_image_derivatives' do + it 'includes default derivatives' do + expect(subject.spotlight_image_derivatives.length).to eq 3 + expect(subject.spotlight_image_derivatives.map do |d| + d[:field] + end).to eq [Spotlight::Engine.config.full_image_field, Spotlight::Engine.config.thumbnail_field, Spotlight::Engine.config.square_image_field] + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/main_navigation_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/main_navigation_spec.rb new file mode 100644 index 0000000..9f9a6d9 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/main_navigation_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Spotlight::MainNavigation, type: :model do + before do + subject.exhibit = FactoryGirl.create(:exhibit) + end + + it 'has a default_label' do + subject.nav_type = :curated_features + expect(subject.default_label).to eq 'Curated Features' + end + + it 'returns the use the default label in the absence of a label' do + expect(subject.label).to be_blank + expect(subject.label_or_default).to eq subject.default_label + subject.label = 'something else' + expect(subject.label_or_default).to eq 'something else' + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/masthead_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/masthead_spec.rb new file mode 100644 index 0000000..e8dab3f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/masthead_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Spotlight::Masthead, type: :model do + describe '#masthead_exists?' do + let(:masthead) { stub_model(described_class) } + let(:image) { OpenStruct.new } + it 'returns false when the masthead is set to not display' do + expect(masthead.display?).to be_falsey + end + it 'returns false when the cropped image is not present' do + masthead.display = true + expect(masthead.display?).to be_falsey + end + it 'returns false when the cropped image is present but the masthead is set to not display' do + allow(masthead).to receive(:image).and_return(image) + allow(image).to receive(:cropped).and_return([0]) + expect(masthead.display?).to be_falsey + end + it 'returns true when the cropped image is present and the masthead is set to display' do + masthead.display = true + expect(masthead).to receive(:image).and_return(image) + expect(image).to receive(:cropped).and_return([0]) + expect(masthead.display?).to be_truthy + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/page_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/page_spec.rb new file mode 100644 index 0000000..fc742cb --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/page_spec.rb @@ -0,0 +1,98 @@ +require 'spec_helper' + +describe Spotlight::Page, type: :model do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:parent_page) { Spotlight::FeaturePage.create! exhibit: exhibit, published: true } + let!(:child_page) { Spotlight::FeaturePage.create! exhibit: exhibit, published: false, parent_page: parent_page } + + describe '.at_top_level' do + it 'scopes results to only top level pages' do + expect(described_class.at_top_level).to_not include child_page + end + end + + describe '.published' do + it 'scopes results to only published pages' do + expect(described_class.at_top_level).to_not include child_page + end + end + + describe '#top_level_page?' do + it 'checks if the page is a top-level page' do + expect(parent_page).to be_a_top_level_page + expect(child_page).not_to be_a_top_level_page + end + end + + describe '#top_level_page_or_self' do + it 'fetches the top level page' do + expect(child_page.top_level_page_or_self).to be parent_page + end + + it 'is the same object if the page is a top level page' do + expect(parent_page.top_level_page_or_self).to be parent_page + end + end + describe '.display_sidebar' do + it 'is set to true by default' do + expect(parent_page.display_sidebar?).to be_truthy + end + end + describe 'should_display_title?' do + let(:page) { FactoryGirl.create(:feature_page) } + it 'returns if the title is present or not' do + expect(page.title).not_to be_blank + expect(page.should_display_title?).to be_truthy + page.title = '' + expect(page.should_display_title?).to be_falsey + end + end + + describe '#content=' do + let(:page) { FactoryGirl.create(:feature_page) } + + it 'works with a serialized JSON array' do + page.content = [].to_json + expect(page.content).to be_a_kind_of SirTrevorRails::BlockArray + end + it 'works with an array' do + page.content = [] + expect(page.content).to be_a_kind_of SirTrevorRails::BlockArray + end + end + + describe '#content?' do + let(:page) { FactoryGirl.create(:feature_page) } + + it 'does not have content when the page is empty' do + page.content = [] + expect(page).not_to have_content + end + + it 'has content when the page has a widget' do + page.content = [{ type: 'rule' }] + expect(page).to have_content + end + end + + describe '#slug' do + let(:page) { FactoryGirl.create(:feature_page) } + + it 'gets a default slug' do + expect(page.slug).not_to be_blank + end + + it 'is updated when the title changes' do + page.update(title: 'abc') + expect(page.slug).to eq 'abc' + end + + context 'with a custom slug' do + let(:page) { FactoryGirl.create(:feature_page, slug: 'xyz') } + + it 'gets a default slug' do + expect(page.slug).to eq 'xyz' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/reindex_progress_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/reindex_progress_spec.rb new file mode 100644 index 0000000..3f08a67 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/reindex_progress_spec.rb @@ -0,0 +1,104 @@ +require 'spec_helper' + +describe Spotlight::ReindexProgress, type: :model do + let(:start_time) { 20.minutes.ago } + let(:finish_time) { 5.minutes.ago } + let(:first_resource) do + FactoryGirl.create( + :resource, + updated_at: 15.minutes.ago, + indexed_at: start_time, + last_indexed_estimate: 7, + last_indexed_count: 5, + index_status: 1 + ) + end + let(:last_resource) do + FactoryGirl.create( + :resource, + updated_at: finish_time, + indexed_at: 15.minutes.ago, + last_indexed_estimate: 3, + last_indexed_count: 2, + index_status: 1 + ) + end + let(:resources) { [first_resource, last_resource] } + subject { described_class.new(resources) } + let(:json) { JSON.parse(subject.to_json) } + + before do + allow(subject).to receive_messages(completed_resources: resources) + end + + describe '#in_progress' do + context 'when the last resource has been updated within the allotted time' do + it 'is true' do + expect(subject).to be_in_progress + end + end + + context 'when any of the resources is makred as waiting' do + before do + expect(last_resource).to receive_messages(updated_at: 12.minutes.ago) + first_resource.waiting! + end + it 'is true' do + expect(subject).to be_in_progress + end + end + + context 'when the last resources has been updated outside of the allotted time ' do + before do + expect(last_resource).to receive_messages(updated_at: 12.minutes.ago) + end + it 'is false' do + expect(subject).not_to be_in_progress + end + end + + it 'is included in the json' do + expect(json['in_progress']).to be true + end + end + + describe '#started' do + it 'returns the indexed_at attribute of the first resource' do + expect(subject.started).to eq start_time + end + + it 'is included in the json as a localized string' do + expect(json['started']).to eq I18n.l(start_time, format: :short) + end + end + + describe '#finished' do + it 'returns the updated_at attribute of the last resource' do + expect(subject.finished).to eq finish_time + end + + it 'is included in the json as a localized string under the updated_at attribute' do + expect(json['updated_at']).to eq I18n.l(finish_time, format: :short) + end + end + + describe '#total' do + it 'sums the resources last_indexed_estimate' do + expect(subject.total).to eq 10 + end + + it 'is included in the json' do + expect(json['total']).to eq 10 + end + end + + describe '#completed' do + it 'sums the resources last_indexed_count' do + expect(subject.completed).to eq 7 + end + + it 'is included in the json' do + expect(json['completed']).to eq 7 + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/resource_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/resource_spec.rb new file mode 100644 index 0000000..b6002e2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/resource_spec.rb @@ -0,0 +1,125 @@ +require 'spec_helper' + +describe Spotlight::Resource, type: :model do + before do + allow_any_instance_of(described_class).to receive(:update_index) + end + let(:exhibit) { FactoryGirl.create(:exhibit) } + + describe '#to_solr' do + before do + allow(subject).to receive(:exhibit).and_return(exhibit) + allow(subject).to receive_messages(type: 'Spotlight::Resource::Something', id: 15, persisted?: true) + end + it 'includes a reference to the resource' do + expect(subject.to_solr).to include spotlight_resource_id_ssim: subject.to_global_id.to_s + end + + it 'includes exhibit-specific data' do + allow(exhibit).to receive(:solr_data).and_return(exhibit_data: true) + expect(subject.to_solr).to include exhibit_data: true + end + end + + describe '#reindex' do + context 'with a provider that generates ids' do + subject do + Class.new(described_class).new(exhibit: exhibit) + end + + let(:solr_response) { { id: 123 } } + + before do + SolrDocument.new(id: 123).sidecars.create!(exhibit: exhibit, data: { document_data: true }) + allow(subject).to receive_messages(to_global_id: '') + + allow(subject).to receive(:to_solr).and_return(solr_response) + end + + it 'includes exhibit document-specific data' do + allow(subject.send(:blacklight_solr)).to receive(:update) do |options| + data = JSON.parse(options[:data], symbolize_names: true) + + expect(data.length).to eq 1 + doc = data.first + + expect(doc).to include document_data: true + end + + subject.reindex + end + + context 'when the index is not writable' do + before do + allow(Spotlight::Engine.config).to receive_messages(writable_index: false) + end + + it "doesn't write" do + expect(subject.send(:blacklight_solr)).not_to receive(:update) + subject.reindex + end + end + + context 'with a resource that creates multiple solr documents' do + let(:solr_response) { [{ id: 1 }, { id: 2 }] } + + before do + allow(subject.send(:blacklight_solr)).to receive(:update) + end + + it 'returns the number of indexed objects' do + expect(subject.reindex).to eq 2 + end + + it 'triggers a solr commit' do + expect(subject.send(:blacklight_solr)).to receive(:commit).once + + subject.reindex + end + + it 'records indexing metadata as document attributes' do + subject.reindex + + expect(subject.indexed_at).to be > Time.zone.now - 5.seconds + expect(subject.last_indexed_estimate).to eq 2 + expect(subject.last_indexed_count).to eq 2 + expect(subject.last_index_elapsed_time).to be < 1 + end + end + end + end + + describe '#save_and_index' do + before do + allow(subject.send(:blacklight_solr)).to receive(:update) + allow(subject).to receive(:reindex_later) + end + + it 'saves the object' do + expect(subject).to receive(:save).and_return(true) + subject.save_and_index + end + + it 'reindexes after save' do + expect(subject).to receive(:save).and_return(true) + expect(subject).to receive(:reindex_later) + subject.save_and_index + end + + context 'if the save fails' do + it 'does not reindex' do + expect(subject).to receive(:save).and_return(false) + expect(subject).not_to receive(:reindex_later) + subject.save_and_index + end + end + end + + it 'stores arbitrary data' do + subject.data[:a] = 1 + subject.data[:b] = 2 + + expect(subject.data[:a]).to eq 1 + expect(subject.data[:b]).to eq 2 + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/resources/open_graph_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/resources/open_graph_spec.rb new file mode 100644 index 0000000..ae67902 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/resources/open_graph_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +describe Spotlight::Resources::OpenGraph, type: :model do + class TestResource < Spotlight::Resource + include Spotlight::Resources::Web + include Spotlight::Resources::OpenGraph + end + + let(:exhibit) { double(solr_data: {}, blacklight_config: Blacklight::Configuration.new) } + + subject { TestResource.new url: 'info:url' } + + describe '#to_solr' do + before do + allow(subject).to receive_messages id: 15, opengraph_properties: {}, exhibit: exhibit, persisted?: true + end + + let(:solr_doc) { subject.to_solr } + + it 'includes this record id' do + expect(solr_doc).to include spotlight_resource_id_ssim: subject.to_global_id.to_s + end + + it 'includes opengraph properties' do + allow(subject).to receive_messages opengraph_properties: { a: 1, b: 2 } + + expect(solr_doc).to include a: 1, b: 2 + end + end + + describe '#opengraph_properties' do + it 'maps opengraph properties to solr fields' do + allow(subject).to receive_messages opengraph: { 'og_title' => 'title', 'og_description' => 'description' } + expect(subject.opengraph_properties).to include 'og_title_tesim' => 'title', 'og_description_tesim' => 'description' + end + end + + describe '#opengraph' do + let(:body) do + Nokogiri::HTML.parse <<-EOF + + + + + + + + + + EOF + end + it 'extracts opengraph tags' do + allow(subject).to receive_messages(body: body) + expect(subject.opengraph).to include 'og:title', 'og:description', 'og:type', 'og:type', 'og:site_name', 'og:video', 'og:video:width', 'og:video:height' + expect(subject.opengraph['og:title']).to eq 'The Ground Truth: The Human Cost of War' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/resources/upload_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/resources/upload_spec.rb new file mode 100644 index 0000000..8d9046f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/resources/upload_spec.rb @@ -0,0 +1,93 @@ +require 'spec_helper' + +describe Spotlight::Resources::Upload, type: :model do + let!(:exhibit) { FactoryGirl.create :exhibit } + let!(:custom_field) { FactoryGirl.create :custom_field, exhibit: exhibit } + before do + subject.exhibit = exhibit + end + + let(:configured_fields) { [title_field] + described_class.fields(exhibit) } + let(:title_field) { OpenStruct.new(field_name: 'configured_title_field') } + let(:upload_data) do + { + title_field.field_name => 'Title Data', + 'spotlight_upload_description_tesim' => 'Description Data', + 'spotlight_upload_attribution_tesim' => 'Attribution Data', + 'spotlight_upload_date_tesim' => 'Date Data', + custom_field.field => 'Custom Field Data' + } + end + + before do + allow(subject).to receive(:configured_fields).and_return configured_fields + allow(described_class).to receive(:fields).and_return configured_fields + + allow(subject.send(:blacklight_solr)).to receive(:update) + allow(Spotlight::Engine.config).to receive(:upload_title_field).and_return(title_field) + subject.data = upload_data + subject.url = File.open(File.join(FIXTURES_PATH, '800x600.png')) + subject.save + end + + context 'with a custom upload title field' do + let(:title_field) { OpenStruct.new(field_name: 'configured_title_field', solr_field: :some_other_field) } + + describe '#to_solr' do + it 'stores the title field in the provided solr field' do + expect(subject.to_solr[:some_other_field]).to eq 'Title Data' + end + end + end + + context 'multiple solr field mappings' do + let :configured_fields do + [ + OpenStruct.new(field_name: 'some_field', solr_field: %w(a b)) + ] + end + + let :upload_data do + { 'some_field' => 'value' } + end + + describe '#to_solr' do + it 'maps a single uploaded field to multiple solr fields' do + expect(subject.to_solr['a']).to eq 'value' + expect(subject.to_solr['b']).to eq 'value' + end + end + end + + describe '#to_solr' do + it 'has the exhibit id and the upload id as the solr id' do + expect(subject.to_solr[:id]).to eq "#{subject.exhibit.id}-#{subject.id}" + end + + it 'has a title field using the exhibit specific blacklight_config' do + expect(subject.to_solr['configured_title_field']).to eq 'Title Data' + end + + it 'has the other additional configured fields' do + expect(subject.to_solr[:spotlight_upload_description_tesim]).to eq 'Description Data' + expect(subject.to_solr[:spotlight_upload_attribution_tesim]).to eq 'Attribution Data' + expect(subject.to_solr[:spotlight_upload_date_tesim]).to eq 'Date Data' + end + + it 'has a spotlight_resource_type field' do + expect(subject.to_solr[:spotlight_resource_type_ssim]).to eq 'spotlight/resources/uploads' + end + it 'has the various image fields' do + expect(subject.to_solr).to have_key Spotlight::Engine.config.full_image_field + expect(subject.to_solr).to have_key Spotlight::Engine.config.thumbnail_field + expect(subject.to_solr).to have_key Spotlight::Engine.config.square_image_field + end + it 'has the full image dimensions fields' do + expect(subject.to_solr[:spotlight_full_image_height_ssm]).to eq 600 + expect(subject.to_solr[:spotlight_full_image_width_ssm]).to eq 800 + end + it 'has fields representing exhibit specific custom fields' do + expect(subject.to_solr[custom_field.solr_field]).to eq 'Custom Field Data' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/resources/web_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/resources/web_spec.rb new file mode 100644 index 0000000..4e3b3bf --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/resources/web_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe Spotlight::Resources::Web, type: :model do + class TestResource < Spotlight::Resource + include Spotlight::Resources::Web + end + + subject { TestResource.new } + describe '.fetch' do + end + + describe '#harvest!' do + it 'caches the body and headers in the data' do + allow(described_class).to receive_messages(fetch: double(body: 'xyz', headers: { a: 1 })) + subject.harvest! + expect(subject.data[:body]).to eq 'xyz' + expect(subject.data[:headers]).to eq a: 1 + end + end + + describe '#body' do + it 'returns the body DOM' do + allow(described_class).to receive_messages(fetch: double(body: '', headers: { a: 1 })) + expect(subject.body).to be_a_kind_of(Nokogiri::HTML::Document) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/role_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/role_spec.rb new file mode 100644 index 0000000..bd90a29 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/role_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +describe Spotlight::Role, type: :model do + describe 'validations' do + subject { described_class.new(args) } + describe 'with nothing' do + let(:args) { { user_key: '' } } + it 'does not be valid' do + expect(subject).not_to be_valid + expect(subject.errors.messages).to eq(role: ['is not included in the list'], user_key: ["can't be blank"]) + end + end + describe 'with user_key' do + let(:user) { FactoryGirl.create(:user) } + describe "that doesn't point at a user" do + let(:args) { { role: 'curator', user_key: 'bob' } } + it 'does not be valid' do + expect(subject).not_to be_valid + expect(subject.errors.messages).to eq(user_key: ['User must sign up first.']) + end + end + describe 'that points at a user' do + let(:args) { { role: 'curator', user_key: user.email } } + it 'is valid' do + expect(subject).to be_valid + expect(subject.errors.messages).to be_empty + end + end + describe 'that points at a user with an existing role' do + before { described_class.create!(role: 'curator', user: user) } + let(:args) { { role: 'curator', user_key: user.email } } + it 'is valid' do + expect(subject).not_to be_valid + expect(subject.errors.messages).to eq(user_key: ['already a member of this exhibit']) + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/search_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/search_spec.rb new file mode 100644 index 0000000..9d4ccd4 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/search_spec.rb @@ -0,0 +1,123 @@ +require 'spec_helper' + +describe Spotlight::Search, type: :model do + let(:exhibit) { FactoryGirl.create(:exhibit) } + + let(:query_params) { { 'f' => { 'genre_sim' => ['map'] } } } + subject { exhibit.searches.build(title: 'Search', query_params: query_params) } + + let(:blacklight_config) { ::CatalogController.blacklight_config } + let(:document) do + SolrDocument.new(id: 'dq287tq6352', + blacklight_config.index.title_field => 'title', + Spotlight::Engine.config.full_image_field => 'https://stacks.stanford.edu/image/iiif/dq287tq6352%2Fdq287tq6352_05_0001/full/!400,400/0/default.jpg') + end + let(:document_without_an_image) do + SolrDocument.new(id: 'ab123fd9876', + blacklight_config.index.title_field => 'title') + end + + context 'thumbnail' do + it 'calls DefaultThumbnailJob to fetch a default feature image' do + expect(Spotlight::DefaultThumbnailJob).to receive(:perform_later).with(subject) + subject.save! + end + + context '#set_default_thumbnail' do + it 'has a default feature image' do + allow(subject).to receive_messages(documents: [document]) + subject.set_default_thumbnail + expect(subject.thumbnail).not_to be_nil + expect(subject.thumbnail.image.path).to end_with 'default.jpg' + end + + it 'uses a document with an image for the default feature image' do + allow(subject).to receive_messages(documents: [document_without_an_image, document]) + subject.set_default_thumbnail + expect(subject.thumbnail).not_to be_nil + expect(subject.thumbnail.image.path).to end_with 'default.jpg' + end + + context 'when full_image_field is nil' do + before do + allow(Spotlight::Engine.config).to receive_messages(full_image_field: nil) + end + it "doesn't query solr" do + expect(subject).not_to receive(:documents) + subject.set_default_thumbnail + expect(subject.thumbnail).to be_nil + end + end + end + end + + describe 'for a search matching all items' do + let(:query_params) { {} } + + it 'has items' do + expect(subject.documents.size).to eq 55 + end + + it 'has images' do + expect(subject.images.size).to eq(55) + expect(subject.images.map(&:last)).to include 'https://stacks.stanford.edu/image/dq287tq6352/dq287tq6352_05_0001_thumb', + 'https://stacks.stanford.edu/image/jp266yb7109/jp266yb7109_05_0001_thumb' + end + end + + describe 'default_scope' do + let!(:page1) { FactoryGirl.create(:search, weight: 5, published: true) } + let!(:page2) { FactoryGirl.create(:search, weight: 1, published: true) } + let!(:page3) { FactoryGirl.create(:search, weight: 10, published: true) } + it 'orders by weight' do + expect(described_class.published.map(&:weight)).to eq [1, 5, 10] + end + end + + describe '#slug' do + let(:search) { FactoryGirl.create(:search) } + + it 'gets a default slug' do + expect(search.slug).not_to be_blank + end + + it 'is updated when the title changes' do + search.update(title: 'abc') + expect(search.slug).to eq 'abc' + end + + context 'with a custom slug' do + let(:search) { FactoryGirl.create(:search, slug: 'xyz') } + + it 'gets a default slug' do + expect(search.slug).to eq 'xyz' + end + end + end + + describe '#search_params' do + it 'maps the search to the appropriate facet values' do + expect(subject.search_params.to_hash).to include 'fq' => array_including('{!raw f=genre_sim}map') + end + + context 'with filter_resources_by_exhibit configured' do + before do + allow(Spotlight::Engine.config).to receive(:filter_resources_by_exhibit).and_return(true) + end + + it 'includes the exhibit context' do + expect(subject.search_params.to_hash).to include 'fq' => array_including("spotlight_exhibit_slug_#{exhibit.slug}_bsi:true") + end + end + end + + describe '#repository' do + let(:search) { FactoryGirl.create(:search) } + before do + allow(search).to receive(:blacklight_config).and_return blacklight_config + end + it 'returns an exhibit specific config' do + expect(search.send(:repository).blacklight_config).to eql blacklight_config + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/site_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/site_spec.rb new file mode 100644 index 0000000..51cd117 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/site_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe Spotlight::Site do + describe '.instance' do + it 'is a singleton' do + expect(described_class.instance).to eq described_class.instance + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/sitemap_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/sitemap_spec.rb new file mode 100644 index 0000000..4ee421b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/sitemap_spec.rb @@ -0,0 +1,112 @@ +require 'spec_helper' +require 'sitemap_generator' + +describe Spotlight::Sitemap do + let(:sitemap) { SitemapGenerator::Interpreter.new } + let(:exhibit) { FactoryGirl.create(:exhibit, published: true) } + let(:blacklight_config) { Blacklight::Configuration.new } + let(:sitemap_content) { sitemap.sitemap.sitemap.instance_variable_get(:@xml_content) } + let(:url_helpers) { Spotlight::Engine.routes.url_helpers } + + subject { described_class.new(sitemap, exhibit) } + + before do + allow(exhibit).to receive(:blacklight_config).and_return(blacklight_config) + + SitemapGenerator::Sitemap.default_host = 'http://localhost/' + SitemapGenerator::Interpreter.send :include, Rails.application.routes.url_helpers + SitemapGenerator::Interpreter.send :include, Spotlight::Engine.routes.url_helpers + end + + describe '.add_all_exhibits' do + let!(:second_exhibit) { FactoryGirl.create(:exhibit, published: true) } + let!(:unpublished_exhibit) { FactoryGirl.create(:exhibit, published: false) } + + it 'builds a sitemap for all published exhibits' do + sitemaps = [] + + allow_any_instance_of(described_class).to receive(:add_resources!) do |s| + sitemaps << s + end + + described_class.add_all_exhibits(sitemap) + + expect(sitemaps.map(&:exhibit)).to include exhibit, second_exhibit + expect(sitemaps.map(&:exhibit)).not_to include unpublished_exhibit + end + end + + describe '.add_exhibit' do + it 'builds a sitemap for the exhibit' do + expect_any_instance_of(described_class).to receive(:add_resources!) + + described_class.add_exhibit(sitemap, exhibit) + end + end + + describe '#add_resources!' do + it 'builds a sitemap for all exhibit resources' do + expect(subject).to receive(:add_exhibit_root) + expect(subject).to receive(:add_pages) + expect(subject).to receive(:add_resources) + expect(subject).to receive(:add_browse_categories) + + subject.add_resources! + end + + it 'does not publish sitemaps for unpublished exhibits' do + exhibit.published = false + + expect(subject).not_to receive(:add_exhibit_root) + expect(subject).not_to receive(:add_pages) + expect(subject).not_to receive(:add_resources) + expect(subject).not_to receive(:add_browse_categories) + + subject.add_resources! + end + end + + describe '#add_exhibit_root' do + it 'adds the home page' do + subject.add_exhibit_root + expect(sitemap_content).to include url_helpers.exhibit_root_path(exhibit) + end + end + + describe '#add_pages' do + let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit, published: true) } + let!(:about_page) { FactoryGirl.create(:about_page, exhibit: exhibit, published: true) } + + it 'adds feature pages' do + subject.add_pages + expect(sitemap_content).to include url_helpers.exhibit_feature_page_path(exhibit, feature_page) + end + + it 'adds about pages' do + subject.add_pages + expect(sitemap_content).to include url_helpers.exhibit_about_page_path(exhibit, about_page) + end + end + + describe '#add_resources' do + let(:document) { blacklight_config.document_model.new(id: 'a') } + + before do + allow(exhibit).to receive(:solr_documents).and_return([document]) + end + + it 'adds document resources' do + subject.add_resources + expect(sitemap_content).to include url_helpers.exhibit_solr_document_path(exhibit, document) + end + end + + describe '#add_browse_categories' do + let!(:search) { FactoryGirl.create(:published_search, exhibit: exhibit) } + + it 'adds browse categories to the sitemap' do + subject.add_browse_categories + expect(sitemap_content).to include url_helpers.exhibit_browse_path(exhibit, search) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/atomic_updates_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/atomic_updates_spec.rb new file mode 100644 index 0000000..a7a1f23 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/atomic_updates_spec.rb @@ -0,0 +1,45 @@ +require 'spec_helper' + +describe Spotlight::SolrDocument::AtomicUpdates, type: :model do + let(:blacklight_solr) { double } + subject do + SolrDocument.new.extend(described_class) + end + + before do + allow(subject).to receive_messages(blacklight_solr: blacklight_solr) + end + + describe '#reindex' do + before do + allow(subject).to receive_messages(to_solr: { id: 'doc_id', a: 1, b: 2 }) + end + + context 'when the index is not writable' do + before do + allow(Spotlight::Engine.config).to receive_messages(writable_index: false) + end + + it "doesn't write" do + expect(blacklight_solr).not_to receive(:update) + subject.reindex + end + end + + it 'sends an atomic update request' do + expected = { + params: { commitWithin: 500 }, + data: [{ id: 'doc_id', a: { set: 1 }, b: { set: 2 } }].to_json, + headers: { 'Content-Type' => 'application/json' } + } + expect(blacklight_solr).to receive(:update).with(expected) + subject.reindex + end + + it 'cowardlies refuse to index a document if the only value is an id' do + allow(subject).to receive_messages(to_solr: { id: 'doc_id' }) + expect(blacklight_solr).not_to receive(:update) + subject.reindex + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/spotlight_images_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/spotlight_images_spec.rb new file mode 100644 index 0000000..8790e22 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/spotlight_images_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe Spotlight::SolrDocument::SpotlightImages do + subject do + SolrDocument.new( + Spotlight::Engine.config.full_image_field => ['http://lorempixel.com/800/500/'], + Spotlight::Engine.config.thumbnail_field => ['http://lorempixel.com/400/240/'], + Spotlight::Engine.config.square_image_field => ['http://lorempixel.com/200/200/'] + ) + end + + it 'is a Versions class' do + expect(subject.spotlight_image_versions).to be_a Spotlight::SolrDocument::SpotlightImages::Versions + end + it 'maps image urls in the document to the appropriate version' do + expect(subject.spotlight_image_versions.full).to eq ['http://lorempixel.com/800/500/'] + expect(subject.spotlight_image_versions.thumb).to eq ['http://lorempixel.com/400/240/'] + expect(subject.spotlight_image_versions.square).to eq ['http://lorempixel.com/200/200/'] + end + it 'includes the version keys in the versions array' do + [:full, :thumb, :square].each do |version| + expect(subject.spotlight_image_versions.versions).to include version + end + end + it 'includes newly configured image versions' do + Spotlight::ImageDerivatives.spotlight_image_derivatives << { + version: :tiny, + field: :new_image_field + } + subject = SolrDocument.new(new_image_field: ['abc']) + expect(subject.spotlight_image_versions.tiny).to eq ['abc'] + Spotlight::ImageDerivatives.spotlight_image_derivatives.delete_if do |d| + d[:version] == :tiny + end + end + + it 'gracefully handles missing data' do + subject = SolrDocument.new Spotlight::Engine.config.full_image_field => ['http://lorempixel.com/800/500/'] + expect(subject.spotlight_image_versions.full).to eq ['http://lorempixel.com/800/500/'] + expect(subject.spotlight_image_versions.thumb).to be_empty + expect(subject.spotlight_image_versions.square).to be_empty + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/uploaded_resource_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/uploaded_resource_spec.rb new file mode 100644 index 0000000..f263625 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document/uploaded_resource_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' + +describe Spotlight::SolrDocument::UploadedResource, type: :model do + let(:valid_resource) do + SolrDocument.new(id: '123', + full_image_url_ssm: ['http://example.com/png.png'], + spotlight_full_image_height_ssm: ['1400'], + spotlight_full_image_width_ssm: ['1000'], + spotlight_resource_type_ssim: ['spotlight/resources/uploads']) + end + + describe 'SolrDocument.use_extension' do + it 'does not include the uploaded resource extension when the spotlight resource type is not correct' do + expect(SolrDocument.new(id: '123', spotlight_resource_type_ssim: ['not-correct'])).to_not be_a_kind_of(described_class) + end + it 'includes the uploaded resource extension when the correct fields are present with the correct data' do + expect(valid_resource).to be_a_kind_of(described_class) + end + end + describe 'to_openseadragon' do + let(:subject) { valid_resource.to_openseadragon } + it 'includes hashes for each full_image_url_ssm' do + expect(subject).to be_an Array + expect(subject.length).to eq 1 + expect(subject.first.keys.length).to eq 1 + end + it 'the hashes key should be a LegacyImagePyramidTileSource object' do + expect(subject.first.keys.first).to be_a(Spotlight::SolrDocument::UploadedResource::LegacyImagePyramidTileSource) + end + describe 'LegacyImagePyramidTileSource' do + let(:subject) { valid_resource.to_openseadragon.first.keys.first.to_tilesource } + it 'is a hash' do + expect(subject).to be_a Hash + end + it 'is a legacy image pyramid type' do + expect(subject[:type]).to eq 'legacy-image-pyramid' + end + describe 'levels' do + it 'includes one level' do + expect(subject[:levels].length).to eq 1 + end + it 'includes the image url' do + expect(subject[:levels].first[:url]).to eq 'http://example.com/png.png' + end + it 'includes the height and width from the document' do + expect(subject[:levels].first[:height]).to eq '1400' + expect(subject[:levels].first[:width]).to eq '1000' + end + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/solr_document_sidecar_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document_sidecar_spec.rb new file mode 100644 index 0000000..f0826ee --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/solr_document_sidecar_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe Spotlight::SolrDocumentSidecar, type: :model do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + allow(subject).to receive_messages exhibit: exhibit + allow(subject).to receive_messages document: SolrDocument.new(id: 'doc_id') + end + + describe '#to_solr' do + before do + subject.data = { 'a_tesim' => 1, 'b_tesim' => 2, 'c_tesim' => 3 } + end + + its(:to_solr) { should include id: 'doc_id' } + its(:to_solr) { should include "exhibit_#{exhibit.slug}_public_bsi".to_sym => true } + its(:to_solr) { should include 'a_tesim', 'b_tesim', 'c_tesim' } + end +end diff --git a/tmp/blacklight-spotlight/spec/models/spotlight/user_spec.rb b/tmp/blacklight-spotlight/spec/models/spotlight/user_spec.rb new file mode 100644 index 0000000..e43f48b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/models/spotlight/user_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe Spotlight::User do + subject { Class.new } + before { subject.extend described_class } + + describe '#invite_pending?' do + it 'is false if the user was never invited in the first place' do + expect(subject).to receive_messages(invited_to_sign_up?: false) + expect(subject.invite_pending?).to be false + end + + it 'is true if the user was invited but has not accepted' do + expect(subject).to receive_messages(invited_to_sign_up?: true) + expect(subject).to receive_messages(invitation_accepted?: false) + expect(subject.invite_pending?).to be true + end + + it 'is false if the user was invited and has accpeted the invite' do + expect(subject).to receive_messages(invited_to_sign_up?: true) + expect(subject).to receive_messages(invitation_accepted?: true) + expect(subject.invite_pending?).to be false + end + end +end diff --git a/tmp/blacklight-spotlight/spec/routing/spotlight/exhibit_catalog_spec.rb b/tmp/blacklight-spotlight/spec/routing/spotlight/exhibit_catalog_spec.rb new file mode 100644 index 0000000..2bd0ae3 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/routing/spotlight/exhibit_catalog_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +module Spotlight + describe 'Catalog controller', type: :routing do + describe 'routing' do + routes { Spotlight::Engine.routes } + + it 'routes to #edit' do + expect(get('/1/catalog/dq287tq6352/edit')).to route_to('spotlight/catalog#edit', exhibit_id: '1', id: 'dq287tq6352') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/routing/spotlight/pages_routing_spec.rb b/tmp/blacklight-spotlight/spec/routing/spotlight/pages_routing_spec.rb new file mode 100644 index 0000000..f8124c0 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/routing/spotlight/pages_routing_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +module Spotlight + describe 'FeaturePagesController and AboutPagesController', type: :routing do + describe 'routing' do + routes { Spotlight::Engine.routes } + + it 'routes to #index' do + expect(get('/1/feature')).to route_to('spotlight/feature_pages#index', exhibit_id: '1') + expect(get('/1/about')).to route_to('spotlight/about_pages#index', exhibit_id: '1') + end + + it 'routes to #new' do + expect(get('/1/feature/new')).to route_to('spotlight/feature_pages#new', exhibit_id: '1') + expect(get('/1/about/new')).to route_to('spotlight/about_pages#new', exhibit_id: '1') + end + + it 'routes to #show' do + expect(get('/1/feature/2')).to route_to('spotlight/feature_pages#show', id: '2', exhibit_id: '1') + expect(get('/1/about/2')).to route_to('spotlight/about_pages#show', id: '2', exhibit_id: '1') + end + + it 'routes to #edit' do + expect(get('/1/feature/2/edit')).to route_to('spotlight/feature_pages#edit', id: '2', exhibit_id: '1') + expect(get('/1/about/2/edit')).to route_to('spotlight/about_pages#edit', id: '2', exhibit_id: '1') + end + + it 'routes to #create' do + expect(post('/1/feature')).to route_to('spotlight/feature_pages#create', exhibit_id: '1') + expect(post('/1/about')).to route_to('spotlight/about_pages#create', exhibit_id: '1') + end + + it 'routes to #update' do + expect(put('/1/feature/2')).to route_to('spotlight/feature_pages#update', id: '2', exhibit_id: '1') + expect(put('/1/about/2')).to route_to('spotlight/about_pages#update', id: '2', exhibit_id: '1') + end + + it 'routes to #destroy' do + expect(delete('/1/feature/2')).to route_to('spotlight/feature_pages#destroy', id: '2', exhibit_id: '1') + expect(delete('/1/about/2')).to route_to('spotlight/about_pages#destroy', id: '2', exhibit_id: '1') + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/serializers/spotlight/exhibit_export_serializer_spec.rb b/tmp/blacklight-spotlight/spec/serializers/spotlight/exhibit_export_serializer_spec.rb new file mode 100644 index 0000000..44cc2ce --- /dev/null +++ b/tmp/blacklight-spotlight/spec/serializers/spotlight/exhibit_export_serializer_spec.rb @@ -0,0 +1,372 @@ +require 'spec_helper' + +describe Spotlight::ExhibitExportSerializer do + let!(:source_exhibit) { FactoryGirl.create(:exhibit) } + + before do + allow_any_instance_of(Spotlight::Search).to receive(:set_default_featured_image) + allow_any_instance_of(SolrDocument).to receive(:reindex) + allow_any_instance_of(Spotlight::Resource).to receive(:reindex) + end + + subject { JSON.parse(described_class.new(source_exhibit).to_json) } + + it 'does not include unique identifiers' do + expect(subject).to_not have_key 'id' + expect(subject).to_not have_key 'slug' + expect(subject).to_not have_key 'name' + expect(subject).to_not have_key 'default' + expect(subject).to_not have_key 'masthead_id' + expect(subject).to_not have_key 'thumbnail_id' + end + + it 'has search attributes' do + expect(subject['searches']).to have(source_exhibit.searches.count).searches + end + + it 'has home page attributes' do + expect(subject).to have_key 'home_page' + expect(subject['home_page']).to_not have_key 'id' + expect(subject['home_page']).to_not have_key 'scope' + expect(subject['home_page']).to_not have_key 'exhibit_id' + end + + it 'has about pages' do + expect(subject['about_pages']).to have(source_exhibit.about_pages.count).pages + end + + it 'has feature pages' do + expect(subject['feature_pages']).to have(source_exhibit.feature_pages.at_top_level.count).pages + end + + it 'has custom fields' do + expect(subject['custom_fields']).to have(source_exhibit.custom_fields.count).items + end + + it 'has contact emails' do + expect(subject['contact_emails']).to have(source_exhibit.contact_emails.count).items + end + + it 'has blacklight configuration attributes' do + expect(subject).to have_key 'blacklight_configuration' + end + + it 'has solr document sidecars' do + source_exhibit.solr_document_sidecars.create! document: SolrDocument.new(id: 1), public: false + expect(subject['solr_document_sidecars']).to have_at_least(1).item + expect(subject['solr_document_sidecars']).to have(source_exhibit.solr_document_sidecars.count).items + + expect(subject['solr_document_sidecars'].first).to include('document_id', 'public') + expect(subject['solr_document_sidecars'].first).to_not include 'id' + end + + it 'has attachments' do + expect(subject['attachments']).to have(source_exhibit.attachments.count).items + end + + it 'has resources' do + expect(subject['resources']).to have(source_exhibit.resources.count).items + end + + it 'has tags' do + source_exhibit.tag(SolrDocument.new(id: 1), with: 'xyz', on: :tags) + expect(subject['owned_taggings']).to have(source_exhibit.owned_taggings.count).items + end + + describe 'should round-trip data' do + before do + source_exhibit.solr_document_sidecars.create! document: SolrDocument.new(id: 1), public: false + source_exhibit.tag(SolrDocument.new(id: 1), with: 'xyz', on: :tags) + end + + let :export do + described_class.new(source_exhibit).as_json + end + + subject do + e = FactoryGirl.create(:exhibit) + e.import(export).tap(&:save) + end + + it 'has exhibit properties' do + expect(subject.title).to eq source_exhibit.title + end + + it 'does not duplicate saved searches' do + expect(subject.searches).to have(1).item + end + + it 'has blacklight configuration properties' do + expect(subject.blacklight_configuration).to be_persisted + end + + context 'for an exhibit without search fields' do + before do + source_exhibit.blacklight_configuration.search_fields = {} + source_exhibit.blacklight_configuration.save + end + + it 'remains without search fields' do + expect(subject.blacklight_configuration.search_fields).to be_blank + end + end + + it 'has home page properties' do + expect(subject.home_page).to be_persisted + expect(subject.home_page.id).not_to eq source_exhibit.home_page.id + + expect(subject.home_page.title).to eq source_exhibit.home_page.title + expect(subject.home_page.content).to eq source_exhibit.home_page.content + end + + it 'has sidecars' do + expect(SolrDocument.new(id: 1).public?(subject)).to be_falsey + end + + context 'for an exhibit with contacts' do + let!(:curator) do + FactoryGirl.create(:contact, + exhibit: source_exhibit, + contact_info: { title: 'xyz' }) + end + it 'has contacts' do + expect(subject.contacts.count).to eq 1 + contact = subject.contacts.first + expect(contact.contact_info[:title]).to eq 'xyz' + end + + describe 'for a contact without an avatar' do + let!(:curator) do + FactoryGirl.create(:contact, exhibit: source_exhibit, avatar: nil) + end + + it 'has contacts' do + expect(subject.contacts.count).to eq 1 + end + end + end + + it 'has tags' do + expect(subject.owned_taggings.length).to eq source_exhibit.owned_taggings.length + expect(subject.owned_taggings.first).to be_persisted + expect(subject.owned_taggings.first.tag.name).to eq 'xyz' + end + + context 'with custom main navigation labels' do + before do + nav = source_exhibit.main_navigations.about + nav.label = 'Custom Label' + nav.save + end + + it 'persists across import/export' do + expect(subject.main_navigations.about.label).to eq 'Custom Label' + end + end + + it 'has tags' do + expect(subject.owned_taggings.length).to eq source_exhibit.owned_taggings.length + expect(subject.owned_taggings.first).to be_persisted + expect(subject.owned_taggings.first.tag.name).to eq 'xyz' + end + + it 'deals with nested feature pages' do + FactoryGirl.create :feature_subpage, exhibit: source_exhibit + expect(subject.feature_pages.at_top_level.length).to eq 1 + expect(subject.feature_pages.first.child_pages.length).to eq 1 + end + + context 'page slugs' do + let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: source_exhibit, slug: 'xyz') } + + it 'uses the existing slug for the page' do + expect(subject.feature_pages.find('xyz')).to be_persisted + end + end + + context 'with a feature page' do + let(:feature_page) { FactoryGirl.create(:feature_page, exhibit: source_exhibit) } + let(:thumbnail) { FactoryGirl.create(:featured_image) } + + before do + feature_page.content = { data: [{ type: 'text', data: { text: 'xyz' } }] }.to_json + feature_page.thumbnail = thumbnail + feature_page.save + end + + it 'copies the masthead' do + expect(subject.feature_pages.first.thumbnail).not_to be_blank + expect(subject.feature_pages.first.thumbnail.image.file.path).not_to eq feature_page.thumbnail.image.file.path + end + + it 'copies the thumbnail' do + expect(subject.feature_pages.first.thumbnail).not_to be_blank + expect(subject.feature_pages.first.thumbnail.image.file.path).not_to eq source_exhibit.feature_pages.first.thumbnail.image.file.path + end + + it 'copies the content' do + expect(JSON.parse(subject.feature_pages.first.read_attribute(:content))).to have_key 'data' + expect(subject.feature_pages.first.content.length).to eq 1 + expect(subject.feature_pages.first.content.first).to be_a_kind_of SirTrevorRails::Blocks::TextBlock + end + end + + it 'assigns STI resources the correct class' do + resource = FactoryGirl.create :uploaded_resource, exhibit: source_exhibit + expect(subject.resources.length).to eq 1 + expect(subject.resources.first.class).to eq Spotlight::Resources::Upload + expect(subject.resources.first.url.file.path).not_to eq resource.url.file.path + end + + it 'assigns normal resources the correct class' do + resource = FactoryGirl.create :resource, exhibit: source_exhibit + expect(subject.resources.length).to eq 1 + expect(subject.resources.first.class).to eq Spotlight::Resource + expect(subject.resources.first.url).to eq resource.url + end + + it 'copies contact avatars' do + contact = FactoryGirl.create :contact, exhibit: source_exhibit + expect(subject.contacts.length).to eq 1 + expect(subject.contacts.first.avatar.file.path).not_to eq contact.avatar.file.path + end + + context 'with a browse category' do + let(:masthead) { FactoryGirl.create(:masthead) } + let(:thumbnail) { FactoryGirl.create(:featured_image) } + let!(:search) { FactoryGirl.create(:search, exhibit: source_exhibit, masthead: masthead, thumbnail: thumbnail) } + + before do + source_exhibit.reload + end + + it 'copies the masthead' do + expect(subject.searches.last.masthead).not_to be_blank + expect(subject.searches.last.masthead.image.file.path).not_to eq search.masthead.image.file.path + end + + it 'copies the thumbnail' do + expect(subject.searches.first.thumbnail).not_to be_blank + expect(subject.searches.first.thumbnail.image.file.path).not_to eq search.thumbnail.image.file.path + end + + context 'without an attached image' do + before do + search.masthead.remove_image! + search.masthead.save + end + + it 'copies the masthead without an image' do + expect(subject.searches.last.masthead).not_to be_blank + expect(subject.searches.last.masthead.image).to be_blank + end + end + + context 'with a thumbnail from an uploaded resource' do + before do + search.masthead.document_global_id = SolrDocument.new(id: 'xyz').to_global_id + search.masthead.source = 'exhibit' + search.masthead.save + + source_exhibit.reload + end + + it 'copies the resource' do + expect(subject.searches.last.masthead).not_to be_blank + end + end + end + + context 'with a masthead' do + let!(:masthead) { FactoryGirl.create(:masthead) } + + before do + source_exhibit.masthead = masthead + end + + it 'is copied' do + expect(subject.masthead).not_to be_blank + expect(subject.masthead.image.file.path).not_to eq source_exhibit.masthead.image.file.path + end + end + + context 'with a thumbnail' do + let!(:thumbnail) { FactoryGirl.create(:featured_image) } + + before do + source_exhibit.thumbnail = thumbnail + end + + it 'is copied' do + expect(subject.thumbnail).not_to be_blank + expect(subject.thumbnail.image.file.path).not_to eq source_exhibit.thumbnail.image.file.path + end + end + end + + it 'is idempotent-ish' do + FactoryGirl.create :feature_subpage, exhibit: source_exhibit + export = described_class.new(source_exhibit).as_json + e = FactoryGirl.create(:exhibit) + e.import(export).tap(&:save) + e.import(export).tap(&:save) + end + + describe 'should export saved searches with query parameters that can be re-generated' do + before do + source_exhibit.feature_pages.create content: [{ + type: 'search_results', + data: { + 'item' => { + search.slug => { id: search.slug, display: 'true' } + }, + view: ['list'] + } + }].to_json + end + + subject do + e = FactoryGirl.create(:exhibit) + e.import(export).tap(&:save) + end + + let :export do + described_class.new(source_exhibit).as_json + end + + context 'with a search object with matching query params' do + let :search do + source_exhibit.searches.first + end + + it 'uses a search within the exhibit' do + # searches need to be published. + subject.searches.each { |x| x.update published: true } + + expect(subject.feature_pages.first.content.first.search.exhibit).to eq subject + end + + it 'uses the existing search object with the same query params' do + expect(subject.searches).to have(1).item + end + end + + context 'with a search object that needs to be created' do + let :search do + source_exhibit.searches.create title: 'custom query', slug: 'xyz', published: true + end + + before do + allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later) + end + + it 'creates a search within the exhibit' do + expect(subject.feature_pages.first.content.first.search.exhibit).to eq subject + end + + it 'uses the existing search object with the same query params' do + expect(subject.searches).to have(2).items + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/spec_helper.rb b/tmp/blacklight-spotlight/spec/spec_helper.rb new file mode 100644 index 0000000..11becf4 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/spec_helper.rb @@ -0,0 +1,92 @@ +ENV['RAILS_ENV'] ||= 'test' + +require 'factory_girl' +require 'database_cleaner' +require 'devise' +require 'engine_cart' +EngineCart.load_application! + +require 'rspec/collection_matchers' +require 'rspec/its' +require 'rspec/rails' +require 'rspec/active_model/mocks' + +require 'capybara/poltergeist' + +if ENV['POLTERGEIST_DEBUG'] + Capybara.register_driver :poltergeist_debug do |app| + Capybara::Poltergeist::Driver.new(app, inspector: true, phantomjs_options: ['--load-images=no']) + end + Capybara.javascript_driver = :poltergeist_debug +else + Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, phantomjs_options: ['--load-images=no']) + end + Capybara.javascript_driver = :poltergeist +end +Capybara.default_max_wait_time = 10 + +if ENV['COVERAGE'] || ENV['CI'] + require 'simplecov' + require 'coveralls' if ENV['CI'] + + SimpleCov.formatter = Coveralls::SimpleCov::Formatter if ENV['CI'] + SimpleCov.start do + add_filter '/spec/' + end +end + +require 'spotlight' + +Dir['./spec/support/**/*.rb'].sort.each { |f| require f } + +FactoryGirl.definition_file_paths = [File.expand_path('../factories', __FILE__)] +FactoryGirl.find_definitions + +FIXTURES_PATH = File.expand_path('../fixtures', __FILE__) + +RSpec.configure do |config| + config.infer_spec_type_from_file_location! + + config.use_transactional_fixtures = false + + config.before :each do + DatabaseCleaner.strategy = if Capybara.current_driver == :rack_test + :transaction + else + :truncation + end + DatabaseCleaner.start + + # The first user is automatically granted admin privileges; we don't want that behavior for many of our tests + Spotlight::Engine.user_class.create email: 'initial+admin@example.com', password: 'password', password_confirmation: 'password' + end + + config.after do + DatabaseCleaner.clean + end + + config.filter_run_excluding js: true if ENV['CI'] + + config.include Devise::TestHelpers, type: :controller + config.include Devise::TestHelpers, type: :view + config.include Spotlight::TestViewHelpers, type: :view + config.include Warden::Test::Helpers, type: :feature + config.after(:each, type: :feature) { Warden.test_reset! } + config.include Controllers::EngineHelpers, type: :controller + config.include Capybara::DSL + config.include Spotlight::TestFeaturesHelpers, type: :feature +end + +def add_new_page_via_button(title = 'New Page') + add_link = find('[data-expanded-add-button]') + within(add_link) do + expect(page).to have_css("input[type='text']", visible: false) + end + add_link.hover + within(add_link) do + input = find("input[type='text']", visible: true) + input.set(title) + find("input[data-behavior='save']").click + end +end diff --git a/tmp/blacklight-spotlight/spec/support/controllers/engine_helpers.rb b/tmp/blacklight-spotlight/spec/support/controllers/engine_helpers.rb new file mode 100644 index 0000000..9dbeaf9 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/support/controllers/engine_helpers.rb @@ -0,0 +1,7 @@ +module Controllers + module EngineHelpers + def main_app + Rails.application.class.routes.url_helpers + end + end +end diff --git a/tmp/blacklight-spotlight/spec/support/features/test_features_helpers.rb b/tmp/blacklight-spotlight/spec/support/features/test_features_helpers.rb new file mode 100644 index 0000000..c35b60f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/support/features/test_features_helpers.rb @@ -0,0 +1,68 @@ +module Spotlight + module TestFeaturesHelpers + def fill_in_typeahead_field(opts = {}) + # Poltergeist / Capybara doesn't fire the events typeahead.js + # is listening for, so we help it out a little: + page.execute_script <<-EOF + $("[data-twitter-typeahead]").val("#{opts[:with]}").trigger("input"); + $("[data-twitter-typeahead]").typeahead("open"); + $(".tt-suggestion").click(); + EOF + + find('.tt-suggestion', text: opts[:with], match: :first).click + end + + def add_widget(type) + click_add_widget + + # click the item + image widget + expect(page).to have_css("a[data-type='#{type}']") + find("a[data-type='#{type}']").click + end + + def click_add_widget + # Lame hack to get the sir-trevor Add widget link to work. + # Not sure if it's the font-icon delayed loading, or something weird w/ the + # test under javascript where the click handler hasn't been applied when the click happens, + # but clicking on it an additional time seems to do the trick. 5 times is totally arbitrary, + # it seems to work after the first attempt. + 5.times do + break if all('a[data-type]').present? + find('[data-icon="add"]').click + sleep(0.1) + end + end + + def save_page + sleep 1 + click_button('Save changes') + # verify that the page was created + expect(page).to have_content('page was successfully updated') + end + + RSpec::Matchers.define :have_breadcrumbs do |*expected| + match do |actual| + errors = [] + errors << 'Unable to find breadcrumbs' unless actual.has_css? '.breadcrumb' + + breadcrumbs = expected.dup + + actual.within('.breadcrumb') do + last = breadcrumbs.pop + breadcrumbs.each do |e| + errors << "Unable to find breadcrumb #{e}" unless actual.has_link? e + end + + errors << "Unable to find breadcrumb #{last}" unless actual.has_content? last + errors << "Expected #{last} not to be a link" if actual.has_link? last + end + + errors.empty? + end + + failure_message do |actual| + "expected that #{actual.all('.breadcrumb li').map(&:text).join(' / ')} would include #{expected.join(' / ')}" + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/support/views/test_view_helpers.rb b/tmp/blacklight-spotlight/spec/support/views/test_view_helpers.rb new file mode 100644 index 0000000..e07d297 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/support/views/test_view_helpers.rb @@ -0,0 +1,12 @@ +module Spotlight + module TestViewHelpers + extend ActiveSupport::Concern + + included do + before do + view.send(:extend, Spotlight::CrudLinkHelpers) + view.send(:extend, Spotlight::TitleHelper) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/test_app_templates/Gemfile.extra b/tmp/blacklight-spotlight/spec/test_app_templates/Gemfile.extra new file mode 100644 index 0000000..e69de29 diff --git a/tmp/blacklight-spotlight/spec/test_app_templates/carrierwave.rb b/tmp/blacklight-spotlight/spec/test_app_templates/carrierwave.rb new file mode 100644 index 0000000..3ce11e2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/test_app_templates/carrierwave.rb @@ -0,0 +1,6 @@ +if Rails.env.test? || Rails.env.cucumber? + CarrierWave.configure do |config| + config.storage = :file + config.enable_processing = false + end +end diff --git a/tmp/blacklight-spotlight/spec/test_app_templates/catalog_controller.rb b/tmp/blacklight-spotlight/spec/test_app_templates/catalog_controller.rb new file mode 100644 index 0000000..77f5fae --- /dev/null +++ b/tmp/blacklight-spotlight/spec/test_app_templates/catalog_controller.rb @@ -0,0 +1,99 @@ +class CatalogController < ApplicationController + include Blacklight::Catalog + helper Openseadragon::OpenseadragonHelper + + configure_blacklight do |config| + ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params + config.default_solr_params = { + qt: 'search', + rows: 10, + fl: '*' + } + + ## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or + ## parameters included in the Blacklight-jetty document requestHandler. + # + # config.default_document_solr_params = { + # :qt => 'document', + # ## These are hard-coded in the blacklight 'document' requestHandler + # # :fl => '*', + # # :rows => 1 + # # :q => '{!raw f=id v=$id}' + # } + + # solr field configuration for search results/index views + config.index.title_field = 'full_title_tesim' + config.index.display_type_field = 'content_metadata_type_ssm' + config.index.thumbnail_field = Spotlight::Engine.config.thumbnail_field + + config.view.gallery.partials = [:index_header, :index] + config.view.slideshow.partials = [:index] + + config.show.tile_source_field = :content_metadata_image_iiif_info_ssm + config.show.partials.insert(1, :openseadragon) + + # solr fields that will be treated as facets by the blacklight application + # The ordering of the field names is the order of the display + # + # Setting a limit will trigger Blacklight's 'more' facet values link. + # * If left unset, then all facet values returned by solr will be displayed. + # * If set to an integer, then "f.somefield.facet.limit" will be added to + # solr request, with actual solr request being +1 your configured limit -- + # you configure the number of items you actually want _displayed_ in a page. + # * If set to 'true', then no additional parameters will be sent to solr, + # but any 'sniffed' request limit parameters will be used for paging, with + # paging at requested limit -1. Can sniff from facet.limit or + # f.specific_field.facet.limit solr request params. This 'true' config + # can be used if you set limits in :default_solr_params, or as defaults + # on the solr side in the request handler itself. Request handler defaults + # sniffing requires solr requests to be made with "echoParams=all", for + # app code to actually have it echo'd back to see it. + # + # :show may be set to false if you don't want the facet to be drawn in the + # facet bar + config.add_facet_field 'genre_ssim', label: 'Genre', limit: true + config.add_facet_field 'personal_name_ssm', label: 'Personal Names', limit: true + config.add_facet_field 'corporate_name_ssm', label: 'Corporate Names', limit: true + config.add_facet_field 'subject_geographic_ssim', label: 'Geographic' + config.add_facet_field 'subject_temporal_ssim', label: 'Era' + config.add_facet_field 'language_ssim', label: 'Language' + + # Have BL send all facet field names to Solr, which has been the default + # previously. Simply remove these lines if you'd rather use Solr request + # handler defaults, or have no facets. + config.add_facet_fields_to_solr_request! + + # solr fields to be displayed in the index (search results) view + # The ordering of the field names is the order of the display + config.add_index_field 'language_ssm', label: 'Language' + config.add_index_field 'abstract_tesim', label: 'Abstract' + config.add_index_field 'note_mapuse_tesim', label: 'Type' + config.add_index_field 'note_source_tesim', label: 'Source' + config.add_index_field 'subject_geographic_tesim', label: 'Geographic Subject' + config.add_index_field 'subject_temporal_tesim', label: 'Temporal Subject' + + # solr fields to be displayed in the show (single result) view + # The ordering of the field names is the order of the display + config.add_show_field 'note_phys_desc_tesim', label: 'Note' + config.add_show_field 'note_source_tesim', label: 'Source' + config.add_show_field 'note_desc_note_tesim', label: 'Note' + config.add_show_field 'note_references_tesim', label: 'References' + config.add_show_field 'note_provenance_tesim', label: 'Provenance' + config.add_show_field 'note_page_num_tesim', label: 'Page Number' + config.add_show_field 'subject_geographic_tesim', label: 'Geographic Subject' + config.add_show_field 'subject_temporal_tesim', label: 'Temporal Subject' + config.add_show_field 'personal_name_ssm', label: 'Personal Names' + config.add_show_field 'corporate_name_ssm', label: 'Corporate Names' + + config.add_search_field 'all_fields', label: 'Everything' + config.add_search_field 'title', label: 'Title', solr_local_parameters: { qf: 'full_title_tesim', pf: 'full_title_tesim' } + config.add_search_field 'author', label: 'Author', solr_local_parameters: { qf: '$qf_author', pf: '$pf_author' } + + config.add_sort_field 'relevance', sort: 'score desc, sort_title_ssi asc', label: 'Relevance' + config.add_sort_field 'title', sort: 'sort_title_ssi asc', label: 'Title' + config.add_sort_field 'type', sort: 'sort_type_ssi asc', label: 'Type' + config.add_sort_field 'source', sort: 'sort_source_ssi asc', label: 'Source' + config.add_sort_field 'identifier', sort: 'id asc', label: 'Identifier' + config.add_sort_field 'date', sort: 'sort_date_dtsi desc', label: 'Date (new to old)' + end +end diff --git a/tmp/blacklight-spotlight/spec/test_app_templates/lib/generators/test_app_generator.rb b/tmp/blacklight-spotlight/spec/test_app_templates/lib/generators/test_app_generator.rb new file mode 100644 index 0000000..e46cece --- /dev/null +++ b/tmp/blacklight-spotlight/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -0,0 +1,51 @@ +require 'rails/generators' + +class TestAppGenerator < Rails::Generators::Base + source_root '../spec/test_app_templates' + + def add_gems + gem 'blacklight', '~> 5.16' + gem 'blacklight-gallery', '>= 0.3.0' + gem 'jettywrapper' + Bundler.with_clean_env do + run 'bundle install' + end + end + + def run_blacklight_generator + say_status('warning', 'GENERATING BL', :yellow) + + generate 'blacklight:install', '--devise' + end + + def run_spotlight_migrations + rake 'spotlight:install:migrations' + rake 'db:migrate' + end + + def add_spotlight_routes_and_assets + generate 'spotlight:install', '-f --mailer_default_url_host=localhost:3000' + end + + def install_test_catalog_controller + copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb', force: true + end + + def add_rake_tasks_to_app + rakefile 'spotlight_test.rake', File.read(find_in_source_paths('spotlight_test.rake')) + end + + def disable_carrierwave_processing + copy_file 'carrierwave.rb', 'config/initializers/carrierwave.rb' + end + + def disable_filter_resources_by_exhibit + initializer 'disable_filter_resources_by_exhibit.rb' do + <<-EOF + # Setting this to false when running tests so that we don't have to set up + # exhibit specific solr documents for tests that don't use the default exhibit. + Spotlight::Engine.config.filter_resources_by_exhibit = false +EOF + end + end +end diff --git a/tmp/blacklight-spotlight/spec/test_app_templates/spotlight_test.rake b/tmp/blacklight-spotlight/spec/test_app_templates/spotlight_test.rake new file mode 100644 index 0000000..2325c61 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/test_app_templates/spotlight_test.rake @@ -0,0 +1,12 @@ +require 'rake' + +namespace :spotlight_test do + namespace :solr do + desc 'Index test data into solr; must be run from within an app (see spotlight:fixtures)' + task :seed do + docs = YAML.load(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', 'sample_solr_documents.yml'), Rails.root))) + Blacklight.default_index.connection.add docs + Blacklight.default_index.connection.commit + end + end +end diff --git a/tmp/blacklight-spotlight/spec/uploaders/spotlight/item_uploader_spec.rb b/tmp/blacklight-spotlight/spec/uploaders/spotlight/item_uploader_spec.rb new file mode 100644 index 0000000..2f1f9f9 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/uploaders/spotlight/item_uploader_spec.rb @@ -0,0 +1,68 @@ +require 'spec_helper' +require 'carrierwave/test/matchers' + +describe Spotlight::ItemUploader do + include CarrierWave::Test::Matchers + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:resource) { stub_model(Spotlight::Resources::Upload) } + before do + allow(resource).to receive(:exhibit).and_return(exhibit) + described_class.enable_processing = true + end + after do + described_class.enable_processing = false + end + describe 'default configuration' do + subject do + described_class.new(resource, :resource) + end + + before do + subject.store!(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', '800x600.png'), Rails.root))) + end + + after do + subject.remove! + end + + context 'the thumb version' do + it 'scales down an image so that the longest edge is 400px (maintaining aspect ratio)' do + expect(subject.thumb).to have_dimensions(400, 300) + end + end + + context 'the square version' do + it 'scales down a landscape image to fit within 100px by 100px' do + expect(subject.square).to be_no_larger_than(100, 100) + end + end + end + describe 'with added configurations' do + subject do + described_class.new(resource, :resource) + end + + before do + Spotlight::ImageDerivatives.spotlight_image_derivatives << { + version: :super_tiny, + blacklight_config_field: :super_tiny_field, + lambda: lambda do + version :super_tiny do + process resize_to_fill: [25, 25] + end + end + } + subject.store!(File.open(File.expand_path(File.join('..', 'spec', 'fixtures', '800x600.png'), Rails.root))) + end + + after do + subject.remove! + end + + context 'the newly configured version' do + pending 'should have the newly configured dimensions' do + expect(subject.super_tiny).to have_dimensions(25, 25) + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/_user_util_links.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/_user_util_links.html.erb_spec.rb new file mode 100644 index 0000000..3af3c5c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/_user_util_links.html.erb_spec.rb @@ -0,0 +1,89 @@ +require 'spec_helper' + +module Spotlight + describe '_user_util_links', type: :view do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + before do + allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new) + allow(view).to receive(:current_user).and_return(current_user) + allow(view).to receive(:current_exhibit).and_return(current_exhibit) + allow(view).to receive_messages(show_contact_form?: true) + end + + describe 'when user is not logged in' do + let(:current_user) { nil } + it 'renders the links' do + render + expect(rendered).to have_link 'Sign in' + expect(rendered).to have_link 'Feedback' + end + end + + describe 'when show_contact_form is false' do + let(:current_user) { nil } + before do + allow(view).to receive_messages(show_contact_form?: false) + end + + it 'does not render the feedback link' do + render + expect(rendered).to_not have_link 'Feedback' + end + end + + describe 'when user is logged in' do + let(:current_user) { Spotlight::Engine.user_class.new } + it 'renders the links' do + render + expect(rendered).to have_link 'Feedback' + expect(rendered).to_not have_link 'Dashboard' + expect(rendered).to have_link 'Sign out' + end + end + + describe 'when user is a curator' do + let(:current_user) { Spotlight::Engine.user_class.new } + before do + allow(view).to receive(:can?).with(:update, current_exhibit).and_return(false) + allow(view).to receive(:can?).with(:create, Spotlight::Exhibit).and_return(false) + allow(view).to receive(:can?).with(:curate, current_exhibit).and_return(true) + end + it 'renders the links' do + render + expect(rendered).to have_link 'Feedback' + expect(rendered).to have_link 'Dashboard' + expect(rendered).to have_link 'Sign out' + end + end + describe 'when user is an admin' do + let(:current_user) { Spotlight::Engine.user_class.new } + before do + allow(view).to receive(:can?).with(:update, current_exhibit).and_return(true) + allow(view).to receive(:can?).with(:create, Spotlight::Exhibit).and_return(false) + allow(view).to receive(:can?).with(:curate, current_exhibit).and_return(true) + end + it 'renders the links' do + render + expect(rendered).to have_link 'Feedback' + expect(rendered).to have_link 'Dashboard' + expect(rendered).to have_link 'Sign out' + end + end + + describe 'when user is a site-wide admin' do + let(:current_user) { Spotlight::Engine.user_class.new } + before do + allow(view).to receive(:can?).with(:update, current_exhibit).and_return(true) + allow(view).to receive(:can?).with(:create, Spotlight::Exhibit).and_return(true) + allow(view).to receive(:can?).with(:curate, current_exhibit).and_return(true) + end + it 'renders the links' do + render + expect(rendered).to have_link 'Feedback' + expect(rendered).to have_link 'Dashboard' + expect(rendered).to have_link 'Create Exhibit' + expect(rendered).to have_link 'Sign out' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/shared/_analytics.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/shared/_analytics.html.erb_spec.rb new file mode 100644 index 0000000..5916e42 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/shared/_analytics.html.erb_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +module Spotlight + describe 'shared/_analytics', type: :view do + it 'is empty without Google Analytics configured' do + render + expect(rendered).to be_empty + end + + it 'renders the GA script tag if the web property id is configured' do + allow(Spotlight::Engine.config).to receive(:ga_web_property_id).and_return('XYZ-234') + render + expect(rendered).to have_selector 'script', visible: false + expect(rendered).to have_content 'XYZ-234' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/shared/_exhibit_navbar.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/shared/_exhibit_navbar.html.erb_spec.rb new file mode 100644 index 0000000..5e1f73f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/shared/_exhibit_navbar.html.erb_spec.rb @@ -0,0 +1,127 @@ +require 'spec_helper' + +describe 'shared/_exhibit_navbar', type: :view do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + let(:feature_page) { FactoryGirl.create(:feature_page, exhibit: current_exhibit) } + let(:unpublished_feature_page) { FactoryGirl.create(:feature_page, published: false, exhibit: current_exhibit) } + let(:about_page) { FactoryGirl.create(:about_page, exhibit: current_exhibit) } + let(:unpublished_about_page) { FactoryGirl.create(:about_page, published: false, exhibit: current_exhibit) } + + before :each do + allow(view).to receive_messages(resource_masthead?: false) + allow(view).to receive_messages(current_exhibit: current_exhibit) + allow(view).to receive_messages(on_browse_page?: false, on_about_page?: false) + allow(view).to receive_messages(render_search_bar: 'Search Bar') + allow(view).to receive_messages(exhibit_path: spotlight.exhibit_path(current_exhibit)) + end + + it 'links to the exhibit home page (as branding) when there is a current search masthead' do + allow(view).to receive_messages(resource_masthead?: true) + render + expect(response).to have_selector('a.navbar-brand', text: current_exhibit.title) + end + + it 'links to the search page if no home page is defined' do + render + expect(response).to have_link 'Home', href: spotlight.exhibit_path(current_exhibit) + end + + it 'links to the home page' do + allow(current_exhibit).to receive_messages home_page: feature_page + render + expect(response).to have_link 'Home', href: spotlight.exhibit_path(current_exhibit) + end + + it 'links directly to a single feature page' do + feature_page + render + expect(response).to have_link feature_page.title, href: spotlight.exhibit_feature_page_path(current_exhibit, feature_page) + end + + it 'provides a dropdown of multiple feature pages' do + feature_page + another_page = FactoryGirl.create(:feature_page, exhibit: current_exhibit) + render + expect(response).to have_selector '.dropdown .dropdown-toggle', text: 'Curated Features' + expect(response).to have_link feature_page.title, visible: false, href: spotlight.exhibit_feature_page_path(current_exhibit, feature_page) + expect(response).to have_link another_page.title, visible: false, href: spotlight.exhibit_feature_page_path(current_exhibit, another_page) + end + + it 'does not display links to feature pages if none are defined' do + render + expect(response).to_not have_link 'Curated Features' + end + + it 'does not display links to feature pages that are not published' do + unpublished_feature_page + render + expect(response).to_not have_link 'Curated Features' + end + + it "links to the browse index if there's a published search" do + FactoryGirl.create :published_search, exhibit: current_exhibit + render + expect(response).to have_link 'Browse', href: spotlight.exhibit_browse_index_path(current_exhibit) + end + + it "marks the browse button as active if we're on a browse page" do + FactoryGirl.create :published_search, exhibit: current_exhibit + allow(view).to receive_messages(on_browse_page?: true) + render + expect(response).to have_selector 'li.active', text: 'Browse' + end + + it 'does not link to the browse index if no categories are defined' do + render + expect(response).not_to have_link 'Browse' + end + + it 'does not link to the browse index if only private categories are defined' do + FactoryGirl.create :search, exhibit: current_exhibit + render + expect(response).not_to have_link 'Browse' + end + + it 'links to the about page' do + allow(current_exhibit).to receive_messages main_about_page: about_page + render + expect(response).to have_link 'About', href: spotlight.exhibit_about_page_path(current_exhibit, about_page) + end + + it 'does not link to the about page if no about page exists' do + render + expect(response).to_not have_link 'About' + end + + it 'does not to the about page if none are published' do + unpublished_about_page + render + expect(response).to_not have_link 'About' + end + + it "marks the about button as active if we're on an about page" do + allow(current_exhibit).to receive_messages main_about_page: about_page + allow(view).to receive_messages(on_about_page?: true) + render + expect(response).to have_selector 'li.active', text: 'About' + end + + it 'includes the search bar when the exhibit is searchable' do + expect(current_exhibit).to receive(:searchable?).and_return(true) + render + expect(response).to have_content 'Search Bar' + end + + it 'does not include the search bar when the exhibit is not searchable' do + expect(current_exhibit).to receive(:searchable?).and_return(false) + render + expect(response).to_not have_content 'Search Bar' + end + + it 'does not include any navigation menu items that are not configured' do + expect(current_exhibit.main_navigations).to receive_messages(displayable: []) + render + expect(response).to have_css('.navbar-nav li', count: 1) + expect(response).to have_css('.navbar-nav li', text: 'Home') + end +end diff --git a/tmp/blacklight-spotlight/spec/views/shared/_footer.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/shared/_footer.html.erb_spec.rb new file mode 100644 index 0000000..2d83d7b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/shared/_footer.html.erb_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +module Spotlight + describe 'shared/_footer', type: :view do + let(:current_exhibit) { double(title: 'Some title', subtitle: 'Subtitle') } + + before do + allow(view).to receive_messages(current_exhibit: current_exhibit) + end + + it 'includes analytics reporting' do + stub_template 'shared/_analytics.html.erb' => 'analytics' + render + expect(rendered).to have_content 'analytics' + end + + it 'displays social media links' do + render + expect(rendered).to have_selector('footer .social-share-button a.social-share-button-twitter[title="Twitter"]') + expect(rendered).to have_selector('footer .social-share-button a.social-share-button-facebook[title="Facebook"]') + expect(rendered).to have_selector('footer .social-share-button a.social-share-button-google_plus[title="Google+"]') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/shared/_header_navbar.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/shared/_header_navbar.html.erb_spec.rb new file mode 100644 index 0000000..0f875b1 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/shared/_header_navbar.html.erb_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +module Spotlight + describe 'shared/_header_navbar', type: :view do + before do + stub_template '_user_util_links.html.erb' => 'links' + end + + it 'has nav links' do + render + expect(rendered).to have_selector '#user-util-collapse', text: 'links' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/shared/_masthead.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/shared/_masthead.html.erb_spec.rb new file mode 100644 index 0000000..c77575f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/shared/_masthead.html.erb_spec.rb @@ -0,0 +1,83 @@ +require 'spec_helper' + +describe 'shared/_masthead', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit, subtitle: 'Some exhibit') } + let(:masthead) { nil } + + before do + stub_template 'shared/_exhibit_navbar.html.erb' => 'navbar' + + allow(view).to receive_messages(current_exhibit: exhibit, + current_masthead: masthead, + resource_masthead?: false) + end + + it 'has the site title and subtitle' do + render + + expect(rendered).to have_selector '.h1', text: exhibit.title + expect(rendered).to have_selector 'small', text: exhibit.subtitle + end + + context 'for an exhibit without a subtitle' do + before do + exhibit.update(subtitle: nil) + end + + it 'does not include the subtitle' do + render + + expect(rendered).not_to have_selector 'small' + end + end + + it 'includes a navbar' do + render + + expect(rendered).to have_content 'navbar' + end + + context 'with an exhibit masthead' do + let(:masthead) { FactoryGirl.create(:masthead) } + + before do + exhibit.masthead = masthead + exhibit.save + end + + it 'adds a class to the masthead' do + render + + expect(rendered).to have_selector '.masthead.image-masthead' + end + + it 'has a background image' do + render + + expect(rendered).to have_selector '.background-container' + expect(rendered).to have_selector '.background-container-gradient' + + expect(rendered).to match(/background-image: url\('#{masthead.image.cropped.url}'\)/) + end + end + + context 'with a resource masthead' do + let(:masthead) { FactoryGirl.create(:masthead) } + + before do + allow(view).to receive_messages(resource_masthead?: true) + end + + it 'adds a class to the masthead' do + render + + expect(rendered).to have_selector '.masthead.resource-masthead' + end + + it 'puts the navbar before the title' do + render + + expect(rendered.index('navbar')).to be < rendered.index(exhibit.title) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb new file mode 100644 index 0000000..1b6e72c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_empty.html.erb_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'spotlight/about_pages/_empty.html.erb', type: :view do + let(:can?) { false } + before do + allow(view).to receive_messages(can?: can?) + render + end + describe 'when a user cannot edit' do + it 'does not render an ordered list of steps' do + expect(rendered).to_not have_css('ol') + end + end + describe 'when a user can edit' do + let(:can?) { true } + it 'renders a heading' do + expect(rendered).to have_css('h2', text: 'Building this about page') + end + it 'renders an ordered list of steps' do + expect(rendered).to have_css('ol li', count: 6) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb new file mode 100644 index 0000000..2d07f28 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe 'spotlight/about_pages/_sidebar.html.erb', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:page1) { FactoryGirl.create(:about_page, title: 'One', weight: 4, exhibit: exhibit) } + let!(:page2) { FactoryGirl.create(:about_page, exhibit: exhibit, title: 'Two', published: false) } + let!(:page3) { FactoryGirl.create(:about_page, exhibit: exhibit, title: 'Three', weight: 3) } + + before do + allow(view).to receive_messages(current_exhibit: exhibit) + allow(view).to receive_messages(exhibit_about_page_path: '/about/9') + end + + it 'renders a list of pages' do + render + # Checking that they are sorted accoding to weight + expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(1) a', text: 'Three' + expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(2) a', text: 'One' + expect(rendered).not_to have_link 'Two' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/index.html.erb_spec.rb new file mode 100644 index 0000000..3192882 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/about_pages/index.html.erb_spec.rb @@ -0,0 +1,71 @@ +require 'spec_helper' + +describe 'spotlight/about_pages/index.html.erb', type: :view do + let(:pages) do + [ + stub_model(Spotlight::AboutPage, + title: 'Title1', + content: '[]', + exhibit: exhibit + ), + stub_model(Spotlight::AboutPage, + title: 'Title2', + content: '[]', + exhibit: exhibit + ) + ] + end + let(:contacts) do + [ + stub_model(Spotlight::Contact, + exhibit: exhibit + ), + stub_model(Spotlight::Contact, + exhibit: exhibit + ) + ] + end + let(:exhibit) { stub_model(Spotlight::Exhibit) } + before do + allow(view).to receive(:disable_save_pages_button?).and_return(false) + allow(view).to receive(:page_collection_name).and_return(:about_pages) + allow(view).to receive(:update_all_exhibit_about_pages_path).and_return('/exhibit/about/update_all') + allow(view).to receive(:exhibit_contacts_path).and_return('/exhibit/1/contacts') + allow(view).to receive(:nestable_data_attributes).and_return('data-behavior="nestable"') + allow(exhibit).to receive_messages(contacts: contacts) + assign(:page, Spotlight::AboutPage.new) + assign(:exhibit, exhibit) + allow(view).to receive(:current_exhibit).and_return(exhibit) + view.lookup_context.prefixes << 'spotlight/pages' + allow(view).to receive(:can?).and_return(true) + end + + it 'renders a list of pages and contacts' do + assign(:pages, pages) + allow(exhibit).to receive(:about_pages).and_return pages + render + expect(rendered).to have_selector '.panel-title', text: 'Title1' + expect(rendered).to have_selector '.panel-title', text: 'Title2' + + expect(rendered).to have_selector '.contacts_admin ol.dd-list li[data-id]', count: 2 + expect(rendered).to have_selector '.contacts_admin ol.dd-list li input[data-property=weight]', count: 2 + expect(rendered).to have_selector '.contacts_admin ol.dd-list li input#exhibit_contacts_attributes_0_id' + expect(rendered).to have_selector '.contacts_admin ol.dd-list li input#exhibit_contacts_attributes_1_id' + end + + describe 'Save button' do + it 'is disabled the when the pages are blank' do + allow(view).to receive(:disable_save_pages_button?).and_return(true) + assign(:pages, []) + render + expect(rendered).to have_selector 'button[disabled]', text: 'Save changes' + end + it 'does not be disabled the when there are pages' do + allow(view).to receive(:disable_save_pages_button?).and_return(false) + assign(:pages, [{}]) + render + expect(rendered).not_to have_selector 'button[disabled]', text: 'Save changes' + expect(rendered).to have_selector 'button', text: 'Save changes' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/browse/_search.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/browse/_search.html.erb_spec.rb new file mode 100644 index 0000000..fb7e75c --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/browse/_search.html.erb_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe 'spotlight/browse/search', type: :view do + let(:search) { FactoryGirl.create(:search) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + before :each do + allow(search).to receive_messages(documents: double(size: 15)) + allow(search).to receive_message_chain(:thumbnail, :image, thumb: '/some/image') + end + + before :each do + assign :exhibit, exhibit + end + + it 'displays the image' do + render partial: 'spotlight/browse/search', locals: { search: search } + expect(response).to have_selector 'a img' + end + + it 'has a heading' do + render partial: 'spotlight/browse/search', locals: { search: search } + expect(response).to have_link search.title, href: spotlight.exhibit_browse_path(exhibit, search) + end + + it 'displays the item count' do + render partial: 'spotlight/browse/search', locals: { search: search } + expect(response).to have_selector 'small', text: /#{search.documents.size} items/i + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb new file mode 100644 index 0000000..d6fbb0f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'spotlight/browse/_sort_and_per_page', type: :view do + let :blacklight_config do + Blacklight::Configuration.new + end + + before do + allow(view).to receive_messages(blacklight_config: blacklight_config) + end + + it 'renders the pagination, sort, per page and view type controls' do + stub_template '_paginate_compact.html.erb' => "paginate_compact\n" + stub_template '_sort_widget.html.erb' => "sort_widget\n" + stub_template '_per_page_widget.html.erb' => "per_page_widget\n" + stub_template '_view_type_group.html.erb' => "view_type_group\n" + render + expect(rendered).to_not have_content 'paginate_compact' + expect(rendered).to have_content 'sort_widget' + expect(rendered).to have_content 'per_page_widget' + expect(rendered).to have_content 'view_type_group' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/browse/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/browse/index.html.erb_spec.rb new file mode 100644 index 0000000..2c9e96b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/browse/index.html.erb_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe 'spotlight/browse/index', type: :view do + let(:search) { FactoryGirl.create(:search) } + let(:another_search) { FactoryGirl.create(:search) } + + it 'has a title' do + render + expect(response).to have_selector 'h1', text: 'Browse Exhibit' + end + + it 'renders the collection of searches' do + assign :searches, [search, another_search] + stub_template 'spotlight/browse/_search.html.erb' => '<%= search.id %>
    ' + render + expect(response).to have_content "#{search.id} #{another_search.id}" + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/browse/show.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/browse/show.html.erb_spec.rb new file mode 100644 index 0000000..c2167eb --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/browse/show.html.erb_spec.rb @@ -0,0 +1,58 @@ +require 'spec_helper' + +describe 'spotlight/browse/show', type: :view do + let(:search) { FactoryGirl.create(:published_search) } + let(:exhibit) { FactoryGirl.create(:exhibit) } + + before :each do + allow(view).to receive_messages(resource_masthead?: false) + allow(view).to receive_messages(blacklight_config: Blacklight::Configuration.new) + view.blacklight_config.view.gallery = true + allow(search).to receive_messages(documents: double(size: 15)) + allow(view).to receive_messages(render_document_index_with_view: '') + stub_template('_results_pagination.html.erb' => '') + stub_template('_sort_and_per_page.html.erb' => 'Sort and Per Page actions') + end + + before :each do + assign :exhibit, exhibit + assign :search, search + assign :document_list, [] + end + + it 'has a heading and item count when there is no current search masthead' do + render + expect(response).to have_selector 'h1', text: search.title + expect(response).to have_selector '.item-count', text: "#{search.documents.size} items" + end + + it 'does not have the heading and item count when there is a current search masthead' do + allow(view).to receive_messages(resource_masthead?: true) + render + expect(response).to_not have_selector 'h1', text: search.title + expect(response).to_not have_selector '.item-count', text: "#{search.documents.size} items" + end + + it 'has an edit button' do + allow(view).to receive_messages(can?: true) + render + expect(response).to have_selector '.btn', text: 'Edit' + end + + it 'displays the long description' do + allow(search).to receive_messages(long_description: 'Long description') + render + expect(response).to have_selector 'p', text: search.long_description + end + + it 'displays search results actions' do + render + expect(response).to have_content 'Sort and Per Page actions' + end + + it 'displays the search results' do + expect(view).to receive(:render_document_index_with_view).with(:gallery, anything, anything).and_return 'Gallery View' + render + expect(response).to include 'Gallery View' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb new file mode 100644 index 0000000..4e3b44b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/_edit_default.html.erb_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe 'spotlight/catalog/_edit_default.html.erb', type: :view do + let(:blacklight_config) do + Blacklight::Configuration.new do |config| + config.index.title_field = :title_field + end + end + + let(:document) { stub_model(::SolrDocument) } + + let(:exhibit) { stub_model(Spotlight::Exhibit) } + + before do + allow(exhibit).to receive_messages(blacklight_config: blacklight_config) + + allow(view).to receive(:uploaded_field_label) do |config| + "#{config.field_name} label" + end + allow(view).to receive_messages(exhibit_tags_path: 'autocomplete-path.json') + allow(view).to receive_messages(blacklight_config: blacklight_config) + allow(view).to receive_messages(current_exhibit: exhibit) + allow(view).to receive_messages(document: document) + allow(view).to receive(:can?).and_return(true) + end + + it 'has a edit tag form' do + render + expect(rendered).to have_field 'solr_document_exhibit_tag_list' + expect(rendered).to have_selector '#solr_document_exhibit_tag_list[@data-autocomplete_url="autocomplete-path.json"]' + end + it 'does not have special metadata editing fields for non-uploaded resources' do + render + expect(rendered).to_not have_field 'title_field label' + expect(rendered).to_not have_field 'spotlight_upload_description_tesim label' + expect(rendered).to_not have_field 'spotlight_upload_attribution_tesim label' + expect(rendered).to_not have_field 'spotlight_upload_date_tesim label' + end + it 'has special metadata fields for an uploaded resource' do + allow(document).to receive_messages(uploaded_resource?: true) + render + expect(rendered).to have_field 'title_field label' + expect(rendered).to have_field 'spotlight_upload_description_tesim label' + expect(rendered).to have_field 'spotlight_upload_attribution_tesim label' + expect(rendered).to have_field 'spotlight_upload_date_tesim label' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/catalog/admin.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/admin.html.erb_spec.rb new file mode 100644 index 0000000..7d5bdfc --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/admin.html.erb_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/catalog/admin.html.erb', type: :view do + let(:exhibit) { stub_model(Spotlight::Exhibit) } + before do + allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config) + allow(view).to receive(:spotlight_page_path_for).and_return(nil) + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(view).to receive(:new_exhibit_resource_path).and_return('') + allow(view).to receive(:reindex_all_exhibit_resources_path).and_return('') + allow(view).to receive(:monitor_exhibit_resources_path).and_return('') + assign(:exhibit, exhibit) + assign(:response, []) + stub_template '_search_header.html.erb' => 'header' + stub_template '_zero_results.html.erb' => 'nuffin' + stub_template '_results_pagination.html.erb' => '0' + allow(view).to receive(:can?).and_return(true) + end + it 'renders the sidebar' do + render + expect(rendered).to have_link 'Browse' + end + + it "renders the 'add items' link if any repository sources are configured" do + allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(['a']) + render + expect(rendered).to have_link 'Add items' + end + + it "does not render the 'add items' link if no repository sources are configured" do + allow(Spotlight::Engine.config).to receive(:resource_partials).and_return([]) + render + expect(rendered).not_to have_link 'Add items' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/catalog/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/edit.html.erb_spec.rb new file mode 100644 index 0000000..db7ea7b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/catalog/edit.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'spotlight/catalog/edit.html.erb', type: :view do + let(:blacklight_config) { Blacklight::Configuration.new } + + let(:document) { stub_model(::SolrDocument) } + + before do + allow(view).to receive_messages(blacklight_config: blacklight_config) + allow(view).to receive_messages(current_exhibit: stub_model(Spotlight::Exhibit)) + assign(:document, document) + allow(view).to receive(:document_counter) + allow(view).to receive(:render_document_partials) + render + end + + it 'renders a document div' do + expect(rendered).to have_css '#document.document' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/contacts/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/contacts/edit.html.erb_spec.rb new file mode 100644 index 0000000..4d643a8 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/contacts/edit.html.erb_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe 'spotlight/contacts/edit.html.erb' do + let(:exhibit) { FactoryGirl.create(:exhibit) } + + let(:contact) do + Spotlight::Contact.new exhibit: exhibit + end + + before do + allow(view).to receive(:exhibit_contacts_path).and_return('/exhibit/1/contacts') + allow(view).to receive(:exhibit_about_pages_path).and_return('/exhibit/admin/about') + assign(:contact, contact) + assign(:exhibit, exhibit) + allow(view).to receive(:current_exhibit).and_return(exhibit) + end + + it 'has a photo field' do + render + expect(rendered).to have_content 'Photo' + end + + it 'has a cropbox' do + render + expect(rendered).to have_selector '#contact_avatar_cropbox' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb new file mode 100644 index 0000000..0a2faa7 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe 'spotlight/dashboards/_analytics.html.erb', type: :view do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + let(:ga_data) { OpenStruct.new(pageviews: 1, users: 2, sessions: 3) } + let(:page_data) { [OpenStruct.new(pageTitle: 'title', pagePath: '/path', pageviews: '123')] } + before do + allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path') + allow(current_exhibit).to receive(:analytics).and_return(ga_data) + allow(current_exhibit).to receive(:page_analytics).and_return(page_data) + end + + it 'uses the exhibit_root_path for analytics' do + expect(current_exhibit).to receive(:analytics).with(1.month, '/some/path').and_return(ga_data) + expect(current_exhibit).to receive(:page_analytics).with(1.month, '/some/path').and_return(page_data) + render + end + + it 'has header' do + render + expect(rendered).to have_content 'User Activity Over the Past Month' + end + + it 'has metric labels' do + render + expect(rendered).to have_content 'visitors' + expect(rendered).to have_content 'unique visits' + expect(rendered).to have_content 'page views' + end + + it 'has metric values' do + render + expect(rendered).to have_selector '.value.pageviews', text: 1 + expect(rendered).to have_selector '.value.users', text: 2 + expect(rendered).to have_selector '.value.sessions', text: 3 + end + + it 'has page-level data' do + render + expect(rendered).to have_content 'Most popular pages' + expect(rendered).to have_link 'title', href: '/path' + expect(rendered).to have_content '123' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb new file mode 100644 index 0000000..63a06f3 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +describe 'spotlight/dashboards/analytics.html.erb', type: :view do + let(:current_exhibit) { FactoryGirl.create(:exhibit) } + + before do + allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path') + end + + it 'has a header' do + render + expect(rendered).to have_selector '.page-header', text: 'Curation' + expect(rendered).to have_selector '.page-header small', text: 'Analytics' + end + + it 'has directions for configuring analytics' do + render + expect(rendered).to have_link 'configure an analytics provider' + end + + context 'with a configured analytics integration' do + before do + allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true) + stub_template 'spotlight/dashboards/_analytics.html.erb' => 'Analytics data' + end + + it 'has analytics data' do + render + + expect(rendered).to have_content 'Analytics data' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb new file mode 100644 index 0000000..c27ce18 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe 'spotlight/exhibits/_exhibit_card_front.html.erb', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:p) { 'spotlight/exhibits/exhibit_card_front' } + + context 'for an exhibit without a thumbnail' do + before do + exhibit.update(thumbnail_id: nil) + end + + it 'has a placeholder thumbnail' do + render p, exhibit: exhibit + + expect(rendered).to have_selector 'img.default-thumbnail' + end + end + + it 'has a thumbnail' do + render p, exhibit: exhibit + + expect(rendered).to have_selector 'img' + end + + it 'has a title' do + render p, exhibit: exhibit + + expect(rendered).to have_selector '.card-title', text: exhibit.title + end + + context 'for an unpublished exhibit' do + before do + exhibit.update(published: false) + end + + it 'has an unpublished banner' do + render p, exhibit: exhibit + + expect(rendered).to have_selector '.label.unpublished', text: 'Unpublished' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/edit.html.erb_spec.rb new file mode 100644 index 0000000..0cc6bdc --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/edit.html.erb_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/exhibits/edit', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + assign(:exhibit, exhibit) + allow(view).to receive_messages(current_exhibit: exhibit) + allow(view).to receive_messages(can?: true) + allow(view).to receive_messages(import_exhibit_path: '/') + allow(view).to receive_messages(get_exhibit_path: '/') + allow(view).to receive_messages(exhibit_filters_path: '/') + end + + it 'renders the edit page form' do + render + + expect(rendered).to have_selector "form[action=\"#{spotlight.exhibit_path(exhibit)}\"]" + expect(rendered).to have_selector '.callout.callout-danger.row' + expect(rendered).to have_content 'This action is irreversible' + expect(rendered).to have_link 'Export data', href: spotlight.import_exhibit_path(exhibit) + expect(rendered).to have_button 'Import data' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/index.html.erb_spec.rb new file mode 100644 index 0000000..4cad365 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/exhibits/index.html.erb_spec.rb @@ -0,0 +1,142 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/exhibits/index', type: :view do + let(:exhibits) { Spotlight::Exhibit.none } + let(:published_exhibits) { exhibits.published.page(1) } + + let(:ability) { ::Ability.new(user) } + let(:user) { Spotlight::Engine.user_class.new } + + before do + assign(:exhibits, exhibits) + assign(:published_exhibits, published_exhibits) + allow(view).to receive_messages(exhibits_path: '/', exhibit_path: '/', current_user: user, current_ability: ability) + end + + context 'with published exhibits' do + let!(:exhibit_a) { FactoryGirl.create(:exhibit, published: true) } + let!(:exhibit_b) { FactoryGirl.create(:exhibit, published: true) } + let!(:exhibit_c) { FactoryGirl.create(:exhibit, published: false) } + + let(:exhibits) { Spotlight::Exhibit.all } + + it 'renders the published exhibits' do + render + + expect(rendered).to have_selector('.exhibit-card', count: 2) + expect(rendered).to have_text exhibit_a.title + expect(rendered).to have_text exhibit_b.title + expect(rendered).not_to have_text exhibit_c.title + + expect(rendered).not_to include 'Private exhibits' + end + + it 'does not include the tab bar' do + render + + expect(rendered).not_to have_selector '.nav-tabs' + end + + it 'does not include tags controls' do + render + + expect(rendered).not_to have_selector '.tags' + end + + it 'does not include pagination controls' do + render + + expect(rendered).not_to have_selector '.pager' + end + + context 'with tagged exhibits' do + before do + exhibit_a.tag_list = ['a'] + exhibit_b.tag_list = ['a'] + exhibit_c.tag_list = ['b'] + + exhibit_a.save + exhibit_b.save + exhibit_c.save + end + + it 'filters by tags' do + render + + expect(rendered).to have_link 'All' + expect(rendered).to have_link 'a' + expect(rendered).to have_link 'b' + end + end + + context 'with paginated exhibits' do + let(:published_exhibits) { exhibits.published.page(1).per(1) } + + it 'renders pagination controls' do + render + + expect(rendered).to have_selector '.pager' + expect(rendered).to have_link 'Next', href: '/?page=2' + end + end + + context 'with an exhibit admin' do + let(:user) { FactoryGirl.create(:exhibit_admin) } + + it 'includes a tab with the exhibits curated by the user' do + render + + expect(rendered).to have_selector '.nav-tabs' + expect(rendered).to have_link 'Your exhibits' + expect(rendered).to have_text user.exhibits.first.title + end + + it 'does not include a tab for unpublished exhibits' do + render + + expect(rendered).to have_selector '.nav-tabs' + expect(rendered).not_to have_link 'Unpublished exhibits' + end + end + + context 'with a site admin' do + let(:user) { FactoryGirl.create(:site_admin) } + + before do + allow(view).to receive_messages(can?: true, new_exhibit_path: '/exhibits/new') + end + + it 'includes a tab with unpublished exhibits' do + render + + expect(rendered).to have_selector '.nav-tabs' + expect(rendered).to have_link 'Unpublished exhibits' + expect(rendered).to have_text exhibit_c.title + end + end + end + + context 'with an authorized user' do + let(:user) { FactoryGirl.build(:site_admin) } + + before do + allow(view).to receive_messages(can?: true, + new_exhibit_path: '/exhibits/new') + end + + it 'gives instructions for getting started' do + render + + expect(rendered).to include 'Welcome to Spotlight!' + expect(rendered).to have_link 'Create Exhibit', href: '/exhibits/new' + end + + it 'has a sidebar with a button to create a new exhibit' do + render + + expect(rendered).to have_selector 'aside .btn', text: 'Create a new exhibit' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb new file mode 100644 index 0000000..8f43f66 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe 'spotlight/feature_pages/_empty.html.erb', type: :view do + let(:can?) { false } + before do + allow(view).to receive_messages(can?: can?) + render + end + describe 'when a user cannot edit' do + it 'does not render an ordered list of steps' do + expect(rendered).to_not have_css('ol') + end + end + describe 'when a user can edit' do + let(:can?) { true } + + it 'renders a heading' do + expect(rendered).to have_css('h2', text: 'Building this feature page') + end + + it 'renders an ordered list of steps' do + expect(rendered).to have_css('ol li', count: 6) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb new file mode 100644 index 0000000..7defec7 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe 'spotlight/feature_pages/_sidebar.html.erb', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:parent1) { FactoryGirl.create(:feature_page, exhibit: exhibit, title: 'Parent Page') } + let!(:parent2) { FactoryGirl.create(:feature_page, exhibit: exhibit, title: 'Two') } + let!(:child1) { FactoryGirl.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Three', weight: 4) } + let!(:child2) { FactoryGirl.create(:feature_page, exhibit: exhibit, parent_page: parent2, title: 'Four') } + let!(:child3) { FactoryGirl.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Five', weight: 2) } + let!(:child4) { FactoryGirl.create(:feature_page, exhibit: exhibit, parent_page: parent1, title: 'Six', published: false) } + let!(:child5) { FactoryGirl.create(:feature_page, exhibit: FactoryGirl.create(:exhibit), title: 'Seven') } + + before do + allow(view).to receive_messages(current_exhibit: parent1.exhibit) + allow(view).to receive_messages(feature_page_path: '/feature/9') + assign(:exhibit, parent1.exhibit) + end + + it 'renders a list of pages for a parent page' do + assign(:page, parent1) + allow(view).to receive(:current_page?).and_return(true, false) + render + # Checking that they are sorted accoding to weight + expect(rendered).to have_selector 'li.active h4', text: 'Parent Page' + expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(1) a', text: 'Five' + expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(2) a', text: 'Three' + expect(rendered).to have_selector 'li h4 a', text: 'Two' # a different parent page + expect(rendered).to have_link 'Four' # different parent + expect(rendered).not_to have_link 'Six' # not published + expect(rendered).not_to have_link 'Seven' # different exhibit + end + + it 'renders a list of pages from a child page' do + assign(:page, child1) + render + # Checking that they are sorted accoding to weight + expect(rendered).to have_selector 'h4', text: 'Parent Page' + expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(1) a', text: 'Five' + expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(2) a', text: 'Three' + expect(rendered).to have_content 'Two' # not selected page + expect(rendered).to have_link 'Four' # different parent + expect(rendered).not_to have_link 'Six' # not published + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb new file mode 100644 index 0000000..7b986da --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_empty.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe 'spotlight/home_pages/_empty.html.erb', type: :view do + describe 'resource providers' do + before do + allow(view).to receive_messages(current_exhibit: FactoryGirl.create(:exhibit), + can?: true, + edit_exhibit_path: '/', + edit_exhibit_appearance_path: '/', + exhibit_roles_path: '/', + admin_exhibit_catalog_index_path: '/', + edit_exhibit_metadata_configuration_path: '/', + edit_exhibit_search_configuration_path: '/') + end + it 'has a list item with a link to add items when there are resource partials configured' do + allow(Spotlight::Engine.config).to receive_messages(resource_partials: [true]) + render + expect(rendered).to have_css('li a', text: 'Curation > Items') + end + it 'does not have a list item with a link to add items when there are no resource partials configured' do + allow(Spotlight::Engine.config).to receive_messages(resource_partials: []) + render + expect(rendered).to_not have_css('li a', text: 'Curation > Items') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb new file mode 100644 index 0000000..aceb336 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/home_pages/_sidebar.html.erb_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe 'spotlight/home_pages/_sidebar.html.erb', type: :view do + before do + stub_template 'catalog/_search_sidebar.html.erb' => 'Search Sidebar' + end + + it 'has a search sidebar' do + render + expect(rendered).to match 'Search Sidebar' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb new file mode 100644 index 0000000..5810e8a --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/metadata_configurations/_metadata_field', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:p) { 'spotlight/metadata_configurations/metadata_field.html.erb' } + before do + assign(:exhibit, exhibit) + assign(:blacklight_configuration, exhibit.blacklight_configuration) + allow(view).to receive_messages( + current_exhibit: exhibit, + blacklight_config: exhibit.blacklight_configuration, + available_view_fields: { some_view_type: 1, another_view_type: 2 }, + select_deselect_button: nil) + end + + let(:facet_field) { Blacklight::Configuration::FacetField.new } + let(:builder) { ActionView::Helpers::FormBuilder.new 'z', nil, view, {} } + + it 'uses the index_field_label helper to render the label' do + allow(view).to receive(:index_field_label).with(nil, 'some_key').and_return 'Some label' + render partial: p, locals: { key: 'some_key', config: facet_field, f: builder } + expect(rendered).to have_selector '.field-label', text: 'Some label' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb new file mode 100644 index 0000000..ece21db --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/metadata_configurations/edit', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + assign(:exhibit, exhibit) + assign(:blacklight_configuration, exhibit.blacklight_configuration) + allow(view).to receive_messages( + current_exhibit: exhibit, + blacklight_config: exhibit.blacklight_configuration, + available_view_fields: { some_view_type: 1, another_view_type: 2 }, + select_deselect_button: nil) + end + + it 'has columns for the available view types' do + render + expect(rendered).to have_selector 'th', text: 'Some View Type' + expect(rendered).to have_selector 'th', text: 'Another View Type' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/pages/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/pages/edit.html.erb_spec.rb new file mode 100644 index 0000000..84da2e1 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/pages/edit.html.erb_spec.rb @@ -0,0 +1,68 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/pages/edit', type: :view do + let(:exhibit) { stub_model(Exhibit) } + let(:page) { stub_model(FeaturePage, exhibit: exhibit) } + before do + assign(:page, page) + allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: []) + end + + it 'renders the edit page form' do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_page_path(page.exhibit, page), 'post' do + assert_select 'input#feature_page_title[name=?]', 'feature_page[title]' + assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]' + end + end + + describe 'locks' do + let(:lock) { Lock.create! on: page } + + before do + page.lock = lock + end + + it 'renders a lock' do + render + + expect(rendered).to have_css '.alert-lock' + end + + it 'does not render an old lock' do + lock.created_at -= 1.day + + render + + expect(rendered).not_to have_css '.alert-lock' + end + + it 'does not render a lock held by the current session' do + lock.current_session! + + render + + expect(rendered).not_to have_css '.alert-lock' + end + + it 'attaches a data-lock attribute to the cancel button' do + lock.current_session! + + render + + expect(rendered).to have_link 'Cancel' + expect(rendered).to have_css "a[data-lock=\"#{url_for([spotlight, page.exhibit, lock])}\"]", text: 'Cancel' + end + + it "does not have data-lock attribute if the lock doesn't belong to this session" do + render + + expect(rendered).to have_link 'Cancel' + expect(rendered).not_to have_css 'a[data-lock]', text: 'Cancel' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/pages/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/pages/index.html.erb_spec.rb new file mode 100644 index 0000000..f036cae --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/pages/index.html.erb_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe 'spotlight/pages/index.html.erb', type: :view do + let(:pages) do + [ + stub_model(Spotlight::FeaturePage, + title: 'Title1', + content: '[]', + exhibit: exhibit + ), + stub_model(Spotlight::FeaturePage, + title: 'Title2', + content: '[]', + exhibit: exhibit + ) + ] + end + let(:exhibit) { stub_model(Spotlight::Exhibit) } + before do + allow(view).to receive(:page_collection_name).and_return(:feature_pages) + allow(view).to receive(:update_all_exhibit_feature_pages_path).and_return('/exhibit/features/update_all') + assign(:page, Spotlight::FeaturePage.new) + assign(:exhibit, exhibit) + allow(view).to receive(:current_exhibit).and_return(exhibit) + end + + it 'renders a list of pages' do + assign(:pages, pages) + allow(exhibit).to receive(:feature_pages).and_return pages + render + expect(rendered).to have_selector '.panel-title', text: 'Title1' + expect(rendered).to have_selector '.panel-title', text: 'Title2' + end + + describe 'Without pages' do + it 'does not disable the update button' do + assign(:pages, []) + render + expect(rendered).not_to have_selector 'button[disabled]', text: 'Save changes' + expect(rendered).to have_selector 'button', text: 'Save changes' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/pages/new.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/pages/new.html.erb_spec.rb new file mode 100644 index 0000000..934432b --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/pages/new.html.erb_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/pages/new', type: :view do + let(:exhibit) { stub_model(Exhibit) } + before do + assign(:page, stub_model(FeaturePage, exhibit: exhibit).as_new_record) + allow(view).to receive_messages(default_thumbnail_jcrop_options: {}, available_index_fields: [], available_view_fields: []) + end + + it 'renders new page form' do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select 'form[action=?][method=?]', spotlight.exhibit_feature_pages_path(exhibit), 'post' do + assert_select 'input#feature_page_title[name=?]', 'feature_page[title]' + assert_select 'textarea#feature_page_content[name=?]', 'feature_page[content]' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/pages/show.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/pages/show.html.erb_spec.rb new file mode 100644 index 0000000..7058b5d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/pages/show.html.erb_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/pages/show', type: :view do + let(:exhibit) { stub_model(Exhibit) } + let(:page) do + stub_model(FeaturePage, + exhibit: exhibit, + title: 'Title', + content: '[]' + ) + end + before(:each) do + allow(view).to receive(:current_exhibit).and_return(exhibit) + assign(:page, page) + stub_template 'spotlight/pages/_sidebar.html.erb' => 'Sidebar' + end + + it 'renders the title as a heading' do + render + expect(rendered).to have_css('.page-title', text: page.title) + end + it 'does not render an empty heading' do + allow(page).to receive_messages(title: nil) + render + expect(rendered).to_not have_css('.page-title') + end + + it 'injects the page title into the html title' do + expect(view).to receive(:set_html_page_title) + render + end + + it 'does not include the page title' do + allow(page).to receive_messages(should_display_title?: false) + expect(view).to_not receive(:set_html_page_title) + render + end + + it 'renders attributes in

    ' do + render + expect(rendered).to match(/Title/) + end + + it 'renders the sidebar' do + page.display_sidebar = true + render + expect(rendered).to match('Sidebar') + end + + it 'does not render the sidebar if the page has it disabled' do + allow(page).to receive_messages(display_sidebar?: false) + render + expect(rendered).to_not match('Sidebar') + end + + it 'renders an empty partial if the page has no content' do + allow(page).to receive_messages(content?: false) + stub_template 'spotlight/pages/_empty.html.erb' => 'Empty message' + render + expect(rendered).to have_content('Empty message') + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb new file mode 100644 index 0000000..eda5685 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/resources/_external_resources_form.html.erb_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'spotlight/resources/_external_resources_form.html.erb', type: :view do + let(:blacklight_config) { Blacklight::Configuration.new } + let(:exhibit) { stub_model(Spotlight::Exhibit) } + + before do + allow(view).to receive_messages(blacklight_config: blacklight_config) + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(view).to receive_messages(current_page?: true) + end + + it 'renders the configured partials' do + allow(Spotlight::Engine.config).to receive(:external_resources_partials).and_return(%w(a b c)) + stub_template '_a.html.erb' => 'a_template' + stub_template '_b.html.erb' => 'b_template' + stub_template '_c.html.erb' => 'c_template' + render + expect(rendered).to have_content 'a_template' + expect(rendered).to have_content 'b_template' + expect(rendered).to have_content 'c_template' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/resources/new.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/resources/new.html.erb_spec.rb new file mode 100644 index 0000000..ba14e03 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/resources/new.html.erb_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe 'spotlight/resources/new.html.erb', type: :view do + let(:blacklight_config) { Blacklight::Configuration.new } + let(:exhibit) { stub_model(Spotlight::Exhibit) } + + before do + allow(view).to receive_messages(blacklight_config: blacklight_config) + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(view).to receive_messages(current_page?: true) + stub_template 'spotlight/shared/_curation_sidebar.html.erb' => '' + end + + it 'renders the configured partials' do + allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(%w(a b c)) + stub_template '_a.html.erb' => 'a_template' + stub_template '_b.html.erb' => 'b_template' + stub_template '_c.html.erb' => 'c_template' + render + expect(rendered).to have_content 'a_template' + expect(rendered).to have_content 'b_template' + expect(rendered).to have_content 'c_template' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/roles/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/roles/index.html.erb_spec.rb new file mode 100644 index 0000000..12354c2 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/roles/index.html.erb_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/roles/index', type: :view do + let(:user) { stub_model(Spotlight::Engine.user_class, email: 'jane@example.com') } + + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:admin_role) { FactoryGirl.create(:role, role: 'admin', user: user, resource: exhibit) } + let(:roles) { [admin_role] } + + before do + assign(:exhibit, exhibit) + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(exhibit).to receive(:roles).and_return roles + end + + it 'renders the index page form' do + render + + assert_select 'form[action=?][method=?]', spotlight.update_all_exhibit_roles_path(exhibit), 'post' do + assert_select 'tr[data-show-for=?]', admin_role.id + assert_select 'tr[data-edit-for=?]', admin_role.id, 2 + assert_select "input[type='submit'][data-behavior='destroy-user'][data-target=?]", admin_role.id + assert_select "input[type='hidden'][data-destroy-for=?]", admin_role.id + assert_select "a[data-behavior='cancel-edit']" + assert_select "input[type='submit'][value='Save changes']" + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb new file mode 100644 index 0000000..369dfae --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_facet_metadata.html.erb_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/search_configurations/_facet_metadata', type: :view do + before do + render partial: 'spotlight/search_configurations/facet_metadata', locals: { metadata: metadata } + end + + context 'with a facet without any documents' do + let(:metadata) { { document_count: 0 } } + + it 'shows there are no documents' do + expect(rendered).to have_content '0 items' + end + end + + context 'with a facet with a small number of values' do + let(:metadata) { { document_count: 1, value_count: 3, terms: %w(a b c) } } + + it 'shows the number of unique values' do + expect(rendered).to have_content '1 item' + expect(rendered).to have_content '3 unique values' + expect(rendered).to have_selector '.btn-with-tooltip' + end + end + + context 'with a facet with a large number of values' do + let(:metadata) { { document_count: 1, value_count: 21, terms: %w() } } + + it 'shows there are many unique values' do + expect(rendered).to have_content '20+ unique values' + end + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb new file mode 100644 index 0000000..2ef76a6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/search_configurations/_search_fields', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + assign(:exhibit, exhibit) + assign(:blacklight_configuration, exhibit.blacklight_configuration) + allow(view).to receive_messages(current_exhibit: exhibit) + + exhibit.blacklight_config.add_search_field 'some_hidden_field', include_in_simple_select: false + end + + let(:f) do + form_helper = nil + controller.view_context.bootstrap_form_for(exhibit.blacklight_configuration, url: '/update') do |f| + form_helper = f + end + + form_helper + end + + it 'has a fieldset with an appropriate legend' do + render partial: 'spotlight/search_configurations/search_fields', locals: { f: f } + + expect(rendered).to have_selector 'fieldset legend', text: 'Field-based search' + end + + it 'has a checkbox to enable or disable fielded search' do + render partial: 'spotlight/search_configurations/search_fields', locals: { f: f } + + expect(rendered).to have_selector 'input[data-behavior="enable-feature"][data-target="#search_fields"]' + end + + it 'has a read-only "everything" search option' do + render partial: 'spotlight/search_configurations/search_fields', locals: { f: f } + expect(rendered).to have_selector "input[name='blacklight_configuration[search_fields][all_fields][enabled]'][data-readonly='true']" + end + + it 'has search options for available search fields' do + render partial: 'spotlight/search_configurations/search_fields', locals: { f: f } + + expect(rendered).to have_selector "input[name='blacklight_configuration[search_fields][title][enabled]']" + expect(rendered).to have_selector "input[name='blacklight_configuration[search_fields][author][enabled]']" + end + + it 'excludes search options that do not show up in the search dropdown' do + render partial: 'spotlight/search_configurations/search_fields', locals: { f: f } + + expect(rendered).not_to have_selector "input[name='blacklight_configuration[search_fields][autocomplete][enabled]']" + expect(rendered).not_to have_selector "input[name='blacklight_configuration[search_fields][some_hidden_field][enabled]']" + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb new file mode 100644 index 0000000..740d4db --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/search_configurations/_sort.html.erb_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/search_configurations/_sort', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + before do + assign(:exhibit, exhibit) + assign(:blacklight_configuration, exhibit.blacklight_configuration) + allow(view).to receive_messages( + current_exhibit: exhibit, + translate_sort_fields: '') + end + + let(:f) do + form_helper = nil + controller.view_context.bootstrap_form_for(exhibit.blacklight_configuration, url: '/update') do |f| + form_helper = f + end + + form_helper + end + + it 'has a disabled relevance sort option' do + render partial: 'spotlight/search_configurations/sort', locals: { f: f } + expect(rendered).to have_selector "input[name='blacklight_configuration[sort_fields][relevance][enable]'][disabled='disabled']" + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/searches/_search.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/searches/_search.html.erb_spec.rb new file mode 100644 index 0000000..0defbd9 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/searches/_search.html.erb_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'spotlight/searches/_search.html.erb', type: :view do + let(:search) do + FactoryGirl.build_stubbed(:search, exhibit: FactoryGirl.create(:exhibit), + id: 99, + title: 'Title1', + query_params: { + f: { + genre_ssim: ['xyz'] + } + }) + end + + before do + allow(view).to receive(:edit_search_path).and_return('/edit') + allow(view).to receive(:search_path).and_return('/search') + allow(search).to receive_message_chain(:thumbnail, :image, thumb: '/some/image') + allow(search).to receive(:count).and_return(15) + allow(search).to receive(:params).and_return({}) + + form_for(search, url: '/update') do |f| + @f = f + end + end + + it 'renders a list of pages' do + # rubocop:disable RSpec/InstanceVariable + render partial: 'spotlight/searches/search', locals: { f: @f } + # rubocop:enable RSpec/InstanceVariable + expect(rendered).to have_selector "li[data-id='99']" + expect(rendered).to have_selector '.panel-heading .main .title', text: 'Title1' + expect(rendered).to have_selector 'img[src="/some/image"]' + expect(rendered).to have_selector 'input[type=hidden][data-property=weight]' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/searches/edit.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/searches/edit.html.erb_spec.rb new file mode 100644 index 0000000..543f2ab --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/searches/edit.html.erb_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'spotlight/searches/edit.html.erb', type: :view do + let(:blacklight_config) do + Blacklight::Configuration.new do |config| + config.add_facet_field :some_field + end + end + let(:exhibit) { FactoryGirl.create(:exhibit) } + let(:search) do + stub_model(Spotlight::Search, exhibit: exhibit, + id: 99, title: 'Title1', query_params: { f: { 'some_field' => ['xyz'] } }) + end + before do + allow(view).to receive(:search_action_path).and_return('/search') + allow(view).to receive(:exhibit_search_path).and_return('/search') + allow(view).to receive(:exhibit_searches_path).and_return('/searches') + allow(view).to receive(:blacklight_config).and_return(blacklight_config) + assign(:exhibit, exhibit) + assign(:search, search) + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(view).to receive_messages(default_masthead_jcrop_options: {}, default_thumbnail_jcrop_options: {}) + end + + it 'renders a form w/ the appropriate autocomplete data attribute' do + render + expect(rendered).to have_selector 'form[data-autocomplete-exhibit-catalog-index-path]' + end + + it 'renders active search constraints' do + render + expect(rendered).to have_selector '.appliedFilter .constraint-value' + expect(rendered).to have_selector '.appliedFilter .constraint-value .filterName', text: 'Some Field' + expect(rendered).to have_selector '.appliedFilter .constraint-value .filterValue', text: 'xyz' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/searches/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/searches/index.html.erb_spec.rb new file mode 100644 index 0000000..76f0f3f --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/searches/index.html.erb_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +describe 'spotlight/searches/index.html.erb', type: :view do + let(:exhibit) { stub_model(Spotlight::Exhibit) } + + before do + allow(view).to receive_messages(update_all_exhibit_searches_path: '/') + allow(view).to receive(:current_exhibit).and_return(exhibit) + assign(:exhibit, exhibit) + end + + describe 'Without searches' do + it 'disables the update button' do + assign(:searches, []) + expect(exhibit).to receive(:searchable?).and_return(true) + render + expect(rendered).to have_content 'You can save search results' + end + end + + describe 'When the exhibit is not searchable' do + it 'displays a warning' do + assign(:searches, []) + expect(exhibit).to receive(:searchable?).and_return(false) + render + expect(rendered).to have_css '.alert-warning', text: %(\ +This exhibit is not currently searchable. To perform searches that can \ +be saved as additional browse categories, \ +temporarily turn on the Display search box option in the Options section \ +of the Configuration > Search page.) + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb new file mode 100644 index 0000000..e1bba0a --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_browse_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/browse_block.html.erb' } + let(:page) { double('Page', display_sidebar?: true) } + let(:search) { FactoryGirl.create(:search) } + let(:block) do + assign(:page, page) + SirTrevorRails::Blocks::BrowseBlock.new({ type: 'block', data: {} }, page) + end + + before do + allow(block).to receive(:searches).and_return([search]) + end + + it 'links to the search' do + render partial: p, locals: { browse_block: block } + expect(rendered).to have_link search.title, href: spotlight.exhibit_browse_path(search.exhibit, search) + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb new file mode 100644 index 0000000..93627d6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_iframe_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/iframe_block.html.erb' } + let(:block) do + OpenStruct.new + end + + it 'renders iframes' do + block.code = "" + render partial: p, locals: { iframe_block: block } + expect(rendered).to have_selector 'iframe[src="xyz"]' + end + + it 'strips extra markup from the code' do + block.code = '' + render partial: p, locals: { iframe_block: block } + expect(rendered).to be_blank + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb new file mode 100644 index 0000000..582f7b0 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_rule_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/rule_block.html.erb' } + + it 'has an hr' do + render partial: p + expect(rendered).to have_selector 'hr' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb new file mode 100644 index 0000000..3b9bfb1 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_solr_documents_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_block.html.erb' } + let(:page) { double('Page') } + let(:block) do + SirTrevorRails::Blocks::SolrDocumentsBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page) + end + let(:doc) { blacklight_config.document_model.new(id: 1) } + let(:blacklight_config) do + Blacklight::Configuration.new do |config| + config.view.embed.partials = %w(a b c) + config.view.embed.locals = { a: 1 } + end + end + + before do + allow(block).to receive(:each_document).and_yield({}, doc) + allow(block).to receive(:documents?).and_return(true) + end + + before do + allow(view).to receive(:blacklight_config).and_return(blacklight_config) + allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb', document_link_params: {}) + end + + context 'with a multi-image object' do + let(:block_options) { { thumbnail_image_url: 'http://example.com' } } + before do + allow(block).to receive(:each_document).and_yield(block_options, doc) + end + + it 'uses the provided thumbnail url' do + render partial: p, locals: { solr_documents_block: block } + expect(rendered).to have_selector 'img[src="http://example.com"]' + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb new file mode 100644 index 0000000..ea6fd6d --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_carousel_block.html.erb' } + let(:block) do + SirTrevorRails::Blocks::SolrDocumentsCarouselBlock.new({ type: 'block', data: {} }, page) + end + + before do + allow(block).to receive(:each_document).and_return([ + [{}, SolrDocument.new(id: 1)], + [{}, SolrDocument.new(id: 2)], + [{}, SolrDocument.new(id: 3)] + ]) + allow(block).to receive_messages(documents?: true) + allow(view).to receive_messages(solr_documents_carousel_block: block) + allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb') + end + + it 'has a slideshow block' do + render partial: p, locals: { item_carousel_block: block } + expect(rendered).to have_selector '.carousel-block' + expect(rendered).to have_selector '.carousel-control.left' + expect(rendered).to have_selector '.carousel-control.right' + expect(rendered).to have_selector '.item', text: 'thumb', count: 3 + expect(rendered).to have_selector '.carousel-indicators' + expect(rendered).to have_selector '.carousel-indicators li', count: 3 + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb new file mode 100644 index 0000000..6ea94e6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_embed_block.html.erb' } + let(:page) { double('Page') } + let(:block) do + SirTrevorRails::Blocks::SolrDocumentsEmbedBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page) + end + let(:doc) { blacklight_config.document_model.new(id: 1) } + let(:blacklight_config) do + Blacklight::Configuration.new do |config| + config.view.embed.partials = %w(a b c) + config.view.embed.locals = { a: 1 } + end + end + + before do + allow(block).to receive(:each_document).and_yield({}, doc) + allow(block).to receive(:documents?).and_return(true) + end + + before do + allow(view).to receive(:blacklight_config).and_return(blacklight_config) + allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb') + end + + it 'has a slideshow block' do + expect(view).to receive(:render_document_partials).with(doc, %w(a b c), hash_including(a: 1, block: block)).and_return('OSD') + render partial: p, locals: { solr_documents_embed_block: block } + expect(rendered).to have_selector 'h3', text: 'Some title' + expect(rendered).to have_content 'Some text' + expect(rendered).to have_selector '.box', text: 'OSD' + expect(rendered).to have_selector '.items-col.pull-left' + expect(rendered).to have_selector '.text-col' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb new file mode 100644 index 0000000..e6050bd --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_features_block.html.erb' } + let(:block) do + SirTrevorRails::Blocks::SolrDocumentsFeaturesBlock.new({ type: 'block', data: { 'show-primary-caption' => true, 'primary-caption-field' => 'x' } }, page) + end + + before do + doc1 = [{}, SolrDocument.new(id: 1, x: 'a' * 100)] + doc2 = [{}, SolrDocument.new(id: 2)] + doc3 = [{}, SolrDocument.new(id: 3)] + allow(block).to receive(:each_document).and_return([doc1, doc2, doc3]) + allow(block).to receive_messages(documents?: true) + allow(view).to receive_messages(solr_documents_features_block: block) + allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb', blacklight_config: Blacklight::Configuration.new) + end + + it 'has a slideshow block' do + render partial: p, locals: { item_carousel_block: block } + expect(rendered).to have_selector '.item-features' + expect(rendered).to have_selector '.item', text: 'thumb', count: 3 + expect(rendered).to have_selector '.carousel-indicators' + expect(rendered).to have_selector '.carousel-indicators li', count: 3 + end + + it 'truncates long titles' do + render partial: p, locals: { item_carousel_block: block } + expect(rendered).to have_selector '.item-features' + expect(rendered).to have_selector '.item', text: 'thumb', count: 3 + expect(rendered).to have_selector '.carousel-indicators' + expect(rendered).to have_selector '.carousel-indicators li', count: 3 + expect(rendered).to have_selector '.carousel-indicators li', text: 'a' * 92 + '...' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb new file mode 100644 index 0000000..c4703b6 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe 'spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb', type: :view do + let(:p) { 'spotlight/sir_trevor/blocks/solr_documents_grid_block.html.erb' } + let(:page) { double('Page') } + let(:block) do + SirTrevorRails::Blocks::SolrDocumentsGridBlock.new({ type: 'block', data: { title: 'Some title', text: 'Some text', 'text-align' => 'right' } }, page) + end + + before do + allow(block).to receive(:each_document).and_return([ + [{}, SolrDocument.new(id: 1)], + [{}, SolrDocument.new(id: 2)], + [{}, SolrDocument.new(id: 3)] + ]) + end + + before do + allow(view).to receive_messages(has_thumbnail?: true, render_thumbnail_tag: 'thumb') + end + + it 'has a slideshow block' do + render partial: p, locals: { solr_documents_grid_block: block } + expect(rendered).to have_selector 'h3', text: 'Some title' + expect(rendered).to have_content 'Some text' + expect(rendered).to have_selector '.box', text: 'thumb', count: 3 + expect(rendered).to have_selector '.items-col.pull-left' + expect(rendered).to have_selector '.text-col' + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb new file mode 100644 index 0000000..f58aec3 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/sites/edit_exhibits.html.erb_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +module Spotlight + describe 'spotlight/sites/edit_exhibits', type: :view do + let!(:exhibit_a) { FactoryGirl.create(:exhibit) } + let!(:exhibit_b) { FactoryGirl.create(:exhibit) } + + before do + assign(:site, Spotlight::Site.instance) + allow(view).to receive_messages(exhibit_path: nil) + end + + it 'has columns for the exhibit data' do + render + + expect(rendered).to have_selector 'th', text: 'Title' + expect(rendered).to have_selector 'th', text: 'Published?' + expect(rendered).to have_selector 'th', text: 'Requested by' + expect(rendered).to have_selector 'th', text: 'Created at' + expect(rendered).to have_selector 'th', text: 'Updated at' + end + + it 'has draggable rows for each exhibit' do + render + + expect(rendered).to have_selector 'tr .dd-handle', count: 2 + end + end +end diff --git a/tmp/blacklight-spotlight/spec/views/spotlight/tags/index.html.erb_spec.rb b/tmp/blacklight-spotlight/spec/views/spotlight/tags/index.html.erb_spec.rb new file mode 100644 index 0000000..26aa623 --- /dev/null +++ b/tmp/blacklight-spotlight/spec/views/spotlight/tags/index.html.erb_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'spotlight/tags/index.html.erb', type: :view do + let(:exhibit) { FactoryGirl.create(:exhibit) } + let!(:tag1) { FactoryGirl.create(:tagging, tagger: exhibit) } + let!(:tag2) { FactoryGirl.create(:tagging, tagger: exhibit) } + before do + assign(:exhibit, exhibit) + assign(:tags, exhibit.owned_tags) + allow(view).to receive_messages(exhibit_tag_path: '/tags') + allow(view).to receive(:current_exhibit).and_return(exhibit) + allow(view).to receive(:url_to_tag_facet, &:first) + end + describe 'Tags' do + it 'is displayed' do + render + [tag1.tag.name, tag2.tag.name].each do |name| + expect(rendered).to have_css('td', text: name) + end + end + end +end diff --git a/tmp/blacklight-spotlight/template.rb b/tmp/blacklight-spotlight/template.rb new file mode 100644 index 0000000..f1db0aa --- /dev/null +++ b/tmp/blacklight-spotlight/template.rb @@ -0,0 +1,28 @@ +DEFAULT_BLACKLIGHT_OPTIONS = '--devise --jettywrapper'.freeze +DEFAULT_SPOTLIGHT_OPTIONS = '-f --openseadragon --mailer_default_url_host=localhost:3000'.freeze +blacklight_options = ENV.fetch('BLACKLIGHT_INSTALL_OPTIONS', DEFAULT_BLACKLIGHT_OPTIONS) +spotlight_options = ENV.fetch('SPOTLIGHT_INSTALL_OPTIONS', DEFAULT_SPOTLIGHT_OPTIONS) + +# Add gem dependencies to the application +gem 'blacklight', '~> 5.16' +gem 'blacklight-spotlight', ENV['SPOTLIGHT_GEM'] ? { path: ENV['SPOTLIGHT_GEM'] } : { github: 'sul-dlss/spotlight' } + +Bundler.with_clean_env do + run 'bundle install' +end + +# run the blacklight install generator +generate 'blacklight:install', blacklight_options + +# run the spotlight installer +generate 'spotlight:install', spotlight_options +rake 'spotlight:install:migrations' + +# create an initial administrator (if we are running interactively..) +if !options['quiet'] && yes?('Would you like to create an initial administrator?') + rake 'db:migrate' # we only need to run the migrations if we are creating an admin user + rake 'spotlight:initialize' +end + +# and configure jetty with a useful configuration +rake 'jetty:configure_solr' if blacklight_options =~ /jettywrapper/ diff --git a/tmp/blacklight-spotlight/vendor/assets/javascripts/bootstrap-tagsinput.js b/tmp/blacklight-spotlight/vendor/assets/javascripts/bootstrap-tagsinput.js new file mode 100644 index 0000000..4702af1 --- /dev/null +++ b/tmp/blacklight-spotlight/vendor/assets/javascripts/bootstrap-tagsinput.js @@ -0,0 +1,530 @@ +/* From https://github.com/TimSchlechter/bootstrap-tagsinput/blob/2661784c2c281d3a69b93897ff3f39e4ffa5cbd1/dist/bootstrap-tagsinput.js */ + +/* The MIT License (MIT) + +Copyright (c) 2013 Tim Schlechter + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* Retrieved 12 February 2014 */ + +(function ($) { + "use strict"; + + var defaultOptions = { + tagClass: function(item) { + return 'label label-info'; + }, + itemValue: function(item) { + return item ? item.toString() : item; + }, + itemText: function(item) { + return this.itemValue(item); + }, + freeInput: true, + maxTags: undefined, + confirmKeys: [13], + onTagExists: function(item, $tag) { + $tag.hide().fadeIn(); + } + }; + + /** + * Constructor function + */ + function TagsInput(element, options) { + this.itemsArray = []; + + this.$element = $(element); + this.$element.hide(); + + this.isSelect = (element.tagName === 'SELECT'); + this.multiple = (this.isSelect && element.hasAttribute('multiple')); + this.objectItems = options && options.itemValue; + this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : ''; + this.inputSize = Math.max(1, this.placeholderText.length); + + this.$container = $('

    '); + this.$input = $('').appendTo(this.$container); + + this.$element.after(this.$container); + + this.build(options); + } + + TagsInput.prototype = { + constructor: TagsInput, + + /** + * Adds the given item as a new tag. Pass true to dontPushVal to prevent + * updating the elements val() + */ + add: function(item, dontPushVal) { + var self = this; + + if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags) + return; + + // Ignore falsey values, except false + if (item !== false && !item) + return; + + // Throw an error when trying to add an object while the itemValue option was not set + if (typeof item === "object" && !self.objectItems) + throw("Can't add objects when itemValue option is not set"); + + // Ignore strings only containg whitespace + if (item.toString().match(/^\s*$/)) + return; + + // If SELECT but not multiple, remove current tag + if (self.isSelect && !self.multiple && self.itemsArray.length > 0) + self.remove(self.itemsArray[0]); + + if (typeof item === "string" && this.$element[0].tagName === 'INPUT') { + var items = item.split(','); + if (items.length > 1) { + for (var i = 0; i < items.length; i++) { + this.add(items[i], true); + } + + if (!dontPushVal) + self.pushVal(); + return; + } + } + + var itemValue = self.options.itemValue(item), + itemText = self.options.itemText(item), + tagClass = self.options.tagClass(item); + + // Ignore items allready added + var existing = $.grep(self.itemsArray, function(item) { return self.options.itemValue(item) === itemValue; } )[0]; + if (existing) { + // Invoke onTagExists + if (self.options.onTagExists) { + var $existingTag = $(".tag", self.$container).filter(function() { return $(this).data("item") === existing; }); + self.options.onTagExists(item, $existingTag); + } + return; + } + + // register item in internal array and map + self.itemsArray.push(item); + + // add a tag element + var $tag = $('' + htmlEncode(itemText) + ''); + $tag.data('item', item); + self.findInputWrapper().before($tag); + $tag.after(' '); + + // add