sufia 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -3
- data/.travis.yml +4 -4
- data/README.md +1 -10
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/audio.png +0 -0
- data/app/assets/javascripts/sufia/trophy.js +11 -5
- data/app/controllers/single_use_links_controller.rb +11 -1
- data/app/helpers/facets_helper.rb +3 -0
- data/app/helpers/sufia/facets_helper_behavior.rb +23 -0
- data/app/helpers/sufia_helper.rb +3 -21
- data/app/views/dashboard/_facet_limit.html.erb +2 -20
- data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +4 -2
- data/app/views/generic_files/_descriptions.html.erb +2 -18
- data/app/views/generic_files/_field_form.html.erb +7 -2
- data/app/views/generic_files/_media_display.html.erb +0 -16
- data/app/views/generic_files/_permission.html.erb +1 -17
- data/app/views/generic_files/_permission_form.html.erb +1 -1
- data/app/views/generic_files/_show_actions.html.erb +1 -8
- data/app/views/generic_files/_versioning.html.erb +1 -17
- data/app/views/generic_files/edit.html.erb +1 -17
- data/app/views/mailbox/index.html.erb +5 -3
- data/app/views/users/_activity.html.erb +3 -0
- data/app/views/users/_activity_log.html.erb +1 -17
- data/app/views/users/_contributions.html.erb +29 -0
- data/app/views/users/_follower_modal.html.erb +26 -0
- data/app/views/users/_following_modal.html.erb +26 -0
- data/app/views/users/_left_sidebar.html.erb +12 -0
- data/app/views/users/_notify_number.html.erb +0 -16
- data/app/views/users/_profile.html.erb +7 -0
- data/app/views/users/_profile_actions.html.erb +11 -0
- data/app/views/users/_profile_tabs.html.erb +11 -0
- data/app/views/users/_search_form.html.erb +1 -17
- data/app/views/users/_social_media_info.html.erb +20 -0
- data/app/views/users/_user_info.html.erb +0 -16
- data/app/views/users/_vitals.html.erb +4 -0
- data/app/views/users/edit.html.erb +1 -17
- data/app/views/users/index.html.erb +0 -16
- data/app/views/users/notifications_number.js.erb +0 -16
- data/app/views/users/show.html.erb +21 -58
- data/lib/sufia.rb +1 -3
- data/lib/sufia/controller.rb +0 -6
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/batch_edits_controller_spec.rb +8 -2
- data/spec/controllers/generic_files_controller_spec.rb +8 -28
- data/spec/controllers/single_use_links_controller_spec.rb +26 -2
- data/spec/factories/generic_files.rb +46 -0
- data/spec/factories/users.rb +6 -2
- data/spec/features/browse_dashboard_files_spec.rb +39 -0
- data/spec/features/browse_files_spec.rb +30 -0
- data/spec/features/{contact_form.rb → contact_form_spec.rb} +1 -1
- data/spec/features/{display_dashboard.rb → display_dashboard_spec.rb} +1 -7
- data/spec/features/{ingest_upload_files.rb → ingest_upload_files_spec.rb} +2 -2
- data/spec/features/notifications_spec.rb +20 -0
- data/spec/features/users_spec.rb +12 -0
- data/spec/helpers/sufia_helper_spec.rb +23 -0
- data/spec/lib/sufia/id_service_spec.rb +0 -38
- data/spec/support/features.rb +2 -0
- data/spec/support/features/session_helpers.rb +9 -1
- data/spec/support/fixture_helpers.rb +10 -0
- data/spec/views/dashboard/facet_limit.html.erb_spec.rb +15 -0
- data/spec/views/dashboard/index_partials/_thumbnail_display.html.erb_spec.rb +22 -0
- data/spec/views/generic_file/edit.html.erb_spec.rb +24 -0
- data/spec/views/users/show.html.erb_spec.rb +31 -0
- data/sufia-models/app/models/concerns/sufia/user.rb +2 -2
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +2 -1
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_linkedin_to_users.rb +5 -0
- data/sufia-models/lib/sufia/models/generic_file/actions.rb +0 -1
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/sufia-models.gemspec +3 -5
- data/tasks/sufia-dev.rake +0 -10
- metadata +43 -69
- data/app/views/generic_files/edit_fields/_type.html.erb +0 -12
- data/lib/tasks/fixtures.rake +0 -231
- data/spec/features/browse_dashboard_files.rb +0 -21
- data/spec/features/browse_files.rb +0 -31
- data/spec/fixtures/empty_file.txt +0 -0
- data/spec/fixtures/fits_datastream.xml +0 -42
- data/spec/fixtures/sufia/bg_header.jpg +0 -0
- data/spec/fixtures/sufia/sufia_test1.descMeta.txt +0 -12
- data/spec/fixtures/sufia/sufia_test1.foxml.erb +0 -89
- data/spec/fixtures/sufia/sufia_test1.txt +0 -1
- data/spec/fixtures/sufia/sufia_test2.descMeta.txt +0 -12
- data/spec/fixtures/sufia/sufia_test2.docx +0 -0
- data/spec/fixtures/sufia/sufia_test2.foxml.erb +0 -88
- data/spec/fixtures/sufia/sufia_test3.descMeta.txt +0 -12
- data/spec/fixtures/sufia/sufia_test3.foxml.erb +0 -91
- data/spec/fixtures/sufia/sufia_test3.xls +0 -0
- data/spec/fixtures/sufia/sufia_test4.descMeta.txt +0 -12
- data/spec/fixtures/sufia/sufia_test4.foxml.erb +0 -91
- data/spec/fixtures/sufia/sufia_test5.descMeta.txt +0 -19
- data/spec/fixtures/sufia/sufia_test5.foxml.erb +0 -90
- data/spec/fixtures/sufia/sufia_test5.txt +0 -1
- data/spec/fixtures/sufia/sufia_test6.descMeta.txt +0 -12
- data/spec/fixtures/sufia/sufia_test6.foxml.erb +0 -89
- data/spec/fixtures/sufia/sufia_test6.jp2 +0 -0
- data/spec/fixtures/sufia/sufia_test6.txt +0 -1
- data/spec/fixtures/sufia_generic_stub.descMeta.txt +0 -12
- data/spec/fixtures/sufia_generic_stub.foxml.erb +0 -79
- data/spec/models/unzip_job_spec.rb +0 -47
- data/spec/rake/sufia_fixtures_spec.rb +0 -74
- data/sufia-models/lib/sufia/models/jobs/unzip_job.rb +0 -38
- data/tasks/sufia-fixtures.rake +0 -232
|
@@ -1,20 +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
|
-
<span id="last-event" class="ui-helper-hidden"><%# @last_event_timestamp %></span>
|
|
18
1
|
<table id="activity" class="table table-striped well">
|
|
19
2
|
<caption class="accessible-hidden">Activity of users you follow</caption>
|
|
20
3
|
<thead>
|
|
@@ -26,6 +9,7 @@ limitations under the License.
|
|
|
26
9
|
</thead>
|
|
27
10
|
<tbody>
|
|
28
11
|
<% events.each do |event| %>
|
|
12
|
+
<% next if event[:action].blank? or event[:timestamp].blank? %>
|
|
29
13
|
<tr>
|
|
30
14
|
<td> </td>
|
|
31
15
|
<td><%= event[:action].html_safe %></td>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<div class="tab-pane active" id="contributions">
|
|
2
|
+
<i class="icon-trophy trophy-on" ></i> <strong>Highlighted Files</strong>
|
|
3
|
+
<% if @trophies.count > 0 %>
|
|
4
|
+
<table>
|
|
5
|
+
<% @trophies.each do |t| %>
|
|
6
|
+
<tr id="trophyrow_<%= Sufia::Noid.noidify(t.pid) %>">
|
|
7
|
+
<% if t.image? || t.pdf? %>
|
|
8
|
+
<% temp_thumbnail_path = sufia.download_path(t) + "?datastream_id=thumbnail" %>
|
|
9
|
+
<% temp_href = "<a href=\"" + sufia.download_path(t) + "\"> <img src=\"" + temp_thumbnail_path + "\" width=\"90\" alt=\"Download the full-sized image\"/></a>" %>
|
|
10
|
+
<% else %>
|
|
11
|
+
<% temp_href = "<a href=\"" + sufia.download_path(t) + "\"> <img src=\"/assets/default.png\" width=\"90\" alt=\"Download file\"/></a>" %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<td>
|
|
14
|
+
<%= temp_href.html_safe() %>
|
|
15
|
+
</td>
|
|
16
|
+
<td>
|
|
17
|
+
<%= link_to display_title(t), sufia.generic_file_path(t) %>
|
|
18
|
+
<% if current_user == @user %>
|
|
19
|
+
<%= link_to raw("<i class='trophy-on icon-remove'></i>"),"", class: 'trophy-on trophy-class', title: "Click to remove from Highlighted files.", id: Sufia::Noid.noidify(t.pid), remote: true, data: {removerow: "true" } %>
|
|
20
|
+
<% end %>
|
|
21
|
+
</td>
|
|
22
|
+
</tr>
|
|
23
|
+
<% end %>
|
|
24
|
+
</table>
|
|
25
|
+
<% else %>
|
|
26
|
+
<%= @user.name %> has no highlighted files.
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<div class="modal-div">
|
|
2
|
+
|
|
3
|
+
<!-- Text to trigger modal -->
|
|
4
|
+
<h4><i class="icon-hand-left"></i><a data-toggle="modal" href="#followers">Follower(s):</a> <%= @followers.count %></h4>
|
|
5
|
+
<!-- Modal -->
|
|
6
|
+
<div class="modal hide in" id="followers" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
7
|
+
<div class="modal-header">
|
|
8
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="modal-body">
|
|
11
|
+
<% if @followers.count > 0 %>
|
|
12
|
+
<h3>Follower(s)</h3>
|
|
13
|
+
<ul>
|
|
14
|
+
<% @followers.each do |f| %>
|
|
15
|
+
<li> <a href="<%= sufia.profile_path(f.login) %>" title="View user's profile"><%= f.name %></a></li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ul>
|
|
18
|
+
<%else%>
|
|
19
|
+
<h3>No Followers</h3>
|
|
20
|
+
<%end %>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="modal-footer">
|
|
23
|
+
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<div class="modal-div">
|
|
2
|
+
|
|
3
|
+
<!-- Text to trigger modal -->
|
|
4
|
+
<h4><i class="icon-hand-right"></i><a data-toggle="modal" href="#following">Following:</a> <%= @following.count %></h4>
|
|
5
|
+
<!-- Modal -->
|
|
6
|
+
<div class="modal hide in" id="following" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
7
|
+
<div class="modal-header">
|
|
8
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="modal-body">
|
|
11
|
+
<% if @following.count > 0 %>
|
|
12
|
+
<h3>Following</h3>
|
|
13
|
+
<ul>
|
|
14
|
+
<% @following.each do |f| %>
|
|
15
|
+
<li> <a href="<%= sufia.profile_path(f.login) %>" title="View user's profile"><%= f.name %></a></li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ul>
|
|
18
|
+
<% else %>
|
|
19
|
+
<h3>No Following</h3>
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="modal-footer">
|
|
23
|
+
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%= image_tag @user.avatar.url(:thumb), :width => 100 %>
|
|
2
|
+
<h3><%= @user.name %><br /><%= @user.user_key %> </h3>
|
|
3
|
+
<hr />
|
|
4
|
+
<%= render "vitals" %>
|
|
5
|
+
<hr />
|
|
6
|
+
|
|
7
|
+
<%= render "follower_modal" %>
|
|
8
|
+
<%= render "following_modal" %>
|
|
9
|
+
|
|
10
|
+
<br />
|
|
11
|
+
<a class="btn btn-primary" href="<%= sufia.profiles_path %>"><i class="icon-globe"></i> View Users</a>
|
|
12
|
+
|
|
@@ -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
|
<i class="icon-bullhorn"></i>
|
|
18
2
|
<% if @notify_number > 0 %>
|
|
19
3
|
<span id="notify_number" class="overlay"> <%=@notify_number%></span>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- profile and view buttons -->
|
|
2
|
+
<% if not signed_in? %>
|
|
3
|
+
<!-- sign in to access social functions -->
|
|
4
|
+
<% elsif current_user == @user %>
|
|
5
|
+
<a class="btn" href="<%= sufia.edit_profile_path(@user) %>"><i class="icon-edit"></i> Edit Your Profile </a>
|
|
6
|
+
<% elsif current_user.following?(@user) %>
|
|
7
|
+
<a class="btn btn-primary" href="<%= sufia.unfollow_user_path(@user) %>"><i class="icon-eye-close"></i> Unfollow </a>
|
|
8
|
+
<% else %>
|
|
9
|
+
<a class="btn btn-primary" href="<%= sufia.follow_user_path(@user) %>"><i class="icon-eye-open"></i> Follow</a>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<ul class="nav nav-tabs" id="myTab">
|
|
2
|
+
<li class="active"><a href="#contributions"><i class="icon-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>
|
|
5
|
+
</ul>
|
|
6
|
+
|
|
7
|
+
<div class="tab-content">
|
|
8
|
+
<%= render 'contributions' %>
|
|
9
|
+
<%= render 'profile' %>
|
|
10
|
+
<%= render 'activity' %>
|
|
11
|
+
</div> <!-- /tab-content -->
|
|
@@ -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 style="float: right;" >
|
|
18
|
-
<%= form_tag sufia.profiles_path, :method => :
|
|
2
|
+
<%= form_tag sufia.profiles_path, :method => :get, :class => "well form-search" do %>
|
|
19
3
|
<label class="accessible-hidden">Search Users</label>
|
|
20
4
|
<%= text_field_tag :uq, params[:uq], :class => "q", :placeholder => "Search Users", :size => '30', :type => "search", :id => "user_search" %>
|
|
21
5
|
<%= hidden_field_tag :sort, params[:sort], :id => 'user_sort' %>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<% if !user.facebook_handle.blank?() %>
|
|
2
|
+
<dt><i class="icon-facebook"></i> Facebook Handle</dt>
|
|
3
|
+
<dd><%= link_to "http://facebook.com/#{user.facebook_handle}", "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
|
|
4
|
+
<% end %>
|
|
5
|
+
|
|
6
|
+
<% if !user.twitter_handle.blank?() %>
|
|
7
|
+
<dt><i class="icon-twitter"></i> Twitter Handle</dt>
|
|
8
|
+
<dd><%= link_to "http://twitter.com/#{user.twitter_handle}", "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
|
|
13
|
+
<dt><i class="icon-google-plus"></i> Google+ Handle</dt>
|
|
14
|
+
<dd><%# link_to user.googleplus_handle, "http://google.com/+#{user.googleplus_handle}", {target:'_blank'} %></dd>
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<% if !user.linkedin_handle.blank?() %>
|
|
18
|
+
<dt><i class="icon-linkedin"></i> Linked In</dt>
|
|
19
|
+
<dd><%= link_to "#{@linkedInUrl}", "#{@linkedInUrl}", {target:'_blank'} %></dd>
|
|
20
|
+
<% end %>
|
|
@@ -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
|
<dl id="user_info">
|
|
18
2
|
<dt><i class="icon-facebook"></i> Facebook Handle</dt>
|
|
19
3
|
<dd><%= link_to user.facebook_handle, "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
|
|
@@ -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
|
// initialize popover helpers
|
|
19
3
|
$("a[rel=popover]").popover({ html: true });
|
|
@@ -90,7 +74,7 @@ $("a[rel=popover]").popover({ html: true });
|
|
|
90
74
|
<hr />
|
|
91
75
|
|
|
92
76
|
<h3><i class="icon-group"></i> User Managed Groups Info (UMG) <%= link_to 'Manage UMG', 'http://umg.its.psu.edu/', :class => 'btn btn-mini btn-primary' %> </h3>
|
|
93
|
-
<% groups.each do |g| %>
|
|
77
|
+
<% current_user.groups.each do |g| %>
|
|
94
78
|
<i class="icon-caret-right"></i> <%= g %><br />
|
|
95
79
|
<% end %>
|
|
96
80
|
</div>
|
|
@@ -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
|
<div id="search" class="row">
|
|
18
2
|
<%= render :partial => 'search_form' %>
|
|
19
3
|
<h1><%= t('sufia.product_name') %> Users</h1>
|
|
@@ -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
|
$("#notify_link").html("<%= escape_javascript(render :partial => "notify_number") %>");
|
|
18
2
|
<% @batches.each do |batch|%>
|
|
19
3
|
$(".<%=batch%>").attr('class', '');;
|
|
@@ -1,63 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
<span class="span60">
|
|
3
|
-
<%= image_tag @user.avatar.url(:thumb), :width => 100 %>
|
|
4
|
-
<%= @user.name %> (<%= @user.user_key %>)
|
|
5
|
-
</span>
|
|
1
|
+
<% content_for :local_js do %>
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<a class="btn btn-primary" href="<%= sufia.edit_profile_path(@user) %>"><i class="icon-edit"></i> Edit Your Profile </a>
|
|
12
|
-
<% elsif current_user.following?(@user) %>
|
|
13
|
-
<a class="btn btn-primary" href="<%= sufia.unfollow_user_path(@user.to_s) %>"><i class="icon-eye-close"></i> Unfollow </a>
|
|
14
|
-
<% else %>
|
|
15
|
-
<a class="btn btn-primary" href="<%= sufia.follow_user_path(@user.to_s) %>"><i class="icon-eye-open"></i> Follow</a>
|
|
16
|
-
<% end %>
|
|
17
|
-
<a class="btn btn-primary" href="<%= sufia.profiles_path %>"><i class="icon-globe"></i> View Users</a>
|
|
18
|
-
</span>
|
|
19
|
-
</h1>
|
|
20
|
-
<dl>
|
|
21
|
-
<dt><i class="icon-calendar"></i> Active Since</dt>
|
|
22
|
-
<dd><%= @user.created_at.to_date.to_formatted_s(:long_ordinal) %></dd>
|
|
23
|
-
<dt><i class="icon-folder-open"></i> Deposited Files</dt>
|
|
24
|
-
<dd><%= link_to_field('depositor', @user.to_s, GenericFile.where(:depositor => @user.to_s).count) %></dd>
|
|
25
|
-
<dt><i class="icon-trophy trophy-on" ></i> Highlighted Files</dt>
|
|
26
|
-
<% @trophies.each do |t| %>
|
|
27
|
-
<dd> <%= link_to t, sufia.generic_file_path(t) %></dd>
|
|
28
|
-
<% end %>
|
|
29
|
-
</dl>
|
|
3
|
+
$('#myTab a').click(function (e) {
|
|
4
|
+
e.preventDefault();
|
|
5
|
+
$(this).tab('show');
|
|
6
|
+
})
|
|
30
7
|
|
|
31
|
-
|
|
8
|
+
<% end %>
|
|
9
|
+
<div class="accessible-hidden" id="current_user"><%=@user.user_key%></div>
|
|
10
|
+
<div class="span110">
|
|
11
|
+
<div class="pull-right">
|
|
12
|
+
<%= render 'profile_actions' %>
|
|
13
|
+
</div>
|
|
14
|
+
<span class="span20">
|
|
15
|
+
<%= render 'left_sidebar' %>
|
|
16
|
+
</span> <!-- /close span20 -->
|
|
17
|
+
|
|
18
|
+
<!-- right col -->
|
|
19
|
+
<span class="span78 offset2">
|
|
20
|
+
|
|
21
|
+
<%= render 'profile_tabs' %>
|
|
22
|
+
</span> <!-- /close span50 -->
|
|
23
|
+
</div><!-- /close span110 -->
|
|
32
24
|
|
|
33
|
-
<h2>User Info</h2>
|
|
34
|
-
<div class="span44">
|
|
35
|
-
<div>
|
|
36
|
-
<h4><i class="icon-hand-left"></i> Follower(s): <%= @followers.count %></h4>
|
|
37
|
-
<ul class="thumbnails">
|
|
38
|
-
<% @followers.each do |f| %>
|
|
39
|
-
<li class="span8">
|
|
40
|
-
<%= link_to(image_tag(f.avatar.url(:thumb)), sufia.profile_path(f.user_key), { :title => f.name } ) %>
|
|
41
|
-
<%= link_to(f.name, sufia.profile_path(f.user_key), { :title => f.name } ) %>
|
|
42
|
-
<li>
|
|
43
|
-
<% end %>
|
|
44
|
-
</ul>
|
|
45
|
-
</div>
|
|
46
25
|
|
|
47
|
-
<div>
|
|
48
|
-
<h4><i class="icon-hand-right"></i> Following: <%= @following.count %></h4>
|
|
49
|
-
<ul class="thumbnails">
|
|
50
|
-
<% @following.each do |f| %>
|
|
51
|
-
<li class="span8">
|
|
52
|
-
<%= link_to(image_tag(f.avatar.url(:thumb)), sufia.profile_path(f.user_key), { :title => f.name } ) %>
|
|
53
|
-
<%= link_to(f.name, sufia.profile_path(f.user_key), { :title => f.name } ) %>
|
|
54
|
-
<li>
|
|
55
|
-
<% end %>
|
|
56
|
-
</ul>
|
|
57
|
-
</div>
|
|
58
|
-
<%= render :partial => 'user_info', :locals => {:user => @user} %>
|
|
59
|
-
</div><!-- close span44 -->
|
|
60
26
|
|
|
61
|
-
<div class="span60 offset5">
|
|
62
|
-
<%= render :partial => 'users/activity_log', :locals => {:events => @events} %>
|
|
63
|
-
</div>
|
data/lib/sufia.rb
CHANGED
|
@@ -7,13 +7,12 @@ require 'sufia/models'
|
|
|
7
7
|
|
|
8
8
|
require 'rails_autolink'
|
|
9
9
|
|
|
10
|
-
autoload :Zip, 'zipruby'
|
|
11
10
|
module Sufia
|
|
12
11
|
extend ActiveSupport::Autoload
|
|
13
12
|
|
|
14
13
|
class Engine < ::Rails::Engine
|
|
15
14
|
engine_name 'sufia'
|
|
16
|
-
|
|
15
|
+
|
|
17
16
|
config.autoload_paths += %W(
|
|
18
17
|
#{config.root}/app/controllers/concerns
|
|
19
18
|
#{config.root}/app/models/concerns
|
|
@@ -28,4 +27,3 @@ module Sufia
|
|
|
28
27
|
autoload :BatchEditsControllerBehavior
|
|
29
28
|
autoload :DownloadsControllerBehavior
|
|
30
29
|
end
|
|
31
|
-
|
data/lib/sufia/controller.rb
CHANGED
|
@@ -6,18 +6,12 @@ module Sufia::Controller
|
|
|
6
6
|
include Hydra::Controller::ControllerBehavior
|
|
7
7
|
|
|
8
8
|
before_filter :notifications_number
|
|
9
|
-
helper_method :groups
|
|
10
|
-
|
|
11
9
|
end
|
|
12
10
|
|
|
13
11
|
def current_ability
|
|
14
12
|
user_signed_in? ? current_user.ability : super
|
|
15
13
|
end
|
|
16
14
|
|
|
17
|
-
def groups
|
|
18
|
-
@groups ||= user_signed_in? ? current_user.groups : []
|
|
19
|
-
end
|
|
20
|
-
|
|
21
15
|
def render_404(exception)
|
|
22
16
|
logger.error("Rendering 404 page due to exception: #{exception.inspect} - #{exception.backtrace if exception.respond_to? :backtrace}")
|
|
23
17
|
render :template => '/error/404', :layout => "error", :formats => [:html], :status => 404
|