diff --git a/app/assets/images/describe.png b/app/assets/images/describe.png
new file mode 100644
index 0000000..c490477
Binary files /dev/null and b/app/assets/images/describe.png differ
diff --git a/app/assets/images/organize.png b/app/assets/images/organize.png
new file mode 100644
index 0000000..f1bea4c
Binary files /dev/null and b/app/assets/images/organize.png differ
diff --git a/app/assets/images/publish.png b/app/assets/images/publish.png
new file mode 100644
index 0000000..125c7fa
Binary files /dev/null and b/app/assets/images/publish.png differ
diff --git a/app/assets/images/upload.png b/app/assets/images/upload.png
new file mode 100644
index 0000000..5eae76c
Binary files /dev/null and b/app/assets/images/upload.png differ
diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss
index 5699d82..ba00f8d 100755
--- a/app/assets/stylesheets/dashboard.scss
+++ b/app/assets/stylesheets/dashboard.scss
@@ -1,30 +1,45 @@
@import 'global';
-div.heading-tile .glyphicon {
- background: $hokie-orange;
+div.dashboard-breadcrumb {
+ margin-bottom: 20px;
+ margin-top: 20px;
+ border-bottom: solid $hokie-orange;
+}
+
+div.heading-tile {
color: white;
display: block;
- width: 2em;
- height: 2em;
+ border-radius: 5px 5px 0 0;
line-height: 1.75em;
margin: 0 auto;
- border-radius: 50%;
- border: 2px solid $hokie-orange;
+ padding-top: 10px;
overflow: hidden;
transition-property: background-color, color;
transition-duration: .35s;
transition-timing-function: ease-out;
}
-div.heading-tile:hover .glyphicon {
+div.heading-tile.active {
+ background-color: orange;
+ color: white;
+ transition-property: background-color, color;
+ transition-duration: .35s;
+ transition-timing-function: ease-out;
+}
+
+div.heading-tile:hover {
background-color: $hokie-orange;
- border-color: $hokie-orange;
color: white;
transition-property: background-color, color;
transition-duration: .35s;
transition-timing-function: ease-out;
}
+div.heading-tile a:hover {
+ text-decoration: none;
+}
+
+
.dashboard {
.panel-default > .panel-heading {
background-color: $hokie-grey;
@@ -42,4 +57,10 @@ div.heading-tile:hover .glyphicon {
padding: 0 .25em;
}
-}
\ No newline at end of file
+}
+
+.heading-tile {
+ img {
+ height: 64px;
+ }
+}
diff --git a/app/assets/stylesheets/styles.scss b/app/assets/stylesheets/styles.scss
index 8e79e20..980fe0e 100755
--- a/app/assets/stylesheets/styles.scss
+++ b/app/assets/stylesheets/styles.scss
@@ -23,6 +23,12 @@
text-align: left;
}
+.table-actionable {
+ .text-left {
+ text-align: left;
+ }
+}
+
#login-form {
margin-top: 5%;
margin-bottom: 5%;
diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb
index bea75a8..5669f12 100644
--- a/app/controllers/collections_controller.rb
+++ b/app/controllers/collections_controller.rb
@@ -1,6 +1,8 @@
class CollectionsController < ApplicationController
+ include Hydra::Catalog
+
include Sufia::CollectionsControllerBehavior
- skip_load_and_authorize_resource :only => [:datacite_search, :crossref_search, :import_metadata, :ldap_search]
+ skip_load_and_authorize_resource :only => [:datacite_search, :crossref_search, :import_metadata, :ldap_search, :add_files]
def presenter_class
MyCollectionPresenter
@@ -115,4 +117,14 @@ def ldap_search
render :layout => false
end
+ def add_files
+ if current_user.admin?
+ search_params_logic = [:show_only_generic_files, :add_access_controls_to_solr_params]
+ else
+ search_params_logic = [:show_only_generic_files, :show_only_resources_deposited_by_current_user]
+ end
+ (_, @files) = search_results({ q: '' }, search_params_logic)
+ @collection = Collection.find(params[:id])
+ authorize! :edit, @collection
+ end
end
diff --git a/app/controllers/publishables_controller.rb b/app/controllers/publishables_controller.rb
new file mode 100644
index 0000000..2f76ef1
--- /dev/null
+++ b/app/controllers/publishables_controller.rb
@@ -0,0 +1,17 @@
+class PublishablesController < ApplicationController
+ include Hydra::Catalog
+ include Hydra::BatchEditBehavior
+ include Hydra::Collections::SelectsCollections
+
+ def index
+ @publishables = []
+ # there is almost certainly a better way to do this!!!
+ Collection.where(depositor: current_user.user_key).each do |collection|
+ unless collection.member_ids.empty?
+ unless collection.identifier.any? {|uri| uri.start_with? "doi:"}
+ @publishables << collection
+ end
+ end
+ end
+ end
+end
diff --git a/app/helpers/dashboard_breadcrumb_helper.rb b/app/helpers/dashboard_breadcrumb_helper.rb
new file mode 100644
index 0000000..2daedd9
--- /dev/null
+++ b/app/helpers/dashboard_breadcrumb_helper.rb
@@ -0,0 +1,17 @@
+module DashboardBreadcrumbHelper
+ @@dashboard_groups = {
+ "generic_files" => :upload,
+ "batch" => :describe,
+ "my/files" => :describe,
+ "my/highlights" => :describe,
+ "my/shares" => :describe,
+ "batch_edits" => :describe,
+ "my/collections" => :organize,
+ "collections" => :organize,
+ "publishables" => :publish
+ }
+
+ def current_dashboard_tab?(sym)
+ @@dashboard_groups[params[:controller]] == sym
+ end
+end
diff --git a/app/views/batch/edit.html.erb b/app/views/batch/edit.html.erb
new file mode 100644
index 0000000..e17cf6c
--- /dev/null
+++ b/app/views/batch/edit.html.erb
@@ -0,0 +1,28 @@
+<%= javascript_tag do %>
+ <%= render partial: "edit", formats: [:js] %>
+<% end %>
+
+<%= render partial: "dashboard/_index_partials/heading_actions" %>
+
+
Apply Metadata
+
+ The information you provide for Title will be applied to the corresponding file only; however all other
+ information you provide will be applied to the entire batch of files you have just
+ deposited into <%= t('sufia.product_name') %>. You may edit individual files from
+ <%= link_to " #{t('sufia.bread_crumb.file_list')}".html_safe, sufia.dashboard_files_path %>
+ once this step is finished. * indicates required fields.
+
+<%= simple_form_for [sufia, @batch, @form], html: { multipart: true }, builder: Sufia::FormBuilder do |f| %>
+
+ <%= render 'metadata', f: f %>
+
+ <%= render 'generic_files/permission_form', f: f, batch: @batch %>
+
+
+ <%= button_tag type: 'submit', class: 'btn btn-primary btn-lg',
+ onclick: "confirmation_needed = false;", id: "upload_submit", name: "update_permission" do %>
+ Save
+ <% end %>
+
+
+<% end %>
diff --git a/app/views/batch_edits/edit.html.erb b/app/views/batch_edits/edit.html.erb
new file mode 100644
index 0000000..d1a7586
--- /dev/null
+++ b/app/views/batch_edits/edit.html.erb
@@ -0,0 +1,59 @@
+<%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
+<%= render partial: 'dashboard/_index_partials/heading_actions.html.erb' %>
+Batch Edit Descriptions Click on labels below to edit file descriptions.
+
+
Changes will be applied to: (<%= @names.size %> files)
+ <%= @names.join(", ").html_safe %>
+
+
+
+
Descriptions:
+
+
+
+
+ <% @terms.each do |term| %>
+
+ <%= simple_form_for @generic_file, url: batch_edits_path, method: :put, remote: true,
+ builder: Sufia::FormBuilder, html: { id: "form_#{term.to_s}", class: "ajax-form"} do |f| %>
+
+
+ <% end %>
+
+ <% end %>
+
+
+
+ <%= form_for @generic_file, url: batch_edits_path, method: :put, remote: true, html: { id: "form_permissions", class: "ajax-form"} do |f| %>
+ <%= hidden_field_tag('update_type', 'update') %>
+ <%= hidden_field_tag('key', 'permissions') %>
+ <%= render "generic_files/permission_form", f: f %>
+
+ <%= f.submit "Save changes", class: 'btn btn-primary updates-batches', id: 'permissions_save' %>
+
+
+ <% end %>
+
+
+
+
+<%= button_to "Clear Batch", { controller: :batch_edits, action: :clear }, form_class: 'hidden', remote: true, id: 'clear_batch' %>
+
+
diff --git a/app/views/collections/_show_actions.html.erb b/app/views/collections/_show_actions.html.erb
index d68071d..e7944c0 100644
--- a/app/views/collections/_show_actions.html.erb
+++ b/app/views/collections/_show_actions.html.erb
@@ -5,10 +5,9 @@
<%= link_to collections.edit_collection_path, class: "btn btn-default", title: "Edit this Dataset" do %>
Edit
<% end %>
- <%= link_to sufia.dashboard_files_path, class: "btn btn-default", title: "Add files to this Dataset" do %>
- Files
+ <%= link_to collections_add_files_path(@collection), class: "btn btn-default", title: "Edit this Dataset" do %>
+ Files
<% end %>
- <%= request_doi_link(@collection) %>
<% end %>
diff --git a/app/views/collections/add_files.html.erb b/app/views/collections/add_files.html.erb
new file mode 100644
index 0000000..886db7b
--- /dev/null
+++ b/app/views/collections/add_files.html.erb
@@ -0,0 +1,32 @@
+<%= render partial: 'dashboard/_index_partials/heading_actions.html.erb' %>
+Files in <%= @collection.title %>
+<% if @files.empty? %>
+ Please upload some files first
+<% else %>
+ <%= form_for @collection, url: collections.collection_path(@collection) do |f| %>
+ <%= hidden_field_tag "collection[members][]" %>
+
+
+
+
+ Filename |
+ Date Uploaded |
+ In Collection |
+
+
+
+ <% @files.each do |file| %>
+
+ <%= render_thumbnail_tag file, { class: "hidden-xs file_listing_thumbnail pull-left media-left" }, { suppress_link: true } %>
+ <%= file.title_or_label %> |
+ <%= file.date_uploaded %> |
+ <%= check_box_tag 'batch_document_ids[]', file.id, @collection.member_ids.include?(file.id) %> |
+
+ <% end %>
+
+
+
+
+ <%= f.button('Add Files to Collection', class: 'btn btn-primary') %>
+ <% end %>
+<% end %>
diff --git a/app/views/collections/edit.html.erb b/app/views/collections/edit.html.erb
index 3140749..194a682 100755
--- a/app/views/collections/edit.html.erb
+++ b/app/views/collections/edit.html.erb
@@ -1,5 +1,8 @@
<% @page_title = "Edit Dataset #{display_title(@collection)} - #{application_name}" %>
<%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
+
+<%= render partial: 'dashboard/_index_partials/heading_actions.html.erb' %>
+
Edit Dataset: <%= display_title(@collection) %>
<% unless has_collection_search_parameters? %>
diff --git a/app/views/collections/new.html.erb b/app/views/collections/new.html.erb
index 20ddfe4..7342ae6 100644
--- a/app/views/collections/new.html.erb
+++ b/app/views/collections/new.html.erb
@@ -1,3 +1,7 @@
+
+
Create New Dataset
<%= radio_button_tag :doi_status, "assigned", checked = false %>
diff --git a/app/views/collections/show.html.erb b/app/views/collections/show.html.erb
index 3a36565..eeeb642 100755
--- a/app/views/collections/show.html.erb
+++ b/app/views/collections/show.html.erb
@@ -1,7 +1,7 @@
<% @page_title = "#{@collection.title} - #{application_name}" %>
<%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
-
+<%= render partial: 'dashboard/_index_partials/heading_actions.html.erb' %>
<%= render partial: 'collections/media_display', locals: { generic_file: @collection } %>
diff --git a/app/views/dashboard/_index_partials/_heading_actions.html.erb b/app/views/dashboard/_index_partials/_heading_actions.html.erb
new file mode 100644
index 0000000..7278ead
--- /dev/null
+++ b/app/views/dashboard/_index_partials/_heading_actions.html.erb
@@ -0,0 +1,31 @@
+<% current_tab ||= nil %>
+
+ <% if can?(:create, GenericFile) %>
+
">
+ <%= link_to sufia.new_generic_file_path do %>
+ <%= image_tag('upload.png') %>
+ <%= t("sufia.dashboard.upload") %>
+ <% end %>
+
+ <% end %>
+
">
+ <%= link_to sufia.dashboard_files_path do %>
+ <%= image_tag('describe.png') %>
+ <%= t("sufia.dashboard.view_files") %>
+ <% end %>
+
+ <% if can?(:create, Collection) %>
+
">
+ <%= link_to sufia.dashboard_collections_path, id: "hydra-collection-add" do %>
+ <%= image_tag('organize.png') %>
+ <%= t("sufia.dashboard.create_collection") %>
+ <% end %>
+
+ <% end %>
+
">
+ <%= link_to dashboard_publishables_path, id: "hydra-collection-view" do %>
+ <%= image_tag('publish.png') %>
+ <%= t("sufia.dashboard.publish") %>
+ <% end %>
+
+
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb
new file mode 100644
index 0000000..e4acf29
--- /dev/null
+++ b/app/views/dashboard/index.html.erb
@@ -0,0 +1,16 @@
+<%= content_for :heading do %>
+
+ <%= render partial: "dashboard/_index_partials/heading_greetings" %>
+
+<% end %>
+
+<%= content_for :sidebar do %>
+
+ <%= render partial: "dashboard/_index_partials/stats" %>
+
+ <%= render partial: "dashboard/_index_partials/user_info" %>
+
+<% end %>
+
+<%= render partial: "dashboard/_index_partials/contents" %>
+
diff --git a/app/views/generic_files/edit.html.erb b/app/views/generic_files/edit.html.erb
new file mode 100644
index 0000000..450c820
--- /dev/null
+++ b/app/views/generic_files/edit.html.erb
@@ -0,0 +1,31 @@
+<%= javascript_tag do %>
+ <%= render partial: "edit", formats: [:js] %>
+<% end %>
+
+<%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
+<%= render partial: 'dashboard/_index_partials/heading_actions.html.erb' %>
+
Edit <%= @generic_file %>
+
+
+
+ <%= render partial: 'media_display' %>
+
+
+
+
+ <%= render "descriptions", form: @form %>
+ <%= render "permission", generic_file: @generic_file %>
+ <%= render "versioning", generic_file: @generic_file %>
+
+
+
diff --git a/app/views/generic_files/new.html.erb b/app/views/generic_files/new.html.erb
new file mode 100644
index 0000000..aad1989
--- /dev/null
+++ b/app/views/generic_files/new.html.erb
@@ -0,0 +1,33 @@
+
Upload
+<%= render partial: 'dashboard/_index_partials/heading_actions' %>
+<%= render partial: 'generic_files/upload/alerts' %>
+<%# using partials rather than inlining, so implementers can add or change stuff on this page without much duplication %>
+
+
+
+
+ <%= t("sufia.upload.my_computer.sr_instructions") %>
+ <%= render partial: 'multiple_upload' %>
+
+
+ <% if Sufia.config.browse_everything %>
+
+ <%= render partial: 'browse_everything' %>
+
+ <% end %>
+
+ <% if Sufia.config.enable_local_ingest %>
+
+ <%= render partial: 'generic_files/local_file_import' %>
+
+ <% end %>
+
+
diff --git a/app/views/layouts/sufia-dashboard.html.erb b/app/views/layouts/sufia-dashboard.html.erb
index 7b062ae..6a61abf 100755
--- a/app/views/layouts/sufia-dashboard.html.erb
+++ b/app/views/layouts/sufia-dashboard.html.erb
@@ -17,6 +17,7 @@
+ <%= render partial: "dashboard/_index_partials/heading_actions" %>
<%= yield %>
@@ -30,4 +31,4 @@
<%= render 'shared/ajax_modal' %>