sufia 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -3
  3. data/.travis.yml +4 -4
  4. data/README.md +1 -10
  5. data/SUFIA_VERSION +1 -1
  6. data/app/assets/images/audio.png +0 -0
  7. data/app/assets/javascripts/sufia/trophy.js +11 -5
  8. data/app/controllers/single_use_links_controller.rb +11 -1
  9. data/app/helpers/facets_helper.rb +3 -0
  10. data/app/helpers/sufia/facets_helper_behavior.rb +23 -0
  11. data/app/helpers/sufia_helper.rb +3 -21
  12. data/app/views/dashboard/_facet_limit.html.erb +2 -20
  13. data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +4 -2
  14. data/app/views/generic_files/_descriptions.html.erb +2 -18
  15. data/app/views/generic_files/_field_form.html.erb +7 -2
  16. data/app/views/generic_files/_media_display.html.erb +0 -16
  17. data/app/views/generic_files/_permission.html.erb +1 -17
  18. data/app/views/generic_files/_permission_form.html.erb +1 -1
  19. data/app/views/generic_files/_show_actions.html.erb +1 -8
  20. data/app/views/generic_files/_versioning.html.erb +1 -17
  21. data/app/views/generic_files/edit.html.erb +1 -17
  22. data/app/views/mailbox/index.html.erb +5 -3
  23. data/app/views/users/_activity.html.erb +3 -0
  24. data/app/views/users/_activity_log.html.erb +1 -17
  25. data/app/views/users/_contributions.html.erb +29 -0
  26. data/app/views/users/_follower_modal.html.erb +26 -0
  27. data/app/views/users/_following_modal.html.erb +26 -0
  28. data/app/views/users/_left_sidebar.html.erb +12 -0
  29. data/app/views/users/_notify_number.html.erb +0 -16
  30. data/app/views/users/_profile.html.erb +7 -0
  31. data/app/views/users/_profile_actions.html.erb +11 -0
  32. data/app/views/users/_profile_tabs.html.erb +11 -0
  33. data/app/views/users/_search_form.html.erb +1 -17
  34. data/app/views/users/_social_media_info.html.erb +20 -0
  35. data/app/views/users/_user_info.html.erb +0 -16
  36. data/app/views/users/_vitals.html.erb +4 -0
  37. data/app/views/users/edit.html.erb +1 -17
  38. data/app/views/users/index.html.erb +0 -16
  39. data/app/views/users/notifications_number.js.erb +0 -16
  40. data/app/views/users/show.html.erb +21 -58
  41. data/lib/sufia.rb +1 -3
  42. data/lib/sufia/controller.rb +0 -6
  43. data/lib/sufia/version.rb +1 -1
  44. data/spec/controllers/batch_edits_controller_spec.rb +8 -2
  45. data/spec/controllers/generic_files_controller_spec.rb +8 -28
  46. data/spec/controllers/single_use_links_controller_spec.rb +26 -2
  47. data/spec/factories/generic_files.rb +46 -0
  48. data/spec/factories/users.rb +6 -2
  49. data/spec/features/browse_dashboard_files_spec.rb +39 -0
  50. data/spec/features/browse_files_spec.rb +30 -0
  51. data/spec/features/{contact_form.rb → contact_form_spec.rb} +1 -1
  52. data/spec/features/{display_dashboard.rb → display_dashboard_spec.rb} +1 -7
  53. data/spec/features/{ingest_upload_files.rb → ingest_upload_files_spec.rb} +2 -2
  54. data/spec/features/notifications_spec.rb +20 -0
  55. data/spec/features/users_spec.rb +12 -0
  56. data/spec/helpers/sufia_helper_spec.rb +23 -0
  57. data/spec/lib/sufia/id_service_spec.rb +0 -38
  58. data/spec/support/features.rb +2 -0
  59. data/spec/support/features/session_helpers.rb +9 -1
  60. data/spec/support/fixture_helpers.rb +10 -0
  61. data/spec/views/dashboard/facet_limit.html.erb_spec.rb +15 -0
  62. data/spec/views/dashboard/index_partials/_thumbnail_display.html.erb_spec.rb +22 -0
  63. data/spec/views/generic_file/edit.html.erb_spec.rb +24 -0
  64. data/spec/views/users/show.html.erb_spec.rb +31 -0
  65. data/sufia-models/app/models/concerns/sufia/user.rb +2 -2
  66. data/sufia-models/lib/generators/sufia/models/install_generator.rb +2 -1
  67. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_linkedin_to_users.rb +5 -0
  68. data/sufia-models/lib/sufia/models/generic_file/actions.rb +0 -1
  69. data/sufia-models/lib/sufia/models/version.rb +1 -1
  70. data/sufia-models/sufia-models.gemspec +3 -5
  71. data/tasks/sufia-dev.rake +0 -10
  72. metadata +43 -69
  73. data/app/views/generic_files/edit_fields/_type.html.erb +0 -12
  74. data/lib/tasks/fixtures.rake +0 -231
  75. data/spec/features/browse_dashboard_files.rb +0 -21
  76. data/spec/features/browse_files.rb +0 -31
  77. data/spec/fixtures/empty_file.txt +0 -0
  78. data/spec/fixtures/fits_datastream.xml +0 -42
  79. data/spec/fixtures/sufia/bg_header.jpg +0 -0
  80. data/spec/fixtures/sufia/sufia_test1.descMeta.txt +0 -12
  81. data/spec/fixtures/sufia/sufia_test1.foxml.erb +0 -89
  82. data/spec/fixtures/sufia/sufia_test1.txt +0 -1
  83. data/spec/fixtures/sufia/sufia_test2.descMeta.txt +0 -12
  84. data/spec/fixtures/sufia/sufia_test2.docx +0 -0
  85. data/spec/fixtures/sufia/sufia_test2.foxml.erb +0 -88
  86. data/spec/fixtures/sufia/sufia_test3.descMeta.txt +0 -12
  87. data/spec/fixtures/sufia/sufia_test3.foxml.erb +0 -91
  88. data/spec/fixtures/sufia/sufia_test3.xls +0 -0
  89. data/spec/fixtures/sufia/sufia_test4.descMeta.txt +0 -12
  90. data/spec/fixtures/sufia/sufia_test4.foxml.erb +0 -91
  91. data/spec/fixtures/sufia/sufia_test5.descMeta.txt +0 -19
  92. data/spec/fixtures/sufia/sufia_test5.foxml.erb +0 -90
  93. data/spec/fixtures/sufia/sufia_test5.txt +0 -1
  94. data/spec/fixtures/sufia/sufia_test6.descMeta.txt +0 -12
  95. data/spec/fixtures/sufia/sufia_test6.foxml.erb +0 -89
  96. data/spec/fixtures/sufia/sufia_test6.jp2 +0 -0
  97. data/spec/fixtures/sufia/sufia_test6.txt +0 -1
  98. data/spec/fixtures/sufia_generic_stub.descMeta.txt +0 -12
  99. data/spec/fixtures/sufia_generic_stub.foxml.erb +0 -79
  100. data/spec/models/unzip_job_spec.rb +0 -47
  101. data/spec/rake/sufia_fixtures_spec.rb +0 -74
  102. data/sufia-models/lib/sufia/models/jobs/unzip_job.rb +0 -38
  103. data/tasks/sufia-fixtures.rake +0 -232
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77cd255a8ab67cb2bcbd0bbfe17a9920d853251b
4
- data.tar.gz: 528e7ca2aeb61cf7bcf5b10e370fcbfd8a51a1fc
3
+ metadata.gz: 600ffd64ac5050922d558df0919adff82b5c86e9
4
+ data.tar.gz: 1c3206cbd65b85dfdbc75c37a0fd539aa577518e
5
5
  SHA512:
