curation_concerns 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile +1 -1
  4. data/Rakefile +3 -11
  5. data/VERSION +1 -1
  6. data/app/assets/javascripts/curation_concerns/application.js +3 -0
  7. data/app/assets/javascripts/curation_concerns/curation_concerns.js +5 -0
  8. data/app/assets/javascripts/curation_concerns/file_manager/affix.es6 +13 -0
  9. data/app/assets/javascripts/curation_concerns/file_manager/list_toggle.es6 +6 -0
  10. data/app/assets/javascripts/curation_concerns/file_manager/member.es6 +82 -0
  11. data/app/assets/javascripts/curation_concerns/file_manager/save_manager.es6 +70 -0
  12. data/app/assets/javascripts/curation_concerns/file_manager/sorting.es6 +82 -0
  13. data/app/assets/stylesheets/curation_concerns/_modules.scss +1 -1
  14. data/app/assets/stylesheets/curation_concerns/_typography.scss +0 -11
  15. data/app/assets/stylesheets/curation_concerns/modules/file_manager.scss +115 -0
  16. data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +1 -1
  17. data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +5 -1
  18. data/app/forms/curation_concerns/forms/work_form.rb +3 -1
  19. data/app/views/catalog/_document_list.html.erb +1 -1
  20. data/app/views/collections/_search_collection_dashboard_form.html.erb +1 -1
  21. data/app/views/collections/_search_form.html.erb +1 -1
  22. data/app/views/collections/show.html.erb +24 -17
  23. data/app/views/curation_concerns/base/_file_manager_actions.html.erb +3 -0
  24. data/app/views/curation_concerns/base/_file_manager_attributes.html.erb +0 -0
  25. data/app/views/curation_concerns/base/_file_manager_extra_tools.html.erb +0 -0
  26. data/app/views/curation_concerns/base/_file_manager_member.html.erb +31 -0
  27. data/app/views/curation_concerns/base/_file_manager_thumbnail.html.erb +1 -0
  28. data/app/views/curation_concerns/base/_show_actions.html.erb +1 -0
  29. data/app/views/curation_concerns/base/file_manager.html.erb +34 -0
  30. data/app/views/shared/_site_search.html.erb +3 -3
  31. data/config/locales/curation_concerns.en.yml +2 -0
  32. data/curation_concerns.gemspec +2 -0
  33. data/lib/curation_concerns/engine.rb +1 -0
  34. data/lib/curation_concerns/rails/routes.rb +5 -0
  35. data/lib/curation_concerns/version.rb +1 -1
  36. data/spec/actors/curation_concerns/work_actor_spec.rb +21 -5
  37. data/spec/controllers/curation_concerns/collections_controller_spec.rb +9 -0
  38. data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +24 -4
  39. data/spec/javascripts/file_manager_member_spec.coffee +87 -0
  40. data/spec/javascripts/fixtures/.gitkeep +0 -0
  41. data/spec/javascripts/fixtures/file_manager_member.html +40 -0
  42. data/spec/javascripts/fixtures/save_button.html +3 -0
  43. data/spec/javascripts/helpers/jasmine-jquery.js +841 -0
  44. data/spec/javascripts/helpers/mock-ajax.js +736 -0
  45. data/spec/javascripts/helpers/test_responses.js +12 -0
  46. data/spec/javascripts/jasmine_spec.rb +25 -0
  47. data/spec/javascripts/save_manager_spec.coffee +84 -0
  48. data/spec/javascripts/support/jasmine.yml +136 -0
  49. data/spec/javascripts/support/jasmine_helper.rb +15 -0
  50. data/spec/routing/route_spec.rb +4 -0
  51. data/spec/support/rake_support.rb +41 -0
  52. data/spec/views/catalog/index.html.erb_spec.rb +2 -2
  53. data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +72 -0
  54. data/tasks/jasmine.rake +18 -0
  55. metadata +71 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7af44881c5c91d837ca80398c54f3e52fd686b01
