sufia 4.0.0.beta4 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/Gemfile +1 -1
  4. data/History.md +325 -0
  5. data/RELEASING.md +1 -0
  6. data/SUFIA_VERSION +1 -1
  7. data/app/assets/javascripts/sufia.js +2 -2
  8. data/app/assets/javascripts/sufia/batch_edit.js +2 -2
  9. data/app/assets/javascripts/sufia/batch_select_all.js +7 -7
  10. data/app/assets/stylesheets/{dashboard.css.scss → file-listing.css.scss} +7 -1
  11. data/app/assets/stylesheets/styles.css.scss +23 -0
  12. data/app/assets/stylesheets/sufia.css.scss +5 -1
  13. data/app/controllers/concerns/sufia/catalog.rb +4 -4
  14. data/app/controllers/concerns/sufia/controller.rb +0 -4
  15. data/app/controllers/concerns/sufia/my_controller_behavior.rb +1 -5
  16. data/app/controllers/my/collections_controller.rb +7 -0
  17. data/app/controllers/my/files_controller.rb +7 -0
  18. data/app/controllers/my/highlights_controller.rb +7 -0
  19. data/app/controllers/my/shares_controller.rb +7 -0
  20. data/app/helpers/sufia/records_helper_behavior.rb +1 -1
  21. data/app/helpers/sufia/sufia_helper_behavior.rb +2 -2
  22. data/app/models/concerns/sufia/solr_document_behavior.rb +10 -0
  23. data/app/views/_user_util_links.html.erb +1 -1
  24. data/app/views/advanced/index.html.erb +10 -13
  25. data/app/views/batch/_edit.js.erb +15 -0
  26. data/app/views/batch/_metadata.html.erb +1 -1
  27. data/app/views/batch/edit.html.erb +10 -25
  28. data/app/views/batch_edits/_batch_edits_actions.html.erb +1 -1
  29. data/app/views/batch_edits/_check_all.html.erb +1 -1
  30. data/app/views/batch_edits/edit.html.erb +3 -3
  31. data/app/views/catalog/_document_list.html.erb +6 -1
  32. data/app/views/catalog/index.html.erb +34 -21
  33. data/app/views/collections/_action_menu.html.erb +5 -5
  34. data/app/views/collections/_batch_edits_actions.html.erb +1 -1
  35. data/app/views/collections/_collection.html.erb +36 -0
  36. data/app/views/collections/_document_list.html.erb +2 -2
  37. data/app/views/collections/_edit_descriptions.html.erb +1 -1
  38. data/app/views/collections/_form.html.erb +11 -8
  39. data/app/views/collections/_search_collection_dashboard_form.html.erb +1 -1
  40. data/app/views/collections/_sort_and_per_page.html.erb +1 -1
  41. data/app/views/dashboard/index.html.erb +1 -1
  42. data/app/views/generic_files/_descriptions.html.erb +1 -1
  43. data/app/views/generic_files/_edit.js.erb +22 -0
  44. data/app/views/generic_files/_extra_fields_modal.html.erb +18 -14
  45. data/app/views/generic_files/_generic_file.html.erb +36 -0
  46. data/app/views/generic_files/_media_display.html.erb +4 -0
  47. data/app/views/generic_files/_permission.html.erb +1 -1
  48. data/app/views/generic_files/_permission_form.html.erb +40 -36
  49. data/app/views/generic_files/_rights_modal.html.erb +37 -33
  50. data/app/views/generic_files/edit.html.erb +13 -30
  51. data/app/views/generic_files/new.html.erb +3 -3
  52. data/app/views/generic_files/show.html.erb +3 -7
  53. data/app/views/generic_files/stats.html.erb +1 -1
  54. data/app/views/generic_files/upload/_form_fields.html.erb +4 -4
  55. data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +2 -2
  56. data/app/views/generic_files/upload/_script_templates.html.erb +2 -2
  57. data/app/views/homepage/_home_content.html.erb +2 -2
  58. data/app/views/homepage/_home_header.html.erb +1 -1
  59. data/app/views/homepage/_sortable_featured.html.erb +1 -1
  60. data/app/views/layouts/_head_tag_content.html.erb +1 -10
  61. data/app/views/layouts/error.html.erb +0 -9
  62. data/app/views/layouts/homepage.html.erb +1 -1
  63. data/app/views/layouts/sufia-dashboard.html.erb +6 -6
  64. data/app/views/layouts/sufia-one-column.html.erb +2 -2
  65. data/app/views/layouts/sufia-two-column.html.erb +2 -2
  66. data/app/views/mailbox/_notifications.html.erb +1 -1
  67. data/app/views/mailbox/index.html.erb +1 -1
  68. data/app/views/my/_batch_edits_actions.html.erb +1 -1
  69. data/app/views/my/_collection_action_menu.html.erb +4 -4
  70. data/app/views/my/_did_you_mean.html.erb +2 -7
  71. data/app/views/my/_document_list.html.erb +1 -1
  72. data/app/views/my/_facet_layout.html.erb +10 -9
  73. data/app/views/my/_facet_limit.html.erb +9 -9
  74. data/app/views/my/_facet_pagination.html.erb +14 -17
  75. data/app/views/my/_facet_selected.html.erb +1 -1
  76. data/app/views/my/_facets.html.erb +20 -7
  77. data/app/views/my/_index_partials/_default_group.html.erb +4 -4
  78. data/app/views/my/_index_partials/_list_collections.html.erb +1 -1
  79. data/app/views/my/_index_partials/_list_files.html.erb +2 -2
  80. data/app/views/my/_results_pagination.html.erb +7 -4
  81. data/app/views/my/_sort_and_per_page.html.erb +5 -8
  82. data/app/views/my/facet.html.erb +2 -5
  83. data/app/views/my/index.html.erb +1 -1
  84. data/app/views/single_use_links/new_download.html.erb +1 -1
  85. data/app/views/users/_contributions.html.erb +3 -3
  86. data/app/views/users/_profile_tabs.html.erb +3 -3
  87. data/app/views/users/_social_media_info.html.erb +3 -3
  88. data/app/views/users/_trophy_edit.html.erb +2 -2
  89. data/app/views/users/_user_info.html.erb +4 -4
  90. data/app/views/users/edit.html.erb +5 -10
  91. data/app/views/users/show.html.erb +16 -21
  92. data/config/locales/sufia.en.yml +7 -6
  93. data/config/routes.rb +25 -32
  94. data/lib/generators/sufia/sufia_generator.rb +1 -1
  95. data/lib/generators/sufia/upgrade400_generator.rb +87 -0
  96. data/lib/sufia/version.rb +1 -1
  97. data/spec/controllers/catalog_controller_spec.rb +22 -0
  98. data/spec/features/browse_dashboard_files_spec.rb +22 -11
  99. data/spec/features/catalog_search_spec.rb +99 -0
  100. data/spec/features/collection_spec.rb +1 -1
  101. data/spec/helpers/records_helper_spec.rb +1 -1
  102. data/spec/helpers/sufia_helper_spec.rb +4 -3
  103. data/spec/models/generic_file_spec.rb +7 -3
  104. data/spec/models/solr_document_spec.rb +27 -9
  105. data/spec/services/noid_spec.rb +16 -0
  106. data/spec/spec_helper.rb +1 -1
  107. data/spec/views/batch/edit.html.erb_spec.rb +34 -0
  108. data/spec/views/my/facet.html.erb_spec.rb +34 -0
  109. data/sufia-models/app/models/concerns/sufia/generic_file/mime_types.rb +1 -1
  110. data/sufia-models/app/services/sufia/noid.rb +2 -5
  111. data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +78 -0
  112. data/sufia-models/lib/sufia/models/engine.rb +1 -1
  113. data/sufia-models/lib/sufia/models/version.rb +1 -1
  114. data/sufia-models/sufia-models.gemspec +3 -3
  115. data/sufia.gemspec +1 -1
  116. data/tasks/sufia-dev.rake +1 -1
  117. metadata +24 -54
  118. data/.gitmodules +0 -4
  119. data/Releasing_sufia.md +0 -6
  120. data/UpgradeGuide.md +0 -3
  121. data/app/views/catalog/_bookmark_control.html.erb +0 -24
  122. data/app/views/catalog/_citation.html.erb +0 -11
  123. data/app/views/catalog/_constraints.html.erb +0 -6
  124. data/app/views/catalog/_constraints_element.html.erb +0 -20
  125. data/app/views/catalog/_did_you_mean.html.erb +0 -10
  126. data/app/views/catalog/_document.html.erb +0 -19
  127. data/app/views/catalog/_email_form.html.erb +0 -11
  128. data/app/views/catalog/_facet_layout.html.erb +0 -12
  129. data/app/views/catalog/_facet_selected.html.erb +0 -12
  130. data/app/views/catalog/_facets.html.erb +0 -7
  131. data/app/views/catalog/_folder_control.html.erb +0 -11
  132. data/app/views/catalog/_index_default.html.erb +0 -11
  133. data/app/views/catalog/_index_header_default.html.erb +0 -20
  134. data/app/views/catalog/_index_partials/_default_group.html.erb +0 -7
  135. data/app/views/catalog/_index_partials/_list_files.html.erb +0 -37
  136. data/app/views/catalog/_marc_view.html.erb +0 -33
  137. data/app/views/catalog/_opensearch_response_metadata.html.erb +0 -2
  138. data/app/views/catalog/_previous_next_doc.html.erb +0 -6
  139. data/app/views/catalog/_refworks_form.html.erb +0 -7
  140. data/app/views/catalog/_results_pagination.html.erb +0 -6
  141. data/app/views/catalog/_show_default.html.erb +0 -9
  142. data/app/views/catalog/_show_sidebar.html.erb +0 -1
  143. data/app/views/catalog/_show_tools.html.erb +0 -46
  144. data/app/views/catalog/_sms_form.html.erb +0 -21
  145. data/app/views/catalog/_sort_and_per_page.html.erb +0 -9
  146. data/app/views/catalog/about.html.erb +0 -0
  147. data/app/views/catalog/citation.html.erb +0 -1
  148. data/app/views/catalog/email.erb +0 -1
  149. data/app/views/catalog/endnote.endnote.erb +0 -1
  150. data/app/views/catalog/index.atom.builder +0 -109
  151. data/app/views/catalog/index.rss.builder +0 -19
  152. data/app/views/catalog/librarian_view.html.erb +0 -3
  153. data/app/views/catalog/opensearch.json.erb +0 -0
  154. data/app/views/catalog/opensearch.xml.builder +0 -10
  155. data/app/views/catalog/send_email_record.erb +0 -0
  156. data/app/views/catalog/show.endnote.erb +0 -1
  157. data/app/views/catalog/show.html.erb +0 -40
  158. data/app/views/catalog/show.refworks.erb +0 -1
  159. data/app/views/catalog/sms.erb +0 -1
  160. data/app/views/collections/_button_for_creating_empty_collection.html.erb +0 -3
  161. data/spec/views/my/facet_limit.html.erb_spec.rb +0 -15
