hyrax 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/.travis.yml +1 -0
  4. data/README.md +7 -1
  5. data/app/actors/hyrax/actors/file_set_actor.rb +22 -32
  6. data/app/assets/javascripts/hyrax/editor.es6 +1 -1
  7. data/app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee +8 -7
  8. data/app/assets/javascripts/hyrax/select_work_type.es6 +4 -0
  9. data/app/assets/stylesheets/hyrax/_dashboard.scss +10 -0
  10. data/app/assets/stylesheets/hyrax/_forms.scss +8 -0
  11. data/app/controllers/concerns/hyrax/controller.rb +2 -5
  12. data/app/controllers/hyrax/admin/workflow_roles_controller.rb +1 -1
  13. data/app/controllers/hyrax/workflow_actions_controller.rb +14 -4
  14. data/app/forms/hyrax/forms/permission_template_form.rb +38 -1
  15. data/app/forms/hyrax/forms/work_form.rb +16 -31
  16. data/app/forms/hyrax/forms/workflow_responsibility_form.rb +5 -2
  17. data/app/helpers/hyrax/hyrax_helper_behavior.rb +1 -1
  18. data/app/jobs/attach_files_to_work_job.rb +5 -15
  19. data/app/models/concerns/hyrax/naming.rb +1 -0
  20. data/app/models/hyrax/permission_template_access.rb +10 -10
  21. data/app/models/sipity/workflow.rb +30 -0
  22. data/app/presenters/hyrax/admin/workflow_role_presenter.rb +17 -31
  23. data/app/presenters/hyrax/admin/workflow_roles_presenter.rb +43 -0
  24. data/app/presenters/hyrax/collection_options_presenter.rb +30 -0
  25. data/app/presenters/hyrax/workflow_presenter.rb +2 -2
  26. data/app/search_builders/hyrax/active_works_search_builder.rb +13 -0
  27. data/app/search_builders/hyrax/my_works_search_builder.rb +9 -12
  28. data/app/search_builders/hyrax/works_search_builder.rb +7 -0
  29. data/app/services/hyrax/actor_factory.rb +1 -1
  30. data/app/services/hyrax/admin_set_create_service.rb +24 -2
  31. data/app/services/hyrax/form_metadata_service.rb +13 -0
  32. data/app/services/hyrax/persist_directly_contained_output_file_service.rb +3 -3
  33. data/app/services/hyrax/workflow/abstract_notification.rb +3 -1
  34. data/app/services/hyrax/workflow/activate_object.rb +1 -1
  35. data/app/services/hyrax/workflow/deactivate_object.rb +1 -1
  36. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +1 -1
  37. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +13 -0
  38. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +11 -0
  39. data/app/services/hyrax/workflow/workflow_schema.rb +1 -1
  40. data/app/views/catalog/_facet_limit.html.erb +5 -3
  41. data/app/views/hyrax/base/_form_visibility_component.html.erb +1 -0
  42. data/app/views/hyrax/homepage/index.html.erb +11 -4
  43. data/app/views/hyrax/my/_facet_limit.html.erb +11 -8
  44. data/app/views/hyrax/my/_index_partials/_default_group.html.erb +2 -1
  45. data/app/views/hyrax/my/_index_partials/_list_works.html.erb +1 -0
  46. data/config/locales/hyrax.en.yml +5 -0
  47. data/config/locales/hyrax.es.yml +8 -3
  48. data/config/locales/hyrax.zh.yml +730 -0
  49. data/hyrax.gemspec +5 -8
  50. data/lib/generators/hyrax/install_generator.rb +2 -3
  51. data/lib/generators/hyrax/models_generator.rb +1 -1
  52. data/lib/generators/hyrax/templates/catalog_controller.rb +37 -37
  53. data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +43 -0
  54. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +43 -0
  55. data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +55 -0
  56. data/lib/generators/hyrax/templates/mediated_deposit_workflow.json.erb +4 -1
  57. data/lib/generators/hyrax/work/templates/controller.rb.erb +1 -1
  58. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +12 -5
  59. data/lib/generators/hyrax/work/templates/locale.zh.yml.erb +10 -0
  60. data/lib/generators/hyrax/work/work_generator.rb +29 -13
  61. data/lib/hyrax/collections_migration.rb +18 -0
  62. data/lib/hyrax/engine.rb +1 -2
  63. data/lib/hyrax/errors.rb +11 -0
  64. data/lib/hyrax/rails/routes.rb +1 -1
  65. data/lib/hyrax/search_state.rb +1 -9
  66. data/lib/hyrax/specs/shared_specs.rb +1 -0
  67. data/lib/hyrax/specs/shared_specs/workflow_method.rb +46 -0
  68. data/lib/hyrax/version.rb +1 -1
  69. data/lib/tasks/migrate.rake +5 -0
  70. data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +3 -3
  71. data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +1 -1
  72. data/spec/controllers/hyrax/workflow_actions_controller_spec.rb +18 -0
  73. data/spec/features/browse_catalog_spec.rb +1 -1
  74. data/spec/features/workflow_roles_spec.rb +1 -1
  75. data/spec/forms/hyrax/forms/work_form_spec.rb +19 -0
  76. data/spec/forms/hyrax/forms/workflow_responsibility_form_spec.rb +15 -7
  77. data/spec/helpers/blacklight_helper_spec.rb +1 -1
  78. data/spec/helpers/hyrax_helper_spec.rb +1 -1
  79. data/spec/jobs/attach_files_to_work_job_spec.rb +8 -14
  80. data/spec/lib/hyrax/collections_migration_spec.rb +34 -0
  81. data/spec/lib/hyrax/search_state_spec.rb +2 -2
  82. data/spec/models/hyrax/permission_template_spec.rb +1 -1
  83. data/spec/models/sipity/workflow_role_spec.rb +1 -0
  84. data/spec/presenters/hyrax/admin/workflow_role_presenter_spec.rb +8 -10
  85. data/spec/presenters/hyrax/admin/workflow_roles_presenter_spec.rb +18 -0
  86. data/spec/presenters/hyrax/collection_options_presenter_spec.rb +14 -0
  87. data/spec/search_builders/hyrax/active_works_search_builder_spec.rb +53 -0
  88. data/spec/search_builders/hyrax/works_search_builder_spec.rb +24 -0
  89. data/spec/services/hyrax/admin_set_create_service_spec.rb +64 -35
  90. data/spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb +11 -7
  91. data/spec/services/hyrax/workflow/activate_object_spec.rb +4 -0
  92. data/spec/services/hyrax/workflow/changes_required_notification_spec.rb +2 -2
  93. data/spec/services/hyrax/workflow/deactivate_object_spec.rb +4 -0
  94. data/spec/services/hyrax/workflow/deposited_notification_spec.rb +2 -2
  95. data/spec/services/hyrax/workflow/grant_edit_to_depositor_spec.rb +4 -0
  96. data/spec/services/hyrax/workflow/pending_review_notification_spec.rb +2 -2
  97. data/spec/services/hyrax/workflow/revoke_edit_from_depositor_spec.rb +35 -0
  98. data/spec/support/controller_level_helpers.rb +1 -1
  99. data/spec/test_app_templates/lib/generators/test_app_generator.rb +10 -2
  100. data/spec/views/catalog/_index_list_default.html.erb_spec.rb +1 -2
  101. data/spec/views/hyrax/admin/workflow_roles/index.html.erb_spec.rb +2 -2
  102. data/spec/views/hyrax/homepage/index.html.erb_spec.rb +22 -2
  103. data/spec/views/shared/select_work_type_modal.html.erb_spec.rb +3 -3
  104. data/template.rb +1 -1
  105. metadata +34 -45
  106. data/lib/hyrax/single_use_error.rb +0 -3
  107. data/lib/hyrax/workflow_authorization_exception.rb +0 -4
