Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annotation tool infant diseases #606

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/medium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def subscribed_users
# if "inherit from lecture" was selected (i.e. if the annotations status of
# this medium is -1).
def get_annotations_status # rubocop:todo Naming/AccessorMethodName
return lecture.annotations_status if annotations_status == -1
return lecture.annotations_status if annotations_status == -1 && lecture.present?

annotations_status
end
Expand Down
27 changes: 15 additions & 12 deletions app/views/annotations/_form_content_further_help.html.erb
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>
3 changes: 2 additions & 1 deletion app/views/media/play.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@

<!--- ANNOTATION BUTTON -->
<% if user_signed_in? %>
<a id="annotation-button" class="btn" title="<%= t('admin.annotation.edit_annotation') %>">
<a id="annotation-button" class="btn"
title="<%= t('admin.annotation.annotation_modal_head_create_annotation') %>">
<i class="fas fa-sticky-note" aria-hidden="true"></i>
</a>
<% end %>
Expand Down