6
- metadata.gz: acc4acc8293673da4aba37329ab6321be93241c9dfd2fd712a4bf5a3cf7218bfe25d5d6d8a99b1a45eb91934903dc31caacce9d7aa8311ebdfa9965075c5df4e
7
- data.tar.gz: 656b6f49ed4a1a4a603cae1b40a3c9320ac42a3aa4e806ba228439442ba87168fa8e0ed2b60e7957014b9297d1221ca9e97ad77605379402f2ffa472af2f816b
6
+ metadata.gz: f5b565ade76f51e2b2a89d291c0bea3413c90c4e7a3769fdf5d87baa16d727aa7bc3bd76719cb8722975402540187c703ec7df09adbc1d8f8c30a0eec84b25b6
7
+ data.tar.gz: 40a89c2d24aa9a953991eeb6d7453ab3de9e4e935445a122680f791172c45aa85971c6ec977f84dfe010bf0817cf51668bdd264174f15e529847b14b4272baa4
data/.gitignore CHANGED
@@ -86,9 +86,6 @@ db/schema.rb
86
86
 
87
87
  ## PROJECT::SPECIFIC
88
88
 
89
- ## fixtures for dev
90
- spec/fixtures/sufia/sufia_sufia1.*
91
-
92
89
  ## ASSET PIPELINE
