sufia 4.0.0.beta3 → 4.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/SUFIA_VERSION +1 -1
  4. data/app/assets/javascripts/sufia/search.js +4 -6
  5. data/app/assets/stylesheets/dashboard.css.scss +26 -0
  6. data/app/assets/stylesheets/header.css.scss +21 -12
  7. data/app/controllers/batch_controller.rb +0 -1
  8. data/app/controllers/collections_controller.rb +0 -1
  9. data/app/controllers/concerns/sufia/catalog.rb +0 -9
  10. data/app/controllers/concerns/sufia/controller.rb +4 -0
  11. data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +24 -74
  12. data/app/controllers/concerns/sufia/downloads_controller_behavior.rb +0 -3
  13. data/app/controllers/concerns/sufia/files_controller_behavior.rb +4 -13
  14. data/app/controllers/concerns/sufia/my_controller_behavior.rb +87 -0
  15. data/app/controllers/{dashboard → my}/collections_controller.rb +3 -2
  16. data/app/controllers/{dashboard → my}/files_controller.rb +3 -2
  17. data/app/controllers/{dashboard → my}/highlights_controller.rb +3 -2
  18. data/app/controllers/{dashboard → my}/shares_controller.rb +3 -2
  19. data/app/controllers/my_controller.rb +3 -0
  20. data/app/controllers/single_use_links_controller.rb +0 -2
  21. data/app/helpers/dashboard_helper.rb +3 -0
  22. data/app/helpers/generic_file_helper.rb +4 -4
  23. data/app/helpers/sufia/dashboard_helper_behavior.rb +25 -0
  24. data/app/helpers/sufia/sufia_helper_behavior.rb +44 -0
  25. data/app/jobs/content_delete_event_job.rb +2 -2
  26. data/app/models/concerns/sufia/solr_document_behavior.rb +5 -0
  27. data/app/views/_user_util_links.html.erb +5 -5
  28. data/app/views/catalog/_results_pagination.html.erb +1 -1
  29. data/app/views/catalog/_search_form.html.erb +56 -28
  30. data/app/views/collections/_dashboard_document_list.html.erb +1 -1
  31. data/app/views/collections/_document_list.html.erb +1 -1
  32. data/app/views/collections/edit.html.erb +8 -11
  33. data/app/views/collections/show.html.erb +2 -2
  34. data/app/views/collections/show_fields/_creator.html.erb +11 -0
  35. data/app/views/collections/show_fields/_description.html.erb +8 -0
  36. data/app/views/collections/show_fields/_title.html.erb +8 -0
  37. data/app/views/dashboard/_index_partials/_stats.html.erb +16 -0
  38. data/app/views/dashboard/_index_partials/_user_info.html.erb +18 -0
  39. data/app/views/dashboard/index.html.erb +51 -19
  40. data/app/views/generic_files/_show_descriptions.html.erb +11 -10
  41. data/app/views/generic_files/show.html.erb +1 -1
  42. data/app/views/generic_files/show_fields/_based_near.html.erb +7 -0
  43. data/app/views/generic_files/show_fields/_contributor.html.erb +7 -0
  44. data/app/views/generic_files/show_fields/_creator.html.erb +7 -0
  45. data/app/views/generic_files/show_fields/_date_created.html.erb +7 -0
  46. data/app/views/generic_files/show_fields/_default.html.erb +6 -12
  47. data/app/views/generic_files/show_fields/_description.html.erb +7 -0
  48. data/app/views/generic_files/show_fields/_identifier.html.erb +4 -0
  49. data/app/views/generic_files/show_fields/_language.html.erb +4 -0
  50. data/app/views/generic_files/show_fields/_publisher.html.erb +7 -0
  51. data/app/views/generic_files/show_fields/_related_url.html.erb +6 -0
  52. data/app/views/generic_files/show_fields/_resource_type.html.erb +4 -0
  53. data/app/views/generic_files/show_fields/_rights.html.erb +4 -0
  54. data/app/views/generic_files/show_fields/_subject.html.erb +7 -0
  55. data/app/views/generic_files/show_fields/_tag.html.erb +4 -0
  56. data/app/views/generic_files/show_fields/_title.html.erb +7 -0
  57. data/app/views/generic_files/upload/_form_fields.html.erb +4 -5
  58. data/app/views/generic_files/upload/_script_templates.html.erb +1 -2
  59. data/app/views/layouts/sufia-dashboard.html.erb +16 -30
  60. data/app/views/mailbox/_notifications.html.erb +21 -0
  61. data/app/views/mailbox/index.html.erb +2 -23
  62. data/app/views/{dashboard → my}/_action_menu.html.erb +0 -0
  63. data/app/views/{dashboard → my}/_batch_edits_actions.html.erb +0 -0
  64. data/app/views/{dashboard → my}/_collection_action_menu.html.erb +0 -0
  65. data/app/views/{dashboard → my}/_did_you_mean.html.erb +0 -0
  66. data/app/views/my/_document_list.html.erb +4 -0
  67. data/app/views/{dashboard → my}/_facet_layout.html.erb +0 -0
  68. data/app/views/{dashboard → my}/_facet_limit.html.erb +0 -0
  69. data/app/views/{dashboard → my}/_facet_pagination.html.erb +0 -0
  70. data/app/views/{dashboard → my}/_facet_selected.html.erb +0 -0
  71. data/app/views/{dashboard → my}/_facets.html.erb +0 -0
  72. data/app/views/{dashboard → my}/_index_partials/_default_group.html.erb +2 -2
  73. data/app/views/{dashboard → my}/_index_partials/_list_collections.html.erb +0 -0
  74. data/app/views/{dashboard → my}/_index_partials/_list_files.html.erb +0 -0
  75. data/app/views/{dashboard → my}/_results_pagination.html.erb +0 -0
  76. data/app/views/my/_scripts.js.erb +11 -0
  77. data/app/views/{dashboard → my}/_sort_and_per_page.html.erb +0 -0
  78. data/app/views/{dashboard → my}/facet.html.erb +0 -0
  79. data/app/views/{dashboard/lists → my}/index.html.erb +4 -20
  80. data/app/views/users/_user_info.html.erb +1 -1
  81. data/config/initializers/sufia_events.rb +19 -2
  82. data/config/locales/sufia.en.yml +27 -2
  83. data/config/routes.rb +7 -11
  84. data/lib/generators/sufia/sufia_generator.rb +15 -0
  85. data/lib/generators/sufia/templates/catalog_controller.rb +14 -14
  86. data/lib/sufia.rb +1 -0
  87. data/lib/sufia/version.rb +1 -1
  88. data/spec/controllers/catalog_controller_spec.rb +7 -16
  89. data/spec/controllers/dashboard_controller_spec.rb +63 -30
  90. data/spec/controllers/generic_files_controller_spec.rb +1 -1
  91. data/spec/controllers/{dashboard → my}/collections_controller_spec.rb +1 -15
  92. data/spec/controllers/my/files_controller_spec.rb +68 -0
  93. data/spec/controllers/{dashboard → my}/highlights_controller_spec.rb +1 -15
  94. data/spec/controllers/{dashboard → my}/shares_controller_spec.rb +1 -15
  95. data/spec/controllers/my_controller_spec.rb +9 -0
  96. data/spec/features/browse_dashboard_files_spec.rb +72 -26
  97. data/spec/features/collection_spec.rb +2 -4
  98. data/spec/features/display_dashboard_spec.rb +20 -26
  99. data/spec/features/search_spec.rb +25 -13
  100. data/spec/helpers/dashboard_helper_spec.rb +41 -0
  101. data/spec/helpers/sufia_helper_spec.rb +104 -3
  102. data/spec/jobs/event_jobs_spec.rb +1 -1
  103. data/spec/models/generic_file/web_form_spec.rb +3 -4
  104. data/spec/models/generic_file_spec.rb +47 -43
  105. data/spec/routing/route_spec.rb +10 -14
  106. data/spec/views/batch_edits/check_all_spec.rb +4 -4
  107. data/spec/views/catalog/sort_and_per_pange.html.erb_spec.rb +27 -0
  108. data/spec/views/dashboard/index_spec.rb +105 -0
  109. data/spec/views/{dashboard → my}/facet_limit.html.erb_spec.rb +2 -2
  110. data/sufia-models/app/actors/sufia/generic_file/actor.rb +23 -3
  111. data/sufia-models/app/models/concerns/sufia/generic_file.rb +0 -5
  112. data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +9 -2
  113. data/sufia-models/app/models/concerns/sufia/generic_file/web_form.rb +2 -2
  114. data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +1 -1
  115. data/sufia-models/app/services/sufia/noid.rb +21 -16
  116. data/sufia-models/lib/generators/sufia/models/install_generator.rb +2 -16
  117. data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +23 -0
  118. data/sufia-models/lib/sufia/models/version.rb +1 -1
  119. data/sufia-models/sufia-models.gemspec +1 -1
  120. data/vendor/assets/javascripts/fileupload/jquery.fileupload-ui.js +18 -10
  121. metadata +68 -45
  122. data/app/assets/images/glyphicons-halflings-white.png +0 -0
  123. data/app/assets/images/glyphicons-halflings.png +0 -0
  124. data/app/controllers/dashboard/lists_controller.rb +0 -13
  125. data/app/views/dashboard/_constraints.html.erb +0 -6
  126. data/app/views/dashboard/_document_list.html.erb +0 -4
  127. data/app/views/dashboard/_heading.html.erb +0 -1
  128. data/app/views/dashboard/_search_form.html.erb +0 -14
  129. data/app/views/dashboard/_show_partials/_default.html.erb +0 -20
  130. data/app/views/dashboard/_show_partials/_default_details.html.erb +0 -15
  131. data/app/views/dashboard/_show_partials/_facets.html.erb +0 -87
  132. data/app/views/generic_files/_field_display.html.erb +0 -12
  133. data/spec/controllers/dashboard/files_controller_spec.rb +0 -71