4
- data.tar.gz: d4186500d7ca262837a72912a0e681b83fac149f
3
+ metadata.gz: 645a0115a0467d0f30efdb1f3a0ed2cde1805831
4
+ data.tar.gz: 04a720d015cc23c6537bfc5c603c8db8fba6d80c
5
5
  SHA512:
6
- metadata.gz: fa316af1763c1a5fd5fe369fd1d88c33b42ff7a5b4f14e8b63191de19862707bc82c3f3f0420c93d0ca9e9c26a9a4406fd400f866559e6201969f1c55dd7a56a
7
- data.tar.gz: 243f21c6b7cea9a5fa6b18de63a373a7a40461fda1d3551490b1a4c17051dcc112e550e109ef4d55d802dc48dde368db8b0b2279eb4a1594eec4b0cee4eb671b
6
+ metadata.gz: 2cd5bad72161b60b7c83e52ccaf80082ffaeb24c912f522a1586273b74ed0cbc40923afd3336f0e991259d7c5076f788b275c0abb3b3594e88158d2eefac006c
7
+ data.tar.gz: db1f0f7b3de445a107da48e31d6755814437b5c194b683424c37fb2a9d2d65c66547f68d6136621bea2f54a2913d44046c60fac37897cc72850bf448fa35582d
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ solr_conf/
12
12
  .byebug_history
13
13
  spec/mock_upload_directory
14
14
  fcrepo4-data
15
+ fcrepo4-test-data
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'curation_concerns-models', path: './curation_concerns-models'
7
7
 
8
8
  group :development, :test do
9
9
  gem 'rubocop', require: false
10
- gem 'rubocop-rspec', require: false
10
+ gem 'rubocop-rspec', '~> 1.3.1', require: false
11
11
  gem 'simplecov', '~> 0.9', require: false
12
12
  gem 'coveralls', require: false
13
13
  gem 'poltergeist'
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ require 'engine_cart/rake_task'
5
5
  require 'rubocop/rake_task'
6
6
  require 'solr_wrapper'
7
7
  require 'fcrepo_wrapper'
8
+ require 'active_fedora/rake_support'
8
9
 
9
10
  Dir.glob('tasks/*.rake').each { |r| import r }
10
11
 
@@ -21,17 +22,8 @@ end
21
22
 
22
23
  desc 'Spin up Solr & Fedora and run the test suite'
23
24
  task ci: ['engine_cart:generate'] do
24
- # TODO: set port to nil (random port)
25
- solr_params = { port: '8985', verbose: true, managed: true }
26
- fcrepo_params = { port: '8986', verbose: true, managed: true }
27
- SolrWrapper.wrap(solr_params) do |solr|
28
- ENV['SOLR_TEST_PORT'] = solr.port
29
- solr.with_collection(name: 'hydra-test', dir: File.join(File.expand_path('.', File.dirname(__FILE__)), 'solr', 'config')) do
30
- FcrepoWrapper.wrap(fcrepo_params) do |fcrepo|
31
- ENV['FCREPO_TEST_PORT'] = fcrepo.port
32
- Rake::Task['spec'].invoke
33
- end
34
- end
25
+ with_test_server do
26
+ Rake::Task['spec'].invoke
35
27
  end
36
28
  end
37
29
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.8.0
@@ -8,5 +8,8 @@
8
8
  //= require bootstrap/tooltip
9
9
  //= require bootstrap/popover
10
10
  //= require bootstrap/tab
11
+ //= require bootstrap/affix
12
+ //
13
+ //= require jquery-ui/sortable
11
14
  //
12
15
  //= require curation_concerns/curation_concerns
@@ -2,6 +2,11 @@
2
2
  //= require curation_concerns/facet_mine
3
3
  //= require curation_concerns/embargoes
4
4
  //= require curation_concerns/fileupload
5
+ //= require curation_concerns/file_manager/affix
6
+ //= require curation_concerns/file_manager/list_toggle
7
+ //= require curation_concerns/file_manager/sorting
8
+ //= require curation_concerns/file_manager/save_manager
9
+ //= require curation_concerns/file_manager/member
5
10
 
6
11
 
