-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing hard coded asset paths, which do not work in production. Whi…
…le doing that upgrading to use existing partials and rails helpers for those links.
- Loading branch information
1 parent
5731333
commit 025a76a
Showing
3 changed files
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
<% if document.image? || document.pdf? || document.video? %> | ||
<% path = sufia.download_path(document.noid, {datastream_id: 'thumbnail'}) %> | ||
<% elsif document.audio? %> | ||
<% path = "/assets/audio.png" %> | ||
<% path = "audio.png" %> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
carolyncole
Author
Contributor
|
||
<% else %> | ||
<% path = "/assets/default.png" %> | ||
<% path = "default.png" %> | ||
<% end %> | ||
<%= link_to image_tag(path, {width: width}), sufia.generic_file_path(document) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
<div class="tab-pane active" id="contributions"> | ||
<i class="icon-trophy trophy-on" ></i> <strong>Highlighted Files</strong> | ||
<% if @trophies.count > 0 %> | ||
<table> | ||
<% @trophies.each do |t| %> | ||
<tr id="trophyrow_<%= Sufia::Noid.noidify(t.pid) %>"> | ||
<% if t.image? || t.pdf? %> | ||
<% temp_thumbnail_path = sufia.download_path(t) + "?datastream_id=thumbnail" %> | ||
<% temp_href = "<a href=\"" + sufia.download_path(t) + "\"> <img src=\"" + temp_thumbnail_path + "\" width=\"90\" alt=\"Download the full-sized image\"/></a>" %> | ||
<% else %> | ||
<% temp_href = "<a href=\"" + sufia.download_path(t) + "\"> <img src=\"/assets/default.png\" width=\"90\" alt=\"Download file\"/></a>" %> | ||
<% end %> | ||
<td> | ||
<%= temp_href.html_safe() %> | ||
</td> | ||
<td> | ||
<%= link_to display_title(t), sufia.generic_file_path(t) %> | ||
<% if current_user == @user %> | ||
<%= 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" } %> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
<% else %> | ||
<%= @user.name %> has no highlighted files. | ||
<% end %> | ||
</div> | ||
<div class="tab-pane active" id="contributions"> | ||
<i class="icon-trophy trophy-on"></i> <strong>Highlighted Files</strong> | ||
<% if @trophies.count > 0 %> | ||
<table> | ||
<% @trophies.each do |t| %> | ||
<tr id="trophyrow_<%= Sufia::Noid.noidify(t.pid) %>"> | ||
<td> | ||
<%= render partial: "dashboard/_index_partials/thumbnail_display", locals: {document: t, width: 90} %> | ||
</td> | ||
<td> | ||
<%= link_to display_title(t), sufia.generic_file_path(t) %> | ||
<%= 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"} if current_user == @user%> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
<% else %> | ||
<%= @user.name %> has no highlighted files. | ||
<% end %> | ||
</div> | ||
|
Would the
asset_path
helper work across environments? (In the meantime, glad this fix does the trick!) 👏