curate 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/app/assets/images/blacklight/bg.png +0 -0
  2. data/app/assets/images/blacklight/border.png +0 -0
  3. data/app/assets/images/blacklight/bul_sq_gry.gif +0 -0
  4. data/app/assets/images/blacklight/checkmark.gif +0 -0
  5. data/app/assets/images/blacklight/logo.png +0 -0
  6. data/app/assets/images/blacklight/magnifying_glass.gif +0 -0
  7. data/app/assets/images/blacklight/remove.gif +0 -0
  8. data/app/assets/images/blacklight/separator.gif +0 -0
  9. data/app/assets/images/blacklight/start_over.gif +0 -0
  10. data/app/assets/javascripts/curate.js +38 -0
  11. data/app/assets/javascripts/help_modal.js +36 -0
  12. data/app/assets/javascripts/manage_repeating_fields.js +65 -0
  13. data/app/assets/javascripts/toggle_details.js +10 -0
  14. data/app/assets/stylesheets/blacklight.css.scss +6 -0
  15. data/app/assets/stylesheets/curate.css.scss +23 -0
  16. data/app/assets/stylesheets/downloads.css.scss +3 -0
  17. data/app/assets/stylesheets/global-variables.scss +303 -0
  18. data/app/assets/stylesheets/help_requests.css.scss +3 -0
  19. data/app/assets/stylesheets/layout/positioning.css.scss +59 -0
  20. data/app/assets/stylesheets/modules.scss +5 -0
  21. data/app/assets/stylesheets/modules/action_bar.css.scss +14 -0
  22. data/app/assets/stylesheets/modules/emphatic_action_area.css.scss +14 -0
  23. data/app/assets/stylesheets/modules/forms.css.scss +39 -0
  24. data/app/assets/stylesheets/modules/multi_value_fields.css.scss +13 -0
  25. data/app/assets/stylesheets/modules/site_search.css.scss +26 -0
  26. data/app/assets/stylesheets/style/theme.css.scss +44 -0
  27. data/app/assets/stylesheets/style/typography.css.scss +130 -0
  28. data/app/repository_models/curation_concern/model.rb +40 -0
  29. data/app/repository_models/curation_concern/with_generic_files.rb +16 -0
  30. data/lib/curate/railtie.rb +9 -0
  31. data/lib/curate/version.rb +1 -1
  32. data/lib/generators/curate/curation_concern/USAGE +14 -0
  33. data/lib/generators/curate/curation_concern/curation_concern_generator.rb +55 -0
  34. data/lib/generators/curate/curation_concern/templates/curation_concern.rb.erb +46 -0
  35. data/lib/generators/curate/curation_concern/templates/curation_concern_factory.rb.erb +13 -0
  36. data/lib/generators/curate/curation_concern/templates/curation_concern_serializer.rb.erb +8 -0
  37. data/lib/generators/curate/curation_concern/templates/curation_concern_serializer_spec.rb.erb +11 -0
  38. data/lib/generators/curate/curation_concern/templates/curation_concern_spec.rb.erb +9 -0
  39. data/lib/generators/curate/curation_concern/templates/metadata_datastream.rb.erb +67 -0
  40. data/lib/generators/curate/curation_concern/templates/metadata_datastream_spec.rb.erb +7 -0
  41. data/spec/dummy/app/controllers/curation_concern/mock_curation_concerns_controller.rb +9 -0
  42. data/spec/dummy/config/routes.rb +1 -1
  43. data/spec/dummy/log/test.log +20535 -0
  44. data/spec/features/error_handlers_spec.rb +36 -0
  45. data/spec/routing/classify_concerns_routing_spec.rb +15 -0
  46. data/spec/routing/common_objects_routing_spec.rb +10 -0
  47. data/spec/routing/downloads_routing_spec.rb +17 -0
  48. data/spec/routing/generic_files_routing_spec.rb +79 -0
  49. data/spec/routing/help_requests_routing_spec.rb +11 -0
  50. data/spec/support/mock_curation_concern.rb +26 -38
  51. data/spec/validators/future_date_validator_spec.rb +35 -0
  52. metadata +75 -4
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the HelpRequests controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,59 @@
1
+ body {
2
+ padding:0;
3
+ }
4
+
5
+ #site-search{
6
+ form {
7
+ margin:2em 0;
8
+ text-align:right;
9
+ }
10
+ }
11
+
12
+ #footer .row {
13
+ margin-bottom:1em;
14
+ margin-top:3em;
15
+ }
16
+
17
+ .page-search {
18
+ padding-top:2em;
19
+ text-align:right;
20
+ }
21
+
22
+ legend .pull-right {
23
+ margin-top:.2em;
24
+ }
25
+
26
+ .with-headroom {
27
+ padding-top:3em;
28
+ }
29
+
30
+ .with-side-padding {
31
+ padding-left:2em;
32
+ padding-right:2em;
33
+ }
34
+
35
+ dl.stacked {
36
+ dt {
37
+ clear:both;
38
+ float:left;
39
+ width:30%;
40
+ }
41
+
42
+ dd {
43
+ clear:right;
44
+ margin:0 0 0 30%;
45
+ width:70%;
46
+ word-wrap:break-word;
47
+ }
48
+ }
49
+
50
+ .main-header {
51
+ border-bottom: 1px solid $grayLighter;
52
+ margin-bottom: 30px;
53
+ margin-top: 20px;
54
+ padding-bottom: 9px;
55
+ }
56
+
57
+ legend + .control-group {
58
+ margin-top: 0px;
59
+ }
@@ -0,0 +1,5 @@
1
+ @import 'modules/action_bar';
2
+ @import 'modules/emphatic_action_area';
3
+ @import 'modules/forms';
4
+ @import 'modules/multi_value_fields';
5
+ @import 'modules/site_search';
@@ -0,0 +1,14 @@
1
+ .action-bar {
2
+ border-bottom:1px solid $dropdownDividerTop;
3
+ padding-bottom:.25em;
4
+
5
+ .nav-pills {
6
+ margin-bottom:0;
7
+ }
8
+
9
+ a,
10
+ a:hover,
11
+ a:visited {
12
+ color: $blue;
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ .emphatic-action-area {
2
+ padding-top:2em;
3
+ text-align:center;
4
+
5
+ a {
6
+ font-family:$serifFontFamily;
7
+ font-size:2em;
8
+ padding:.5em;
9
+ }
10
+ }
11
+
12
+ .home .emphatic-action-area {
13
+ padding-bottom:8em;
14
+ }
@@ -0,0 +1,39 @@
1
+ .input-xxxlarge {
2
+ box-sizing:border-box;
3
+ width:100%;
4
+ }
5
+
6
+ legend small {
7
+ margin-left:.5em;
8
+ }
9
+
10
+ .label-large {
11
+ font-size: 110%;
12
+ line-height: 1.2;
13
+ padding: .3em .6em;
14
+ white-space: normal;
15
+ position: relative;
16
+
17
+
18
+ input[type="checkbox"]{
19
+ margin:-2px 0 0;
20
+ position: absolute;
21
+ left:.5em;
22
+ top:38%;
23
+ }
24
+ }
25
+
26
+ .label-checkbox .label-text {
27
+ display:block;
28
+ padding-left:1.2em;
29
+ }
30
+
31
+ .control-group.error input,
32
+ .control-group.error option,
33
+ .control-group.error textarea {
34
+ color:$grayDark;
35
+ }
36
+
37
+ .form-actions .btn-link {
38
+ color: $blue;
39
+ }
@@ -0,0 +1,13 @@
1
+ .multi_value {
2
+ .field-wrapper {
3
+ list-style-type:none;
4
+ }
5
+
6
+ .listing {
7
+ margin-left:0;
8
+ }
9
+
10
+ .field-controls span {
11
+ margin-left:.2em;
12
+ }
13
+ }
@@ -0,0 +1,26 @@
1
+ .search-form {
2
+ .search-query,
3
+ .search-submit {
4
+ box-sizing:border-box;
5
+ }
6
+
7
+ .search-query {
8
+ width:80%;
9
+ padding-top:1em;
10
+ padding-bottom:1em;
11
+ @include border-bottom-left-radius(15px);
12
+ @include border-bottom-right-radius(0);
13
+ @include border-top-left-radius(15px);
14
+ @include border-top-right-radius(0);
15
+ }
16
+
17
+ .search-submit {
18
+ padding-left:0;
19
+ width:20%;
20
+ white-space:nowrap;
21
+ @include border-bottom-left-radius(0);
22
+ @include border-bottom-right-radius(15px);
23
+ @include border-top-left-radius(0);
24
+ @include border-top-right-radius(15px);
25
+ }
26
+ }
@@ -0,0 +1,44 @@
1
+ #brand-bar-wrapper {
2
+ background-color:$blueDark;
3
+ @include background-image(linear-gradient($blueDark, #07366C 85%, #001834));
4
+ border-bottom:1px solid #001834;
5
+
6
+ h2 a, h3 a {
7
+ color:#FFF;
8
+ }
9
+
10
+ .division {
11
+ float:right;
12
+ }
13
+ }
14
+
15
+ #title-bar-wrapper {
16
+ background-color:$yellow;
17
+ @include background-image(linear-gradient(#F5E59E, $yellow 98%, #9C7012));
18
+ border-top:1px solid #FFF;
19
+ margin-bottom:.3em;
20
+
21
+ h1 {
22
+ color:$blue;
23
+ @include text-shadow(#FFF 0 0 1px)
24
+
25
+ }
26
+
27
+ a:visited {
28
+ color:$blue;
29
+ }
30
+
31
+ .site-search {
32
+ float:right;
33
+ }
34
+ }
35
+
36
+ #main {
37
+ h1,h2,h3,h4,h5,h6 {
38
+ color:$blue;
39
+ }
40
+ }
41
+
42
+ #footer {
43
+ color:#999;
44
+ }
@@ -0,0 +1,130 @@
1
+ @import "compass/css3/columns";
2
+
3
+ #banner {
4
+ font-family:$serifFontFamily;
5
+
6
+ h1,h2,h3 {
7
+ font-weight:normal;
8
+ }
9
+
10
+ h1 {
11
+ margin:.65em 0;
12
+ }
13
+
14
+ a {
15
+ text-decoration:none;
16
+ }
17
+ }
18
+
19
+ #brand-bar-wrapper {
20
+ letter-spacing:.2em;
21
+ padding:.15em 0;
22
+ text-transform:uppercase;
23
+
24
+ h2, h3 {
25
+ font-size:.95em;
26
+ margin:0;
27
+ }
28
+
29
+ .division {
30
+ text-align:right;
31
+ }
32
+
33
+ i {
34
+ letter-spacing:0;
35
+ padding:0 .2em;
36
+ text-transform:none;
37
+ }
38
+ }
39
+
40
+ #main,
41
+ .modal-header {
42
+ h1,h2,h3,h4,h5,h6 {
43
+ font-family:$headerFontFamily;
44
+ font-weight:normal;
45
+ text-rendering: optimizeLegibility;
46
+ }
47
+ h1 {
48
+ .human_readable_type {
49
+ font-size:.66em;
50
+ padding-left:1em;
51
+ }
52
+ }
53
+ }
54
+
55
+ legend {
56
+ font-family:$headerFontFamily;
57
+
58
+ a {
59
+ font-family:$sansFontFamily;
60
+ }
61
+ }
62
+
63
+ .table-heading {
64
+ text-align:left;
65
+
66
+ h1,h2,h3,h4,h5,h6 {
67
+ padding-top:1em;
68
+ }
69
+ }
70
+
71
+ .nested-field-heading {
72
+ font-family:$sansFontFamily;
73
+ font-size: 14px;
74
+ font-weight:normal;
75
+ }
76
+
77
+ .redacted,
78
+ .unratified .contributor_agreement p {
79
+ font-family:'BLOKKNeue-Regular';
80
+ }
81
+
82
+ #footer {
83
+ text-align:center;
84
+
85
+ p {
86
+ margin-bottom:.3em;
87
+ }
88
+ }
89
+
90
+ .accessible-hidden {
91
+ border: 0;
92
+ clip: rect(0 0 0 0);
93
+ height: 1px;
94
+ margin: -1px;
95
+ overflow: hidden;
96
+ padding: 0;
97
+ position: absolute;
98
+ width: 1px;
99
+ }
100
+
101
+ .centered {
102
+ text-align:center;
103
+ }
104
+
105
+ .contributor_agreement.human_readable {
106
+ font-size:150%;
107
+ }
108
+
109
+ .doi {
110
+ font-size:200%;
111
+ margin:1em 0;
112
+ text-align:center;
113
+ }
114
+
115
+ .inline-item-actions {
116
+ padding:0 .5em;
117
+
118
+ a {
119
+ margin-right:.5em;
120
+ }
121
+ }
122
+
123
+ .wide-text {
124
+ @include column-count(2);
125
+ @include column-width(30px);
126
+
127
+ p {
128
+ @include column-break-inside(avoid);
129
+ }
130
+ }
@@ -0,0 +1,40 @@
1
+ module CurationConcern
2
+ module Model
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ include Hydra::ModelMixins::CommonMetadata
7
+ include Sufia::ModelMethods
8
+ include Sufia::Noid
9
+ include Sufia::GenericFile::Permissions
10
+
11
+ has_metadata name: "properties", type: PropertiesDatastream, control_group: 'M'
12
+ delegate_to :properties, [:relative_path, :depositor], unique: true
13
+ delegate_to :descMetadata, [:archived_object_type], unique: true
14
+ before_save :set_archived_object_type
15
+ end
16
+
17
+ def human_readable_type
18
+ self.class.to_s.demodulize.titleize
19
+ end
20
+
21
+ def set_archived_object_type
22
+ self.archived_object_type = human_readable_type
23
+ end
24
+
25
+ def to_solr(solr_doc={}, opts={})
26
+ super(solr_doc, opts)
27
+ solr_doc["noid_s"] = noid
28
+ return solr_doc
29
+ end
30
+
31
+ def to_param
32
+ noid
33
+ end
34
+
35
+ def to_s
36
+ title
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,16 @@
1
+ module CurationConcern
2
+ module WithGenericFiles
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ has_many :generic_files, property: :is_part_of
7
+
8
+ after_destroy :after_destroy_cleanup
9
+ end
10
+
11
+ def after_destroy_cleanup
12
+ generic_files.each(&:destroy)
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ module Curate
2
+ class Railtie < Rails::Railtie
3
+ generators do
4
+ require(
5
+ 'generators/curate/curation_concern/curation_concern_generator'
6
+ )
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Curate
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,14 @@
1
+ Description:
2
+ This generator provides a means of creating a collection
3
+
4
+ Example:
5
+ rails generate curate:collection ChickenPie
6
+
7
+ This will create:
8
+ app/repository_models/chicken_pie.rb
9
+ app/repository_datastreams/chicken_pie_metadata_datastream.rb
10
+ app/repository_serializers/chicken_pie_serializer.rb
11
+ spec/repository_models/chicken_pie_spec.rb
12
+ spec/repository_datastreams/chicken_pie_metadata_datastream_spec.rb
13
+ spec/repository_serializers/chicken_pie_serializer.rb
14
+ spec/factories/chicken_pie_factory.rb