samvera-labs / dog_biscuits

Models, vocabularies and behaviours for Hyrax applications.
Other
11 stars 4 forks source link

DogBiscuits

Code: Build Status Coverage Status Maintainability Inline docs

Docs: Documentation Contribution Guidelines Apache 2.0 License

Models, vocabularies and behaviours for Hyrax applications :dog: :cookie:

Product Owner

Julie Allinson geekscruff

Installation

For use within Hyrax 2 applications.

Add this line to your application's Gemfile:

gem 'dog_biscuits', :git => 'git://github.com/samvera-labs/dog_biscuits.git'

And then execute:

$ bundle install

Run the generator

$ rails generate dog_biscuits:install

The installer adds some new field templates in views/hyrax/records/edit_fields:

Removing these will default back to standard text field display

Generate Works

Run the work generator

$ rails generate dog_biscuits:work WorkName

If the work is not supported, the generator will give you a list of supported models.

Add the --skipmodel flag leave the model and indexer unchanged (eg. when you have custom properties in the model and/or custom indexing).

Configure Works

Edit config/initializers/dog_biscuits.rb to configure the properties used by your work - see the comments in that file for details.

Dates

Date slider in search results

Add blacklight_range_limit by setting the following flag in config/initializers/dog_biscuits.rb:

config.date_range = true

Then run:

$ rails generate dog_biscuits:dates

Date picker in edit form

Control date fields with a date picker by setting the following flag in config/initializers/dog_biscuits.rb:

config.date_picker = true

Change which fields are controlled by the picker by changing config.date_properties in config/initializers/dog_biscuits.rb. The default is all date fields.

Then run:

$ rails generate dog_biscuits:dates

Documentation

Further documentation is available in the wiki.