@@ -8,7 +8,7 @@ on element ids -->
8
8
  <td width="1%">
9
9
  </td>
10
10
  <td width="37%">
11
- <a href="" title="Click for more details"><i id="expand_<%= noid.gsub(":", "_") %>" class="glyphicon-plus icon-large fleft"></i></a>&nbsp;
11
+ <a href="" title="Click for more details"><i id="expand_<%= noid.gsub(":", "_") %>" class="glyphicon-plus large-icon fleft"></i></a>&nbsp;
12
12
  <%= link_to image_tag("/assets/folder.png", width: 36), collections.collection_path(noid) %>
13
13
  <span class=center><%= link_to document.title_or_label, collections.collection_path(noid), id: "src_copy_link#{noid}" %> <br /></span>
14
14
  </td>
@@ -13,9 +13,9 @@
13
13
  <td width="41%">
14
14
  <a href="#" title="Click for more details"><i id="expand_<%= noid %>" class="glyphicon glyphicon-plus"></i></a>&nbsp;
15
15
  <%= link_to sufia.generic_file_path(document) do %>
16
- <%= render_thumbnail_tag document %>
16
+ <%= render_thumbnail_tag document, class:"hidden-xs file_listing_thumbnail" %>
17
17
  <% end %>
18
- <span class=center>
18
+ <span>
19
19
  <%= link_to document.title_or_label, sufia.generic_file_path(noid), id: "src_copy_link#{noid}", class: "#{'document-title' if document.title_or_label == document.label}" %><br/>