7
12
  // Initialize plugins and Bootstrap dropdowns on jQuery's ready event as well as
@@ -0,0 +1,13 @@
1
+ Blacklight.onLoad(function() {
2
+ let tools = $("#file-manager-tools")
3
+ if(tools.length > 0) {
4
+ tools.affix({
5
+ offset: {
6
+ top: $("#file-manager-tools").parent().offset().top,
7
+ bottom: function() {
8
+ return $("#file-manager-extra-tools").outerHeight(true) + $("footer").outerHeight(true)
9
+ }
10
+ }
11
+ })
12
+ }
13
+ })
@@ -0,0 +1,6 @@
1
+ Blacklight.onLoad(function() {
2
+ $("*[data-action=list-toggle] button").click(function() {
3
+ $(this).parent().find("button").toggleClass("active")
4
+ $("#sortable").toggleClass("grid")
5
+ })
6
+ })
@@ -0,0 +1,82 @@
1
+ Blacklight.onLoad(function() {
2
+ $("li[data-reorder-id]").each(function(index, element) {
3
+ let manager_member = new FileManagerMember($(element), window.save_manager)
4
+ $(element).data("file_manager_member", manager_member)
5
+ })
6
+ })
7
+ class InputTracker {
8
+ constructor(element, notifier) {
9
+ this.element = element
10
+ this.notifier = notifier
11
+ this.element.data("initial-value", this.element.val())
12
+ this.element.data("tracker", this)
13
+ this.element.change(this.value_changed)
14
+ }
15
+
16
+ reset() {
17
+ this.element.data("initial-value", this.element.val())
18
+ this.notifier.mark_unchanged(this.element)
19
+ }
20
+
21
+ get value_changed() {
22
+ return () => {
23
+ if(this.element.val() == this.element.data("initial-value")) {
24
+ this.notifier.mark_unchanged(this.element)
25
+ } else {
26
+ this.notifier.push_changed(this.element)
27
+ }
28
+ }
29
+ }
30
+ }
31
+ class FileManagerMember {
32
+ constructor(element, save_manager) {
33
+ this.element = element
34
+ this.save_manager = save_manager
35
+ this.elements = []
36
+ this.track_label()
37
+ }
38
+
39
+ push_changed(element) {
40
+ this.elements.push(element)
41
+ this.elements = $.unique(this.elements)
42
+ this.save_manager.push_changed(this)
43
+ }
44
+
45
+ mark_unchanged(element) {
46
+ this.elements = jQuery.grep(this.elements, (value) => {
47
+ return value != element
48
+ })
49
+ if(!this.is_changed) {
50
+ this.save_manager.mark_unchanged(this)
51
+ }
52
+ }
53
+
54
+ get is_changed() {
55
+ return this.elements.length > 0
56
+ }
57
+
58
+ track_label() {
59
+ new InputTracker(this.element.find("input[type='text']"), this)
60
+ }
61
+
62
+ persist() {
63
+ if(this.is_changed) {
64
+ let form = this.element.find("form")
65
+ let deferred = $.Deferred()
66
+ form.on("ajax:success", () => {
67
+ this.elements.forEach((element) => {
68
+ element.data("tracker").reset()
69
+ })
70
+ deferred.resolve()
71
+ })
72
+ form.on("ajax:error", () => {
73
+ deferred.reject()
74
+ })
75
+ form.submit()
76
+ return deferred
77
+ } else {
78
+ return $.Deferred().resolve()
79
+ }
80
+ }
81
+ }
82
+
@@ -0,0 +1,70 @@
1
+ class SaveManager {
2
+ constructor() {
3
+ this.override_save_button()
4
+ this.elements = []
5
+ }
6
+
7
+ override_save_button() {
8
+ jQuery(() => {
9
+ this.save_button.click(this.clicked_save)
10
+ })
11
+ }
12
+
13
+ push_changed(element) {
14
+ this.elements.push(element)
15
+ this.elements = $.unique(this.elements)
16
+ this.check_button()
17
+ }
18
+
19
+ mark_unchanged(element) {
20
+ this.elements = jQuery.grep(this.elements, (value) => {
21
+ return value != element
22
+ })
23
+ this.check_button()
24
+ }
25
+
26
+ check_button() {
27
+ if(this.is_changed && this.save_button.text() == "Save") {
28
+ this.save_button.removeClass("disabled")
29
+ } else {
30
+ this.save_button.addClass("disabled")
31
+ }
32
+ }
33
+
34
+ persist() {
35
+ let promises = []
36
+ this.elements.forEach((element) => {
37
+ let result = element.persist()
38
+ promises.push(
39
+ result.then(() => { return element })
40
+ .done((element) => { this.mark_unchanged(element) })
41
+ .fail((element) => { this.push_changed(element) })
42
+ )
43
+ })
44
+ this.save_button.text("Saving...")
45
+ this.save_button.addClass("disabled")
46
+ $.when.apply($, promises).always(() => { this.reset_save_button() })
47
+ }
48
+
49
+ reset_save_button() {
50
+ this.save_button.text("Save")
51
+ this.check_button()
52
+ }
53
+
54
+ get is_changed() {
55
+ return this.elements.length > 0
56
+ }
57
+
58
+ get save_button() {
59
+ return $("*[data-action='save-actions']")
60
+ }
61
+
62
+ get clicked_save() {
63
+ return (event) => {
64
+ event.preventDefault()
65
+ this.persist()
66
+ }
67
+ }
68
+ }
69
+
70
+ window.save_manager = new SaveManager
@@ -0,0 +1,82 @@
1
+ {
2
+ Blacklight.onLoad(function() {
3
+ window.new_sort_manager = new SortManager
4
+ })
5
+
6
+ class SortManager {
7
+ constructor() {
8
+ this.element = $("#sortable")
9
+ this.sorting_info = {}
10
+ this.initialize_sort()
11
+ this.element.data("current-order", this.order)
12
+ this.save_manager = window.save_manager
13
+ }
14
+
15
+ initialize_sort() {
16
+ this.element.sortable({handle: ".panel-heading"})
17
+ this.element.disableSelection()
18
+ this.element.on("sortstop", this.stopped_sorting)
19
+ this.element.on("sortstart", this.started_sorting)
20
+ }
21
+
22
+ persist() {
23
+ let params = {}
24
+ params[this.singular_class_name] = {
25
+ "ordered_member_ids": this.order
26
+ }
27
+ params["_method"] = "PATCH"
28
+ let persisting = $.post(
29
+ `/concern/${this.class_name}/${this.id}`,
30
+ params
31
+ ).done(() => {
32
+ this.element.data("current-order", this.order)
33
+ })
34
+ return persisting
35
+ }
36
+
37
+ get_sort_position(item) {
38
+ return this.element.children().index(item)
39
+ }
40
+
41
+ get stopped_sorting() {
42
+ return (event, ui) => {
43
+ this.sorting_info.end = this.get_sort_position($(ui.item))
44
+ if(this.sorting_info.end == this.sorting_info.start) {
45
+ return
46
+ }
47
+ if(this.order.toString() != this.element.data("current-order").toString()) {
48
+ this.save_manager.push_changed(this)
49
+ } else {
50
+ this.save_manager.mark_unchanged(this)
51
+ }
52
+ }
53
+ }
54
+
55
+ get started_sorting() {
56
+ return (event, ui) => {
57
+ this.sorting_element = $(ui.item)
58
+ this.sorting_info.start = this.get_sort_position(ui.item)
59
+ }
60
+ }
61
+
62
+ get id() {
63
+ return this.element.data("id")
64
+ }
65
+
66
+ get class_name() {
67
+ return this.element.data("class-name")
68
+ }
69
+
70
+ get singular_class_name() {
71
+ return this.element.data("singular-class-name")
72
+ }
73
+
74
+ get order() {
75
+ return $("*[data-reorder-id]").map(
76
+ function() {
77
+ return $(this).data("reorder-id")
78
+ }
79
+ ).toArray()
80
+ }
81
+ }
82
+ }
@@ -11,4 +11,4 @@
11
11
  @import 'modules/pagination';