data/hyrax.gemspec CHANGED
@@ -19,19 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.license = 'Apache2'
20
20
 
21
21
  spec.add_dependency 'hydra-head', '>= 10.4.0'
22
- spec.add_dependency 'hydra-editor', '~> 3.1'
22
+ spec.add_dependency 'hydra-editor', '~> 3.2'
23
23
  spec.add_dependency 'hydra-works', '~> 0.16'
24
24
  spec.add_dependency 'browse-everything', '>= 0.10.5'
25
- # Workaround for https://github.com/projecthydra-labs/hyrax/issues/546
26
- spec.add_dependency 'blacklight', '~> 6.6', '< 6.8.0'
25
+ spec.add_dependency 'blacklight', '~> 6.9'
27
26
  spec.add_dependency 'blacklight-gallery', '~> 0.7'
28
27
  spec.add_dependency 'tinymce-rails', '~> 4.1'
29
28
  spec.add_dependency 'tinymce-rails-imageupload', '~> 4.0.17.beta'
30
- spec.add_dependency 'daemons', '~> 1.1'
31
- spec.add_dependency 'yaml_db', '~> 0.2'
32
29
  spec.add_dependency 'font-awesome-rails', '~> 4.2'
33
30
  spec.add_dependency 'select2-rails', '~> 3.5.9'