20
20
  </span>
21
21
  </td>
@@ -1,6 +1,9 @@
1
1
  <% if @response.total_pages > 1 %>
2
- <div class="pager">
3
- <%= paginate @response, outer_window: 2, theme: 'blacklight', route_set: sufia %>
4
- <div class="clearfix"></div>
5
- </div><!-- /pager -->
2
+ <div class="row record-padding">
3
+ <div class="col-md-9">
4
+ <div class="pagination">
5
+ <%= paginate @response, outer_window: 2, theme: 'blacklight', route_set: sufia %>
6
+ </div>
7
+ </div>
8
+ </div>
6
9
  <% end %>
@@ -7,17 +7,13 @@
7
7
  <% session[:batch_edit_state] = "on" %>
8
8
  <%= batch_edit_continue "Edit Selected" %>
9
9
  <%= batch_delete %>
10
- <%= form_tag sufia.dashboard_index_path do %>
11
- <%= hidden_field_tag :type, nil, value: "Add to Collection" %>
12
- <div>
13
- </div>
14
- <% end %>
15
- <%= button_tag "Add to Collection", class: 'btn btn-primary submits-batches submits-batches-add',
16
- data: { toggle: "modal", target: "#collection-list-container" } %>
10
+ <%= button_tag "Add to Collection", class: 'btn btn-primary submits-batches submits-batches-add',
11
+ data: { toggle: "modal", target: "#collection-list-container" } %>
17
12
  </div>
13
+
18
14
  <div class="sort-toggle">
19
15
  <% unless @response.response['numFound'] < 2 %>