12
12
  @import 'modules/embargoes';
13
13
  @import 'modules/icons';
14
-
14
+ @import 'modules/file_manager';
@@ -89,17 +89,6 @@ legend {
89
89
  }
90
90
  }
91
91
 
92
- .accessible-hidden {
93
- border: 0;
94
- clip: rect(0 0 0 0);
95
- height: 1px;
96
- margin: -1px;
97
- overflow: hidden;
98
- padding: 0;
99
- position: absolute;
100
- width: 1px;
101
- }
102
-
103
92
  .centered {
104
93
  text-align:center;
105
94
  }
@@ -0,0 +1,115 @@
1
+ *[data-action=file-manager] {
2
+ .actions {
3
+ padding: 10px;
4
+ .form-group div {
5
+ padding-left: 0;
6
+ }
7
+ }
8
+
9
+ .ui-selectable {
10
+ padding-left: 0px;
11
+ padding-right: 0px;
12
+ margin-top: 61px;
13
+ }
14
+
15
+ .btn-group {
16
+ margin-bottom: 10px;
17
+ padding-left: 15px;
18
+ }
19
+
20
+ ul {
21
+ list-style-type: none;
22
+ &.grid li {
23
+ @extend .col-xs-4;
24
+ .thumbnail {
25
+ height: 150px;
26
+ @extend .col-xs-12;
27
+ img {
28
+ max-height: 140px;
29
+ }
30
+ }
31
+
32
+ .spacer {
33
+ @extend .col-xs-12;
34
+ }
35
+ .attributes {
36
+ @extend .col-xs-12;
37
+ }
38
+ .order-title {
39
+ width: 85%;
40
+ }
41
+ .order-filename {
42
+ width: 100%;
43
+ }
44
+ .file-set-link {
45
+ padding-right: 15px;
46
+ }
47
+ }
48
+ li {
49
+ @extend .col-xs-12;
50
+ .text {
51
+ display: inline-block;
52
+ }
53
+ .thumbnail {
54
+ @extend .col-xs-3;
55
+ }
56
+ .spacer {
57
+ @extend .col-xs-3;
58
+ }
59
+ .attributes {
60
+ @extend .col-xs-6;
61
+ }
62
+ .order-title {
63
+ width: 49%;
64
+ display: inline-block;
65
+ }
66
+ .order-filename {
67
+ width: 46%;
68
+ display: inline-block;
69
+ }
70
+ .file-set-link {
71
+ display: inline-block;
72
+ width: 3%;
73
+ a {
74
+ font-size: 20px;
75
+ color: #999;
76
+ }
77
+ span {
78
+ top: 5px;
79
+ }
80
+ }
81
+ .ui-selecting .panel-body {
82
+ background: #FECA40;
83
+ }
84
+ .ui-selected .panel-body {
85
+ background: #F39814;
86
+ }
87
+ .panel-heading {
88
+ cursor: grab;
89
+ cursor: -webkit-grab;
90
+ cursor: -moz-grab;
91
+ }
92
+ input[type=radio] {
93
+ width: 20px;
94
+ }
95
+ }
96
+ }
97
+ #file-manager-tools {
98
+ @media (max-width: $screen-md-min) {
99
+ &.affix {
100
+ position: inherit;
101
+ }
102
+ }
103
+ @media (min-width: $screen-md-min) {
104
+ &.affix {
105
+ top: 0;
106
+ width: 235px;
107
+ }
108
+ }
109
+ @media (min-width: $screen-lg-min) {
110
+ &.affix {
111
+ width: 285px;
112
+ }
113
+ }
114
+ }
115
+ }
@@ -60,7 +60,7 @@ module CurationConcerns
60
60
  end
