Models, vocabularies and behaviours for Hyrax applications 🐶 🍪
Julie Allinson geekscruff
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
:
- abstract - show as a paragraph
- funder - use the crossref fundref autosuggest service
- note - show as a paragraph
- part_of - for JournalArticle use the crossref journals autosuggest service
- publication_status - use a file_based authority (from config/authorities)
- refereeed - show radio buttons for Yes and No
- resource_type_general - use a file_based authority (from config/authorities)
Removing these will default back to standard text field display
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).
Edit config/initializers/dog_biscuits.rb
to configure the properties used by your work - see the comments in that file for details.
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
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
Further documentation is available in the wiki.