20
- <%= form_tag sufia.dashboard_index_path, method: :get, class: 'per_page form-inline' do %>
16
+ <%= form_tag sufia.dashboard_files_path, method: :get, class: 'per_page form-inline' do %>
21
17
  <%= label_tag(:sort, "<span>Sort By:</span>".html_safe) %>
22
18
  <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort]))) %>
23
19
  &nbsp;&nbsp;&nbsp;
@@ -31,4 +27,5 @@
31
27
  <% end %>
32
28
  <% end unless sort_fields.empty? %>
33
29
  </div>
30
+
34
31
  </div>
@@ -1,6 +1,3 @@
1
- <!-- This was copied from https://github.com/projectblacklight/blacklight/blob/master/app/views/catalog/facet.html.erb
2
- It implements the facets in the same manner as blacklight does for the main catalog for the individual's dashbord
3
- -->
4
1
  <div class="facet_pagination top">
5
2
  <%= render partial: 'facet_pagination' %>
6
3
  </div>
@@ -11,10 +8,10 @@
11
8
  </div>
12
9
  <div class="modal-body">
13
10
  <div class="facet_extended_list">
14
- <%= render_facet_limit(@display_facet, layout: false) %>
11
+ <%= render_facet_limit(@display_facet, layout: false) %>
15
12
  </div>
16
13
  </div>
17
-
14
+
18
15
  <div class="modal-footer">
19
16
 
20
17
  <div class="facet_pagination bottom">
@@ -10,7 +10,7 @@
10
10
  <% @page_title = application_name + " Dashboard" %>
11
11
 
12
12
  <% if params.has_key?("q") %>
13
- <div class="alert alert-info"><i class="glyphicon glyphicon-search icon-large"></i> You searched for:
13
+ <div class="alert alert-info"><i class="glyphicon glyphicon-search large-icon"></i> You searched for:
14
14
  <strong><%= params[:q] %></strong></div>
15
15
  <% end %>
16
16
 
@@ -1,5 +1,5 @@
1
1
  <div class="single-use-link">
2
2
  <h1>Single Use Link</h1>
3
3
  <p>Anyone can use the following link once to download the file</p>
4
- <%= link_to @asset, @link, class: 'download-link' %> <%= link_to raw('<i class="icon-link icon-large"></i>'), '#', class: 'copypaste itemicon itemcode', title: 'Copy File URL', id: "copy_link_#{@asset.pid}" %>
4
+ <%= link_to @asset, @link, class: 'download-link' %> <%= link_to raw('<i class="glyphicon glyphicon-link large-icon"></i>'), '#', class: 'copypaste itemicon itemcode', title: 'Copy File URL', id: "copy_link_#{@asset.pid}" %>
5
5
  </div>
@@ -1,5 +1,5 @@
1
1
  <div class="tab-pane active" id="contributions">
2
- <i class="icon-trophy trophy-on"></i> <strong>Highlighted Files</strong>
2
+ <i class="glyphicon glyphicon-star trophy-on"></i> <strong>Highlighted Files</strong>
3
3
  <% if @trophies.count > 0 %>
4
4
  <table>
5
5
  <% @trophies.each do |t| %>
@@ -12,8 +12,8 @@
12
12
  <td>
13
13
  <%= link_to display_title(t), sufia.generic_file_path(t) %>
14
14
  <% if current_user == @user %>
15
- <%= display_trophy_link current_user, t.noid, class: 'glyphicon glyphicon-trophy', data: {removerow: true} do %>
16
- <i class='trophy-on icon-remove'></i>
15
+ <%= display_trophy_link current_user, t.noid, class: 'glyphicon glyphicon-star', data: {removerow: true} do %>
16
+ <i class='trophy-on glyphicon glyphicon-remove'></i>
17
17
  <% end %>
18
18
  <% end %>
19
19
  </td>
@@ -1,7 +1,7 @@
1
1
  <ul class="nav nav-tabs" id="myTab">
2
- <li class="active"><a href="#contributions"><i class="glyphicon glyphicon-trophy"></i> Contributions</a></li>
3
- <li><a href="#profile"><i class="icon-info-sign"></i> Profile</a></li>
4
- <li><a href="#activity_log" ><i class="icon-rss"></i> Activity</a></li>
2
+ <li class="active"><a href="#contributions"><i class="glyphicon glyphicon-star"></i> Contributions</a></li>
3
+ <li><a href="#profile"><i class="glyphicon glyphicon-info-sign"></i> Profile</a></li>
4
+ <li><a href="#activity_log" ><i class="glyphicon glyphicon-calendar"></i> Activity</a></li>
5
5
  </ul>
6
6
 
7
7
  <div class="tab-content">
@@ -1,10 +1,10 @@
1
1
  <% if !user.facebook_handle.blank?() %>
