sufia 6.0.0.rc3 → 6.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/README.md +2 -18
  4. data/SUFIA_VERSION +1 -1
  5. data/app/assets/javascripts/sufia.js +1 -0
  6. data/app/assets/javascripts/sufia/featured_researcher.js +14 -0
  7. data/app/assets/javascripts/sufia/user_search.js +5 -2
  8. data/app/assets/stylesheets/sufia/_buttons.scss +68 -8
  9. data/app/assets/stylesheets/sufia/_dashboard.scss +20 -2
  10. data/app/assets/stylesheets/sufia/_featured.scss +4 -0
  11. data/app/assets/stylesheets/sufia/_file-listing.scss +4 -0
  12. data/app/assets/stylesheets/sufia/_header.scss +31 -35
  13. data/app/assets/stylesheets/sufia/_settings.scss +40 -3
  14. data/app/assets/stylesheets/sufia/_styles.scss +2 -14
  15. data/app/controllers/batch_controller.rb +1 -44
  16. data/app/controllers/concerns/sufia/batch_controller_behavior.rb +55 -0
  17. data/app/controllers/concerns/sufia/files_controller_behavior.rb +7 -3
  18. data/app/controllers/concerns/sufia/single_use_links_controller_behavior.rb +51 -0
  19. data/app/controllers/concerns/sufia/single_use_links_viewer_controller_behavior.rb +58 -0
  20. data/app/controllers/content_blocks_controller.rb +10 -1
  21. data/app/controllers/single_use_links_controller.rb +2 -41
  22. data/app/controllers/single_use_links_viewer_controller.rb +1 -50
  23. data/app/helpers/content_block_helper.rb +5 -1
  24. data/app/views/batch/edit.html.erb +1 -1
  25. data/app/views/batch_edits/_delete_selected.html.erb +2 -2
  26. data/app/views/collections/_sort_and_per_page.html.erb +1 -1
  27. data/app/views/content_blocks/_featured_researcher.html.erb +3 -0
  28. data/app/views/content_blocks/index.html.erb +7 -0
  29. data/app/views/dashboard/_index_partials/_user_info.html.erb +2 -2
  30. data/app/views/generic_files/_permission.html.erb +1 -1
  31. data/app/views/generic_files/show.html.erb +1 -1
  32. data/app/views/generic_files/upload/_form_fields.html.erb +3 -3
  33. data/app/views/homepage/_featured_researcher.html.erb +1 -0
  34. data/app/views/my/_sort_and_per_page.html.erb +1 -1
  35. data/config/routes.rb +1 -0
  36. data/lib/generators/sufia/install_generator.rb +16 -0
  37. data/lib/sufia/version.rb +1 -1
  38. data/spec/controllers/content_blocks_controller_spec.rb +14 -0
  39. data/spec/jobs/sufia_resque_queue_spec.rb +49 -0
  40. data/spec/models/ability_spec.rb +3 -0
  41. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -10
  42. data/spec/views/dashboard/index_spec.rb +2 -2
  43. data/spec/views/generic_file/show.html.erb_spec.rb +14 -2
  44. data/sufia-models/app/models/concerns/sufia/ability.rb +1 -0
  45. data/sufia-models/lib/generators/sufia/models/install_generator.rb +5 -10
  46. data/sufia-models/lib/sufia/models/resque.rb +8 -0
  47. data/sufia-models/lib/sufia/models/version.rb +1 -1
  48. metadata +13 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a67f16943a8f2a6992d93cd1b9a2f55a983864f9
4
- data.tar.gz: a1ded0b6d953e9821b63b8662e4ade6d28444e93
3
+ metadata.gz: 8e0e2744f7b799d2b4a2d090e260e66c6ed2cc5d
4
+ data.tar.gz: 142e115791a129a7b013773cd20993909f4e3f86
5
5
  SHA512:
6
- metadata.gz: dbc993658fa74c21bf7413c5339aed88aa1235f7b3d964005182a1395d3c767dfa06679225f7ae964c75086b076837e064d0b0288c8d5dbd84768d8700c4a0de
7
- data.tar.gz: 182feec8e0a68c2a11eecfbcd3f896d43018e891151be4b491e23b127c49511e7efe6bbdd39a095f18aeaef2391a68a5924f34b936f16f0222dcd916c3986320
6
+ metadata.gz: 15e992259c723cf8cd267b89e1a3a1008650a009165cf8490d0cdb7c86bd577e6db0c298e7b7ea99301af325a7f76925e4339724ee015c2fda6c1457ba51b2c2
7
+ data.tar.gz: 12b7cbf716a772af91f4740064cf148f6aac7726d4d6ac3f5fdb4d01aad12f30c378bd4393834f55d0f63e9407755a3395a26ba6f1b82b412ae6d468c68da849
data/Gemfile CHANGED
@@ -20,10 +20,10 @@ if File.exists?(file)
20
20
  else