61
61
 
62
62
  def collection_search_builder
63
- collection_search_builder_class.new(self).with(params).tap do |builder|
63
+ collection_search_builder_class.new(self).with(params.except(:q)).tap do |builder|
64
64
  builder.current_ability = current_ability
65
65
  end
66
66
  end
@@ -16,7 +16,7 @@ module CurationConcerns::CurationConcernController
16
16
 
17
17
  module ClassMethods
18
18
  def set_curation_concern_type(curation_concern_type)
19
- load_and_authorize_resource class: curation_concern_type, instance_name: :curation_concern, except: :show
19
+ load_and_authorize_resource class: curation_concern_type, instance_name: :curation_concern, except: [:show, :file_manager]
20
20
  self.curation_concern_type = curation_concern_type
21
21
  end
22
22
 
@@ -85,6 +85,10 @@ module CurationConcerns::CurationConcernController
85
85
  after_destroy_response(title)
86
86
  end
87
87
 
88
+ def file_manager
89
+ presenter
90
+ end
91
+
88
92
  attr_writer :actor
89
93
 
90
94
  protected
@@ -14,7 +14,7 @@ module CurationConcerns
14
14
  :representative_id, :thumbnail_id, :files,
15
15
  :visibility_during_embargo, :embargo_release_date, :visibility_after_embargo,