2
- <dt><i class="glyphicon glyphicon-facebook"></i> Facebook Handle</dt>
2
+ <dt><i class="icon-facebook"></i> Facebook Handle</dt>
3
3
  <dd><%= link_to "http://facebook.com/#{user.facebook_handle}", "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
4
4
  <% end %>
5
5
 
6
6
  <% if !user.twitter_handle.blank?() %>
7
- <dt><i class="glyphicon glyphicon-twitter"></i> Twitter Handle</dt>
7
+ <dt><i class="icon-twitter"></i> Twitter Handle</dt>
8
8
  <dd><%= link_to "http://twitter.com/#{user.twitter_handle}", "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
9
9
  <% end %>
10
10
 
@@ -15,6 +15,6 @@
15
15
  -->
16
16
 
17
17
  <% if !user.linkedin_handle.blank?() %>
18
- <dt><i class="glyphicon glyphicon-linkedin"></i> Linked In</dt>
18
+ <dt><i class="icon-linkedin"></i> Linked In</dt>
19
19
  <dd><%= link_to "#{@linkedInUrl}", "#{@linkedInUrl}", {target:'_blank'} %></dd>
20
20
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div class="control-label">
2
- <i class="icon-trophy trophy-on" ></i> Remove Highlight Designation
3
- <a href="#" id="remove_trophy_help" rel="popover" data-content="If you would like to remove a highlight designation, check the box and save your profile." data-original-title="Remove Highlight Designation"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
2
+ <i class="glyphicon glyphicon-star trophy-on" ></i> Remove Highlight Designation
3
+ <a href="#" id="remove_trophy_help" rel="popover" data-content="If you would like to remove a highlight designation, check the box and save your profile." data-original-title="Remove Highlight Designation"><i class="glyphicon glyphicon-question-sign"></i></a>
4
4
  </div>
5
5
  <div class="control-group">
6
6
  <dl>
@@ -1,11 +1,11 @@
1
1
  <dl id="user_info" class="row">
2
- <dt class="col-xs-5"><i class="glyphicon glyphicon-facebook"></i> Facebook Handle</dt>
2
+ <dt class="col-xs-5"><i class="icon-facebook"></i> Facebook Handle</dt>
3
3
  <dd class="col-xs-7"><%= link_to user.facebook_handle, "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
4
4
 
5
- <dt class="col-xs-5"><i class="glyphicon glyphicon-twitter"></i> Twitter Handle</dt>
5
+ <dt class="col-xs-5"><i class="icon-twitter"></i> Twitter Handle</dt>
6
6
  <dd class="col-xs-7"><%= link_to user.twitter_handle, "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
7
7
 
8
- <dt class="col-xs-5"><i class="glyphicon glyphicon-google-plus"></i> Google+ Handle</dt>
8
+ <dt class="col-xs-5"><i class="icon-google-plus"></i> Google+ Handle</dt>
9
9
  <dd class="col-xs-7"><%= link_to user.googleplus_handle, "http://google.com/+#{user.googleplus_handle}", {target:'_blank'} %></dd>
10
10
 
11
11
  <dt class="col-xs-5"><i class="glyphicon glyphicon-envelope-alt"></i> Email</dt>
@@ -52,7 +52,7 @@
52
52
  <% end %>
53
53
 
54
54
  <% if user.telephone %>
55
- <dt class="col-xs-5"><i class="glyphicon glyphicon-phone"></i> Telephone</dt>
55
+ <dt class="col-xs-5"><i class="glyphicon glyphicon-earphone"></i> Telephone</dt>
56
56
  <dd class="col-xs-7"><%= link_to_telephone(user) %></dd>
57
57
  <% end %>
58
58
 
@@ -1,8 +1,3 @@
1
- <% content_for :local_js do %>
2
- // initialize popover helpers
3
- $("a[rel=popover]").popover({ html: true });
4
- <% end %>
5
-
6
1
  <h1>Edit Profile</h1>
7
2
  <div class="col-xs-12 col-sm-5 well">
8
3
  <%= form_for @user, url: sufia.profile_path(@user.to_param), html: {multipart: true, class: 'form-horizontal' } do |f| %>
@@ -21,7 +16,7 @@ $("a[rel=popover]").popover({ html: true });
21
16
  <div class="col-xs-8">
22
17
  <label class="checkbox">
23
18
  <%= f.check_box :remove_avatar %> Yes
24
- <a href="#" id="delete_picture_help" rel="popover" data-content="If you would like to remove your picture entirely, check the box and save your profile." data-original-title="Delete Picture"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
19
+ <a href="#" id="delete_picture_help" rel="popover" data-content="If you would like to remove your picture entirely, check the box and save your profile." data-original-title="Delete Picture"><i class="glyphicon glyphicon-question-sign"></i></a>
25
20
  </label>
