bulk_ops 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/images/bulk_ops/github_logo.png +0 -0
  3. data/app/assets/javascripts/bulk_ops.js +14 -0
  4. data/app/assets/javascripts/bulk_ops/selections.js +24 -0
  5. data/app/assets/javascripts/selections.js +38 -0
  6. data/app/assets/javascripts/work_search.js +64 -0
  7. data/app/assets/stylesheets/bulk_ops.scss +99 -0
  8. data/app/controllers/bulk_ops/application_controller.rb +13 -0
  9. data/app/controllers/bulk_ops/github_authorization_controller.rb +33 -0
  10. data/app/controllers/bulk_ops/operations_controller.rb +481 -0
  11. data/app/jobs/bulk_ops/application_job.rb +4 -0
  12. data/app/mailers/bulk_ops/application_mailer.rb +6 -0
  13. data/app/models/bulk_ops/application_record.rb +5 -0
  14. data/app/views/bulk_ops/_bulk_ops_sidebar_widget.html.erb +15 -0
  15. data/app/views/bulk_ops/_github_auth_widget.html.erb +13 -0
  16. data/app/views/bulk_ops/operations/_bulk_ops_header.html.erb +4 -0
  17. data/app/views/bulk_ops/operations/_choose_fields.html.erb +22 -0
  18. data/app/views/bulk_ops/operations/_choose_notifications.html.erb +22 -0
  19. data/app/views/bulk_ops/operations/_git_message.html.erb +7 -0
  20. data/app/views/bulk_ops/operations/_ingest_options.html.erb +42 -0
  21. data/app/views/bulk_ops/operations/_operation_options.html.erb +38 -0
  22. data/app/views/bulk_ops/operations/_show_authorize.html.erb +13 -0
  23. data/app/views/bulk_ops/operations/_show_complete.html.erb +31 -0
  24. data/app/views/bulk_ops/operations/_show_draft.html.erb +20 -0
  25. data/app/views/bulk_ops/operations/_show_new.html.erb +2 -0
  26. data/app/views/bulk_ops/operations/_show_pending.html.erb +58 -0
  27. data/app/views/bulk_ops/operations/_show_running.html.erb +56 -0
  28. data/app/views/bulk_ops/operations/_show_verifying.html.erb +8 -0
  29. data/app/views/bulk_ops/operations/_show_waiting.html.erb +9 -0
  30. data/app/views/bulk_ops/operations/_update_draft_work_list.html.erb +45 -0
  31. data/app/views/bulk_ops/operations/_update_draft_work_search.html.erb +59 -0
  32. data/app/views/bulk_ops/operations/_update_options.html.erb +9 -0
  33. data/app/views/bulk_ops/operations/index.html.erb +51 -0
  34. data/app/views/bulk_ops/operations/new.html.erb +36 -0
  35. data/app/views/bulk_ops/operations/show.html.erb +7 -0
  36. data/config/routes.rb +25 -0
  37. data/db/migrate/20180926190757_create_github_credentials.rb +13 -0
  38. data/db/migrate/20181017180436_create_bulk_ops_tables.rb +40 -0
  39. data/lib/bulk_ops.rb +15 -0
  40. data/lib/bulk_ops/create_spreadsheet_job.rb +43 -0
  41. data/lib/bulk_ops/create_work_job.rb +14 -0
  42. data/lib/bulk_ops/delete_file_set_job.rb +15 -0
  43. data/lib/bulk_ops/engine.rb +6 -0
  44. data/lib/bulk_ops/error.rb +141 -0
  45. data/lib/bulk_ops/github_access.rb +284 -0
  46. data/lib/bulk_ops/github_credential.rb +3 -0
  47. data/lib/bulk_ops/operation.rb +358 -0
  48. data/lib/bulk_ops/relationship.rb +79 -0
  49. data/lib/bulk_ops/search_builder_behavior.rb +80 -0
  50. data/lib/bulk_ops/templates/configuration.yml +5 -0
  51. data/lib/bulk_ops/templates/readme.md +1 -0
  52. data/lib/bulk_ops/update_work_job.rb +14 -0
  53. data/lib/bulk_ops/verification.rb +210 -0
  54. data/lib/bulk_ops/verification_job.rb +23 -0
  55. data/lib/bulk_ops/version.rb +3 -0
  56. data/lib/bulk_ops/work_job.rb +104 -0
  57. data/lib/bulk_ops/work_proxy.rb +466 -0
  58. data/lib/generators/bulk_ops/install/install_generator.rb +27 -0
  59. data/lib/generators/bulk_ops/install/templates/config/github.yml.example +28 -0
  60. metadata +145 -0
