Git Product home page Git Product logo

blacklight_date_range_limit's Introduction

BlacklightDateRangeLimit: date range limit for Blacklight applications

Screen shot

Description

The BlacklightDateRangeLimit plugin provides a limit for date fields, that lets the user enter range limits with a text box or a date-picker. This plugin was cloned from blacklight_range_limit plugin.

Requirements

A Solr date field. Depending on your data, it may or may not be advantageous to use a tdate (trie with non-zero precision) type field.

Installation

The 6.x version of blacklight_date_range_limit work with blacklight 6.x -- we now synchronize the major version number between blacklight and blacklight_date_range_limit.

Add

gem "blacklight_date_range_limit"

to your Gemfile. Run "bundle install".

Then run

rails generate blacklight_date_range_limit:install

This will install some asset references in your application.js and application.css.

Configuration

You have at least one solr field you want to display as a range limit, that's why you've installed this plugin. In your CatalogController, the facet configuration should look like:

config.add_facet_field 'pub_date', label: 'Publication Year', date_range: true 

You should now get range limit display.

Javascript dependencies

The selectable histograms/barcharts are done with Javascript, using Flot. Flot requires JQuery, as well as support for the HTML5 canvas element. In IE previous to IE9, canvas element support can be added with excanvas. For the slider, bootstrap-slider is used (bootstrap-slider is actually third party, not officially bootstrap). Flot and bootstrap-slider are both directly included in blacklight_range_limit in vendor.

A require 'blacklight_date_range_limit' in a Rails asset pipeline manifest file will automatically include all of these things. The blacklight_date_range_limit adds just this line to your app/assets/application.js.

There is a copy of flot vendored in this gem for this purpose. jquery is obtained from the jquery-rails gem, which this gem depends on.

Note this means a copy of jquery, from the jquery-rails gem, will be included in your assets by blacklight_date_range_limit even if you didn't include it yourself explicitly in application.js. Flot will also be included.

If you don't want any of this gem's JS, you can simply remove the require 'blacklight_date_range_limit' line from your application.js, and hack something else together yourself.

blacklight_date_range_limit's People

Contributors

afred avatar atz avatar cappadona avatar cbeer avatar cjcolvar avatar jchristo4 avatar jcoyne avatar jkeck avatar jrochkind avatar mejackreed avatar mohideen avatar peetucket avatar tampakis avatar

Watchers

 avatar  avatar

Forkers

cfitz umd-lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.