@@ -1,5 +1,6 @@
1
- module Dashboard
2
- class CollectionsController < ListsController
1
+ module My
2
+ class CollectionsController < MyController
3
+
3
4
  self.solr_search_params_logic += [
4
5
  :show_only_collections
5
6
  ]
@@ -1,5 +1,6 @@
1
- module Dashboard
2
- class FilesController < ListsController
1
+ module My
2
+ class FilesController < MyController
3
+
3
4
  self.solr_search_params_logic += [
4
5
  :show_only_files_deposited_by_current_user,
5
6
  :show_only_generic_files
@@ -1,5 +1,6 @@
1
- module Dashboard
2
- class HighlightsController < ListsController
1
+ module My
2
+ class HighlightsController < MyController
3
+
3
4
  self.solr_search_params_logic += [
4
5
  :show_only_highlighted_files
5
6
  ]
@@ -1,5 +1,6 @@
1
- module Dashboard
2
- class SharesController < ListsController
1
+ module My
2
+ class SharesController < MyController
3
+
3
4
  self.solr_search_params_logic += [
4
5
  :show_only_shared_files,
5
6
  ]
@@ -0,0 +1,3 @@
1
+ class MyController < ApplicationController
2
+ include Sufia::MyControllerBehavior
3
+ end
@@ -1,8 +1,6 @@
1
1
  require 'sufia/single_use_error'
2
2
 
3
3
  class SingleUseLinksController < ApplicationController
4
- include Sufia::Noid
5
-
6
4
  prepend_before_filter :normalize_identifier
7
5
  before_filter :load_asset
8
6
  before_filter :authenticate_user!
@@ -0,0 +1,3 @@
1
+ module DashboardHelper
2
+ include Sufia::DashboardHelperBehavior
3
+ end
@@ -8,6 +8,10 @@ module GenericFileHelper
8
8
  [:title, :creator, :tag, :rights].include?(key)
9
9
  end
10
10
 
11
+ def render_show_field_partial(key, locals)
12
+ render_show_field_partial_with_action('generic_files', key, locals)
13
+ end
14
+
11
15
  def render_edit_field_partial(key, locals)
12
16
  render_edit_field_partial_with_action('generic_files', key, locals)
13
17
  end
@@ -16,10 +20,6 @@ module GenericFileHelper
16
20
  render_edit_field_partial_with_action('batch_edit', key, locals)
17
21
  end
18
22
 
19
- def render_show_field_partial(key, locals)
20
- render_show_field_partial_with_action('generic_files', key, locals)
21
- end
22
-
23
23
  def render_download_icon title = nil
24
24
  if title.nil?
25
25
  link_to download_image_tag, sufia.download_path(@generic_file.id), { target: "_blank", title: "Download the document", id: "file_download", data: { label: @generic_file.id } }
@@ -0,0 +1,25 @@
1
+ module Sufia
2
+ module DashboardHelperBehavior
3
+
4
+ def render_recent_activity
5
+ if @activity.empty?
6
+ "User has no recent activity"
7
+ else
8
+ render partial: 'users/activity_log', locals: {events: @activity}
9
+ end
10
+ end
11
+
12
+ def render_recent_notifications
13
+ if @notifications.empty?
14
+ "User has no notifications"
15
+ else
16
+ render partial: "mailbox/notifications", locals: { messages: @notifications }
17
+ end
18
+ end
19
+
20
+ def on_the_dashboard?
21
+ params[:controller].match(/^dashboard|my/)
22
+ end
23
+
24
+ end
25
+ end
@@ -94,6 +94,11 @@ module Sufia
94
94
  end
95
95
  end
96
96
 
97
+ def link_to_telephone(user = nil)
98
+ @user ||= user
99
+ link_to @user.telephone, "wtai://wp/mc;#{@user.telephone}" if @user.telephone
100
+ end
101
+
97
102
  # Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
98
103
  # We should be able to do away with this method in Blacklight 5
99
104
  # @example
@@ -105,5 +110,44 @@ module Sufia
105
110
  opts[:label] ||= t('blacklight.back_to_search')
106
111
  link_to opts[:label], link_url
107
112
  end
113
+
114
+ # Only display the current search parameters if the user is not in the dashboard.
115
+ # If they are in the dashboard, then the search defaults to the user's files and not
116
+ # all of Sufia.
117
+ def current_search_parameters
118
+ if on_the_dashboard?
119
+ return nil
120
+ else
121
+ return params[:q]
122
+ end
123
+ end
124
+
125
+ # Depending on which page we're landed on, we'll need to set the appropriate action url for
126
+ # our search form.
127
+ def search_form_action
128
+ if on_the_dashboard?
129
+ search_action_for_dashboard
130
+ else
131
+ catalog_index_path
132
+ end
133
+ end
134
+
135
+ private
136
+
137
+ def search_action_for_dashboard
138
+ case params[:controller]
139
+ when "my/files"
140
+ sufia.dashboard_files_path
141
+ when "my/collections"
142
+ sufia.dashboard_collections_path
143
+ when "my/shares"
144
+ sufia.dashboard_shares_path
145
+ when "my/highlights"
146
+ sufia.dashboard_highlights_path
147
+ else
148
+ sufia.dashboard_files_path
149
+ end
150
+ end
151
+
108
152
  end
109
153
  end
@@ -1,8 +1,8 @@
1
1
  class ContentDeleteEventJob < EventJob
2
2
 
3
-
4
3
  def run
5
- action = "User #{link_to_profile depositor_id} has deleted file '#{generic_file_id}'"
4
+ noid = Sufia::Noid.noidify(generic_file_id)
5
+ action = "User #{link_to_profile depositor_id} has deleted file '#{noid}'"
6
6
  timestamp = Time.now.to_i
7
7
  depositor = User.find_by_user_key(depositor_id)
8
8
  # Create the event
@@ -1,6 +1,11 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Sufia
3
3
  module SolrDocumentBehavior
4
+ # Add a schema.org itemtype
5
+ def itemtype
6
+ Sufia.config.resource_types_to_schema[resource_type.first] || 'http://schema.org/CreativeWork'
7
+ end
8
+
4
9
  def title_or_label
5
10
  title || label
6
11
  end
@@ -1,15 +1,15 @@
1
1
  <% if user_signed_in? %>
2
2
  <div class="btn-group" id="user_utility_links">
3
3
  <%= render partial: 'users/notify_link' %>
4
- <a href="<%= sufia.profile_path(current_user) %>" class="btn btn-default " id="profile_link" title="click for User Profile"><i class="glyphicon glyphicon-user">&nbsp;</i><%= current_user.name %>
4
+ <a href="<%= sufia.profile_path(current_user) %>" class="btn btn-default " id="profile_link" title="click for User Profile"><span class="glyphicon glyphicon-user">&nbsp;</span><%= current_user.name %>
5
5
  </a>
6
6
  <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret" title="click for additional menu options"></span></a>
7
7
  <ul class="dropdown-menu dropdown-menu-right" role="menu">
8
- <li><%= link_to raw('<i class="glyphicon glyphicon-dashboard"></i> my dashboard'), sufia.dashboard_index_path, id: 'dashboard_nav_link' %></li>
9
- <li><%= link_to raw('<i class="glyphicon glyphicon-upload"></i> upload'), sufia.new_generic_file_path, id: 'upload_nav_link' %></li>
10
- <li><%= link_to raw('<i class="glyphicon glyphicon-cog"></i> edit profile'), sufia.edit_profile_path(current_user), id: 'upload_nav_link' %></li>
8
+ <li><%= link_to raw('<span class="glyphicon glyphicon-dashboard"></span> my dashboard'), sufia.dashboard_index_path, id: 'dashboard_nav_link' %></li>
9
+ <li><%= link_to raw('<span class="glyphicon glyphicon-upload"></span> upload'), sufia.new_generic_file_path, id: 'upload_nav_link' %></li>
10
+ <li><%= link_to raw('<span class="glyphicon glyphicon-cog"></span> edit profile'), sufia.edit_profile_path(current_user), id: 'upload_nav_link' %></li>
11
11
  <li class="divider"></li>
12
- <li><%= link_to raw('<i class="glyphicon glyphicon-signout"></i> log out'), destroy_user_session_path, id: 'logout_nav_link' %></li>
12
+ <li><%= link_to raw('<span class="glyphicon glyphicon-signout"></span> log out'), destroy_user_session_path, id: 'logout_nav_link' %></li>
13
13
  </ul>
14
14
  </div><!-- /.btn-group -->
15
15
  <% else %>
@@ -1,6 +1,6 @@
1
1
  <% if @response.total_pages > 1 %>
2
2
  <div class="pager">
3
- <%= paginate @response, outer_window: 2, theme: 'blacklight', route_set: sufia %>
3
+ <%= paginate @response, outer_window: 2, theme: 'blacklight' %>
4
4
  <div class="clearfix"></div>
5
5
  </div><!-- /pager -->
6
6
  <% end %>
@@ -1,31 +1,59 @@
1
- <%# only display the q parameter if the controller is not the dashboard. If they are in the dashboard controller, then the search is of the dashboard. %>
2
- <%= form_tag catalog_index_path, method: :get, id: "search-form-header", class: "col-xs-12", role: "search" do %>
3
- <%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8, :owner)) %>
4
- <%= hidden_field_tag 'owner', params[:owner] %>
1
+ <%= form_tag search_form_action, method: :get, id: "search-form-header", role: "search" do %>
2
+ <%= render_hash_as_hidden_fields(params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
3
+ <div class="container-fluid">
4
+ <div class="row">
5
5
 
6
- <div class="row">
7
- <div class="col-lg-10">
8
- <div class="input-group">
9
- <% q = params[:controller].match(/^dashboard/) ? nil : params[:q] %>
10
- <%= text_field_tag :q, q, class: "q form-control", id: "search-field-header", placeholder: t('sufia.search.form.q.placeholder') %>
11
- <%# if this label goes before the search field, it'll mess up the rounded corners %>
12
- <label class="sr-only" for="search-field-header"><%= t('sufia.search.form.q.label') %></label>
6
+ <div class="col-xs-10">
7
+ <div class="input-group">
8
+ <%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header",
9
+ placeholder: t("sufia.search.form.q.placeholder") %>
13
10
 
14
- <div class="input-group-btn">
15
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span data-search-element="label"><%= t('sufia.search.form.option.all.label_long') %></span> <span class="caret"></span></button>
16
- <ul class="dropdown-menu pull-right">
17
- <li><a href="#" data-search-option="all" data-search-label="<%= t('sufia.search.form.option.all.label_short') %>"><%= t('sufia.search.form.option.all.label_long') %></a></li>
18
- <li><a href="#" data-search-option="mine" data-search-label="<%= t('sufia.search.form.option.mine.label_short') %>"><%= t('sufia.search.form.option.mine.label_long') %></a></li>
19
- </ul>
20
- </div>
21
- </div>
22
- </div>
23
- <div class="col-lg-2">
24
- <button type="submit" class="btn btn-primary" id="search-submit-header">
25
- <i class="glyphicon glyphicon-search"></i> Go
26
- </button>
27
- </div>
28
- </div>
29
- <% end %>
11
+ <%# if this label goes before the search field, it"ll mess up the rounded corners %>
12
+ <label class="sr-only" for="search-field-header"><%= t("sufia.search.form.q.label") %></label>
30
13
 
31
-
14
+ <div class="input-group-btn">
15
+ <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
16
+ <span data-search-element="label"><%= t("sufia.search.form.option.all.label_long") %></span>
17
+ <span class="caret"></span>
18
+ </button>
19
+
20
+ <ul class="dropdown-menu pull-right">
21
+ <li>
22
+ <%= link_to t("sufia.search.form.option.all.label_long"), "#",
23
+ data: { "search-option" => catalog_index_path, "search-label" => t("sufia.search.form.option.all.label_short") } %>
24
+ </li>
25
+
26
+ <% if current_user %>
27
+ <li>
28
+ <%= link_to t("sufia.search.form.option.my_files.label_long"), "#",
29
+ data: { "search-option" => sufia.dashboard_files_path, "search-label" => t("sufia.search.form.option.my_files.label_short") } %>
30
+ </li>
31
+ <li>
32
+ <%= link_to t("sufia.search.form.option.my_collections.label_long"), "#",
33
+ data: { "search-option" => sufia.dashboard_collections_path, "search-label" => t("sufia.search.form.option.my_collections.label_short") } %>
34
+ </li>
35
+ <li>
36
+ <%= link_to t("sufia.search.form.option.my_highlights.label_long"), "#",
37
+ data: { "search-option" => sufia.dashboard_highlights_path, "search-label" => t("sufia.search.form.option.my_highlights.label_short") } %>
38
+ </li>
39
+ <li>
40
+ <%= link_to t("sufia.search.form.option.my_shares.label_long"), "#",
41
+ data: { "search-option" => sufia.dashboard_shares_path, "search-label" => t("sufia.search.form.option.my_shares.label_short") } %>
42
+ </li>
43
+ <% end %>
44
+
45
+ </ul>
46
+ </div><!-- /.input-group-btn -->
47
+
48
+ </div><!-- /.input-group -->
49
+ </div><!-- /text field dropdown -->
50
+
51
+ <div class="col-xs-2">
52
+ <button type="submit" class="btn btn-primary" id="search-submit-header">
53
+ <span class="glyphicon glyphicon-search"></span> Go
54
+ </button>
55
+ </div><!-- /.go -->
56
+
57
+ </div><!-- /.row -->
58
+ </div><!-- /.container-fluid -->
59
+ <% end %>
@@ -3,4 +3,4 @@
3
3
  <% @all_checked = false %>
4
4
  <% @max_batch_size = 100 %>
5
5
  <% @user = current_user %>
6
- <%= render partial:'dashboard/_index_partials/default_group', locals:{documents: documents, docs:documents} %>
6
+ <%= render partial: "my/_index_partials/default_group", locals: { docs: documents } %>
@@ -4,7 +4,7 @@
4
4
  <% @max_batch_size = 100 %>
5
5
  <% @user = current_user %>
6
6
  <% if params[:action] == "edit" %>
7
- <%= render partial:'dashboard/_index_partials/default_group', locals:{documents: documents, docs:documents} %>
7
+ <%= render partial:'my/_index_partials/default_group', locals:{documents: documents, docs:documents} %>
8
8
  <% else %>
9
9
  <%= render partial:'catalog/_index_partials/default_group', locals:{documents: documents, docs:documents} %>
10
10
  <% end %>
@@ -1,6 +1,7 @@
1
1
  <% @page_title = "Edit Collection #{display_title(@collection)} - #{application_name}" %>
2
2
  <%= render partial: 'generic_files/breadcrumbs', locals: {
3
- include_file: false, generic_file: GenericFile.new(title: @collection.title) } %>
3
+ include_file: false, generic_file: GenericFile.new(title: @collection.title)
4
+ } %>
4
5
 