16
16
  :visibility_during_lease, :lease_expiration_date, :visibility_after_lease,
17
- :visibility]
17
+ :visibility, :ordered_member_ids]
18
18
 
19
19
  # @param [ActiveFedora::Base,#member_ids] model
20
20
  # @param [Ability] current_ability
@@ -43,6 +43,8 @@ module CurationConcerns
43
43
  case term.to_s
44
44
  when 'rights'
45
45
  false
46
+ when 'ordered_member_ids'
47
+ true
46
48
  else
47
49
  super
48
50
  end
@@ -1,4 +1,4 @@
1
- <h3 id="document-list-heading" class="accessible-hidden">List of files deposited in <%= t('curation_concerns.product_name') %> that match your search criteria</h3>
1
+ <h3 id="document-list-heading" class="sr-only">List of items deposited in <%= t('curation_concerns.product_name') %> that match your search criteria</h3>
2
2
  <ol id="documents" class="container-fluid search-results-list" start="<%= document_counter_with_offset(0) %>" aria-labeled-by="document-list-heading">
3
3
  <%= render documents, as: :document %>
4
4
  </ol>
@@ -1,7 +1,7 @@
1
1
  <div style="float: right;" >
2
2
  <%= form_for([collections, @collection], url: collections.edit_collection_path , method: :get, class: "well form-search") do |f| %>
3
3
 
4
- <label class="accessible-hidden">Search Collection <%= @collection.title %></label>
4
+ <label class="sr-only">Search Collection <%= @collection.title %></label>
5
5
  <%= text_field_tag :cq, params[:cq], class: "collection-query", placeholder: "Search Collection", size: '30', type: "search", id: "collection_search" %>
6
6
  <%= hidden_field_tag :sort, params[:sort], id: 'collection_sort' %>
7
7
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:cq, :sort, :qt, :page)) %>
@@ -1,7 +1,7 @@
1
1
  <div style="float: right;" >
2
2
  <%= form_for [collections, @presenter], method: :get, class: "well form-search" do |f| %>
3
3
 
4
- <label class="accessible-hidden">Search Collection <%= @presenter.title %></label>
4
+ <label class="sr-only">Search Collection <%= @presenter.title %></label>
5
5
  <%= text_field_tag :cq, params[:cq], class: "collection-query", placeholder: "Search Collection", size: '30', type: "search", id: "collection_search" %>
6
6
  <%= hidden_field_tag :sort, params[:sort], id: 'collection_sort' %>
7
7
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:cq, :sort, :qt, :page)) %>
@@ -1,24 +1,31 @@
1
- <% @page_title = "#{@presenter.title} - #{application_name}" %>
1
+ <% provide :page_title, "#{@presenter.title} - #{application_name}" %>
2
2
 
3
- <h1 class="lower"><%= @presenter.title %></h1>
3
+ <% provide :sidebar do %>
4
+ <%= render 'search_sidebar' %>
5
+ <% end %>
4
6
 
5
- <%= render 'curation_concerns/base/representative_media', work: @presenter %>
7
+ <div id="content">
8
+ <h1 class="lower"><%= @presenter.title %></h1>
6
9
 
