curate 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +135 -51
- data/app/assets/images/curate/default.png +0 -0
- data/app/assets/stylesheets/layout/positioning.css.scss +4 -0
- data/app/assets/stylesheets/modules/search_results.css.scss +4 -0
- data/app/controllers/concerns/curate/fields_for_add_to_collection.rb +9 -0
- data/app/controllers/curation_concern/base_controller.rb +1 -0
- data/app/controllers/curation_concern/generic_files_controller.rb +1 -0
- data/app/models/concerns/curate/ability.rb +6 -2
- data/app/repository_models/curation_concern/model.rb +1 -1
- data/app/repository_models/generic_file.rb +4 -0
- data/app/views/application/_add_to_collection_gui.html.erb +19 -0
- data/app/views/catalog/_index_partials/_identifier_and_action.html.erb +19 -11
- data/app/views/collections/_collection.html.erb +2 -27
- data/app/views/curate/collections/_form_to_add_member.html.erb +12 -10
- data/app/views/curate/collections/add_member_form.html.erb +4 -2
- data/app/views/curation_concern/base/_collections.html.erb +0 -10
- data/app/views/curation_concern/base/_related_files.html.erb +1 -1
- data/app/views/curation_concern/base/_representative_media.html.erb +8 -0
- data/app/views/curation_concern/base/_thumbnail.html.erb +7 -5
- data/app/views/curation_concern/base/show.html.erb +14 -6
- data/app/views/curation_concern/documents/_document.html.erb +1 -1
- data/app/views/curation_concern/generic_files/_media_display.html.erb +11 -1
- data/app/views/curation_concern/generic_files/show.html.erb +1 -1
- data/app/views/curation_concern/people/_person.html.erb +2 -20
- data/app/views/profiles/_profile.html.erb +2 -27
- data/lib/curate/spec_support.rb +1 -2
- data/lib/curate/version.rb +1 -1
- data/spec/features/catalog_search_spec.rb +0 -30
- data/spec/features/generic_file_spec.rb +2 -1
- data/spec/features/generic_work_spec.rb +0 -10
- data/spec/features/thumbnail_display_spec.rb +5 -2
- data/spec/helpers/curate_helper_spec.rb +27 -0
- data/spec/internal/Gemfile.lock +6 -6
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/initializers/secret_token.rb +1 -1
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20131203200422_devise_create_users.rb → 20131205204122_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200427_add_devise_guests_to_users.rb → 20131205204126_add_devise_guests_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200428_create_searches.rb → 20131205204127_create_searches.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200429_create_bookmarks.rb → 20131205204128_create_bookmarks.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200430_remove_editable_fields_from_bookmarks.rb → 20131205204129_remove_editable_fields_from_bookmarks.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200431_add_user_types_to_bookmarks_searches.rb → 20131205204130_add_user_types_to_bookmarks_searches.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200432_acts_as_follower_migration.rb → 20131205204131_acts_as_follower_migration.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200433_add_social_to_users.rb → 20131205204132_add_social_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200434_create_single_use_links.rb → 20131205204133_create_single_use_links.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200435_add_ldap_attrs_to_user.rb → 20131205204134_add_ldap_attrs_to_user.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200436_add_avatars_to_users.rb → 20131205204135_add_avatars_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200437_create_checksum_audit_logs.rb → 20131205204136_create_checksum_audit_logs.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200438_create_version_committers.rb → 20131205204137_create_version_committers.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200439_add_groups_to_users.rb → 20131205204138_add_groups_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200440_create_local_authorities.rb → 20131205204139_create_local_authorities.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200441_create_trophies.rb → 20131205204140_create_trophies.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200450_create_mailboxer.mailboxer_engine.rb → 20131205204152_create_mailboxer.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200451_add_notified_object.mailboxer_engine.rb → 20131205204153_add_notified_object.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200452_add_notification_code.mailboxer_engine.rb → 20131205204154_add_notification_code.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200453_add_attachments.mailboxer_engine.rb → 20131205204155_add_attachments.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200454_rename_receipts_read.mailboxer_engine.rb → 20131205204156_rename_receipts_read.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200455_add_global_notification_support.mailboxer_engine.rb → 20131205204157_add_global_notification_support.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200459_add_terms_of_service_to_user.curate_engine.rb → 20131205204202_add_terms_of_service_to_user.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200460_add_user_force_update_profile.curate_engine.rb → 20131205204203_add_user_force_update_profile.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200461_create_help_requests.curate_engine.rb → 20131205204204_create_help_requests.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200462_add_repository_id_to_user.curate_engine.rb → 20131205204205_add_repository_id_to_user.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200463_create_curate_proxy_deposit_rights.curate_engine.rb → 20131205204206_create_curate_proxy_deposit_rights.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200464_change_display_name_to_name.curate_engine.rb → 20131205204207_change_display_name_to_name.curate_engine.rb} +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/log/development.log +203 -191
- data/spec/internal/log/test.log +84621 -104943
- data/spec/internal/spec/factories/spams_factory.rb +0 -1
- data/spec/internal/spec/fixtures/cassettes/remotely_identified_doi_mint_generic_work.yml +13 -14
- data/spec/internal/spec/fixtures/cassettes/remotely_identified_doi_mint_spam.yml +13 -14
- data/spec/internal/tmp/cache/assets/test/sass/2c6be7e0f6fa11a075d87959732f91fde3df1f13/search_results.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/953d624c1831fcea22a3be549290f4c654726e96/positioning.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/163665b72c8e98b0c88c19896f080bc4 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1c1167e9384b80e15359a663448a3196 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4132e961bdf0f2ffa2f96a4c7822e209 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/41dd5dbd03cfa3f49e2d7569ffd03f8d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/611235bfd282813bdfbc998bcbe798e8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7d4fe23150294500a7bcd2630667e5c8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{7078324d4486aa4ba7a6c21debbf3638 → 98ad78dc8c309689440b20bfa7372b3e} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ada353bb8ffe3eb0f2dd479e6d869a70 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b148a5e98ff09a12b6a2139af1e62e46 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f0817826ed378d461b95e0e1ac870fcf → c14352828e1be2bbf3199771a34f9c57} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d510daa6eb0cd4805bff7fd0990dfdb5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d610f39602b6149ca02638c1728778b5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e9c2a0f2fa471ace3f7ed3a1f1b9ffc5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ea0ece5befbce765051e27cf991cc805 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/matchers.rb +24 -0
- data/spec/{support/matchers → matchers}/metadata_field_matchers.rb +0 -0
- data/spec/{support/matchers → matchers}/raise_rescue_response_type_matcher.rb +0 -0
- data/spec/repository_models/generic_file_spec.rb +11 -0
- data/spec/spec_helper.rb +3 -2
- data/spec/support/shared/shared_examples_with_related_works.rb +0 -1
- data/spec/views/application/_add_to_collection_gui.html.erb_spec.rb +60 -0
- data/spec/views/curate/collections/_form_to_add_member.html.erb_spec.rb +11 -11
- data/spec/views/curation_concern/base/_collection.html.erb_spec.rb +0 -2
- data/spec/views/curation_concern/base/_related_files.html.erb_spec.rb +16 -0
- data/spec/views/curation_concern/base/_representative_media.html.erb_spec.rb +15 -0
- data/spec/views/curation_concern/base/_thumbnail.html.erb_spec.rb +27 -0
- data/spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb +34 -0
- data/spec/views/curation_concern/generic_files/show.html.erb_spec.rb +12 -0
- metadata +87 -74
- data/app/views/catalog/_add_to_collection_gui.html.erb +0 -15
- data/app/views/curation_concern/base/_add_to_collection_gui.html.erb +0 -18
- data/app/views/curation_concern/base/_form_to_add_collection.html.erb +0 -9
- data/app/views/curation_concern/base/_representative_image.html.erb +0 -6
- data/spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb +0 -48
- data/spec/views/curation_concern/base/_add_to_collection_gui.html.erb_spec.rb +0 -34
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59395ca50b59f9b6078a239e94f897910cb07f8c
|
|
4
|
+
data.tar.gz: caaf8e67b45bc57f724c9b1c660f3a03299fc33f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1da77dd060d40a9307c28220655e6be818921a7371dcff140a907db975b1a3784e51bb52c7c137c761fe2e4c9c52afec7832d67287f101169f25a403db4c94ca
|
|
7
|
+
data.tar.gz: 04b2dc97393bfd0a1125be100c6eceb0bf64de81f02977b75239ec7b989a89237ee568ed1c00f6374fb65ead6c24a1caf5340c153095eb74ab0972ed2672f14b
|
data/README.md
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
# Curate [](http://badge.fury.io/rb/curate) [](https://travis-ci.org/projecthydra/curate) [](https://coveralls.io/r/projecthydra/curate)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Curate is a [Rails engine](http://edgeguides.rubyonrails.org/engines.html) leveraging [ProjectHydra](http://projecthydra.org) and [ProjectBlacklight](http://projectblacklight.org/) components to deliver a foundation for an Institutional Repositories.
|
|
4
|
+
It is released under the [Apache 2 License](./LICENSE)
|
|
5
|
+
|
|
6
|
+
* [Starting a new Curate-based Rails application](#starting-a-new-curate-based-application)
|
|
7
|
+
* [or install by hand](#or-install-by-hand)
|
|
8
|
+
* [Developing and contributing for the Curate gem](#developing-and-contributing-for-the-curate-gem)
|
|
9
|
+
* [Prerequisites](#prerequisites)
|
|
10
|
+
* [Clone the Curate repository](#clone-the-repo)
|
|
11
|
+
* [Jetty](#jetty)
|
|
12
|
+
* [Running the specs](#running-the-specs)
|
|
13
|
+
* [All of them](#all-of-them)
|
|
14
|
+
* [Some of them](#some-of-them)
|
|
15
|
+
* [With Zeus](#with-zeus)
|
|
16
|
+
* [Contributing back](#contributing-back)
|
|
17
|
+
* [Coding Guidelines](#coding-guidelines)
|
|
18
|
+
* [Writing Your Code](#writing-your-code)
|
|
19
|
+
* [Ruby File Structure](#ruby-file-structure)
|
|
20
|
+
* [Source Control Guidelines](#source-control-guidelines)
|
|
21
|
+
* [Working on Curate while working on my Application](#working-on-curate-while-working-on-my-application)
|
|
22
|
+
* [Standing up your Curate-based Rails application in Production](#standing-up-your-curate-based-rails-application-in-production)
|
|
23
|
+
|
|
24
|
+
# Starting a New Curate Based Application
|
|
4
25
|
|
|
5
26
|
When you generate your new Rails application, you can use Curate's application template:
|
|
6
27
|
```bash
|
|
7
28
|
$ rails new my_curate_application -m https://raw.github.com/ndlib/curate/master/lib/generators/curate/application_template.rb
|
|
8
29
|
```
|
|
9
30
|
|
|
10
|
-
|
|
31
|
+
## Or Install By Hand
|
|
11
32
|
|
|
12
33
|
Add the following line to your application's Gemfile:
|
|
13
34
|
|
|
@@ -19,84 +40,147 @@ $ bundle
|
|
|
19
40
|
$ rails generate curate
|
|
20
41
|
```
|
|
21
42
|
|
|
22
|
-
|
|
43
|
+
# Developing and Contributing for the Curate gem
|
|
23
44
|
|
|
24
|
-
|
|
45
|
+
## Prerequisites
|
|
25
46
|
|
|
26
|
-
|
|
47
|
+
You may need to have the following installed ‡
|
|
27
48
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
* imagemagick (http://www.imagemagick.org/script/index.php)
|
|
50
|
+
* fits.sh (https://code.google.com/p/fits/wiki/installing)
|
|
51
|
+
* ffmpeg (optional, http://www.ffmpeg.org/)
|
|
52
|
+
* Redis (http://redis.io/)
|
|
53
|
+
* rubygems (http://rubygems.org/pages/download)
|
|
54
|
+
* ClamAV (http://www.clamav.net/)
|
|
31
55
|
|
|
32
|
-
|
|
56
|
+
‡ - Why "you may need"? Some of these are only optionally used in development and tests; But production will need it.
|
|
33
57
|
|
|
34
|
-
|
|
58
|
+
## Clone the Curate repository
|
|
35
59
|
|
|
60
|
+
From the command line:
|
|
36
61
|
```bash
|
|
37
|
-
|
|
62
|
+
git clone https://github.com/projecthydra/curate.git ./path/to/local
|
|
38
63
|
```
|
|
39
64
|
|
|
40
|
-
|
|
65
|
+
## Jetty
|
|
41
66
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
67
|
+
Curate uses Jetty for development and testing.
|
|
68
|
+
You could configure it to use an alternate Fedora and SOLR location, but that is an exercise for the reader.
|
|
69
|
+
**The hydra-jetty package should not be use for secure production installations**
|
|
46
70
|
|
|
47
|
-
Jetty
|
|
71
|
+
### Install Jetty
|
|
72
|
+
Install jetty, you should only need to do this once (unless you remove the ./jetty directory)
|
|
48
73
|
|
|
49
74
|
```bash
|
|
50
|
-
$
|
|
75
|
+
$ rake jetty:unzip
|
|
51
76
|
```
|
|
52
77
|
|
|
53
|
-
|
|
78
|
+
## Running the Specs
|
|
54
79
|
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
$ rake clean
|
|
58
|
-
$ rake generate
|
|
59
|
-
```
|
|
80
|
+
Inside the Curate directory (i.e. `./path/to/local`):
|
|
60
81
|
|
|
61
|
-
|
|
82
|
+
### All of Them
|
|
62
83
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
1. Make sure jetty is running (`rake jetty:start`); It will take a bit to spin up jetty.
|
|
85
|
+
1. Make sure you have a dummy app ‡
|
|
86
|
+
1. Run `rake regenerate` build the to get a clean app ./spec/dummy
|
|
87
|
+
1. Then run `rake spec`; The tests will take quite a while ‡‡
|
|
88
|
+
|
|
89
|
+
‡ - A Rails engine requires a Rails application to run.
|
|
90
|
+
The dummy app is an generated application inside Curate in the `./spec/internal` directory
|
|
91
|
+
‡‡ - Slow tests are a big problem and we are working on speeding them up, but its complicated.
|
|
92
|
+
|
|
93
|
+
### Some of Them
|
|
94
|
+
|
|
95
|
+
In some cases you want to know the results of a single test. Here's how you do it.
|
|
96
|
+
|
|
97
|
+
1. Make sure jetty is running (`rake jetty:start`); It will take a bit to spin up jetty.
|
|
98
|
+
1. Make sure you have a dummy app ‡
|
|
99
|
+
1. Run `rake regenerate` build the to get a clean app ./spec/dummy
|
|
100
|
+
1. Then run `BUNDLE_GEMFILE=spec/internal/Gemfile bundle exec rspec path/to/spec.rb:LINE` ‡
|
|
101
|
+
|
|
102
|
+
‡ - With Curate being an Engine we need to point to the Dummy Application's Gemfile.
|
|
103
|
+
In full Rails applications you can normally run the following `rspec path/to/spec.rb:LINE`
|
|
104
|
+
|
|
105
|
+
### With Zeus
|
|
106
|
+
|
|
107
|
+
> [Zeus](https://github.com/burke/zeus) preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second. ‡
|
|
108
|
+
|
|
109
|
+
1. In terminal window #1 run `zeus start`
|
|
110
|
+
1. In terminal window #2, once Zeus is started: run `zeus rake spec` for all tests; or `zeus test path/to/spec.rb:LINE` for one
|
|
111
|
+
|
|
112
|
+
‡ - Loading the environment to run your tests takes less than a second. So running an individual test will take less time.
|
|
113
|
+
|
|
114
|
+
## Contributing Back
|
|
115
|
+
|
|
116
|
+
There is an existing [CONTRIBUTING.md](./CONTRIBUTING.md) document which is currently under review.
|
|
117
|
+
|
|
118
|
+
### Coding Guidelines
|
|
119
|
+
|
|
120
|
+
The [Ruby Style Guide][1] is an excellent resource for how to craft your Ruby code, in particular the [Naming section][2].
|
|
121
|
+
|
|
122
|
+
**Can I break these guidelines?** Yes. But you may need to convince the person merging your changes.
|
|
123
|
+
|
|
124
|
+
#### Writing Your Code
|
|
125
|
+
|
|
126
|
+
We are going to do our best to follow [Sandi Metz' Rules for Developers][3]
|
|
127
|
+
|
|
128
|
+
> Here are the rules:
|
|
129
|
+
>
|
|
130
|
+
> * Classes can be no longer than one hundred lines of code.
|
|
131
|
+
> * Methods can be no longer than five lines of code.
|
|
132
|
+
> * Pass no more than four parameters into a method. Hash options are parameters.
|
|
133
|
+
> * Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed).
|
|
134
|
+
|
|
135
|
+
#### Ruby File Structure
|
|
136
|
+
|
|
137
|
+
* Use soft-tabs with a two space indent.
|
|
138
|
+
* Never leave trailing whitespace (unless it is meaningful in the language)
|
|
139
|
+
* End each file with a blank newline.
|
|
140
|
+
* Please do your best to keep lines to 80 characters or fewer.
|
|
141
|
+
|
|
142
|
+
### Source Control Guidelines
|
|
143
|
+
|
|
144
|
+
*This is a placeholder for things to come*
|
|
145
|
+
|
|
146
|
+
[Processing JIRA issues with commit messages](https://confluence.atlassian.com/display/BITBUCKET/Processing+JIRA+issues+with+commit+messages)
|
|
67
147
|
|
|
68
|
-
To run a localized spec:
|
|
69
|
-
```bash
|
|
70
|
-
$ BUNDLE_GEMFILE=spec/internal/Gemfile bundle exec rspec path/to/spec.rb:LINE
|
|
71
148
|
```
|
|
149
|
+
First line is 50 characters or less
|
|
72
150
|
|
|
73
|
-
|
|
151
|
+
Description of work done; wrap at 72 characters.
|
|
74
152
|
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
$ zeus start
|
|
153
|
+
HYDRASIR-123 #close Any comment to post to JIRA
|
|
78
154
|
```
|
|
79
155
|
|
|
80
|
-
|
|
156
|
+
Make sure your JIRA email matches your Git config email (`~/.gitconfig`)
|
|
81
157
|
|
|
82
|
-
|
|
83
|
-
|
|
158
|
+
[1]:https://github.com/bbatsov/ruby-style-guide "Ruby Style Guide"
|
|
159
|
+
[2]:https://github.com/bbatsov/ruby-style-guide#naming "Ruby Style Guide - Naming"
|
|
160
|
+
[3]:http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers "Sandi Metz' Rules for Developers"
|
|
161
|
+
|
|
162
|
+
# Working on Curate while working on my Application
|
|
163
|
+
|
|
164
|
+
Assuming you are wanting to work on your Curate-based application and make modifications to the Curate gem, follow these instructions.
|
|
165
|
+
|
|
166
|
+
Replace the folliwing line in the Gemfile of your Curate-based application (see [Starting a New Curate Based Application](#starting-a-new-curate-based-application)):
|
|
167
|
+
|
|
168
|
+
```ruby
|
|
169
|
+
gem 'curate' ...
|
|
84
170
|
```
|
|
85
171
|
|
|
86
|
-
|
|
172
|
+
with
|
|
87
173
|
|
|
88
|
-
```
|
|
89
|
-
|
|
174
|
+
```ruby
|
|
175
|
+
gem 'curate', path: './path/to/my/clone/of/curate'
|
|
90
176
|
```
|
|
91
177
|
|
|
92
|
-
|
|
178
|
+
[More information about Gemfile management at Bundler.io](http://bundler.io/v1.5/gemfile.html)
|
|
93
179
|
|
|
94
|
-
|
|
180
|
+
You can then do concurrent development on both your clone of the Curate gem and your Curate-based application.
|
|
95
181
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
$ rails server
|
|
102
|
-
```
|
|
182
|
+
**NOTE: Any changes you make in the Curate gem will likely require you to restart your web-server.**
|
|
183
|
+
|
|
184
|
+
# Standing up your Curate-based Rails application in Production
|
|
185
|
+
|
|
186
|
+
We are working on this and have more to come.
|
|
Binary file
|
|
@@ -3,6 +3,7 @@ module Curate::FieldsForAddToCollection
|
|
|
3
3
|
|
|
4
4
|
included do
|
|
5
5
|
helper_method :available_profiles
|
|
6
|
+
helper_method :available_collections
|
|
6
7
|
helper_method :current_users_profile_sections
|
|
7
8
|
end
|
|
8
9
|
|
|
@@ -16,6 +17,14 @@ protected
|
|
|
16
17
|
current_user ? current_user.collections.to_a : []
|
|
17
18
|
end
|
|
18
19
|
|
|
20
|
+
def available_collections(item = nil)
|
|
21
|
+
if item.present?
|
|
22
|
+
collection_options.reject {|n| n == item}
|
|
23
|
+
else
|
|
24
|
+
collection_options
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
19
28
|
def available_profiles
|
|
20
29
|
return [] unless current_user
|
|
21
30
|
return [] unless current_user.profile
|
|
@@ -2,12 +2,12 @@ module Curate
|
|
|
2
2
|
module Ability
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
included do
|
|
5
|
-
self.ability_logic += [:curate_permissions]
|
|
5
|
+
self.ability_logic += [:curate_permissions, :collection_permissions]
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def curate_permissions
|
|
9
9
|
alias_action :confirm, :copy, :to => :update
|
|
10
|
-
can :edit, Person do |p|
|
|
10
|
+
can :edit, Person do |p|
|
|
11
11
|
p.pid == current_user.repository_id
|
|
12
12
|
end
|
|
13
13
|
|
|
@@ -17,6 +17,10 @@ module Curate
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
def collection_permissions
|
|
21
|
+
can :collect, :all
|
|
22
|
+
end
|
|
23
|
+
|
|
20
24
|
end
|
|
21
25
|
end
|
|
22
26
|
|
|
@@ -63,7 +63,7 @@ protected
|
|
|
63
63
|
solr_doc[Solrizer.solr_name(:collection)] ||= []
|
|
64
64
|
self.collection_ids.each do |collection_id|
|
|
65
65
|
collection_obj = ActiveFedora::Base.load_instance_from_solr(collection_id)
|
|
66
|
-
if collection_obj.
|
|
66
|
+
if collection_obj.is_a?(Collection)
|
|
67
67
|
solr_doc[Solrizer.solr_name(:collection, :facetable)] << collection_id
|
|
68
68
|
solr_doc[Solrizer.solr_name(:collection)] << collection_id
|
|
69
69
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<% button_class ||= "btn" %>
|
|
2
|
+
<% modal_id = "#{collectible.noid}-modal" %>
|
|
3
|
+
<% modal_title_id = "#{modal_id}-title" %>
|
|
4
|
+
|
|
5
|
+
<div class="modal fade" id="<%= modal_id %>">
|
|
6
|
+
<div class="modal-dialog">
|
|
7
|
+
<div class="modal-content">
|
|
8
|
+
<div class="modal-header">
|
|
9
|
+
<h4 id="<% modal_title_id %>class="modal-title">Add <%= "#{collectible}" %> to one of your collections:</h4>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="unpadded modal-body">
|
|
12
|
+
<%= render partial: 'curate/collections/form_to_add_member', locals: { collectible: collectible, fieldset_class: 'with-side-padding with-top-padding', select_label_id: modal_title_id } %>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<%= link_to 'Add to Collection', add_member_form_collections_path(collectible_id: collectible.pid), data: { toggle: "modal", target: ('#' + modal_id) }, method: :get, class: "add-to-collection #{button_class}", remote: true %>
|
|
19
|
+
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
<% solr_doc
|
|
1
|
+
<% solr_doc ||= document.inner_object.solr_doc %>
|
|
2
|
+
<% title_link_target ||= polymorphic_path([:curation_concern, document]) %>
|
|
3
|
+
<% title_link_text ||= render_index_field_value(document: solr_doc, field: 'desc_metadata__title_tesim') %>
|
|
4
|
+
<% edit_path ||= edit_polymorphic_path([:curation_concern, document]) %>
|
|
2
5
|
<div class="row-fluid identifier-and-action">
|
|
3
6
|
<div class="span2 list-number">
|
|
4
7
|
<%= document_counter_with_offset(counter) if defined?(counter) %>
|
|
5
8
|
<%= render :partial => 'catalog/_index_partials/type_display', locals: {document: document} %>
|
|
6
9
|
</div>
|
|
7
10
|
|
|
8
|
-
<div class="span6">
|
|
11
|
+
<div class="span6 search-result-link">
|
|
9
12
|
<%# Minimize Fedora hits by using solr_doc rather than document %>
|
|
10
|
-
<%= link_to
|
|
13
|
+
<%= link_to title_link_text, title_link_target, :id => "src_copy_link_#{solr_doc.noid}" %>
|
|
11
14
|
</div>
|
|
12
15
|
|
|
13
|
-
<div class="span4">
|
|
16
|
+
<div class="span4 search-result-actions">
|
|
14
17
|
<% if current_user -%>
|
|
15
|
-
|
|
18
|
+
<% if can?( :edit, document ) && edit_path.present? %>
|
|
16
19
|
<%= link_to(
|
|
17
20
|
raw('<i class="icon-pencil icon-large"></i>'),
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
)
|
|
22
|
-
|
|
21
|
+
edit_path,
|
|
22
|
+
class: 'itemicon itemedit btn',
|
|
23
|
+
title: "Edit #{document.human_readable_type}"
|
|
24
|
+
)%>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% if can? :collect, document %>
|
|
27
|
+
<%= render 'add_to_collection_gui', collectible: document %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
23
30
|
</div>
|
|
24
|
-
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
<%# This is a search result view %>
|
|
2
2
|
<% noid = collection.noid %>
|
|
3
|
+
<% solr_doc = collection.inner_object.solr_doc %>
|
|
3
4
|
<li id="document_<%= noid %>" class="search-result">
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="span2 list-number">
|
|
8
|
-
<%= document_counter_with_offset( collection_counter ) %>
|
|
9
|
-
<%= render :partial => 'catalog/_index_partials/type_display', locals: {document: collection} %>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="span6">
|
|
13
|
-
<% solr_doc = collection.inner_object.solr_doc %>
|
|
14
|
-
<%# Minimize Fedora hits by using solr_doc rather than document %>
|
|
15
|
-
<%= link_to render_index_field_value(document: solr_doc, field: 'desc_metadata__title_tesim'), collection, :id => "src_copy_link_#{noid}" %>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="span4">
|
|
19
|
-
<% if current_user %>
|
|
20
|
-
<%= render partial: 'add_to_collection_gui', locals: { document: collection } %>
|
|
21
|
-
|
|
22
|
-
<%= link_to(
|
|
23
|
-
raw('<i class="icon-pencil icon-large"></i>'),
|
|
24
|
-
edit_collection_path(collection),
|
|
25
|
-
:class=> 'itemicon itemedit btn pull-right',
|
|
26
|
-
:title => 'Edit Collection'
|
|
27
|
-
) if can? :edit, collection %>
|
|
28
|
-
<% end -%>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
</div>
|
|
6
|
+
<%= render :partial => 'catalog/_index_partials/identifier_and_action', locals: { document: collection, counter: collection_counter, title_link_target: collection, edit_path: edit_collection_path(collection), solr_doc: solr_doc } %>
|
|
32
7
|
|
|
33
8
|
<div class="row-fluid">
|
|
34
9
|
|