5
6
  <h1>Edit Collection: <%= display_title(@collection) %></h1>
6
7
 
@@ -15,16 +16,12 @@
15
16
  </div><!-- /columns second -->
16
17
  </div> <!-- /columns two-b -->
17
18
  <% end %>
18
-
19
19
 
20
- <h2>Manage Items in this Collection</h2>
21
- <%= render partial: 'search_collection_dashboard_form'%>
22
- <%= render partial: 'dashboard/did_you_mean' %>
23
- <%= render partial: 'dashboard/facet_selected' %>
24
-
25
- <%= render 'dashboard/constraints', localized_params: params %>
26
-
27
- <%= render 'collections/sort_and_per_page' %>
28
- <%= render partial:'document_list', locals: { documents: @member_docs, document_list_format: "dashboard" } %>
20
+ <h2>Manage Items in this Collection</h2>
21
+ <%= render partial: 'search_collection_dashboard_form'%>
22
+ <%= render partial: 'my/did_you_mean' %>
23
+ <%= render partial: 'my/facet_selected' %>
24
+ <%= render 'collections/sort_and_per_page' %>
25
+ <%= render partial:'document_list', locals: { documents: @member_docs, document_list_format: "dashboard" } %>
29
26
 
30
27
  <%= render partial:'paginate' %>