93
90
  .sass-cache/
94
91
  public/assets/
data/.travis.yml CHANGED
@@ -1,17 +1,17 @@
1
1
  language: ruby
2
2
  before_install:
3
- - sudo apt-get install libclamav-dev clamav-data
3
+ - sudo apt-get install libclamav-dev clamav-data clamav-daemon
4
+ - sudo freshclam -v
4
5
  rvm:
5
- - "1.9.3"
6
6
  - "2.0.0"
7
+ - "2.1.0-preview2"
7
8
  env:
8
9
  global:
9
10
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
10
11
  notifications:
11
12
  email:
12
13
  recipients:
13
- - "ul-dlt-applications@lists.psu.edu"
14
- - "michael@psu.edu"
14
+ - "ul-dlt-hydra@lists.psu.edu"
15
15
  on_success: "change"
16
16
  on_failure: "always"
17
17
  irc:
data/README.md CHANGED
@@ -132,20 +132,11 @@ See https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
132
132
 
133
133
  ## Developers:
134
134
  This information is for people who want to modify the engine itself, not an application that uses the engine:
135
- ### Create fixtures
136
- ```
137
- # configure jetty & start jetty (if you haven't already)
138
- rake jetty:config
139
- rake jetty:start
140
-
141
- # load sufia fixtures
142
- rake sufia:fixtures:create sufia:fixtures:generate
143
- rake fixtures
144
135
 
145
136
  # run the tests
146
137
  rake clean spec
147
- bundle exec cucumber features
148
138
  ```
139
+
149
140
  ### Change validation behavior
150
141
 
151
142
  To change what happens to files that fail validation add an after_validation hook
data/SUFIA_VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.0
1
+ 3.6.0
Binary file
@@ -8,15 +8,21 @@ $(function() {
8
8
  type:"post",
9
9
  data: "file_id="+this.id,
10
10
  success:function(data) {
11
- var oldclass = $('#'+data.trophy.generic_file_id).find('i').attr("class");
11
+ gid = data.generic_file_id;
12
+ var oldclass = $('#'+gid).find('i').attr("class");
12
13
  if (oldclass.indexOf("trophy-on") != -1){
13
- $('#'+data.trophy.generic_file_id).find('i').attr("title", "Highlight work");
14
+ $('#'+gid).find('i').attr("title", "Highlight work");
14
15
  } else {
15
- $('#'+data.trophy.generic_file_id).find('i').attr("title", "Unhighlight work");
16
+ $('#'+gid).find('i').attr("title", "Unhighlight work");
16
17
  }
17
18
 
18
- $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-on");
19
- $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-off");
19
+ $('#'+gid).find('i').toggleClass("trophy-on");
20
+ $('#'+gid).find('i').toggleClass("trophy-off");
21
+ if ($('#'+gid).data('removerow')) {
22
+ $('#trophyrow_'+gid).fadeOut(1000, function() {
23
+ $('#trophyrow_'+gid).remove();
24
+ });
25
+ }
20
26
  }
21
27
  })
22
28
  });
@@ -28,9 +28,19 @@ class SingleUseLinksController < ApplicationController
28
28
  end
29
29
  end
30
30
 
31
+ # Catch permission errors
32
+ rescue_from Hydra::AccessDenied, CanCan::AccessDenied do |exception|
33
+ if current_user and current_user.persisted?
34
+ redirect_to root_url, :alert => "You do not have sufficient privileges to create links to this document"
35
+ else
36
+ session["user_return_to"] = request.url
37
+ redirect_to new_user_session_url, :alert => exception.message
38
+ end
39
+ end
40
+
31
41
  protected
32
42
  def authorize_user!
33
- authorize! :read, @asset
43
+ authorize! :edit, @asset
34
44
  end
35
45
 
36
46
  def load_asset