26
21
  </div><!-- .controls -->
27
22
  </div><!-- .form-group -->
@@ -31,27 +26,27 @@ $("a[rel=popover]").popover({ html: true });
31
26
  <div class="col-xs-8">
32
27
  <label class="checkbox">
33
28
  <%= check_box_tag 'update_directory' %> Yes
34
- <a href="#" id="refresh_directory_help" rel="popover" data-content="The information displayed in your profile comes from <%=t('sufia.institution_name') %>'s central directory (LDAP) and is cached by <%=t('sufia.product_name') %>. If you have updated that information and don't see those changes in your <%=t('sufia.product_name') %> profile, check the box and save your profile." data-original-title="Refresh Directory Info"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
29
+ <a href="#" id="refresh_directory_help" rel="popover" data-content="The information displayed in your profile comes from <%=t('sufia.institution_name') %>'s central directory (LDAP) and is cached by <%=t('sufia.product_name') %>. If you have updated that information and don't see those changes in your <%=t('sufia.product_name') %> profile, check the box and save your profile." data-original-title="Refresh Directory Info"><i class="glyphicon glyphicon-question-sign"></i></a>
35
30
  </label>
36
31
  </div><!-- .controls -->
37
32
  </div><!-- .form-group -->
38
33
 
39
34
  <div class="form-group">
40
- <%= f.label :twitter_handle, '<i class="glyphicon glyphicon-twitter"></i> Twitter Handle'.html_safe, class: 'col-xs-4 control-label' %>
35
+ <%= f.label :twitter_handle, '<i class="icon-twitter"></i> Twitter Handle'.html_safe, class: 'col-xs-4 control-label' %>
41
36
  <div class="col-xs-8">
42
37
  <%= f.text_field :twitter_handle, class: "input-medium" %>
43
38
  </div><!-- .controls -->
44
39
  </div><!-- .form-group -->
45
40
 
46
41
  <div class="form-group">
47
- <%= f.label :facebook_handle, '<i class="glyphicon glyphicon-facebook"></i> Facebook Handle'.html_safe, class: 'col-xs-4 control-label' %>
42
+ <%= f.label :facebook_handle, '<i class="icon-facebook"></i> Facebook Handle'.html_safe, class: 'col-xs-4 control-label' %>
48
43
  <div class="col-xs-8">
49
44
  <%= f.text_field :facebook_handle, class: "input-medium" %>
50
45
  </div><!-- .controls -->
51
46
  </div><!-- .form-group -->
52
47
 
53
48
  <div class="form-group">
54
- <%= f.label :googleplus_handle, '<i class="glyphicon glyphicon-google-plus"></i> Google+ Handle'.html_safe, class: 'col-xs-4 control-label' %>
49
+ <%= f.label :googleplus_handle, '<i class="icon-google-plus"></i> Google+ Handle'.html_safe, class: 'col-xs-4 control-label' %>
55
50
  <div class="col-xs-8">
56
51
  <%= f.text_field :googleplus_handle, class: "input-medium" %>
57
52
  </div><!-- .controls -->
@@ -1,24 +1,19 @@
1
- <% content_for :local_js do %>
2
-
3
- $('#myTab a').click(function (e) {
4
- e.preventDefault();
5
- $(this).tab('show');
6
- })
7
-
1
+ <%= javascript_tag do %>
2
+ $('#myTab a').click(function (e) {
3
+ e.preventDefault();
4
+ $(this).tab('show');
5
+ })
8
6
  <% end %>
9
- <div class="col-xs-12">
10
- <div class="pull-right">
11
- <%= render 'profile_actions' %>
12
- </div>
13
- <span class="col-xs-3">
14
- <%= render 'left_sidebar' %>
15
- </span>
16
7
 
17
- <!-- right col -->
18
- <span class="col-xs-9">
19
- <%= render 'profile_tabs' %>
20
- </span>
8
+ <div class="col-xs-12">
9
+ <div class="pull-right">
10
+ <%= render 'profile_actions' %>
21
11
  </div>
22
-
23
-
24
-
12
+ <span class="col-xs-3">
13
+ <%= render 'left_sidebar' %>
14
+ </span>
15
+ <!-- right col -->
16
+ <span class="col-xs-9">
17
+ <%= render 'profile_tabs' %>
18
+ </span>
19
+ </div>
@@ -18,17 +18,17 @@ en:
18
18
  label_short: "All"
19
19
  label_long: "All of Sufia"
20
20
  my_files:
21
- label_short: "My Files"
21
+ label_short: "My Files"
22
22
  label_long: "My Files"
23
23
  my_collections:
24
- label_short: "My Collections"
24
+ label_short: "My Collections"
25
25
  label_long: "My Collections"