21
21
  gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
22
22
 
23
- if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/
23
+ if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] !~ /^4.2/
24
+ gem 'sass-rails', "< 5.0"
25
+ else
24
26
  gem 'responders', "~> 2.0"
25
27
  gem 'sass-rails', ">= 5.0"
26
- else
27
- gem 'sass-rails', "< 5.0"
28
28
  end
29
29
  end
data/README.md CHANGED
@@ -96,28 +96,12 @@ rake jetty:start
96
96
  ### To use the CSS and JavaScript and other assets that ship with Sufia...
97
97
 
98
98
  #### Modify app/assets/stylesheets/application.css
99
- Add this line:
100
- ```
101
- *= require sufia
102
- ```
103
- **Remove** this line:
104
- ```*= require_tree .```
105
-
106
- _Removing the require_tree from application.css will ensure you're not loading the blacklight.css. This is because blacklight's css styling does not mix well with sufia's default styling._
107
-
108
- #### Modify app/assets/javascripts/application.js
109
-
110
- Add this line at the bottom of the file:
111
- ```
112
- //= require sufia
113
- ```
114
-
115
- **Remove** this line, if present (typically, when using Rails 4):
99
+ **Remove** this line, if present:
116
100
  ```
117
101
  //= require turbolinks
118
102
  ```
119
103
 
120
- Turbolinks does not mix well with Blacklight.
104
+ Turbolinks causes the TinyMCE editor to not load.
121
105
 
122
106
  ### Install Notes
123
107
 
@@ -1 +1 @@
1
- 6.0.0.rc3
1
+ 6.0.0.rc4
@@ -34,6 +34,7 @@
34
34
  //= require sufia/permissions
35
35
  //= require sufia/trophy
36
36
  //= require sufia/featured_works
37
+ //= require sufia/featured_researcher
37
38
  //= require sufia/batch_select_all
38
39
  //= require sufia/edit_metadata
39
40
  //= require sufia/single_use_link
@@ -0,0 +1,14 @@
1
+
2
+ // The selector for the User field (external_key field) on the
3
+ // featured researcher form
4
+
5
+ (function( $ ){
6
+ $.fn.userSelector = function( options ) {
7
+ $(".select2-user").userSearch();
8
+ };
9
+ })( jQuery );
10
+
11
+ Blacklight.onLoad(function() {
12
+ $('.select2-user').userSelector();
13
+ });
14
+
@@ -8,9 +8,12 @@
8
8
 
