sufia 4.0.0.rc1 → 4.0.0.rc2
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/.gitignore +2 -0
- data/.travis.yml +2 -2
- data/Gemfile +9 -17
- data/README.md +18 -9
- data/Rakefile +10 -5
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/jquery.blacklightTagCloud.js +1 -1
- data/app/assets/javascripts/sufia.js +5 -22
- data/app/assets/javascripts/sufia/batch.js +8 -0
- data/app/assets/javascripts/sufia/batch_edit.js +19 -3
- data/app/assets/javascripts/sufia/dashboard_actions.js +23 -10
- data/app/assets/javascripts/sufia/multiForm.js +2 -2
- data/app/assets/javascripts/sufia/permissions.js +10 -9
- data/app/assets/javascripts/sufia/tabs.js +20 -0
- data/app/assets/stylesheets/catalog.css.scss +5 -0
- data/app/assets/stylesheets/collections.css.scss +40 -0
- data/app/assets/stylesheets/file-listing.css.scss +37 -13
- data/app/assets/stylesheets/generic_files.css.erb +5 -0
- data/app/assets/stylesheets/header.css.scss +1 -4
- data/app/assets/stylesheets/settings.css.scss +6 -0
- data/app/assets/stylesheets/styles.css.scss +4 -3
- data/app/assets/stylesheets/sufia-audio-overrides.css +2 -2
- data/app/assets/stylesheets/sufia.css.scss +27 -5
- data/app/assets/stylesheets/tagcloud.css +5 -1
- data/app/controllers/batch_controller.rb +3 -3
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +14 -1
- data/app/controllers/concerns/sufia/catalog.rb +0 -1
- data/app/controllers/concerns/sufia/controller.rb +5 -0
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +2 -9
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +3 -3
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +5 -1
- data/app/controllers/concerns/sufia/homepage_controller.rb +1 -1
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +3 -2
- data/app/helpers/batch_edits_helper.rb +6 -0
- data/app/helpers/generic_file_helper.rb +15 -0
- data/app/helpers/sufia/blacklight_override.rb +19 -3
- data/app/helpers/sufia/dashboard_helper_behavior.rb +25 -3
- data/app/helpers/sufia/records_helper_behavior.rb +13 -5
- data/app/helpers/sufia/sufia_helper_behavior.rb +15 -12
- data/app/models/concerns/sufia/solr_document_behavior.rb +5 -36
- data/app/views/_masthead.html.erb +1 -1
- data/app/views/_user_util_links.html.erb +6 -4
- data/app/views/advanced/_advanced_search_fields.html.erb +4 -4
- data/app/views/advanced/_advanced_search_form.html.erb +14 -17
- data/app/views/advanced/index.html.erb +3 -3
- data/app/views/batch/_metadata.html.erb +22 -24
- data/app/views/batch/_more_metadata.html.erb +1 -1
- data/app/views/batch/edit.html.erb +2 -2
- data/app/views/batch_edits/_check_all.html.erb +7 -9
- data/app/views/batch_edits/_delete_selected.html.erb +1 -0
- data/app/views/batch_edits/edit.html.erb +25 -26
- data/app/views/batch_edits/update_edit.js.erb +1 -1
- data/app/views/catalog/_facet_limit.html.erb +4 -12
- data/app/views/catalog/_search_form.html.erb +8 -13
- data/app/views/collections/_action_menu.html.erb +2 -2
- data/app/views/collections/_collection.html.erb +10 -31
- data/app/views/collections/_document_list.html.erb +1 -1
- data/app/views/collections/_edit_actions.html.erb +2 -2
- data/app/views/collections/_edit_descriptions.html.erb +3 -5
- data/app/views/collections/_form.html.erb +8 -10
- data/app/views/collections/_media_display.html.erb +1 -1
- data/app/views/collections/_show_actions.html.erb +5 -5
- data/app/views/collections/_show_descriptions.html.erb +13 -8
- data/app/views/collections/_show_document_list.html.erb +17 -0
- data/app/views/collections/_show_document_list_menu.html.erb +24 -0
- data/app/views/collections/_show_document_list_row.html.erb +63 -0
- data/app/views/collections/edit.html.erb +2 -2
- data/app/views/collections/show.html.erb +28 -19
- data/app/views/contact_form/new.html.erb +21 -29
- data/app/views/dashboard/_index_partials/_contents.html.erb +14 -0
- data/app/views/dashboard/_index_partials/_heading_actions.html.erb +18 -0
- data/app/views/dashboard/_index_partials/_heading_greetings.html.erb +8 -0
- data/app/views/dashboard/_index_partials/_stats.html.erb +6 -2
- data/app/views/dashboard/index.html.erb +5 -37
- data/app/views/generic_files/_breadcrumbs.html.erb +2 -0
- data/app/views/generic_files/_browse_everything.html.erb +2 -2
- data/app/views/generic_files/_descriptions.html.erb +4 -6
- data/app/views/generic_files/_field_form.html.erb +2 -2
- data/app/views/generic_files/_generic_file.html.erb +8 -29
- data/app/views/generic_files/_groups_description.html.erb +5 -4
- data/app/views/generic_files/_permission.html.erb +2 -2
- data/app/views/generic_files/_permission_form.html.erb +62 -77
- data/app/views/generic_files/_rights_modal.html.erb +0 -2
- data/app/views/generic_files/_share_with.html.erb +14 -0
- data/app/views/generic_files/_show_actions.html.erb +1 -1
- data/app/views/generic_files/_show_collections.html.erb +17 -0
- data/app/views/generic_files/_show_descriptions.html.erb +2 -2
- data/app/views/generic_files/_versioning.html.erb +2 -2
- data/app/views/generic_files/_visibility.html.erb +17 -0
- data/app/views/generic_files/show.html.erb +39 -2
- data/app/views/generic_files/stats.html.erb +1 -1
- data/app/views/generic_files/upload/_form_fields.html.erb +2 -2
- data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +1 -1
- data/app/views/generic_files/upload/_script_templates.html.erb +2 -2
- data/app/views/generic_files/upload/_tos_checkbox.html.erb +3 -3
- data/app/views/homepage/_home_content.html.erb +0 -9
- data/app/views/homepage/_home_header.html.erb +1 -1
- data/app/views/homepage/_recent_document.html.erb +2 -2
- data/app/views/layouts/_head_tag_content.html.erb +7 -1
- data/app/views/layouts/sufia-dashboard.html.erb +4 -2
- data/app/views/layouts/sufia-one-column.html.erb +1 -1
- data/app/views/my/_action_menu.html.erb +1 -1
- data/app/views/my/_collection_action_menu.html.erb +3 -3
- data/app/views/my/_constraints.html.erb +11 -0
- data/app/views/my/_document_list.html.erb +1 -1
- data/app/views/my/_facet_limit.html.erb +4 -12
- data/app/views/my/_facets.html.erb +1 -3
- data/app/views/my/_index_partials/_default_group.html.erb +2 -3
- data/app/views/my/_index_partials/_list_collections.html.erb +17 -11
- data/app/views/my/_index_partials/_list_files.html.erb +20 -24
- data/app/views/my/_search_header.html.erb +5 -0
- data/app/views/my/_sort_and_per_page.html.erb +11 -7
- data/app/views/my/index.html.erb +9 -15
- data/app/views/records/_edit_field.html.erb +14 -10
- data/app/views/records/edit_fields/_default.html.erb +6 -0
- data/app/views/records/edit_fields/_description.html.erb +3 -7
- data/app/views/records/edit_fields/_resource_type.html.erb +4 -6
- data/app/views/records/edit_fields/_rights.html.erb +4 -5
- data/app/views/records/edit_fields/_suffix.html.erb +6 -3
- data/app/views/records/edit_fields/_type.html.erb +7 -12
- data/app/views/{generic_files → records}/show_fields/_based_near.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_contributor.html.erb +2 -2
- data/app/views/records/show_fields/_creator.html.erb +6 -0
- data/app/views/{generic_files → records}/show_fields/_date_created.html.erb +1 -1
- data/app/views/records/show_fields/_default.html.erb +6 -0
- data/app/views/records/show_fields/_description.html.erb +6 -0
- data/app/views/records/show_fields/_identifier.html.erb +4 -0
- data/app/views/{generic_files → records}/show_fields/_language.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_publisher.html.erb +1 -1
- data/app/views/records/show_fields/_related_url.html.erb +6 -0
- data/app/views/{generic_files → records}/show_fields/_resource_type.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_rights.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_subject.html.erb +1 -1
- data/app/views/{generic_files → records}/show_fields/_tag.html.erb +1 -1
- data/app/views/records/show_fields/_title.html.erb +6 -0
- data/app/views/shared/_attributes.html.erb +27 -0
- data/app/views/static/agreement.html.erb +1 -1
- data/app/views/users/_activity_log.html.erb +0 -2
- data/app/views/users/_follower_modal.html.erb +27 -23
- data/app/views/users/_following_modal.html.erb +27 -23
- data/app/views/users/_social_media_info.html.erb +4 -4
- data/app/views/users/_trophy_edit.html.erb +5 -7
- data/app/views/users/_user_info.html.erb +3 -3
- data/app/views/users/_user_util_links_extra.html.erb +4 -0
- data/app/views/users/edit.html.erb +28 -33
- data/app/views/users/index.html.erb +1 -1
- data/app/views/users/show.html.erb +0 -4
- data/config/jetty.yml +1 -1
- data/config/locales/sufia.en.yml +53 -12
- data/lib/generators/sufia/install_generator.rb +89 -0
- data/lib/generators/sufia/templates/catalog_controller.rb +1 -1
- data/lib/generators/sufia/upgrade400_generator.rb +4 -0
- data/lib/sufia.rb +1 -10
- data/lib/sufia/version.rb +1 -1
- data/solr_conf/conf/solrconfig.xml +31 -17
- data/spec/actors/generic_file/actor_spec.rb +17 -0
- data/spec/controllers/batch_controller_spec.rb +2 -2
- data/spec/controllers/batch_edits_controller_spec.rb +24 -19
- data/spec/controllers/catalog_controller_spec.rb +23 -12
- data/spec/controllers/collections_controller_spec.rb +19 -17
- data/spec/controllers/dashboard_controller_spec.rb +5 -19
- data/spec/controllers/generic_files_controller_spec.rb +35 -20
- data/spec/controllers/homepage_controller_spec.rb +25 -2
- data/spec/controllers/users_controller_spec.rb +99 -102
- data/spec/factories/generic_files.rb +2 -2
- data/spec/factories/users.rb +32 -2
- data/spec/features/browse_dashboard_files_spec.rb +14 -2
- data/spec/features/browse_files_spec.rb +5 -1
- data/spec/features/catalog_search_spec.rb +7 -6
- data/spec/features/collection_spec.rb +43 -33
- data/spec/features/display_dashboard_spec.rb +25 -22
- data/spec/features/notifications_spec.rb +9 -4
- data/spec/features/users_spec.rb +34 -25
- data/spec/fixtures/1.5mb-avatar.jpg +0 -0
- data/spec/helpers/batch_edits_helper_spec.rb +38 -0
- data/spec/helpers/dashboard_helper_spec.rb +16 -5
- data/spec/helpers/generic_file_helper_spec.rb +41 -0
- data/spec/helpers/records_helper_spec.rb +12 -0
- data/spec/jobs/active_fedora_pid_based_job_spec.rb +1 -1
- data/spec/jobs/audit_job_spec.rb +2 -3
- data/spec/jobs/batch_update_job_spec.rb +39 -24
- data/spec/jobs/event_jobs_spec.rb +1 -1
- data/spec/lib/sufia/id_service_spec.rb +25 -7
- data/spec/lib/sufia/messages_spec.rb +60 -0
- data/spec/lib/sufia/readable_permissions_spec.rb +56 -0
- data/spec/lib/sufia/writable_permissions_spec.rb +20 -0
- data/spec/models/batch_spec.rb +1 -1
- data/spec/models/collection_spec.rb +24 -2
- data/spec/models/featured_work_spec.rb +2 -2
- data/spec/models/file_content_datastream_spec.rb +5 -5
- data/spec/models/generic_file_spec.rb +149 -133
- data/spec/models/local_authority_spec.rb +1 -1
- data/spec/models/user_spec.rb +33 -6
- data/spec/spec_helper.rb +7 -10
- data/spec/{support → test_app_templates}/lib/generators/test_app_generator.rb +11 -6
- data/spec/views/batch/edit.html.erb_spec.rb +8 -2
- data/spec/views/catalog/index.html.erb_spec.rb +34 -0
- data/spec/views/catalog/{sort_and_per_pange.html.erb_spec.rb → sort_and_per_page.html.erb_spec.rb} +0 -0
- data/spec/views/collections/_form.html.erb_spec.rb +32 -0
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +25 -0
- data/spec/views/dashboard/index_spec.rb +33 -4
- data/spec/views/generic_file/_breadcrumbs.html.erb_spec.rb +32 -0
- data/spec/views/generic_file/show.html.erb_spec.rb +273 -8
- data/spec/views/users/_user_util_links.html.erb_spec.rb +25 -0
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +14 -5
- data/sufia-models/{lib/sufia/models → app}/jobs/active_fedora_pid_based_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/audit_job.rb +4 -10
- data/sufia-models/{lib/sufia/models → app}/jobs/batch_update_job.rb +22 -18
- data/sufia-models/{lib/sufia/models → app}/jobs/characterize_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/create_derivatives_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/import_url_job.rb +0 -0
- data/sufia-models/{lib/sufia/models → app}/jobs/resolrize_job.rb +0 -0
- data/sufia-models/app/models/collection.rb +1 -39
- data/sufia-models/{lib → app/models/concerns}/sufia/ability.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/collection.rb +55 -0
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +5 -11
- data/sufia-models/app/models/concerns/sufia/generic_file/audit.rb +1 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/characterization.rb +4 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +27 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/mime_types.rb +1 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/permissions.rb +2 -49
- data/sufia-models/{lib/sufia/models → app/models/concerns/sufia}/model_methods.rb +0 -0
- data/sufia-models/app/models/concerns/sufia/user.rb +8 -1
- data/sufia-models/app/models/sufia/avatar_uploader.rb +2 -3
- data/sufia-models/app/services/sufia/noid.rb +9 -0
- data/sufia-models/config/locales/sufia.en.yml +1 -0
- data/sufia-models/lib/generators/sufia/models/fulltext_generator.rb +27 -0
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +7 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/analytics.yml +5 -5
- data/sufia-models/lib/generators/sufia/models/templates/config/solrconfig.xml +177 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +3 -1
- data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +7 -0
- data/sufia-models/lib/sufia/messages.rb +67 -0
- data/sufia-models/lib/sufia/models.rb +2 -0
- data/sufia-models/lib/sufia/models/active_fedora/redis.rb +0 -6
- data/sufia-models/lib/sufia/models/engine.rb +1 -3
- data/sufia-models/lib/sufia/models/resque.rb +1 -1
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/lib/sufia/permissions.rb +9 -0
- data/sufia-models/lib/sufia/permissions/readable.rb +20 -0
- data/sufia-models/lib/sufia/permissions/writable.rb +56 -0
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +58 -2
- data/sufia-models/sufia-models.gemspec +11 -11
- data/sufia.gemspec +19 -9
- data/tasks/jetty.rake +6 -5
- data/tasks/sufia-dev.rake +4 -77
- metadata +235 -72
- data/app/assets/images/folder.png +0 -0
- data/app/views/collections/show_fields/_creator.html.erb +0 -11
- data/app/views/collections/show_fields/_description.html.erb +0 -8
- data/app/views/collections/show_fields/_title.html.erb +0 -8
- data/app/views/generic_files/edit_fields/_default.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_description.html.erb +0 -5
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_rights.html.erb +0 -6
- data/app/views/generic_files/edit_fields/_suffix.html.erb +0 -9
- data/app/views/generic_files/show_fields/_creator.html.erb +0 -7
- data/app/views/generic_files/show_fields/_default.html.erb +0 -6
- data/app/views/generic_files/show_fields/_description.html.erb +0 -7
- data/app/views/generic_files/show_fields/_identifier.html.erb +0 -4
- data/app/views/generic_files/show_fields/_related_url.html.erb +0 -6
- data/app/views/generic_files/show_fields/_title.html.erb +0 -7
- data/lib/generators/sufia/sufia_generator.rb +0 -89
- data/spec/active_fedora/unsaved_digital_object_spec.rb +0 -35
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
$
|
|
1
|
+
h4 .small {
|
|
2
|
+
color: $navbar-default-toggle-icon-bar-bg;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.table thead th {
|
|
6
|
+
text-align: center;
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
.table {
|
|
5
10
|
> tbody {
|
|
@@ -17,6 +22,7 @@ $gray-lighter: #eee;
|
|
|
17
22
|
}
|
|
18
23
|
dd {
|
|
19
24
|
margin-left: -15px;
|
|
25
|
+
min-height: 1.5em;
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -35,7 +41,8 @@ $gray-lighter: #eee;
|
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
.file_listing_thumbnail {
|
|
38
|
-
|
|
44
|
+
@extend .media-object;
|
|
45
|
+
width: 64px;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
.nav > li > a.accordion-toggle {
|
|
@@ -59,10 +66,6 @@ $gray-lighter: #eee;
|
|
|
59
66
|
}
|
|
60
67
|
}
|
|
61
68
|
|
|
62
|
-
.facet_select {
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
69
|
.facet-count {
|
|
67
70
|
padding-left: 0.2em;
|
|
68
71
|
padding-right: 0.2em;
|
|
@@ -73,15 +76,11 @@ $gray-lighter: #eee;
|
|
|
73
76
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
.batch-info {
|
|
77
|
-
margin-bottom: 0.8em;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
79
|
.sorts-dash, .sorts, .expandable_new {
|
|
81
80
|
cursor: pointer;
|
|
82
81
|
}
|
|
83
82
|
.sort-toggle {
|
|
84
|
-
padding:
|
|
83
|
+
padding: 10px 0 10px 0;
|
|
85
84
|
}
|
|
86
85
|
.caret.up {
|
|
87
86
|
border-top: 0;
|
|
@@ -120,7 +119,20 @@ $gray-lighter: #eee;
|
|
|
120
119
|
|
|
121
120
|
.heading-row {
|
|
122
121
|
border-bottom: 1px solid $gray-lightish;
|
|
123
|
-
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
input.batch_document_selector {
|
|
125
|
+
margin: 10px 10px 2px 10px;
|
|
126
|
+
padding: 0px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
input#check_all {
|
|
130
|
+
padding: 0;
|
|
131
|
+
margin: 3px 3px 3px 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.constraints-container {
|
|
135
|
+
margin-bottom: 10px;
|
|
124
136
|
}
|
|
125
137
|
|
|
126
138
|
#collection-list-container {
|
|
@@ -136,3 +148,15 @@ $gray-lighter: #eee;
|
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
|
|
151
|
+
#documents {
|
|
152
|
+
.media-body {
|
|
153
|
+
padding-top: 12px;
|
|
154
|
+
}
|
|
155
|
+
td {
|
|
156
|
+
vertical-align: middle;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#my_nav {
|
|
161
|
+
margin-bottom: 20px;
|
|
162
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
$gray-lightish: #bbb;
|
|
2
|
-
$gray-lighter: #eee;
|
|
3
|
-
|
|
4
1
|
#masthead {
|
|
5
2
|
background: #0071BC; /* Old browsers */
|
|
6
3
|
background-image: -webkit-gradient(
|
|
@@ -98,5 +95,5 @@ $gray-lighter: #eee;
|
|
|
98
95
|
margin-top: 7px;
|
|
99
96
|
}
|
|
100
97
|
#search-submit-header {
|
|
101
|
-
|
|
98
|
+
border: none;
|
|
102
99
|
}
|
|
@@ -4,21 +4,26 @@
|
|
|
4
4
|
*= require video-js
|
|
5
5
|
*= require jquery-ui
|
|
6
6
|
*= require sufia-audio-overrides
|
|
7
|
-
*= require styles
|
|
8
|
-
*= require header
|
|
9
7
|
*= require home-page
|
|
10
8
|
*= require tagcloud
|
|
11
9
|
*= require featured
|
|
12
|
-
*= require file-listing
|
|
13
10
|
*= require usage-stats
|
|
14
11
|
*= require nestable
|
|
12
|
+
*= require catalog
|
|
15
13
|
*/
|
|
16
14
|
|
|
17
15
|
@import 'bootstrap';
|
|
18
|
-
|
|
19
16
|
@import 'blacklight/blacklight';
|
|
20
17
|
@import "browse_everything";
|
|
21
18
|
|
|
19
|
+
// Use import here instead of require so we can use the Sass variables defined in Bootstrap and Blacklight
|
|
20
|
+
// TODO: Probably should use import throughout and move all of Sufia's stylesheets into a single named directory.
|
|
21
|
+
@import 'settings';
|
|
22
|
+
@import 'header';
|
|
23
|
+
@import 'styles';
|
|
24
|
+
@import 'file-listing';
|
|
25
|
+
@import 'collections';
|
|
26
|
+
|
|
22
27
|
#browse-everything {
|
|
23
28
|
top:10%;
|
|
24
29
|
background-color: initial;
|
|
@@ -34,4 +39,21 @@
|
|
|
34
39
|
|
|
35
40
|
#content {
|
|
36
41
|
padding-top: 10px;
|
|
37
|
-
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* This class is to workaround an issue in which Bootstrap requires a div to display a tooltip
|
|
45
|
+
* on a disabled button. Using a span instead of a div would be ideal but unfortunately it does
|
|
46
|
+
* not render the tooltip correctly in all browsers (e.g. in Chrome the tooltip is detected in
|
|
47
|
+
* the wrong position). This class forces the div to render inline, just like a span.
|
|
48
|
+
*
|
|
49
|
+
* More info:
|
|
50
|
+
* http://getbootstrap.com/css/#responsive-utilities-classes
|
|
51
|
+
* http://stackoverflow.com/a/19938049/446681
|
|
52
|
+
*/
|
|
53
|
+
.visible-all-inline-block {
|
|
54
|
+
display: inline-block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button_to-inline {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.tagcloud {
|
|
2
2
|
padding-left: 0px;
|
|
3
|
-
text-align:
|
|
3
|
+
text-align: center;
|
|
4
4
|
}
|
|
5
5
|
.tagcloud li{
|
|
6
6
|
display: inline;
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
.tagcloud.list li {
|
|
15
15
|
display: block;
|
|
16
16
|
}
|
|
17
|
+
.tagcloud li a {
|
|
18
|
+
color: inherit;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
.tagcloud li .badge {
|
|
18
22
|
display:none;
|
|
19
23
|
}
|
|
@@ -8,7 +8,7 @@ class BatchController < ApplicationController
|
|
|
8
8
|
def edit
|
|
9
9
|
@batch = Batch.find_or_create(params[:id])
|
|
10
10
|
@generic_file = GenericFile.new
|
|
11
|
-
@generic_file.creator = current_user.name
|
|
11
|
+
@generic_file.creator = [current_user.name]
|
|
12
12
|
@generic_file.title = @batch.generic_files.map(&:label)
|
|
13
13
|
@generic_file.initialize_fields
|
|
14
14
|
end
|
|
@@ -16,10 +16,10 @@ class BatchController < ApplicationController
|
|
|
16
16
|
def update
|
|
17
17
|
authenticate_user!
|
|
18
18
|
@batch = Batch.find_or_create(params[:id])
|
|
19
|
-
@batch.status="processing"
|
|
19
|
+
@batch.status = ["processing"]
|
|
20
20
|
@batch.save
|
|
21
21
|
Sufia.queue.push(BatchUpdateJob.new(current_user.user_key, params))
|
|
22
|
-
flash[:notice] = 'Your files are being processed by ' + t('sufia.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-
|
|
22
|
+
flash[:notice] = 'Your files are being processed by ' + t('sufia.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-danger" title="Private">Private</span> until this process is complete (shouldn\'t take too long, hang in there!). You may need to refresh your dashboard to see these updates.'
|
|
23
23
|
redirect_to sufia.dashboard_files_path
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -40,9 +40,13 @@ module Sufia
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def after_update
|
|
43
|
-
|
|
43
|
+
redirect_to_return_controller unless request.xhr?
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
def after_destroy_collection
|
|
47
|
+
redirect_to_return_controller unless request.xhr?
|
|
48
|
+
end
|
|
49
|
+
|
|
46
50
|
def update_document(obj)
|
|
47
51
|
super
|
|
48
52
|
obj.date_modified = Time.now.ctime
|
|
@@ -86,5 +90,14 @@ module Sufia
|
|
|
86
90
|
file[key] = attributes[key].empty? ? [''] : attributes[key]
|
|
87
91
|
end
|
|
88
92
|
end
|
|
93
|
+
|
|
94
|
+
def redirect_to_return_controller
|
|
95
|
+
if params[:return_controller]
|
|
96
|
+
redirect_to sufia.url_for(controller: params[:return_controller], only_path: true)
|
|
97
|
+
else
|
|
98
|
+
redirect_to sufia.dashboard_index_path
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
89
102
|
end
|
|
90
103
|
end
|
|
@@ -41,6 +41,11 @@ module Sufia::Controller
|
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
# Override Devise method to redirect to dashboard after signing in
|
|
45
|
+
def after_sign_in_path_for(resource)
|
|
46
|
+
sufia.dashboard_index_path
|
|
47
|
+
end
|
|
48
|
+
|
|
44
49
|
protected
|
|
45
50
|
|
|
46
51
|
### Hook which is overridden in Sufia::Ldap::Controller
|
|
@@ -32,20 +32,13 @@ module Sufia
|
|
|
32
32
|
# in your dashboard view. You'll need to alter dashboard/index.html.erb accordingly.
|
|
33
33
|
def gather_dashboard_information
|
|
34
34
|
@user = current_user
|
|
35
|
-
@activity =
|
|
35
|
+
@activity = current_user.get_all_user_activity(params[:since].blank? ? DateTime.now.to_i - 8640 : params[:since].to_i)
|
|
36
36
|
@notifications = current_user.mailbox.inbox
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
# Returns the most recent activity in the last 24 hours, or since a given timestamp
|
|
40
|
-
# specified by params[:since]
|
|
41
|
-
def get_user_activity
|
|
42
|
-
since = params[:since] ? params[:since].to_i : (DateTime.now.to_i - 86400)
|
|
43
|
-
current_user.events.reverse.collect { |event| event if event[:timestamp].to_i > since }.compact
|
|
44
|
-
end
|
|
45
|
-
|
|
46
39
|
# Formats the user's activities into human-readable strings used for rendering JSON
|
|
47
40
|
def human_readable_user_activity
|
|
48
|
-
|
|
41
|
+
current_user.get_all_user_activity.map do |event|
|
|
49
42
|
[event[:action], "#{time_ago_in_words(Time.at(event[:timestamp].to_i))} ago", event[:timestamp].to_i]
|
|
50
43
|
end
|
|
51
44
|
end
|
|
@@ -15,15 +15,15 @@ module Sufia::FilesController
|
|
|
15
15
|
def create_from_browse_everything(params)
|
|
16
16
|
params[:selected_files].each_pair do |index, file_info|
|
|
17
17
|
next if file_info.blank? || file_info["url"].blank?
|
|
18
|
-
create_file_from_url(file_info["url"])
|
|
18
|
+
create_file_from_url(file_info["url"], file_info["file_name"])
|
|
19
19
|
end
|
|
20
20
|
redirect_to self.class.upload_complete_path( params[:batch_id])
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
# Generic utility for creating GenericFile from a URL
|
|
24
24
|
# Used in to import files using URLs from a file picker like browse_everything
|
|
25
|
-
def create_file_from_url(url, batch_id=nil)
|
|
26
|
-
generic_file = ::GenericFile.new(import_url: url, label:
|
|
25
|
+
def create_file_from_url(url, file_name, batch_id=nil)
|
|
26
|
+
generic_file = ::GenericFile.new(import_url: url, label: file_name).tap do |gf|
|
|
27
27
|
actor = Sufia::GenericFile::Actor.new(gf, current_user)
|
|
28
28
|
actor.create_metadata(params[:batch_id])
|
|
29
29
|
gf.save!
|
|
@@ -112,7 +112,7 @@ module Sufia
|
|
|
112
112
|
|
|
113
113
|
# routed to /files/:id (PUT)
|
|
114
114
|
def update
|
|
115
|
-
success = if
|
|
115
|
+
success = if wants_to_revert?
|
|
116
116
|
update_version
|
|
117
117
|
elsif params.has_key? :filedata
|
|
118
118
|
update_file
|
|
@@ -134,6 +134,10 @@ module Sufia
|
|
|
134
134
|
|
|
135
135
|
protected
|
|
136
136
|
|
|
137
|
+
def wants_to_revert?
|
|
138
|
+
params.has_key?(:revision) && params[:revision] != @generic_file.content.latest_version.versionID
|
|
139
|
+
end
|
|
140
|
+
|
|
137
141
|
def actor
|
|
138
142
|
@actor ||= Sufia::GenericFile::Actor.new(@generic_file, current_user)
|
|
139
143
|
end
|
|
@@ -49,13 +49,14 @@ module Sufia::UsersControllerBehavior
|
|
|
49
49
|
def update
|
|
50
50
|
if params[:user]
|
|
51
51
|
@user.update_attributes(params.require(:user).permit(*User.permitted_attributes))
|
|
52
|
+
@user.populate_attributes if ActiveRecord::ConnectionAdapters::Column.value_to_boolean(params[:user][:update_directory])
|
|
52
53
|
end
|
|
53
|
-
|
|
54
|
-
@user.remove_avatar = true if params[:delete_avatar]
|
|
54
|
+
|
|
55
55
|
unless @user.save
|
|
56
56
|
redirect_to sufia.edit_profile_path(@user.to_param), alert: @user.errors.full_messages
|
|
57
57
|
return
|
|
58
58
|
end
|
|
59
|
+
# TODO this should be moved to TrophiesController
|
|
59
60
|
params.keys.select {|k, v| k.starts_with? 'remove_trophy_' }.each do |smash_trophy|
|
|
60
61
|
smash_trophy = smash_trophy.sub /^remove_trophy_/, ''
|
|
61
62
|
current_user.trophies.where(generic_file_id: smash_trophy).destroy_all
|
|
@@ -32,6 +32,12 @@ module GenericFileHelper
|
|
|
32
32
|
link_to (text || "Download"), sufia.download_path(@generic_file.noid), { id: "file_download", target: "_new", data: { label: @generic_file.id } }
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def render_collection_list gf
|
|
36
|
+
unless gf.collections.empty?
|
|
37
|
+
("Is part of: " + gf.collections.map { |c| link_to(c.title, collections.collection_path(c.id)) }.join(", ")).html_safe
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
35
41
|
private
|
|
36
42
|
|
|
37
43
|
def render_edit_field_partial_with_action(action, key, locals)
|
|
@@ -74,4 +80,13 @@ module GenericFileHelper
|
|
|
74
80
|
image_tag sufia.download_path(@generic_file, datastream_id: 'thumbnail'), { class: "img-responsive", alt: "#{title} of #{@generic_file.title.first}" }
|
|
75
81
|
end
|
|
76
82
|
end
|
|
83
|
+
|
|
84
|
+
def render_visibility_badge
|
|
85
|
+
if can? :edit, @generic_file
|
|
86
|
+
render_visibility_link @generic_file
|
|
87
|
+
else
|
|
88
|
+
render_visibility_label @generic_file
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
77
92
|
end
|
|
@@ -4,8 +4,24 @@ module Sufia
|
|
|
4
4
|
false
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
def url_for_document doc, options = {}
|
|
8
|
+
if doc['has_model_ssim'].first == ::Collection.to_class_uri
|
|
9
|
+
[collections, doc]
|
|
10
|
+
else
|
|
11
|
+
[sufia, doc]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def render_constraints_query(localized_params = params)
|
|
16
|
+
# So simple don't need a view template, we can just do it here.
|
|
17
|
+
scope = localized_params.delete(:route_set) || self
|
|
18
|
+
return "".html_safe if localized_params[:q].blank?
|
|
19
|
+
|
|
20
|
+
render_constraint_element(constraint_query_label(localized_params),
|
|
21
|
+
localized_params[:q],
|
|
22
|
+
:classes => ["query"],
|
|
23
|
+
:remove => scope.url_for(localized_params.merge(:q=>nil, :action=>'index')))
|
|
24
|
+
end
|
|
25
|
+
|
|
10
26
|
end
|
|
11
27
|
end
|