@@ -8,13 +8,13 @@
8
8
  <h3><%=@collection.description%> </h3>
9
9
 
10
10
  <% unless has_collection_search_parameters? %>
11
- <div class="row">
11
+ <div itemscope itemtype="http://schema.org/CollectionPage" class="row">
12
12
  <div class="col-xs-12 col-sm-4">
13
13
  <%= render partial: 'collections/media_display', locals: { generic_file: @collection } %>
14
14
  </div>
15
15
  <div class="col-xs-12 col-sm-8"><!-- class="column second"> -->
16
16
  <%= render partial: 'collections/show_actions' %>
17
- <%= render partial: 'generic_files/show_descriptions', locals: { generic_file: @collection } %>
17
+ <%= render partial: 'collections/show_descriptions', locals: { generic_file: @collection } %>
18
18
  </div><!-- /columns second -->
19
19
  </div> <!-- /columns two-b -->
20
20
  <% end %>
@@ -0,0 +1,11 @@
1
+ <tr>
2
+ <th>Creator</th>
3
+ <td>
4
+ <% @collection.creator.each do |creator| %>
5
+ <span itemprop="creator" itemscope itemtype="http://schema.org/Thing">
6
+ <span itemprop="name"><%= link_to_facet(creator, Solrizer.solr_name("properties__creator", :facetable)) %></span>
7
+ </span>
8
+ <br />
9
+ <% end %>
10
+ </td>
11
+ </tr>
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <th>Abstract or Summary</th>
3
+ <td>
4
+ <span itemprop="description">
5
+ <%= iconify_auto_link(@collection.description) %>
6
+ </span>
7
+ </td>
8
+ </tr>
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <th>Title</th>
3
+ <td>
4
+ <span itemprop="name">
5
+ <%= @collection.title %>
6
+ </span>
7
+ </td>
8
+ </tr>
@@ -0,0 +1,16 @@
1
+ <h3><%= t("sufia.dashboard.stats.heading") %></h3>
2
+
3
+ <table class="table table-condensed">
4
+ <tr>
5
+ <td><span class="label label-default"><%= number_of_deposits(@user) %></span></td>
6
+ <td><%= t("sufia.dashboard.stats.deposits") %></td>
7
+ </tr>
8
+ <tr>
9
+ <td><span class="label label-default"><%= @user.all_following.count %></span></td>
10
+ <td><%= t("sufia.dashboard.stats.following") %></td>
11
+ </tr>
12
+ <tr>
13
+ <td><span class="label label-default"><%= @user.followers.count %></span></td>
14
+ <td><%= t("sufia.dashboard.stats.followers") %></td>
15
+ </tr>
16
+ </table>
@@ -0,0 +1,18 @@
1
+ <div class="row">
2
+ <div class="col-xs-12">
3
+ <h3><%= @user.name %></h3>
4
+ <h5><%= @user.title %></h5>
5
+ <h5><%= @user.department %></h5>
6
+ <h6><%= link_to_telephone %></h6>
7
+ <h6><%= @user.email %></h6>
8
+ </div>
9
+ </div>
10
+
11
+ <div class="row">
12
+ <div class="col-xs-6">
13
+ <%= link_to t("sufia.view_profile"), sufia.profile_path(@user), class: "btn btn-info" %>
14
+ </div>
15
+ <div class="col-xs-6">
16
+ <%= link_to t("sufia.edit_profile"), sufia.edit_profile_path(@user), class: "btn btn-info" %>
17
+ </div>
18
+ </div>
@@ -1,21 +1,53 @@
1
- <% content_for :head do %>
2
- <%= auto_discovery_link_tag(:rss, sufia.url_for(params.merge(format: 'rss')), title: "RSS for results") %>
3
- <%= auto_discovery_link_tag(:atom, sufia.url_for(params.merge(format: 'atom')), title: "Atom for results") %>
1
+ <%= content_for :heading do %>
2
+
3
+ <div class="col-xs-12 heading-row">
4
+ <div class="col-xs-3 heading-tile">
5
+ <h1><%= t("sufia.dashboard.title") %></h1>
6
+ </div>
7
+ <div class="col-xs-9 heading-tile">
8
+ <h1><%= t("sufia.dashboard.greeting") + current_user.name %></h1>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="col-xs-12 heading-row">
13
+ <div class="col-xs-4 heading-tile">
14
+ <span class="glyphicon glyphicon-open"></span>
15
+ <%= link_to t("sufia.dashboard.upload"), sufia.new_generic_file_path %>
16
+ </div>
17
+ <div class="col-xs-4 heading-tile">
18
+ <span class="glyphicon glyphicon-folder-open"></span>
19
+ <%= link_to t("sufia.dashboard.create_collection"), collections.new_collection_path %>
20
+ </div>
21
+ <div class="col-xs-4 heading-tile">
22
+ <span class="glyphicon glyphicon-eye-open"></span>
23
+ <%= link_to t("sufia.dashboard.view_files"), sufia.dashboard_files_path %>
24
+ </div>
25
+ </div>
26
+
27
+ <% end %>
28
+
29
+ <%= content_for :sidebar do %>
30
+
31
+ <div class="row">
32
+ <div class="portal"><%= render partial: "dashboard/_index_partials/user_info" %></div>
33
+ </div>
34
+
35
+ <div class="row">
36
+ <div class="portal"><%= render partial: "dashboard/_index_partials/stats" %></div>
37
+ </div>
38
+
4
39
  <% end %>
5
40
 
6
- <ul class="nav nav-tabs">
7
- <li class="<%= "active" if @selected_tab == :files %>">
8
- <%= link_to "Files", sufia.dashboard_files_path %>
9
- </li>
10
- <li class="<%= "active" if @selected_tab == :collections %>">
11
- <%= link_to "Collections", sufia.dashboard_collections_path %>
12
- </li>
13
- <li class="<%= "active" if @selected_tab == :highlighted %>">
14
- <%= link_to "Highlighted", sufia.dashboard_highlights_path %>
15
- </li>
16
- <li class="<%= "active" if @selected_tab == :shared %>">
17
- <%= link_to "Shared with Me", sufia.dashboard_shares_path %>
18
- </li>
19
- </ul>
20
-
21
- Totally awesome new dashboard goes here!<br/>
41
+ <div class="row">
42
+ <div class="portal">
43
+ <h3><%= t("sufia.dashboard.user_activity") %></h3>
44
+ <%= render_recent_activity %>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="row">
49
+ <div class="portal">
50
+ <h3><%= t("sufia.dashboard.user_notifications") %></h3>
51
+ <%= render_recent_notifications %>
52
+ </div>
53
+ </div>