7
- <h3><%= @presenter.description %> </h3>
10
+ <%= render 'curation_concerns/base/representative_media', work: @presenter %>
8
11
 
9
- <% unless has_collection_search_parameters? %>
10
- <%= render partial: 'collections/show_actions' %>
11
- <%= render 'attributes', curation_concern: @presenter %>
12
- <% end %>
12
+ <h3><%= @presenter.description %> </h3>
13
13
 
14
- <%= render 'search_form' %>
15
- <%= render 'sort_and_per_page', collection: @presenter %>
14
+ <% unless has_collection_search_parameters? %>
15
+ <%= render partial: 'collections/show_actions' %>
16
+ <%= render 'attributes', curation_concern: @presenter %>
17
+ <% end %>
16
18
 
17
- <% if has_collection_search_parameters? %>
18
- <h2>Search Results within this Collection</h2>
19
- <% else %>
20
- <h2>Items in this Collection</h2>
21
- <% end %>
22
- <%= render_document_index @member_docs %>
19
+ <%= render 'search_form' %>
20
+ <%= render 'sort_and_per_page', collection: @presenter %>
21
+
22
+ <% if has_collection_search_parameters? %>
23
+ <h2>Search Results within this Collection</h2>
24
+ <% else %>
25
+ <h2>Items in this Collection</h2>
26
+ <% end %>
27
+ <%= render_document_index @member_docs %>
28
+
29
+ <%= render partial: 'paginate' %>
30
+ </div>
23
31
 
24
- <%= render partial: 'paginate' %>
@@ -0,0 +1,3 @@
1
+ <div class="actions form-horizontal panel panel-default">
2
+ <%= button_tag "Save", class: "btn btn-primary disabled", data: { action: "save-actions" }%>
3
+ </div>
@@ -0,0 +1,31 @@
1
+ <li data-reorder-id='<%= node.id %>'>
2
+ <%= simple_form_for [main_app, node], remote: true do |f| %>
3
+ <div class="panel panel-default">
4
+ <div class="panel-heading">
5
+ <div class="order-title">
6
+ <%= f.input :title, as: :string, input_html: { name: "#{f.object.model_name.singular}[title][]", class: "title" }, value: node.to_s, label: false %>
7
+ </div>
8
+ <div class="file-set-link pull-right">
9
+ <%= link_to polymorphic_path([main_app, node]), title: "Edit file" do %>
10
+ <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
11
+ <% end %>
12
+ </div>
13
+ <% if node.respond_to?(:page_title) %>
14
+ <div class="order-filename">
15
+ <em title="<%= node.page_title %>">(<%= truncate(node.page_title, length: 29) %>)</em>
16
+ </div>
17
+ <% end %>
18
+ </div>
19
+ <div class="panel-body">
20
+ <div class="text-center thumbnail">
21
+ <%= render "file_manager_thumbnail", node: node %>
22
+ </div>
23
+ <div class="attributes">
24
+ <%= render "file_manager_attributes", node: node, f: f%>
25
+ </div>
26
+ <div class="spacer">
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <% end %>
31
+ </li>
@@ -0,0 +1 @@
1
+ <%= render_thumbnail_tag node, class: 'thumbnail-inner' %>
@@ -3,6 +3,7 @@
3
3
  <% if editor %>
4
4
  <%= link_to "Edit This #{@presenter.human_readable_type}", edit_polymorphic_path([main_app, @presenter]), class: 'btn btn-default' %>
5
5
  <%= link_to "Attach a File", main_app.new_curation_concerns_file_set_path(@presenter), class: 'btn btn-default' %>
6
+ <%= link_to t("file_manager.link_text"), polymorphic_path([main_app, :file_manager, @presenter]), class: 'btn btn-default' %>
6
7
  <%= link_to "Delete This #{@presenter.human_readable_type}", [main_app, @presenter], class: 'btn btn-danger pull-right', data: { confirm: "Delete this #{@presenter.human_readable_type}?" }, method: :delete %>
7
8
  <% end %>
8
9
  <% if collector %>