26
26
  my_highlights:
27
- label_short: "My Highlights"
27
+ label_short: "My Highlights"
28
28
  label_long: "My Highlights"
29
29
  my_shares:
30
- label_short: "My Shares"
31
- label_long: "My Shares"
30
+ label_short: "My Shares"
31
+ label_long: "My Shares"
32
32
  upload:
33
33
  my_computer:
34
34
  tab_label: "My Computer"
@@ -44,7 +44,8 @@ en:
44
44
  tag: "Keyword"
45
45
  date_created: "Date Created"
46
46
  related_url: "Related URL"
47
-
47
+ homepage:
48
+ featured_works: 'Featured Works'
48
49
  dashboard:
49
50
  title: "My Dashboard"
50
51
  greeting: "Hello, "
@@ -1,10 +1,10 @@
1
1
  Sufia::Engine.routes.draw do
2
2
 
3
3
  # Downloads controller route
4
- resources :homepage, only: "index"
4
+ resources :homepage, only: 'index'
5
5
 
6
6
  # Route the home page as the root
7
- root to: "homepage#index"
7
+ root to: 'homepage#index'
8
8
 
9
9
  get 'single_use_link/generate_download/:id' => 'single_use_links#new_download', as: :generate_download_single_use_link
10
10
  get 'single_use_link/generate_show/:id' => 'single_use_links#new_show', as: :generate_show_single_use_link
@@ -13,8 +13,8 @@ Sufia::Engine.routes.draw do
13
13
 
14
14
  match 'batch_edits/clear' => 'batch_edits#clear', as: :batch_edits_clear, via: [:get, :post]
15
15
 
16
- # "Notifications" route for catalog index view
17
- get "users/notifications_number" => "users#notifications_number", as: :user_notify
16
+ # Notifications route for catalog index view
17
+ get 'users/notifications_number' => 'users#notifications_number', as: :user_notify
18
18
 
19
19
  # Generic file routes
20
20
  resources :generic_files, path: :files, except: :index do
@@ -29,7 +29,7 @@ Sufia::Engine.routes.draw do
29
29
  resources :featured_work_lists, path: 'featured_works', only: :create
30
30
 
31
31
  # Downloads controller route
32
- resources :downloads, only: "show"
32
+ resources :downloads, only: 'show'
33
33
 
34
34
  # Messages
35
35
  resources :notifications, only: [:destroy, :index], controller: :mailbox do
@@ -48,38 +48,31 @@ Sufia::Engine.routes.draw do
48
48
  end
49
49
 
50
50
  # Dashboard page
51
- resources 'dashboard', only: :index do
51
+ resources :dashboard, only: :index do
52
52
  collection do
53
53
  get 'activity', action: :activity, as: :dashboard_activity
54
54
  end
55
55
  end
56
56
 
57
57
  # Routes for user's files, collections, highlights and shares
58
- namespace :dashboard do
59
- resources :files, only: :index, controller: "/my/files" do
60
- collection do
61
- get 'page/:page', action: :index
62
- get 'facet/:id', action: :facet, as: :dashboard_facet
63
- end
64
- end
65
- resources :collections, only: :index, controller: "/my/collections" do
66
- collection do
67
- get 'page/:page', action: :index
68
- get 'facet/:id', action: :facet, as: :dashboard_facet
69
- end
70
- end
71
- resources :highlights, only: :index, controller: "/my/highlights" do
72
- collection do
73
- get 'page/:page', action: :index
74
- get 'facet/:id', action: :facet, as: :dashboard_facet
75
- end
76
- end
77
- resources :shares, only: :index, controller: "/my/shares" do
78
- collection do
79
- get 'page/:page', action: :index
80
- get 'facet/:id', action: :facet, as: :dashboard_facet
81
- end
82
- end
58
+ # Preserves existing behavior by maintaining paths to /dashboard
59
+ # Routes actions to the various My controllers
60
+ scope :dashboard do
61
+ get '/files', controller: 'my/files', action: :index, as: 'dashboard_files'
62
+ get '/files/page/:page', controller: 'my/files', action: :index
63
+ get '/files/facet/:id', controller: 'my/files', action: :facet, as: 'dashboard_files_facet'
64
+
65
+ get '/collections', controller: 'my/collections', action: :index, as: 'dashboard_collections'
66
+ get '/collections/page/:page', controller: 'my/collections', action: :index
67
+ get '/collections/facet/:id', controller: 'my/collections', action: :facet, as: 'dashboard_collections_facet'
68
+
69
+ get '/highlights', controller: 'my/highlights', action: :index, as: 'dashboard_highlights'
70
+ get '/highlights/page/:page', controller: 'my/highlights', action: :index
71
+ get '/highlights/facet/:id', controller: 'my/highlights', action: :facet, as: 'dashboard_highlights_facet'
72
+
73
+ get '/shares', controller: 'my/shares', action: :index, as: 'dashboard_shares'
74
+ get '/shares/page/:page', controller: 'my/shares', action: :index
75
+ get '/shares/facet/:id', controller: 'my/shares', action: :facet, as: 'dashboard_shares_facet'
83
76
  end
