{"id":19341844,"url":"https://github.com/samvera/hydra-editor","last_synced_at":"2026-03-27T04:12:25.350Z","repository":{"id":8041363,"uuid":"9451614","full_name":"samvera/hydra-editor","owner":"samvera","description":"A basic editor for samvera objects.","archived":false,"fork":false,"pushed_at":"2025-02-03T17:32:59.000Z","size":490,"stargazers_count":10,"open_issues_count":11,"forks_count":12,"subscribers_count":59,"default_branch":"main","last_synced_at":"2025-05-26T04:15:01.288Z","etag":null,"topics":["core-components","samvera-community"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samvera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-04-15T15:18:49.000Z","updated_at":"2025-02-03T17:07:10.000Z","dependencies_parsed_at":"2024-06-19T00:19:33.503Z","dependency_job_id":"ed82fd82-ec64-4c54-9191-23001edfcf68","html_url":"https://github.com/samvera/hydra-editor","commit_stats":{"total_commits":281,"total_committers":31,"mean_commits":9.064516129032258,"dds":0.6298932384341638,"last_synced_commit":"7c9afe557c529b158b8fa00265a5c0a9fd136ea3"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/samvera/hydra-editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvera%2Fhydra-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvera%2Fhydra-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvera%2Fhydra-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvera%2Fhydra-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samvera","download_url":"https://codeload.github.com/samvera/hydra-editor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samvera%2Fhydra-editor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357770,"owners_count":23298484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["core-components","samvera-community"],"created_at":"2024-11-10T03:32:44.814Z","updated_at":"2025-12-18T00:19:18.706Z","avatar_url":"https://github.com/samvera.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HydraEditor\n\nCode:\n[![Gem Version](https://badge.fury.io/rb/hydra-editor.png)](http://badge.fury.io/rb/hydra-editor)\n[![Build Status](https://circleci.com/gh/samvera/hydra-editor.svg?style=svg)](https://circleci.com/gh/samvera/hydra-editor)\n[![Coverage Status](https://coveralls.io/repos/github/samvera/hydra-editor/badge.svg?branch=main)](https://coveralls.io/github/samvera/hydra-editor?branch=main)\n\nDocs:\n[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)\n[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE.txt)\n\nCommunity Support: [![Samvera Community Slack](https://img.shields.io/badge/samvera-slack-blueviolet)](http://slack.samvera.org/)\n\n# What is hydra-editor?\n\nA basic metadata editor for Rails applications based on hydra-head.\n\n## Product Owner \u0026 Maintenance\n\n`hydra-editor` was a Core Component of the Samvera Community. Given a decline in available labor required for maintenance, this project no longer has a dedicated Product Owner. The documentation for what this means can be found [here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).\n\n### Product Owner\n\n**Vacant**\n\n_Until a Product Owner has been identified, we ask that you please direct all requests for support, bug reports, and general questions to the [`#dev` Channel on the Samvera Slack](https://samvera.slack.com/app_redirect?channel=dev)._\n\n# Help\n\nThe Samvera community is here to help. Please see our [support guide](./SUPPORT.md).\n\n# Getting Started\n\nTo use add to your gemfile:\n\n```ruby\ngem 'hydra-editor'\n```\n\nThen run:\n```\nbundle install\n```\n\nNext generate the bootstrap form layouts:\n```\nrails generate simple_form:install --bootstrap\n```\n\nAnd to config/routes.rb add:\n\n```ruby\n  mount HydraEditor::Engine =\u003e '/'\n```\n\n(Note: You do not have to mount the engine if you do not intend to use the engine's default routes.)\n\nIn your initialization set ```HydraEditor.models```\n\n```ruby\n# config/initializers/hydra_editor.rb\nHydraEditor.models = [\"RecordedAudio\", \"PdfModel\"]\n```\n\nYou can customize the names of your fields/models by adding to your translation file:\n\n```yaml\n# config/locales/en.yml\nen:\n  hydra_editor:\n    form:\n      model_label:\n        PdfModel: \"PDF\"\n        RecordedAudio: \"audio\"\n\n  simple_form:\n    labels:\n      image:\n        dateCreated: \"Date Created\"\n        sub_location: \"Holding Sub-location\"\n```\n\nCreate a form object for each of your models.\n\n```ruby\n# app/forms/recorded_audio_form.rb\nclass RecordedAudioForm\n  include HydraEditor::Form\n  self.model_class = RecordedAudio\n  self.terms = [] # Terms to be edited\n  self.required_fields = [] # Required fields\nend\n```\n\nAdd the javascript by adding this line to your app/assets/javascript/application.js:\n\n```javascript\n//= require hydra-editor/hydra-editor\n```\n\nAdd the stylesheets by adding this line to your app/assets/stylesheets/application.css:\n\n```css\n *= require hydra-editor/hydra-editor\n```\n\n(Note: The Javascript includes require Blacklight and must be put after that.)\n\n## Updating to 4.0.0\n\n* [SimpleForm](https://github.com/plataformatec/simple_form) is supported from release 3.2.0 onwards\n* `#to_model` now returns `self` (previously it was the value of `@model`):\n  ```ruby\n    class MyForm\n      include HydraEditor::Form\n      self.model_class = MyModel\n      self.terms = [:title, :creator]\n      # [...]\n    end\n    # [...]\n    some_work = MyModel.new(title: ['Black holes: The Reith Lectures.'], creator: 'S.W. Hawking')\n    some_form = MyForm.new(some_work)\n    # [...]\n    some_form.to_model\n    # =\u003e #\u003cMyForm:0x00007fd5b2fd1468 @attributes={\"id\"=\u003enil, \"title\"=\u003e[\"Black holes: The Reith Lectures.\"], \"creator\"=\u003e\"S.W. Hawking\"}, @model=#\u003cMyModel id: nil, title: [\"Black holes: The Reith Lectures.\"], creator: \"S.W. Hawking\"\u003e\u003e\n  ```\n* When a form field for a single value is empty, it now returns a `nil` value (as opposed to an empty `String`):\n  ```ruby\n    class MyForm\n      include HydraEditor::Form\n      self.model_class = MyModel\n      self.terms = [:title, :creator]\n      # [...]\n    end\n\n    # [...]\n    values = MyForm.model_attributes(\n      title: ['On the distribution of values of angles determined by coplanar points.'],\n      creator: ''\n    )\n    values['creator']\n    # =\u003e nil\n  ```\n\n## Other customizations\n\nBy default `hydra-editor` provides a RecordsController with :new, :create, :edit, and :update actions implemented in the included RecordsControllerBehavior module, and a RecordsHelper module with methods implemented in RecordsHelperBehavior.  If you are mounting the engine and using its routes, you can override the controller behaviors by creating your own RecordsController:\n\n```ruby\nclass RecordsController \u003c ApplicationController\n  include RecordsControllerBehavior\n\n  # You custom code\nend\n```\n\nIf you are not mounting the engine or using its default routes, you can include RecordsControllerBehavior in your own controller and add the appropriate routes to your app's config/routes.rb.\n\n## Releasing\n\n1. `bundle install`\n2. Increase the version number in `lib/hydra_editor/version.rb`\n3. Increase the same version number in `.github_changelog_generator`\n4. Update `CHANGELOG.md` by running this command:\n\n  ```\n  github_changelog_generator --user samvera --project hydra-editor --token YOUR_GITHUB_TOKEN_HERE\n  ```\n\n5. Commit these changes to the main branch\n\n6. Run `rake release`\n\n# Acknowledgments\n\nThis software has been developed by and is brought to you by the Samvera community.  Learn more at the\n[Samvera website](http://samvera.org/).\n\n![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1\u0026modificationDate=1498550535816\u0026api=v2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamvera%2Fhydra-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamvera%2Fhydra-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamvera%2Fhydra-editor/lists"}