@@ -0,0 +1,3 @@
1
+ module FacetsHelper
2
+ include Sufia::FacetsHelperBehavior
3
+ end
@@ -0,0 +1,23 @@
1
+ module Sufia
2
+ module FacetsHelperBehavior
3
+ include Hydra::FacetsHelperBehavior
4
+
5
+ # Override to remove the label class (easier integration with bootstrap)
6
+ # and handles arrays
7
+ def render_facet_value(facet_solr_field, item, options ={})
8
+ logger.warn "display value #{ facet_display_value(facet_solr_field, item)}"
9
+ if item.is_a? Array
10
+ render_array_facet_value(facet_solr_field, item, options)
11
+ end
12
+ if params[:controller] == "dashboard"
13
+ path = sufia.url_for(add_facet_params_and_redirect(facet_solr_field,item.value ).merge(:only_path=>true))
14
+ (link_to_unless(options[:suppress_link], facet_display_value(facet_solr_field, item), path, :class=>"facet_select") + " " + render_facet_count(item.hits)).html_safe
15
+ else
16
+ # This is for controllers that use this helper method that are defined outside Sufia
17
+ path = url_for(add_facet_params_and_redirect(facet_solr_field, item.value).merge(:only_path=>true))
18
+ (link_to_unless(options[:suppress_link], facet_display_value(facet_solr_field, item), path, :class=>"facet_select") + " " + render_facet_count(item.hits)).html_safe
19
+ end
20
+ end
21
+
22
+ end
23
+ end
@@ -1,4 +1,3 @@
1
-
2
1
  module SufiaHelper
3
2
 
4
3
  # link_back_to_dashboard(:label=>'Back to Search')
@@ -26,7 +25,7 @@ module SufiaHelper
26
25
  end
27
26
 
28
27
  def number_of_deposits(user)
29
- ActiveFedora::SolrService.query("#{Solrizer.solr_name('depositor', :stored_searchable, :type => :string)}:#{user.user_key}").count
28
+ ActiveFedora::Base.where(Solrizer.solr_name('depositor', :stored_searchable) => user.user_key).count
30
29
  end
31
30
 
32
31
  def link_to_facet(field, field_string)
@@ -76,26 +75,9 @@ module SufiaHelper
76
75
  end
77
76
  end
78
77
 
79
- # Override to remove the label class (easier integration with bootstrap)
80
- # and handles arrays
81
- def render_facet_value(facet_solr_field, item, options ={})
82
- logger.warn "display value #{ facet_display_value(facet_solr_field, item)}"
83
- if item.is_a? Array
84
- render_array_facet_value(facet_solr_field, item, options)
85
- end
86
- if params[:controller] == "dashboard"
87
- path = sufia.url_for(add_facet_params_and_redirect(facet_solr_field,item.value ).merge(:only_path=>true))
88
- path = sufia.url_for(add_facet_params_and_redirect(facet_solr_field,item.value ).merge(:only_path=>true))
89
- (link_to_unless(options[:suppress_link], facet_display_value(facet_solr_field, item), path, :class=>"facet_select") + " " + render_facet_count(item.hits)).html_safe
90
- else
91
- # This is for controllers that use this helper method that are defined outside Sufia
92
- path = url_for(add_facet_params_and_redirect(facet_solr_field, item.value).merge(:only_path=>true))
93
- (link_to_unless(options[:suppress_link], facet_display_value(facet_solr_field, item), path, :class=>"facet_select") + " " + render_facet_count(item.hits)).html_safe
94
- end
95
- end
96
-
97
- # link_back_to_catalog(:label=>'Back to Search')
98
78
  # Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
79
+ # @example
80
+ # link_back_to_catalog(:label=>'Back to Search')
99
81
  def link_back_to_catalog(opts={:label=>t('blacklight.back_to_search')})
100
82
  query_params = session[:search] ? session[:search].dup : {}
101
83
  query_params.delete :counter
@@ -1,23 +1,5 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
- <% paginator =
18
- Blacklight::Solr::FacetPaginator.new(display_facet.items,
19
- :limit => facet_limit_for(solr_field))
20
- %>
1
+ <% paginator = Blacklight::Solr::FacetPaginator.new(display_facet.items,
2
+ limit: facet_limit_for(solr_field)) %>
21
3
  <ul class="slide-list">
22
4
  <% paginator.items.each do |item| -%>
