-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix annotation tool infant diseases (#606)
* Don't assume that `lecture` variable is present For example, when opening a worked example that is not attached to a particular lecture, it will be `nil`. In this case, we return the annotation status of the medium itself. * Don't show emergency link if `lecture` is not present * Fix wrong tooltip for annotation button
- Loading branch information
Showing
3 changed files
with
18 additions
and
14 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
27 changes: 15 additions & 12 deletions
27
app/views/annotations/_form_content_further_help.html.erb
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,16 +1,19 @@ | ||
<div id="emergency-link"> | ||
<% lecture = Medium.find_by_id(@medium_id).lecture %> | ||
<% status = lecture.emergency_link_status_for_database %> | ||
<% link = lecture.emergency_link %> | ||
<% if status == Lecture.emergency_link_statuses[:lecture_link] %> | ||
<% link_name = Lecture.find_by_id(link.tr("^[0-9]", "")).title %> | ||
<% elsif status == Lecture.emergency_link_statuses[:direct_link] %> | ||
<% link_name = link %> | ||
<% if lecture %> | ||
<% status = lecture.emergency_link_status_for_database %> | ||
<% link = lecture.emergency_link %> | ||
<% if status == Lecture.emergency_link_statuses[:lecture_link] %> | ||
<% link_name = Lecture.find_by_id(link.tr("^[0-9]", "")).title %> | ||
<% elsif status == Lecture.emergency_link_statuses[:direct_link] %> | ||
<% link_name = link %> | ||
<% end %> | ||
|
||
<% unless link_name.blank? %> | ||
<%= t('admin.annotation.further_help') %> <br> | ||
<a href="<%= link %>" target="_blank" rel="noopener noreferrer"> | ||
<%= link_name %> | ||
</a> | ||
<% end %> | ||
<% end %> | ||
<% unless link_name.blank? %> | ||
<%= t('admin.annotation.further_help') %> <br> | ||
<a href="<%= link %>" target="_blank" rel="noopener noreferrer"> | ||
<%= link_name %> | ||
</a> | ||
<% end %> | ||
</div> |
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