9
9
  return this.each(function() {
10
10
  $(this).select2( {
11
- placeholder: "Search for a user",
11
+ placeholder: $(this).attr('value') || "Search for a user",
12
12
  minimumInputLength: 2,
13
- initSelection: function(element, callback) { },
13
+ initSelection : function (element, callback) {
14
+ var data = {id: element.val(), text: element.val()};
15
+ callback(data);
16
+ },
14
17
  ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
15
18
  url: "/users.json",
16
19
  dataType: 'json',
@@ -1,13 +1,73 @@
1
- .btn-raised {
2
- box-shadow: 1px 2px 2px 0 rgba(0, 0, 0, 0.15);
1
+ .action-button {
2
+ padding-top: 1em;
3
+ padding-bottom: 1em;
3
4
  }
4
5
 
5
- .btn-raised:active {
6
- box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.1);
7
- transition-delay: 0s;
6
+ .multi_value .listing .input-group {
7
+ margin-bottom: .35em;
8
8
  }
9
9
 
10
- .action-button {
11
- padding-top: 1em;
12
- padding-bottom: 1em;
10
+ .input-group-btn:last-child > .btn {
11
+ margin-left: 0;
12
+ }
13
+
14
+ ul.listing .add, ul.listing .remove {
15
+ width: 7em;
16
+ text-align: center;
17
+ }
18
+
19
+ .add, .btn-primary {
20
+ background-color: $add-background-color;
21
+ border-color: $add-border-color;
22
+ color: $add-text-color;
23
+ }
24
+ .add:hover, .add:focus,
25
+ .btn-primary:hover, .btn-primary:focus {
26
+ background-color: $add-background-hover;
27
+ border-color: $add-border-color;
28
+ color: $add-text-hover;
29
+ }
30
+
31
+ #search-form-header {
32
+ .btn-primary:hover, .btn-primary:focus {
33
+ background-color: $gray-light !important;
34
+ color: $basic-black;
35
+ }
13
36
  }
37
+
38
+ .remove, .btn-danger {
39
+ background-color: $remove-background-color;
40
+ border-color: $remove-border-color;
41
+ color: $remove-text-color;
42
+ }
43
+ .remove:hover, .remove:focus,
44
+ .btn-danger:hover, .btn-danger:focus {
45
+ background-color: $remove-background-hover;
46
+ border-color: $remove-border-color;
47
+ color: $remove-text-hover;
48
+ }
49
+
50
+ .btn-warning {
51
+ background-color: $neutral-background-color;
52
+ border-color: $neutral-border-color;
53
+ color: $neutral-text-color;
54
+ }
55
+ .btn-warning:hover, .btn-warning:focus {
56
+ background-color: $neutral-background-hover;
57
+ border-color: $neutral-border-color;
58
+ color: $neutral-text-hover;
59
+ }
60
+
61
+ .info {
62
+ background-color: $view-select-background-color;
63
+ border-color: $view-select-border-color;
64
+ color: $view-select-text-color;
65
+ }
66
+ .info:hover, .info:focus {
67
+ background-color: $view-select-background-hover;
68
+ border-color: $view-select-border-color;
69
+ color: $view-select-text-hover;
70
+ }
71
+
72
+
73
+
@@ -56,10 +56,16 @@
56
56
  padding-top: .5em;
57
57
  a:link, a:visited {
58
58
  color: $icon-link-color;
59
+ text-decoration: none;
60
+ transition-property: background-color, color;
61
+ transition-duration: .35s;
62
+ transition-timing-function: ease-out;
59
63
  }
60
- a:hover {
64
+ a:hover, a:focus {
61
65
  color: $icon-link-hover-color;
62
- text-decoration: none;
66
+ transition-property: background-color, color;
67
+ transition-duration: .35s;
68
+ transition-timing-function: ease-out;
63
69
  }
64
70
  }
65
71
 
@@ -74,6 +80,18 @@ div.heading-tile .glyphicon {
74
80
  border-radius: 50%;
75
81
  border: 2px solid $icon-border-color;
76
82
  overflow: hidden;
83
+ transition-property: background-color, color;
84
+ transition-duration: .35s;
85
+ transition-timing-function: ease-out;
86
+ }
87
+
88
+ div.heading-tile:hover .glyphicon {
89
+ background-color: $icon-background-color-hover;
90
+ border-color: $icon-border-color-hover;
91
+ color: $icon-font-color-hover;
92
+ transition-property: background-color, color;
93
+ transition-duration: .35s;
94
+ transition-timing-function: ease-out;
77
95
  }
78
96
 
79
97
  .proxy-search h3 {
@@ -14,3 +14,7 @@ ol#featured_works {
14
14
  }
15
15
  }
16
16
 
17
+ .featured-researcher {
18
+ padding: 1em 0;
19
+ border-bottom: 1px dotted $gray-lighter;
20
+ }
@@ -2,6 +2,10 @@ h4 .small {
2
2
  color: $navbar-default-toggle-icon-bar-bg;
3
3
  }
4
4
 
5
+ .table-responsive {
6
+ overflow-x: visible;
7
+ }
8
+
5
9
  .table thead th {
6
10
  text-align: center;
7
11
  }
@@ -1,17 +1,5 @@
1
1
  #masthead {
2
- background: #0071BC; /* Old browsers */
3
- background-image: -webkit-gradient(
4
- linear,
5
- left top,
6
- left bottom,
7
- color-stop(0, #0071BC),
8
- color-stop(1, #003457)
9
- );
10
- background-image: -o-linear-gradient(bottom, #0071BC 0%, #003457 100%);
11
- background-image: -moz-linear-gradient(bottom, #0071BC 0%, #003457 100%);
12
- background-image: -webkit-linear-gradient(bottom, #0071BC 0%, #003457 100%);
13
- background-image: -ms-linear-gradient(bottom, #0071BC 0%, #003457 100%);
14
- background-image: linear-gradient(to bottom, #0071BC 0%, #003457 100%);
2
+ background: $blue-dark;
15
3
  min-height: 4em;
16
4
 
17
5
  #logo span.glyphicon {
@@ -57,36 +45,44 @@
57
45
  }
58
46
  }
59
47
 
48
+ #masthead_controls .navbar-default .navbar-nav > .active > a,
49
+ #masthead_controls .navbar-default .navbar-nav > .active > a:hover,
50
+ #masthead_controls .navbar-default .navbar-nav > .active > a:focus {
51
+ background-color: $blue-medium-bright;
52
+ color: $classic-white;
53
+ }
54
+
60
55
  #masthead_controls {
61
- background-color: #D2B48C;
62
- border-top: 1px solid #0071BC;
63
- border-bottom: 1px solid #B89972;
56
+ border-top: 1px solid $blue-medium;
57
+ border-bottom: 1px solid $blue-medium;
58
+ background-color: $blue-medium-bright;
59
+ #search-submit-header {
60
+ background-color: $gray-dark;
61
+ border-top: 1px solid $gray-medium;
62
+ border-bottom: 1px solid $gray-medium;
63
+ }
64
64
  .navbar {
65
- background-color: #D2B48C;
65
+ background-color: $blue-medium-bright;
66
66
  margin-bottom: 0;
67
- text-align: center;
68
- }
69
- .navbar li {
70
- border-right: 1px solid #B89972;
71
- }
72
- .navbar a:link, .navbar a:visited {
73
- color: #FFF;
74
- }
75
- .navbar a:hover {
76
- background-color: #7D5D55;
67
+ li {
68
+ border-right: 2px solid $blue-medium;
69
+ }
70
+ li:first-child {
71
+ border-left: 2px solid $blue-medium;
72
+ }
73
+ a:link, a:visited {
74
+ background-color: $blue-medium-bright;
75
+ color: $classic-white;
76
+ }
77
+ a:hover {
78
+ background-color: $basic-black;
79
+ }
77
80
  }
78
81
  .navbar-default {
79
- border: 0;
80
- }
81
- .navbar-default .navbar-nav>.active>a,
82
- .navbar-default .navbar-nav>.active>a:hover,
83
- .navbar-default .navbar-nav>.active>a:focus {
84
- background-color: #F7EEDE;
85
- color: #555;
82
+ border: none;
86
83
  }
87
84
  }
88
85
 
89
-
90
86
  .login_button {
91
87
  margin: 1.75em 3em 0 0;
92
88
  }
@@ -7,6 +7,8 @@ $basic-black: #000;
7
7
  $blue-dark: #036;
8
8
  $blue-medium: #1C5798;
9
9
  $blue-medium-bright: #2674CA;
10
+ $teal: #2CAEB7;
11
+ $teal-light: #67ADA9;
10
12
  $brown-dark: #7D5D55;
11
13
  $brown-medium-dark: #A78352;
12
14
  $brown-medium: #B89972;
@@ -19,21 +21,56 @@ $gray-medium: #CECDCD;
19
21
  $gray-light: #DDD;
20
22
  $gray-lighter: #E1E1E1;
21
23
  $gray-lightish: #bbb;
24
+ $yellow-medium: #FFC74E;
22
25
  $highlight-yellow: #F0CA00;
23
- $teal: #2CAEB7;
24
26
  $vermilion: #F30;
27
+ $red-orange: #D6562B;
28
+
25
29
 
30
+ // Dashboard
26
31
  $badge-background-color: $highlight-yellow;
27
32
  $badge-optional-background-color: $gray-medium;
28
33
  $badge-font-color: $classic-white;
34
+
29
35
  $content-wrapper-background-color: $cream-light;
36
+
30
37
  $dashboard-background-color: $classic-white;
31
38
  $dashboard-border-color: $gray-light;
39
+
32
40
  $icon-background-color: $vermilion;
33
41
  $icon-border-color: $classic-white;
34
42
  $icon-font-color: $classic-white;
35
- $icon-link-color: $basic-black;
36
- $icon-link-hover-color: $blue-medium-bright;
43
+ $icon-link-color: $gray-med-dark;
44
+ $icon-link-hover-color: $basic-black;
45
+ $icon-background-color-hover: $classic-white;
46
+ $icon-border-color-hover: $basic-black;
47
+ $icon-font-color-hover: $basic-black;
48
+
37
49
  $panel-background-color: $classic-white;
38
50
  $panel-dashboard-background-color: $teal;
39
51
  $panel-dashboard-font-color: $classic-white;
52
+
53
+ // Buttons
54
+ $add-background-color: $teal-light;
55
+ $add-border-color: $teal-light;
56
+ $add-text-color: $classic-white;
57
+ $add-background-hover: $classic-white;
58
+ $add-text-hover: $teal-light;
59
+
60
+ $neutral-background-color: $yellow-medium;
61
+ $neutral-border-color: $highlight-yellow;
62
+ $neutral-text-color: $classic-white;
63
+ $neutral-background-hover: $classic-white;
64
+ $neutral-text-hover: $yellow-medium;
65
+
66
+ $remove-background-color: $red-orange;
67
+ $remove-border-color: $red-orange;
68
+ $remove-text-color: $classic-white;
69
+ $remove-background-hover: $classic-white;
70
+ $remove-text-hover: $red-orange;
71
+
72
+ $view-select-background-color: $blue-medium-bright;
73
+ $view-select-border-color: $blue-medium-bright;
74
+ $view-select-text-color: $classic-white;
75
+ $view-select-background-hover: $classic-white;
76
+ $view-select-text-hover: $blue-medium-bright;
@@ -55,23 +55,11 @@ button {
55
55
  }
56
56
 
57
57
  #footer {
58
+ background: $blue-dark;
58
59
  clear: both;
59
- color: #FFF;
60
+ color: $classic-white;
60
61
  margin-top: 2em;
61
62
  padding: 1em;
62
- background: #0071BC; /* Old browsers */
63
- background-image: -webkit-gradient(
64
- linear,
65
- left top,
66
- left bottom,
67
- color-stop(0, #0071BC),
68
- color-stop(1, #003457)
69
- );
70
- background-image: -o-linear-gradient(bottom, #0071BC 0%, #003457 100%);
71
- background-image: -moz-linear-gradient(bottom, #0071BC 0%, #003457 100%);
72
- background-image: -webkit-linear-gradient(bottom, #0071BC 0%, #003457 100%);
73
- background-image: -ms-linear-gradient(bottom, #0071BC 0%, #003457 100%);
74
- background-image: linear-gradient(to bottom, #0071BC 0%, #003457 100%);
75
63
  min-height: 4em;
76
64
  }
77
65
 
@@ -1,46 +1,3 @@
1
1
  class BatchController < ApplicationController
2
- include Hydra::Controller::ControllerBehavior
3
- layout "sufia-one-column"
4
-
5
- before_filter :has_access?
6
-
7
- def edit
8
- @batch = Batch.find_or_create(params[:id])
9
- @form = edit_form
10
- end
11
-
12
- def update
13
- authenticate_user!
14
- @batch = Batch.find_or_create(params[:id])
15
- @batch.status = ["processing"]
16
- @batch.save
17
- file_attributes = Sufia::Forms::BatchEditForm.model_attributes(params[:generic_file])
18
- Sufia.queue.push(BatchUpdateJob.new(current_user.user_key, params[:id], params[:title], file_attributes, params[:visibility]))
19
- 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.'
20
- if uploading_on_behalf_of? @batch
21
- redirect_to sufia.dashboard_shares_path
22
- else
23
- redirect_to sufia.dashboard_files_path
24
- end
25
- end
26
-
27
- protected
28
-
29
- def edit_form
30
- generic_file = GenericFile.new(creator: [current_user.name], title: @batch.generic_files.map(&:label))
31
- Sufia::Forms::BatchEditForm.new(generic_file)
32
- end
33
-
34
- # override this method if you need to initialize more complex RDF assertions (b-nodes)
35
- def initialize_fields(file)
36
- file.initialize_fields
37
- end
38
-
39
- def uploading_on_behalf_of? batch
40
- file = batch.generic_files.first
41
- return false if file.nil? || file.on_behalf_of.blank?
42
- current_user.user_key != file.on_behalf_of
43
- end
44
-
45
- ActiveSupport::Deprecation.deprecate_methods(BatchController, :initialize_fields)
2
+ include Sufia::BatchControllerBehavior
46
3
  end