34
- spec.add_dependency 'json-schema'
31
+ spec.add_dependency 'json-schema' # for Arkivio
35
32
  spec.add_dependency 'nest', '~> 2.0'
36
33
  spec.add_dependency 'mailboxer', '~> 0.12'
37
34
  spec.add_dependency 'carrierwave', '~> 1.0'
@@ -43,11 +40,11 @@ Gem::Specification.new do |spec|
43
40
  spec.add_dependency 'jquery-ui-rails', '~> 5.0'
44
41
  spec.add_dependency 'redis-namespace', '~> 1.5.2'
45
42
  spec.add_dependency 'flot-rails', '~> 0.0.6'
46
- spec.add_dependency 'almond-rails', '~> 0.0.1'
43
+ spec.add_dependency 'almond-rails', '~> 0.1'
47
44
  spec.add_dependency 'qa', '~> 1.0' # questioning_authority
48
45
  spec.add_dependency 'flipflop', '~> 2.3'
49
46
  spec.add_dependency 'jquery-datatables-rails', '~> 3.4.0'
50
- spec.add_dependency 'rdf-rdfxml'
47
+ spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
51
48
  spec.add_dependency 'railties', '~> 5.0'
52
49
  spec.add_dependency 'clipboard-rails', '~> 1.5'
53
50
  spec.add_dependency 'rails_autolink', '~> 1.1'