@@ -0,0 +1,4 @@
1
+ module BulkOps
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module BulkOps
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module BulkOps
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ <% if can? :review, :submissions %>
2
+ <li>
3
+ <%= menu.collapsable_section 'Bulk Operations',
4
+ icon_class: "fa fa-table",
5
+ id: 'collapseBulkOps',
6
+ open: false do %>
7
+ <%= menu.nav_link("/bulk_ops/new") do %>
8
+ <span class="fa fa-file-o"></span> New Bulk Operation
9
+ <% end %>
10
+ <%= menu.nav_link("/bulk_ops/") do %>
11
+ <span class="fa fa-copy"></span> Manage Bulk Operations
12
+ <% end %>
13
+ <% end %>
14
+ </li>
15
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <div id="github-auth">
2
+ <%= image_tag 'bulk_ops/github_logo.png' %>
3
+ <% if @github_username %>
4
+ <p>You are logged in as <strong><%= @github_username %></strong>.</p>
5
+ <%= form_tag("/bulk_ops/github_logout/#{current_user.id}", method: :post) do %>
6
+ <input type="submit" name="logout" value="Logout" />
7
+ <% end %>
8
+ <% else %>
9
+ <a href="<%= BulkOps::GithubAccess.auth_url(current_user) %>" >
10
+ <button>Log in to Github</button>
11
+ </a>
12
+ <% end %>
13
+ </div>
@@ -0,0 +1,4 @@
1
+ <div id="bulk-ops-header">
2
+ <div id="gem-header">Bulk Ops</div>
3
+ <div id="bulk-ops-page-title"><%= title %></div>
4
+ </div>
@@ -0,0 +1,22 @@
1
+ <div id="fields-options" class="bulk-ops-options">
2
+
3
+ <input id="use-default-fields" type="checkbox" checked="checked" />
4
+
5
+ <label for="use-default-fields" data-toggle="tooltip" title="Uncheck this box to manually choose which fields will be included in the template spreadsheet. This is useful if you aren't sure how to format the field names you need.">Use Default Fields for Template Spreadsheet</label>
6
+
7
+
8
+ <div id="choose-fields">
9
+ <label data-toggle="tooltip" title="Which metadata fields would you like to include on the template spreadsheet for this bulk operation?">Fields for Initial Spreadsheet</label>
10
+ <ul id="bulk-ops-field-options">
11
+ <% @all_fields.each do |field| %>
12
+ <li>
13
+ <% next if field.nil? %>
14
+ <input type="checkbox" name="fields[]" value="<%= field %>" <%= 'checked="checked"' if @default_fields.include?(field) %> />
15
+ <%=field%>
16
+ </li>
17
+ <% end %>
18
+ </ul>
19
+ </div>
20
+
21
+ </div>
22
+
@@ -0,0 +1,22 @@
1
+ <a class="bulk-ops-collapse-link collapsed" data-toggle="collapse" href="#notification-options" aria-expanded="false" aria-controls="notification-options">
2
+ Show/Hide Notification Options
3
+ </a>
4
+ <div id="notification-options" class="bulk-ops-options collapse">
5
+ <label data-toggle="tooltip" title="The people on this list will recieve email notifications when important events happen to this operation.">Notification Recipients:</label>
6
+ <ul id="notifications">
7
+ <% @notified_users.each do |user| %>
8
+ <% next if user.nil? %>
9
+ <li>
10
+ <input type="hidden" name="notified_users[]" value="<%= user.email %>"/>
11
+ <%= user.email %>
12
+ <button class="remove_user_notification" onclick="$(this).parent().remove()">X</button>
13
+ </li>
14
+ <% end %>
15
+ </ul>
16
+ <div id="add-new-notification">
17
+ <labeldata-toggle="tooltip" title="Enter an email address here to add it to the list of notification recipients"> Add recipient email:</label>
18
+ <input type="text" name="add-user-notification" id="add-user-notification"/>
19
+ <button type="button" id="add-user-notification" onclick="name=$(this).siblings('input#add-user-notification').val();$('<li><button class=remove_user_notification onclick=$(this).parent().remove()>Remove</button><input type=hidden name=notified-users[] value='+name+' /> '+name+'</li>').appendTo('ul#notifications')">Add</button>
20
+ </div>
21
+ </div>
22
+
@@ -0,0 +1,7 @@
1
+ <div class="github-message">
2
+ <div onclick="$(this).next().show();$(this).hide()" id="show-git-message" type="button">Add Comment to Describe Action</div>
3
+ <div id="git-message-div" style="display:none">
4
+ <label for="git-message-input">Comment:</label> <input id="git-message-input" type="text" name="git_message" size="64"/>
5
+ <p>Type a short comment describing the action you are taking. This comment will be recorded in the history of this operation, and will be visible to other administrators.</p>
6
+ </div>
7
+ </div>
@@ -0,0 +1,42 @@
1
+ <div id="ingest-options" class="options-panel bulk-ops-options">
2
+
3
+ <div>
4
+ <label for="visibility" data-toggle="tooltip" title="How would you like to set the default visibility of the imported works? If you're unsure, keep the works private for now and publish them later." >Default Visibility:</label>
5
+ <select id="visibility" name="visibility">
6
+ <%= options_for_select @visibility_options, @operation.options["visibility"] || "restricted" %>
7
+ </select>
8
+ </div>
9
+
10
+ <div>
11
+ <label for="work-type" data-toggle="tooltip" title="Which work type would you like to create by default? This can be changed later, and/or overridden in the ingest spreadsheet on a line-by-line basis.">Default Work Type:</label>
12
+ <select name="work_type" id="work-type">
13
+ <%= options_for_select @work_type_options, @operation.options["work_type"] || "Work" %>
14
+ </select>
15
+ </div>
16
+ <% unless @operation.stage == "pending" %>
17
+
18
+ <div class="checkbox-container">
19
+ <input type="checkbox" id="complex-objects" name="complex_objects" onclick="refops = jQuery('div#reference-options'); if(this.checked){refops.show().enable();}else{refops.hide().disable();}" value="<%=@operation.options["complex_objects"] || ""%>"/>
20
+ <label for="complex-objects" data-toggle="tooltip" title="Check this box if the works in your spreadsheet have structural metadata relating them to one another (e.g. parent-child relationships)">This field contains complex objects</label>
21
+ </div>
22
+
23
+ <div id="reference-options" style="display:none">
24
+ <div class="checkbox-container">
25
+ <input type="checkbox" name="include_reference_column" checked="checked" onclick="refcol = jQuery('div.reference-column-toggle'); if(this.checked?){refcol.show();}else{refcol.hide()}" value="<%=@operation.options["include_reference_column"] || ""%>" disabled="disabled"/>
26
+ <label data-toggle="tooltip" title="Check this box to include a dedicated column on the spreadsheet for a unique identifier of each row. These identifiers are meant to be used for rows with parent-child relationships to refer to one another. This reference column will not be ingested as metadata.">Include Dedicated Reference Column</label>
27
+ </div>
28
+
29
+
30
+ <div class="reference-column-toggle" style="display:none">
31
+ <label data-toggle="tooltip" title="If we aren't including a dedicated column for rows to reference one another, we need to use one of the metadat columns. Please enter the name of the column you want to use as a unique identifier of each row for reference purposes within the spreadsheet.">Column or Field to Identify Referenced Works:</label>
32
+ <input type="text" name="reference_identifier" value="<%=@operation.options["reference_identifier"] || ""%>" disabled="disabled"/>
33
+ </div>
34
+
35
+ <div class="reference-column-toggle">
36
+ <label data-toggle="tooltip" title="Choose a name for the dedicated reference column. This can be anything that isn't used for another purpose in the spreadsheet.">Reference Column Name:</label>
37
+ <input type="text" id="reference-column-name" name="reference_column_name" value="<%=@operation.options["reference_identifier"] || "INGEST REFERENCE"%>" disabled="disabled" />
38
+ </div>
39
+ </div>
40
+ <% end %>
41
+
42
+ </div>
@@ -0,0 +1,38 @@
1
+ <div id="operation-options" class="options-panel bulk-ops-options">
2
+
3
+ <div title="This string will be added before each filename included in the spreadsheet. Use this for a shared base directory." data-toggle="tooltip">
4
+ <label>Filename Prefix:</label>
5
+ <input type="text" name="file_prefix" value="<%=@operation.options["file_prefix"] || ""%>" />
6
+ </div>
7
+
8
+ <div title="Any column whose header is on this list will be ignored when ingesting this spreadsheet.">
9
+ <label>Columns to Ignore:</label>
10
+ <ul id="ignored-columns">
11
+
12
+ <% (@operation.options["ignored_columns"] || []).each do |ignored_column| %>
13
+ <li >
14
+ <input type="text" name="ignored_columns[]" value="<%= ignored_column %>" />
15
+ <button type="button"
16
+ class="remove-ignore"
17
+ onclick="jQuery(this).parent('li').remove()">X</button>
18
+ </li>
19
+ <% end %>
20
+ <li >
21
+ <input type="text" name="ignored_columns[]" />
22
+ <button type="button"
23
+ class="remove-ignore"
24
+ onclick="jQuery(this).parent('li').remove()">X</button>
25
+ </li>
26
+ <li id="template-li" style="display:none">
27
+ <input type="text" name="ignored_columns[]" />
28
+ <button type="button"
29
+ class="remove-ignore"
30
+ onclick="jQuery(this).parent('li').remove()">X</button>
31
+ </li>
32
+ </ul>
33
+ <button type="button" id="add-ignore-column"
34
+ onclick="jQuery('li#template-li').clone().show().appendTo('ul#ignored-columns');">Add another ignored column</button>
35
+ </div>
36
+
37
+
38
+ </div>
@@ -0,0 +1,13 @@
1
+ <h3>Awaiting Approval </h1>
2
+ <div>
3
+ <p>This bulk <%=@operation.operation_type%> is waiting for approval before it can be applied.</p>
4
+ <% if @operation.can_merge? %>
5
+ <p style="font-size:1.2em"> You have the authority to approve this <%=@operation.type%> and apply it immediately. </p>
6
+ <%= form_tag("#{@operation.id}/approve") do %>
7
+ <%= render "git_message" %>
8
+ <%= submit_tag 'Approve & Apply Now' %>
9
+ <% end %>
10
+ <% else %>
11
+ <p> Contact the DAMS administrators to approve your bulk <%=@operation.type%>.
12
+ <% end %>
13
+ </div>
@@ -0,0 +1,31 @@
1
+ <div id="operation-header">
2
+ <h3>Bulk <%= @operation.operation_type.capitalize %> Complete!</h3>
3
+ </div>
4
+
5
+ <div class="operation-info">
6
+ <label> Total works in this <%= @operation.operation_type %>:</label> <%= @num_works %>
7
+ </div>
8
+
9
+ <div class="operation-info">
10
+ <label> Number of works that failed to <%= @operation.operation_type %>:</label> <%= @num_failed %>
11
+ </div>
12
+
13
+ <div class="operation-info">
14
+ <%# <a href="TODO MAKE THIS LINK WORK"> %>
15
+ <p> Works that completed successfully: <%= @num_complete %></p>
16
+ <%# </a> %>
17
+ </div>
18
+
19
+ <%= form_tag "#{@operation.id}/duplicate" do %>
20
+ <input type="hidden" name="status_to_edit" value="all"/>
21
+ <button id="new-operation-all"> Create new update from all works in this <%=@operation.operation_type %> </button>
22
+ <% end %>
23
+ <%= form_tag "#{@operation.id}/duplicate" do %>
24
+ <input type="hidden" name="status_to_edit" value="complete"/>
25
+ <button id="new-operation-completed"> Create new update from all works that have completed this <%= @operation.operation_type %></button>
26
+ <% end %>
27
+ <%= form_tag "#{@operation.id}/duplicate" do %>
28
+ <input type="hidden" name="status_to_edit" value="error"/>
29
+ <button id="new-operation-failed"> Create new <%= @operation.operation_type %> from all works that have failed this <%= @operation.operation_type %></button>
30
+ <% end %>
31
+
@@ -0,0 +1,20 @@
1
+ <h2>Edit Grouping for Bulk Update: "<%= @operation.name %>"</h2>
2
+ <p>Add and remove works from this group to indicate which works you want to update. The group will be saved even if you log out. Take your time and get the right group of works; it is harder to change later.</p>
3
+
4
+ <hr class="bulk-ops">
5
+
6
+ <%= render "update_draft_work_search" %>
7
+
8
+ <hr class="bulk-ops">
9
+
10
+ <%= render "update_draft_work_list" %>
11
+
12
+ <hr class="bulk-ops">
13
+
14
+ <%= form_tag("#{@operation.id}", method: :put, id: "finalize-draft") do %>
15
+ <h3>Actions</h3>
16
+ <input type="hidden" name="operation_id" value="<%=@operation.id%>" />
17
+ <%= render "git_message" %>
18
+ <input type="submit" name="finalize" value="Finalize Group & Start Updating" />
19
+ <input name="destroy" type="submit" value="Delete Bulk Update" />
20
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render "show_pending" if @operation.type == "ingest"%>
2
+ <%= render "show_draft" if @operation.type == "draft"%>
@@ -0,0 +1,58 @@
1
+ <h4>Status: <%= @operation.status %></h4>
2
+ <p>Last log message: <%= @operation.message %></p>
3
+ <p>Your current spreadsheet would affect <%= @operation.spreadsheet_count %> works.</p>
4
+
5
+ <h3> Actions </h3>
6
+ <div id="bulk-operation-actions">
7
+ <div class=op-action>
8
+ <p class="big">Download the current metadata spreadsheet as a csv file</p>
9
+ <p>You can then edit this file in your favorite spreadsheet editor, and re-upload the edited file in the section below.</p>
10
+ <%= link_to("/bulk_ops/#{@operation.id}/csv", target: :_blank) do %>
11
+ <button>Download</button>
12
+ <% end %>
13
+ </div>
14
+
15
+ <hr class="bulk-ops"/>
16
+
17
+ <%= form_for @operation, :html => { :multipart => true } do |f| %>
18
+
19
+ <div class="op-action" id="spreadsheet-input">
20
+ <p class="big">Upload a new version of your metadata spreadsheet</p>
21
+ <div>
22
+ <label>New Spreadsheet:</label>
23
+ <%= file_field_tag "spreadsheet" %>
24
+ </div>
25
+ <%= render "git_message" %>
26
+ <input type=submit id="upload-spreadsheet" name="upload_spreadsheet" value="Upload" />
27
+ </div>
28
+
29
+ <hr class="bulk-ops"/>
30
+
31
+ <a class="bulk-ops-collapse-link collapsed" data-toggle="collapse" href="#edit-options" aria-expanded="false" aria-controls="edit-options">
32
+ Show/Hide <%= @operation.operation_type.capitalize %> Options
33
+ </a>
34
+ <div class="op-action collapse" id="edit-options" aria-expanded="false" >
35
+ <%= render "operation_options" %>
36
+ <%= render "#{@operation.operation_type}_options" %>
37
+ <%= render "git_message" %>
38
+ <input type="submit" name ="edit_options" value="Save Changes" />
39
+ </div>
40
+
41
+ <% end %>
42
+
43
+ <hr class="bulk-ops"/>
44
+
45
+ <%= form_tag("#{@operation.id}/destroy") do %>
46
+ <p class="big">Cancel and delete this bulk <%=@operation.type %> completely</p>
47
+ <%= render "git_message" %>
48
+ <%= submit_tag("Cancel/Delete") %>
49
+ <% end %>
50
+
51
+ <hr class="bulk-ops"/>
52
+
53
+ <%= form_tag("/bulk_ops/#{@operation.id}/request_apply") do %>
54
+ <p class="big">Flag that the spreadsheet is ready after the final version has been uploaded and the bulk <%= @operation.operation_type %> is ready to apply. Approval from another administator may be necessary.</p>
55
+ <%= render "git_message" %>
56
+ <%= submit_tag "Finished" %>
57
+ <% end %>
58
+ </div>
@@ -0,0 +1,56 @@
1
+ <div id="operation-header">
2
+ <h2><%= @operation.name%> </h2>
3
+ <h3><%= @operation.stage %></h3>
4
+ <p id="status"> Status: <%= @operation.status %></p>
5
+ <p id="message"><%= @operation.message %></p>
6
+ </div>
7
+
8
+ <div id="operation-progress"></div>
9
+
10
+ <script>
11
+ $( function() {
12
+ $( "#operation-progress" ).progressbar({value: <%= @num_complete * 100 / @num_works %>});
13
+ } );
14
+ </script>
15
+
16
+ <div class="operation-info">
17
+ <label> Total works to <%= @operation.operation_type %>:</label> <%= @num_works%>
18
+ </div>
19
+
20
+ <div class="operation-info">
21
+ <label> Works queued up and waiting:</label> <%= @num_queued %>
22
+ </div>
23
+
24
+ <div class="operation-info">
25
+ <label> Works currently being <%= @operation.operation_type %>ed:</label> <%= @num_running %>
26
+ </div>
27
+
28
+ <div class="operation-info">
29
+ <label> Works that failed to <%= @operation.operation_type %>:</label> <%= @num_failed %>
30
+ </div>
31
+
32
+ <div class="operation-info">
33
+ <label> Works that completed successfully:</label>
34
+ <a href="TODO MAKE THIS LINK WORK"><%= @num_complete %></a>
35
+ </div>
36
+
37
+ <% if @operation.operation_type == "update" %>
38
+ <button id="new-operation-all"> Create new update from all works in this update</button>
39
+ <% end %>
40
+ <button id="new-operation-completed"> Create new update from all works that have completed this <%= @operation.operation_type%></button>
41
+ <button id="new-operation-failed"> Create new <%= @operation.operation_type %> from all works that have failed this <%= @operation.operation_type%></button>
42
+
43
+
44
+ <div id="log">
45
+
46
+
47
+
48
+
49
+ </div>
50
+
51
+ <div id="error_log">
52
+
53
+
54
+
55
+
56
+ </div>
@@ -0,0 +1,8 @@
1
+ <h2> Running automatic spreadsheet validations...</h2>
2
+ <p>We're running some tests on the spreadsheet to anticipate any ingest problems before we start. Check back here in a few minutes to see whether your spreadsheet passes our validation tests. If it passes, it will be up for one final approval before the bulk operation is applied.</p>
3
+
4
+ <script type="text/javascript">
5
+ setTimeout(function(){
6
+ location.reload();
7
+ },5000);
8
+ </script>
@@ -0,0 +1,9 @@
1
+ <h3>Waiting for Github...</h1>
2
+ <p>Waiting for Github to acknowledge to pull request merge and trigger the application of this bulk operation</p>
3
+
4
+
5
+ <script type="text/javascript">
6
+ setTimeout(function(){
7
+ location.reload();
8
+ },5000);
9
+ </script>
@@ -0,0 +1,45 @@
1
+ <div id="work-list">
2
+ <h3>Works included in update: <%= @draft_work_count %></h3>
3
+ <% if @draft_works.blank? %>
4
+ <p id="draft-empty-message" >
5
+ There are no works in this update so far. Search for works above and then add them to this update.
6
+ </p>
7
+ <% else %>
8
+ <p id="draft-message" >
9
+ Once you've added all the works you want, click "finalize" to create a spreadsheet of metadata from this list of works.
10
+ </p>
11
+ <%= form_tag("#{@operation.id}/edit") do %>
12
+ <div id="work-list-controls" >
13
+ <button type="button" class="select-all">Select All</button>
14
+ <button type="button" class="select-none">Select None</button>
15
+ <input type="submit" name="remove_works" id="remove-works" value="Remove Checked Works From List" />
16
+ </div>
17
+ <ul id="proxy-list">
18
+ <li id="template" class="hidden">
19
+ <input type="checkbox" name="selected_work_ids[]" value=""/>
20
+ <%= image_tag("", height: '200', class: 'work-thumb') %>
21
+ <div class="work-title"></div>
22
+ <div class="work-desription"></div>
23
+ </li>
24
+ <% @draft_works.each do |work| %>
25
+ <% doc = SolrDocument.find(work.id) %>
26
+ <li>
27
+ <input class="remove-work-id" type="checkbox" name="remove_work_ids[]" value="<%= work.id %>" />
28
+ <%= image_tag(doc.thumbnail_path, height: '200', class: 'work-thumb') %>
29
+ <div class="work-meta">
30
+ <div class="work-title"><%=doc.title.join(", ")%></div>
31
+ <div class="work-desription"><%=doc.description.join(", ")%></div>
32
+ </div>
33
+ </li>
34
+ <% end %>
35
+ </ul>
36
+ <div id="work-list-controls" >
37
+ <button type="button" class="select-all">Select All</button>
38
+ <button type="button" class="select-none">Select None</button>
39
+ <input type="submit" name="remove_works" id="remove-works" value="Remove Checked Works From List" />
40
+ </div>
41
+ <% end %>
42
+ <% end %>
43
+ </div>
44
+
45
+