23
5
  <li>
@@ -1,6 +1,8 @@
1
1
  <% width = 36 if width.blank? %>
2
- <% if document.image? || document.pdf? || document.video? %>
3
- <% path = sufia.download_path(document["id"], {datastream_id: 'thumbnail'}) %>
2
+ <% if document.image? || document.pdf? || document.video? %>
3
+ <% path = sufia.download_path(document.noid, {datastream_id: 'thumbnail'}) %>
4
+ <% elsif document.audio? %>
5
+ <% path = "/assets/audio.png" %>
4
6
  <% else %>
5
7
  <% path = "/assets/default.png" %>
6
8
  <% end %>
@@ -1,24 +1,8 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
1
  <%# convert class variable to a local variable if the local hasn't been set %>
18
- <% generic_file = @generic_file unless generic_file %>
2
+ <% generic_file ||= @generic_file %>
19
3
 
20
4
  <div id="descriptions_display" class="tab-pane active">
21
- <%= form_for generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
5
+ <%= form_for generic_file, :url => sufia.generic_file_path(@generic_file), :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
22
6
  <%= hidden_field_tag('redirect_tab', 'descriptions') %>
23
7
  <h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
24
8
  <div class="well">
@@ -8,7 +8,12 @@
8
8
  <%= f.label key, get_label(key), :class=>"control-label"%>
9
9
  <% end %>
10
10
 
11
- <% vals.to_ary.each_with_index do |v, index| %>
12
- <%= render_edit_field_partial(key, record: generic_file, f:f, v: v, index: index, render_req: render_req) %>
11
+ <% if key == :resource_type %>
12
+ <%# resource_type is a multiselect box, so don't render one row for each %>
13
+ <%= render_edit_field_partial(key, record: generic_file, f:f, render_req: render_req) %>
14
+ <% else %>
15
+ <% vals.to_ary.each_with_index do |v, index| %>
16
+ <%= render_edit_field_partial(key, record: generic_file, f:f, v: v, index: index, render_req: render_req) %>
17
+ <% end %>
13
18
  <% end %>
14
19
  </div><!-- /control-group -->
@@ -1,19 +1,3 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
1
  <% if @generic_file.image? %>
18
2
  <a href="<%= sufia.download_path(@generic_file) %>" target="_new" title="Download the full-sized image"><img src="<%= sufia.download_path(@generic_file, {:datastream_id => 'thumbnail'}) %>" width="338" alt="Download the full-sized image of <%= @generic_file.title.first %>"/>Download the full-sized image</a>
19
3
  <% elsif @generic_file.video? %>
@@ -1,21 +1,5 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
1
  <div id="permissions_display" class="tab-pane">
18
- <%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'permission'} do |f| %>
2
+ <%= form_for @generic_file, :url => sufia.generic_file_path(@generic_file), :html => {:multipart => true, :class => 'form-horizontal', :id => 'permission'} do |f| %>
19
3
  <%= hidden_field_tag('redirect_tab', 'permissions') %>
20
4
  <%= render :partial => "generic_files/permission_form", :locals => { :gf => @generic_file, :f=> f } %>
21
5
  <div class="row form-actions" id="permissions_submit">
@@ -87,7 +87,7 @@
87
87
  <div class="row control-group">
88
88
  <div id="new-group" >
89
89
  <div class="input-append">
90
- <%= select_tag 'new_group_name_skel', options_for_select(["Select a group"] + groups), :class => 'span38' %>
90
+ <%= select_tag 'new_group_name_skel', options_for_select(["Select a group"] + current_user.groups), :class => 'span38' %>
91
91
  <%= select_tag 'new_group_permission_skel', options_for_select(Sufia.config.permission_levels), :class => 'span17' %>
92
92
  <button class="btn btn-mini btn-inverse" id="add_new_group_skel" ><i class="icon-plus-sign"></i> Add</button>
93
93
  <br /><span id="directory_group_result"></span>
@@ -1,11 +1,9 @@
1
1
  <h2 class="non lower">Actions</h2>
2
2
  <p>
3
3
  <%= link_to "Download", sufia.download_path(@generic_file.noid) %>
4
- <!-- &nbsp;|&nbsp; -->
5
- <%# link_to "Cite", citation_generic_file_path, {:id => 'citeLink', :name => 'citation', :class => 'lightboxLink'}, :action => 'citation' %>
6
4
  <% if can? :edit, @generic_file %>