84
77
 
85
78
  # advanced routes for advanced search
@@ -108,7 +101,7 @@ Sufia::Engine.routes.draw do
108
101
  if defined?(Sufia::ResqueAdmin)
109
102
  namespace :admin do
110
103
  constraints Sufia::ResqueAdmin do
111
- mount Resque::Server, at: "queues"
104
+ mount Resque::Server, at: 'queues'
112
105
  end
113
106
  end
114
107
  end
@@ -38,7 +38,7 @@ This generator makes the following changes to your application:
38
38
  " \n# Adds Sufia behaviors into the application controller \n" +
39
39
  " include Sufia::Controller\n"
40
40
  end
41
- gsub_file file_path, "layout 'blacklight'", "layout :search_layout"
41
+ gsub_file file_path, "layout 'blacklight'", "layout 'sufia-one-column'"
42
42
  else
43
43
  puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your Controllers, you must include the Sufia::Controller module in the Controller class definition."
44
44
  end
@@ -0,0 +1,87 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'rails/generators'
3
+ require 'rails/generators/migration'
4
+
5
+ class Sufia::Upgrade400Generator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ argument :model_name, type: :string , default: "user"
11
+ desc """
12
+ This generator for upgrading sufia from 3.7.2 to 4.0 makes the following changes to your application:
13
+ 1. Updates the root route
14
+ 2. Adds Sufia's abilities into the Ability class
15
+ 3. Adds Sufia behavior to the catalog controller
16
+ 4. Creates a Sufia helper
17
+ 5. Removes Blacklight stylesheet
18
+ 6. Creates TinyMCE config for editable content feature
19
+ 7. Adds blacklight-marc dependency if SolrDocument depends on it
20
+ 8. Runs sufia-models upgrade generator
21
+ """
22
+
23
+ def banner
24
+ say_status("warning", "UPGRADING SUFIA", :yellow)
25
+ end
26
+
27
+ # The engine routes have to come after the devise routes so that /users/sign_in will work
28
+ def update_root_route
29
+ # Nuke old Sufia-related routes
30
+ gsub_file 'config/routes.rb', 'root :to => "catalog#index"', "root to: 'homepage#index'"
31
+ end
32
+
33
+ def insert_abilities
34
+ insert_into_file 'app/models/ability.rb', after: /Hydra::Ability/ do
35
+ "\n include Sufia::Ability\n"
36
+ end
37
+ end
38
+
39
+ # Add Sufia behaviors to the catalog controller
40
+ def inject_sufia_controller_behavior
41
+ controller_name = "CatalogController"
42
+ file_path = "app/controllers/catalog_controller.rb"
43
+ if File.exists?(file_path)
44
+ insert_into_file file_path, after: 'include Hydra::Controller::ControllerBehavior' do
45
+ "\n # Adds Sufia behaviors to the catalog controller\n" +
46
+ " include Sufia::Catalog\n"
47
+ end
48
+ else
49
+ puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your Controllers, you must include the Sufia::Catalog module in the CatalogController class definition."
50
+ end
51
+ end
52
+
53
+ def copy_helper
54
+ copy_file 'sufia_helper.rb', 'app/helpers/sufia_helper.rb'
55
+ end
56
+
57
+ def remove_blacklight_scss
58
+ remove_file 'app/assets/stylesheets/blacklight.css.scss'
59
+ end
60
+
61
+ def tinymce_config
62
+ copy_file "config/tinymce.yml", "config/tinymce.yml"
63
+ end
64
+
65
+ def blacklight_marc
66
+ file_path = 'app/models/solr_document.rb'
67
+ return unless File.exists?(file_path) &&
68
+ file_contains?('app/models/solr_document.rb', 'Blacklight::Solr::Document::Marc') &&
69
+ !file_contains?('Gemfile', 'blacklight-marc')
70
+ insert_into_file 'Gemfile', after: /gem 'sufia'.*$/ do
71
+ "\ngem 'blacklight-marc'"
72
+ end
73
+ Bundler.with_clean_env do
74
+ run 'bundle install'
75
+ end
76
+ end
77
+
78
+ def upgrade_sufia_models
79
+ generate "sufia:models:upgrade400"
80
+ end
81
+
82
+ private
83
+
84
+ def file_contains?(path, string)
85
+ File.readlines(path).grep(/#{string}/).any?
86
+ end
87
+ end