@@ -29,11 +29,10 @@ module Hyrax
29
29
  """
30
30
 
31
31
  def run_required_generators
32
- say_status('warning', '[Hyrax] GENERATING BLACKLIGHT', :yellow)
32
+ say_status('info', '[Hyrax] GENERATING BLACKLIGHT', :blue)
33
33
  generate 'blacklight:install --devise'
34
- say_status('warning', '[Hyrax] GENERATING HYDRA-HEAD', :yellow)
34
+ say_status('info', '[Hyrax] GENERATING HYDRA-HEAD', :blue)
35
35
  generate 'hydra:head -f'
36
- say_status('warning', '[Hyrax] GENERATING MODELS', :yellow)
37
36
  generate "hyrax:models#{options[:force] ? ' -f' : ''}"
38
37
  end
39
38
 
@@ -8,7 +8,7 @@ This generator makes the following changes to your application:
8
8
  3. Generates the clam anti-virus configuration.
9
9
  '
10
10
  def banner
11
- say_status('warning', 'GENERATING HYRAX MODELS', :yellow)
11
+ say_status('info', 'GENERATING HYRAX MODELS', :blue)
12
12
  end
13
13
 
14
14
  # Setup the database migrations
@@ -36,19 +36,19 @@ class CatalogController < ApplicationController
36
36
  # The ordering of the field names is the order of the display
37
37
  config.add_facet_field solr_name("human_readable_type", :facetable), label: "Type", limit: 5
38
38
  config.add_facet_field solr_name("resource_type", :facetable), label: "Resource Type", limit: 5
39
- config.add_facet_field solr_name("creator", :facetable), label: "Creator", limit: 5
39
+ config.add_facet_field solr_name("creator", :facetable), limit: 5
40
40
  config.add_facet_field solr_name("contributor", :facetable), label: "Contributor", limit: 5
41
- config.add_facet_field solr_name("keyword", :facetable), label: "Keyword", limit: 5
42
- config.add_facet_field solr_name("subject", :facetable), label: "Subject", limit: 5
43
- config.add_facet_field solr_name("language", :facetable), label: "Language", limit: 5
44
- config.add_facet_field solr_name("based_near", :facetable), label: "Location", limit: 5
45
- config.add_facet_field solr_name("publisher", :facetable), label: "Publisher", limit: 5
46
- config.add_facet_field solr_name("file_format", :facetable), label: "File Format", limit: 5
41
+ config.add_facet_field solr_name("keyword", :facetable), limit: 5
42
+ config.add_facet_field solr_name("subject", :facetable), limit: 5
43
+ config.add_facet_field solr_name("language", :facetable), limit: 5
44
+ config.add_facet_field solr_name("based_near", :facetable), limit: 5
45
+ config.add_facet_field solr_name("publisher", :facetable), limit: 5
46
+ config.add_facet_field solr_name("file_format", :facetable), limit: 5
47
47
  config.add_facet_field solr_name('member_of_collections', :symbol), limit: 5, label: 'Collections'
48
48
 
49
49
  # The generic_type isn't displayed on the facet list
50
50
  # It's used to give a label to the filter that comes from the user profile
51
- config.add_facet_field solr_name("generic_type", :facetable), label: "Type", if: false
51
+ config.add_facet_field solr_name("generic_type", :facetable), if: false
52
52
 
53
53
  # Have BL send all facet field names to Solr, which has been the default
54
54
  # previously. Simply remove these lines if you'd rather use Solr request
@@ -58,44 +58,44 @@ class CatalogController < ApplicationController
58
58
  # solr fields to be displayed in the index (search results) view
59
59
  # The ordering of the field names is the order of the display
60
60
  config.add_index_field solr_name("title", :stored_searchable), label: "Title", itemprop: 'name', if: false
61
- config.add_index_field solr_name("description", :stored_searchable), label: "Description", itemprop: 'description', helper_method: :iconify_auto_link
62
- config.add_index_field solr_name("keyword", :stored_searchable), label: "Keyword", itemprop: 'keywords', link_to_search: solr_name("keyword", :facetable)
63
- config.add_index_field solr_name("subject", :stored_searchable), label: "Subject", itemprop: 'about', link_to_search: solr_name("subject", :facetable)
64
- config.add_index_field solr_name("creator", :stored_searchable), label: "Creator", itemprop: 'creator', link_to_search: solr_name("creator", :facetable)
65
- config.add_index_field solr_name("contributor", :stored_searchable), label: "Contributor", itemprop: 'contributor', link_to_search: solr_name("contributor", :facetable)
61
+ config.add_index_field solr_name("description", :stored_searchable), itemprop: 'description', helper_method: :iconify_auto_link
62
+ config.add_index_field solr_name("keyword", :stored_searchable), itemprop: 'keywords', link_to_search: solr_name("keyword", :facetable)
63
+ config.add_index_field solr_name("subject", :stored_searchable), itemprop: 'about', link_to_search: solr_name("subject", :facetable)
64
+ config.add_index_field solr_name("creator", :stored_searchable), itemprop: 'creator', link_to_search: solr_name("creator", :facetable)
65
+ config.add_index_field solr_name("contributor", :stored_searchable), itemprop: 'contributor', link_to_search: solr_name("contributor", :facetable)
66
66
  config.add_index_field solr_name("proxy_depositor", :symbol), label: "Depositor", helper_method: :link_to_profile
67
67
  config.add_index_field solr_name("depositor"), label: "Owner", helper_method: :link_to_profile
68
- config.add_index_field solr_name("publisher", :stored_searchable), label: "Publisher", itemprop: 'publisher', link_to_search: solr_name("publisher", :facetable)
69
- config.add_index_field solr_name("based_near", :stored_searchable), label: "Location", itemprop: 'contentLocation', link_to_search: solr_name("based_near", :facetable)
70
- config.add_index_field solr_name("language", :stored_searchable), label: "Language", itemprop: 'inLanguage', link_to_search: solr_name("language", :facetable)
71
- config.add_index_field solr_name("date_uploaded", :stored_sortable, type: :date), label: "Date Uploaded", itemprop: 'datePublished', helper_method: :human_readable_date
72
- config.add_index_field solr_name("date_modified", :stored_sortable, type: :date), label: "Date Modified", itemprop: 'dateModified', helper_method: :human_readable_date
73
- config.add_index_field solr_name("date_created", :stored_searchable), label: "Date Created", itemprop: 'dateCreated'
74
- config.add_index_field solr_name("rights", :stored_searchable), label: "Rights", helper_method: :license_links
68
+ config.add_index_field solr_name("publisher", :stored_searchable), itemprop: 'publisher', link_to_search: solr_name("publisher", :facetable)
69
+ config.add_index_field solr_name("based_near", :stored_searchable), itemprop: 'contentLocation', link_to_search: solr_name("based_near", :facetable)
70
+ config.add_index_field solr_name("language", :stored_searchable), itemprop: 'inLanguage', link_to_search: solr_name("language", :facetable)
71
+ config.add_index_field solr_name("date_uploaded", :stored_sortable, type: :date), itemprop: 'datePublished', helper_method: :human_readable_date
72
+ config.add_index_field solr_name("date_modified", :stored_sortable, type: :date), itemprop: 'dateModified', helper_method: :human_readable_date
73
+ config.add_index_field solr_name("date_created", :stored_searchable), itemprop: 'dateCreated'
74
+ config.add_index_field solr_name("rights", :stored_searchable), helper_method: :license_links
75
75
  config.add_index_field solr_name("resource_type", :stored_searchable), label: "Resource Type", link_to_search: solr_name("resource_type", :facetable)
76
- config.add_index_field solr_name("file_format", :stored_searchable), label: "File Format", link_to_search: solr_name("file_format", :facetable)
77
- config.add_index_field solr_name("identifier", :stored_searchable), label: "Identifier", helper_method: :index_field_link, field_name: 'identifier'
76
+ config.add_index_field solr_name("file_format", :stored_searchable), link_to_search: solr_name("file_format", :facetable)
77
+ config.add_index_field solr_name("identifier", :stored_searchable), helper_method: :index_field_link, field_name: 'identifier'
78
78
  config.add_index_field solr_name("embargo_release_date", :stored_sortable, type: :date), label: "Embargo release date", helper_method: :human_readable_date
79
79
  config.add_index_field solr_name("lease_expiration_date", :stored_sortable, type: :date), label: "Lease expiration date", helper_method: :human_readable_date
80
80
 
81
81
  # solr fields to be displayed in the show (single result) view
82
82
  # The ordering of the field names is the order of the display
83
- config.add_show_field solr_name("title", :stored_searchable), label: "Title"
84
- config.add_show_field solr_name("description", :stored_searchable), label: "Description"
85
- config.add_show_field solr_name("keyword", :stored_searchable), label: "Keyword"
86
- config.add_show_field solr_name("subject", :stored_searchable), label: "Subject"
87
- config.add_show_field solr_name("creator", :stored_searchable), label: "Creator"
88
- config.add_show_field solr_name("contributor", :stored_searchable), label: "Contributor"
89
- config.add_show_field solr_name("publisher", :stored_searchable), label: "Publisher"
90
- config.add_show_field solr_name("based_near", :stored_searchable), label: "Location"
91
- config.add_show_field solr_name("language", :stored_searchable), label: "Language"
92
- config.add_show_field solr_name("date_uploaded", :stored_searchable), label: "Date Uploaded"
93
- config.add_show_field solr_name("date_modified", :stored_searchable), label: "Date Modified"
94
- config.add_show_field solr_name("date_created", :stored_searchable), label: "Date Created"
95
- config.add_show_field solr_name("rights", :stored_searchable), label: "Rights"
83
+ config.add_show_field solr_name("title", :stored_searchable)
84
+ config.add_show_field solr_name("description", :stored_searchable)
85
+ config.add_show_field solr_name("keyword", :stored_searchable)
86
+ config.add_show_field solr_name("subject", :stored_searchable)
87
+ config.add_show_field solr_name("creator", :stored_searchable)
88
+ config.add_show_field solr_name("contributor", :stored_searchable)
89
+ config.add_show_field solr_name("publisher", :stored_searchable)
90
+ config.add_show_field solr_name("based_near", :stored_searchable)
91
+ config.add_show_field solr_name("language", :stored_searchable)
92
+ config.add_show_field solr_name("date_uploaded", :stored_searchable)
93
+ config.add_show_field solr_name("date_modified", :stored_searchable)
94
+ config.add_show_field solr_name("date_created", :stored_searchable)
95
+ config.add_show_field solr_name("rights", :stored_searchable)
96
96
  config.add_show_field solr_name("resource_type", :stored_searchable), label: "Resource Type"
97
- config.add_show_field solr_name("format", :stored_searchable), label: "File Format"
98
- config.add_show_field solr_name("identifier", :stored_searchable), label: "Identifier"
97
+ config.add_show_field solr_name("format", :stored_searchable)
98
+ config.add_show_field solr_name("identifier", :stored_searchable)
99
99
 
100
100
  # "fielded" search configuration. Used by pulldown among other places.
101
101
  # For supported keys in hash, see rdoc for Blacklight::SearchFields
@@ -1,4 +1,47 @@
1
1
  en:
2
+ blacklight:
3
+ search:
4
+ fields:
5
+ facet:
6
+ based_near_sim: Location
7
+ creator_sim: Creator
8
+ file_format_sim: Format
9
+ generic_type_sim: Type
10
+ keyword_sim: Keyword
11
+ language_sim: Language
12
+ publisher_sim: Publisher
13
+ subject_sim: Subject
14
+ index:
15
+ based_near_tesim: Location
16
+ contributor_tesim: Contributor
17
+ creator_tesim: Creator
18
+ date_created_tesim: Date Created
19
+ date_modified_dtsi: Date Modified
20
+ date_uploaded_dtsi: Date Uploaded
21
+ description_tesim: Description
22
+ file_format_tesim: File Format
23
+ identifier_tesim: Identifier
24
+ keyword_tesim: Keyword
25
+ language_tesim: Language
26
+ publisher_tesim: Publisher
27
+ rights_tesim: Rights
28
+ subject_tesim: Subject
29
+ show:
30
+ based_near_tesim: Location
31
+ contributor_tesim: Contributor
32
+ creator_tesim: Creator
33
+ date_created_tesim: Date Created
34
+ date_modified_dtsi: Date Modified
35
+ date_uploaded_dtsi: Date Uploaded
36
+ description_tesim: Description
37
+ file_format_tesim: File Format
38
+ identifier_tesim: Identifier
39
+ keyword_tesim: Keyword
40
+ language_tesim: Language
41
+ publisher_tesim: Publisher
42
+ rights_tesim: Rights
43
+ subject_tesim: Subject
44
+ title_tesim: Title
2
45
  hyrax:
3
46
  product_name: "Hyrax"
4
47
  product_twitter_handle: "@HydraSphere"
@@ -1,4 +1,47 @@
1
1
  es:
2
+ blacklight:
3
+ search:
4
+ fields:
5
+ facet:
6
+ based_near_sim: Ubicación
7
+ creator_sim: Creador
8
+ file_format_sim: Formato
9
+ generic_type_sim: Tipo
10
+ keyword_sim: Palabra clave
11
+ language_sim: Idioma
12
+ publisher_sim: Editor
13
+ subject_sim: Tema
14
+ index:
15
+ based_near_tesim: Ubicación
16
+ contributor_tesim: Contribuidor
17
+ creator_tesim: Creador
18
+ date_created_tesim: Fecha de Creacion
19
+ date_modified_dtsi: Fecha Modificada
20
+ date_uploaded_dtsi: Fecha de Subida
21
+ description_tesim: Descripción
22
+ file_format_tesim: Formato de Archivo
23
+ identifier_tesim: Identificador
24
+ keyword_tesim: Palabra clave
25
+ language_tesim: Idioma
26
+ publisher_tesim: Editor
27
+ rights_tesim: Derechos
28
+ subject_tesim: Tema
29
+ show:
30
+ based_near_tesim: Ubicación
31
+ contributor_tesim: Contribuidor
32
+ creator_tesim: Creador
33
+ date_created_tesim: Fecha de Creacion
34
+ date_modified_dtsi: Fecha Modificada
35
+ date_uploaded_dtsi: Fecha de Subida
36
+ description_tesim: Descripción
37
+ file_format_tesim: Formato de Archivo
38
+ identifier_tesim: Identificador
39
+ keyword_tesim: Palabra clave
40
+ language_tesim: Idioma
41
+ publisher_tesim: Editor
42
+ rights_tesim: Derechos
43
+ subject_tesim: Tema
44
+ title_tesim: Título
2
45
  hyrax:
3
46
  product_name: "Hyrax"
4
47
  product_twitter_handle: "@HydraSphere"
@@ -0,0 +1,55 @@
1
+ zh:
2
+ blacklight:
3
+ search:
4
+ fields:
5
+ facet:
6
+ based_near_sim: 位置
7
+ creator_sim: 创造者
8
+ file_format_sim: 文件格式
9
+ generic_type_sim: 类型
10
+ keyword_sim: 关键词
11
+ language_sim: 语言
12
+ publisher_sim: 出版者
13
+ subject_sim: 学科
14
+ index:
15
+ based_near_tesim: 位置
16
+ contributor_tesim: 贡献者
17
+ creator_tesim: 创造者
18
+ date_created_tesim: 创建日期
19
+ date_modified_dtsi: 修改日期
20
+ date_uploaded_dtsi: 日期上传
21
+ description_tesim: 描述
22
+ file_format_tesim: 文件格式
23
+ identifier_tesim: 识别码
24
+ keyword_tesim: 关键词
25
+ language_tesim: 语言
26
+ publisher_tesim: 出版者
27
+ rights_tesim: 权
28
+ subject_tesim: 学科
29
+ show:
30
+ based_near_tesim: 位置
31
+ contributor_tesim: 贡献者
32
+ creator_tesim: 创造者
33
+ date_created_tesim: 创建日期
34
+ date_modified_dtsi: 修改日期
35
+ date_uploaded_dtsi: 日期上传
36
+ description_tesim: 描述
37
+ file_format_tesim: 文件格式
38
+ identifier_tesim: 识别码
39
+ keyword_tesim: 关键词
40
+ language_tesim: 语言
41
+ publisher_tesim: 出版者
42
+ rights_tesim: 权
43
+ subject_tesim: 学科
44
+ title_tesim: 标题
45
+ hyrax:
46
+ product_name: "蹄兔"
47
+ product_twitter_handle: "@HydraSphere"
48
+ institution_name: "机构"
49
+ institution_name_full: "机构名称"
50
+ account_name: "我的机构帐户标识符"
51
+ directory:
52
+ suffix: "@example.org"
53
+ footer:
54
+ copyright_html: "<strong>版权所有 &copy; 2017 Project Hydra</strong> 根据Apache许可证2.0版许可"
55
+ service_html: 的服务<a href="http://projecthydra.org/" class="navbar-link" target="_blank">Hydra项目</a>.
@@ -32,7 +32,8 @@
32
32
  }
33
33
  ],
34
34
  "methods": [
35
- "Hyrax::Workflow::DeactivateObject"
35
+ "Hyrax::Workflow::DeactivateObject",
36
+ "Hyrax::Workflow::GrantEditToDepositor"
36
37
  ]
37
38
  }, {
38
39
  "name": "approve",
@@ -46,6 +47,8 @@
46
47
  }
47
48
  ],
48
49
  "methods": [
50
+ "Hyrax::Workflow::GrantReadToDepositor",
51
+ "Hyrax::Workflow::RevokeEditFromDepositor",
49
52
  "Hyrax::Workflow::ActivateObject"
50
53
  ]
51
54
  }, {
@@ -6,6 +6,6 @@ module Hyrax
6
6
  # Adds Hyrax behaviors to the controller.
7
7
  include Hyrax::WorksControllerBehavior
8
8
  include Hyrax::BreadcrumbsForWorks
9
- self.curation_concern_type = <%= class_name %>
9
+ self.curation_concern_type = ::<%= class_name %>
10
10
  end
11
11
  end
@@ -3,7 +3,8 @@
3
3
  require 'rails_helper'
4
4
  include Warden::Test::Helpers
5
5
 
6
- RSpec.feature 'Create a <%= class_name %>' do
6
+ # NOTE: If you generated more than one work, you have to set "js: true"
7
+ RSpec.feature 'Create a <%= class_name %>', js: false do
7
8
  context 'a logged in user' do
8
9
  let(:user_attributes) do
9
10
  { <%= Devise.authentication_keys.first %>: 'test@example.com' }
@@ -13,14 +14,20 @@ RSpec.feature 'Create a <%= class_name %>' do
13
14
  end
14
15
 
15
16
  before do
17
+ AdminSet.find_or_create_default_admin_set_id
16
18
  login_as user
17
19
  end
18
20
 
19
21
  scenario do
20
- visit new_curation_concerns_<%= file_name %>_path
21
- fill_in 'Title', with: 'Test <%= class_name %>'
22
- click_button 'Create <%= class_name %>'
23
- expect(page).to have_content 'Test <%= class_name %>'
22
+ visit '/dashboard'
23
+ click_link "Works"
24
+ click_link "Add new work"
25
+
26
+ # If you generate more than one work uncomment these lines
27
+ # choose "payload_concern", option: "<%= class_name %>"
28
+ # click_button "Create work"
29
+
30
+ expect(page).to have_content "Add New <%= human_name %>"
24
31
  end
25
32
  end
26
33
  end
@@ -0,0 +1,10 @@
1
+ zh:
2
+ hyrax:
3
+ icons:
4
+ <%= file_name %>: 'fa fa-file-text-o'
5
+ select_type:
6
+ <%= file_name %>:
7
+ # TODO: translate `human_name` into Chinese
8
+ name: "<%= human_name.titleize %>"
9
+ # TODO: translate `human_name` into Chinese
10
+ description: "<%= human_name %> 作品"
@@ -1,6 +1,13 @@
1
1
  require 'rails/generators'
2
+ require 'rails/generators/model_helpers'
2
3
 
3
4
  class Hyrax::WorkGenerator < Rails::Generators::NamedBase
5
+ # ActiveSupport can interpret models as plural which causes
6
+ # counter-intuitive route paths. Pull in ModelHelpers from
7
+ # Rails which warns users about pluralization when generating
8
+ # new models or scaffolds. include Rails::Generators::ModelHelpers
9
+ include Rails::Generators::ModelHelpers
10
+
4
11
  source_root File.expand_path('../templates', __FILE__)
5
12
 
6
13
  argument :attributes, type: :array, default: [], banner: 'field:type field:type'
@@ -16,23 +23,23 @@ class Hyrax::WorkGenerator < Rails::Generators::NamedBase
16
23
  end
17
24
 
18
25
  def create_actor
19
- template('actor.rb.erb', "app/actors/hyrax/actors/#{file_name}_actor.rb")
26
+ template('actor.rb.erb', File.join('app/actors/hyrax/actors', class_path, "#{file_name}_actor.rb"))
20
27
  end
21
28
 
22
29
  def create_controller
23
- template('controller.rb.erb', "app/controllers/hyrax/#{plural_file_name}_controller.rb")
30
+ template('controller.rb.erb', File.join('app/controllers/hyrax', class_path, "#{plural_file_name}_controller.rb"))
24
31
  end
25
32
 
26
33
  def create_form
27
- template('form.rb.erb', "app/forms/hyrax/#{file_name}_form.rb")
34
+ template('form.rb.erb', File.join('app/forms/hyrax', class_path, "#{file_name}_form.rb"))
28
35
  end
29
36
 
30
37
  def create_model
31
- template('model.rb.erb', "app/models/#{file_name}.rb")
38
+ template('model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb"))
32
39
  end
33
40
 
34
41
  def create_views
35
- create_file "app/views/hyrax/#{plural_file_name}/_#{file_name}.html.erb" do
42
+ create_file File.join('app/views/hyrax', class_path, "#{plural_file_name}/_#{file_name}.html.erb") do
36
43
  "<%# This is a search result view %>\n" \
37
44
  "<%= render 'catalog/document', document: #{file_name}, document_counter: #{file_name}_counter %>\n"
38
45
  end
@@ -47,7 +54,7 @@ class Hyrax::WorkGenerator < Rails::Generators::NamedBase
47
54
  lastmatch = line if line =~ /config.register_curation_concern :(?!#{file_name})/
48
55
  end
49
56
  content = " # Injected via `rails g hyrax:work #{class_name}`\n" \
50
- " config.register_curation_concern :#{file_name}\n"
57
+ " config.register_curation_concern #{registration_path_symbol}\n"
51
58
  anchor = lastmatch || "Hyrax.config do |config|\n"
52
59
  inject_into_file config, after: anchor do
53
60
  content
@@ -56,33 +63,34 @@ class Hyrax::WorkGenerator < Rails::Generators::NamedBase
56
63
  end
57
64
 
58
65
  def create_i18n
59
- template('locale.en.yml.erb', "config/locales/#{file_name}.en.yml")
60
- template('locale.es.yml.erb', "config/locales/#{file_name}.es.yml")
66
+ template('locale.en.yml.erb', File.join('config/locales/', class_path, "#{file_name}.en.yml"))
67
+ template('locale.es.yml.erb', File.join('config/locales/', class_path, "#{file_name}.es.yml"))
68
+ template('locale.zh.yml.erb', File.join('config/locales/', class_path, "#{file_name}.zh.yml"))
61
69
  end
62
70
 
63
71
  def create_actor_spec
64
72
  return unless rspec_installed?
65
- template('actor_spec.rb.erb', "spec/actors/hyrax/actors/#{file_name}_actor_spec.rb")
73
+ template('actor_spec.rb.erb', File.join('spec/actors/hyrax/actors', class_path, "#{file_name}_actor_spec.rb"))
66
74
  end
67
75
 
68
76
  def create_controller_spec
69
77
  return unless rspec_installed?
70
- template('controller_spec.rb.erb', "spec/controllers/hyrax/#{plural_file_name}_controller_spec.rb")
78
+ template('controller_spec.rb.erb', File.join('spec/controllers/hyrax', class_path, "#{plural_file_name}_controller_spec.rb"))
71
79
  end
72
80
 
73
81
  def create_feature_spec
74
82
  return unless rspec_installed?
75
- template('feature_spec.rb.erb', "spec/features/create_#{file_name}_spec.rb")
83
+ template('feature_spec.rb.erb', File.join('spec/features', class_path, "create_#{file_name}_spec.rb"))
76
84
  end
77
85
 
78
86
  def create_form_spec
79
87
  return unless rspec_installed?
80
- template('form_spec.rb.erb', "spec/forms/hyrax/#{file_name}_form_spec.rb")
88
+ template('form_spec.rb.erb', File.join('spec/forms/hyrax', class_path, "#{file_name}_form_spec.rb"))
81
89
  end
82
90
 
83
91
  def create_model_spec
84
92
  return unless rspec_installed?
85
- template('model_spec.rb.erb', "spec/models/#{file_name}_spec.rb")
93
+ template('model_spec.rb.erb', File.join('spec/models', class_path, "#{file_name}_spec.rb"))
86
94
  end
87
95
 
88
96
  def display_readme
@@ -98,4 +106,12 @@ class Hyrax::WorkGenerator < Rails::Generators::NamedBase
98
106
  def revoking?
99
107
  behavior == :revoke
100
108
  end
109
+
110
+ def registration_path_symbol
111
+ return ":#{file_name}" if class_path.blank?
112
+ # this next line creates a symbol with a path like
113
+ # "abc/scholarly_paper" where abc is the namespace and
114
+ # scholarly_paper is the concern
115
+ ":\"#{File.join(class_path, file_name)}\""
116
+ end
101
117
  end