7
5
  &nbsp;|&nbsp;
8
- <%= link_to "Edit", sufia.edit_generic_file_path unless @generic_file.processing? %>
6
+ <%= link_to "Edit", sufia.edit_generic_file_path(@generic_file) unless @generic_file.processing? %>
9
7
  <%= "File is being processed you may edit once it is complete" if @generic_file.processing? %>
10
8
  <%end %>
11
9
  </p>
@@ -15,11 +13,6 @@
15
13
  <%= link_to 'Zotero', sufia.static_path('zotero'), {:id => 'zoteroLink', :name => 'zotero', :class => 'lightboxLink'} %>
16
14
  &nbsp;|&nbsp;
17
15
  <%= link_to 'Mendeley', sufia.static_path('mendeley'), {:id => 'mendeleyLink', :name => 'mendeley', :class => 'lightboxLink'} %>
18
- <!-- Disabling RefWorks export due to stakeholder deprioritization -->
19
- <%# link_to 'RefWorks', refworks_export_url(:id => @generic_file.noid) %>
20
- <!-- &nbsp;|&nbsp; -->
21
- <!-- Disabling Email This and SMS This links due to lack of use cases -->
22
- <%# link_to 'Email This', email_catalog_path(:id => @generic_file.persistent_url), {:id => 'emailLink', :name => 'email', :class => 'lightboxLink'} %>
23
16
  </p>
24
17
  <!-- AddThis Button BEGIN -->
25
18
  <div class="addthis_toolbox addthis_default_style">
@@ -1,23 +1,7 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
1
  <div id="versioning_display" class="tab-pane">
18
2
  <h2 class="non lower">Versions</h2>
19
3
  <div class="well">
20
- <%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
4
+ <%= form_for @generic_file, :url => sufia.generic_file_path(@generic_file), :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
21
5
  <%= hidden_field_tag('redirect_tab', 'versions') %>
22
6
  <h3>Upload New Version</h3>
23
7
  <p>Upload a new version of this file from your computer.</p>
@@ -1,19 +1,3 @@
1
- <%#
2
- Copyright © 2012 The Pennsylvania State University
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- %>
16
-
17
1
  <% content_for :local_js do %>
18
2
  if (navigator.userAgent.match("MSIE")){
19
3
  $("form").validate();
@@ -51,7 +35,7 @@ $("a[rel=popover]").popover({ html: true });
51
35
  </div>
52
36
  <div class="span2">&nbsp;</div>
53
37
  <div class="span68">
54
- <%= link_to "&lt;&lt;Browse view".html_safe, sufia.generic_file_path %></li>
38
+ <%= link_to "&lt;&lt;Browse view".html_safe, sufia.generic_file_path(@generic_file) %></li>
55
39
  <ul class="nav nav-tabs">
56
40
  <li id="edit_descriptions_link" class="active"><a href="#descriptions_display" data-toggle="tab"><i class="icon-tags"></i> Descriptions</a></li>
57
41
  <li id="edit_versioning_link"><a href="#versioning_display" data-toggle="tab"><i class="icon-sitemap"></i> Versions</a></li>
@@ -5,14 +5,16 @@
5
5
  <div id="Data">
6
6
  <table class="table table-striped">
7
7
  <thead>
8
- <tr>
9
- <th>Subject</th>
8
+ <tr>
9
+ <th>Date</th>
10
+ <th>Subject</th>
10
11
  <th>Message</th>
11
12
  </tr>
12
13
  </thead>
13
14
  <tbody>
14
15
  <% @messages.each do |msg| %>
15
- <tr class="<%= cycle("","zebra") %>">
16
+ <tr class="<%= cycle("","zebra") %>">
17
+ <td><%= time_ago_in_words(msg.last_message.created_at) %> ago </td>
16
18
  <td><%= msg.last_message.subject.html_safe %></td>
17
19
  <td><%= msg.last_message.body.html_safe %></td>
18
20
  <td><%= link_to raw('<i class="icon-trash icon-large"></i>'),
@@ -0,0 +1,3 @@
1
+ <div class="tab-pane" id="activity_log">
2
+ <%= render :partial => 'users/activity_log', :locals => {:events => @events} %>
3
+ </div>