mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Merge pull request #1391 from okriuchykhin/ok_SCI_2880
Fix smart annotations rendering issues [SCI-2880]
This commit is contained in:
commit
20e2cbf0ca
|
@ -127,7 +127,7 @@ class MyModuleCommentsController < ApplicationController
|
|||
module: @my_module.name
|
||||
)
|
||||
)
|
||||
message = custom_auto_link(@comment.message)
|
||||
message = custom_auto_link(@comment.message, team: current_team)
|
||||
render json: { comment: message }, status: :ok
|
||||
else
|
||||
render json: { errors: @comment.errors.to_hash(true) },
|
||||
|
|
|
@ -120,7 +120,7 @@ class ProjectCommentsController < ApplicationController
|
|||
project: @project.name
|
||||
)
|
||||
)
|
||||
message = custom_auto_link(@comment.message)
|
||||
message = custom_auto_link(@comment.message, team: current_team)
|
||||
render json: { comment: message }, status: :ok
|
||||
else
|
||||
render json: { errors: @comment.errors.to_hash(true) },
|
||||
|
|
|
@ -124,7 +124,7 @@ class ResultCommentsController < ApplicationController
|
|||
result: @result.name
|
||||
)
|
||||
)
|
||||
message = custom_auto_link(@comment.message)
|
||||
message = custom_auto_link(@comment.message, team: current_team)
|
||||
render json: { comment: message }, status: :ok
|
||||
else
|
||||
render json: { errors: @comment.errors.to_hash(true) },
|
||||
|
|
|
@ -124,7 +124,7 @@ class StepCommentsController < ApplicationController
|
|||
step_name: @step.name
|
||||
)
|
||||
)
|
||||
message = custom_auto_link(@comment.message)
|
||||
message = custom_auto_link(@comment.message, team: current_team)
|
||||
render json: { comment: message }, status: :ok
|
||||
else
|
||||
render json: { errors: @comment.errors.to_hash(true) },
|
||||
|
|
|
@ -166,18 +166,20 @@ module ApplicationHelper
|
|||
|
||||
user_name = user.full_name
|
||||
|
||||
unless skip_user_status || user_still_in_team
|
||||
user_name << " #{I18n.t('atwho.res.removed')}"
|
||||
end
|
||||
|
||||
raw("<img src='#{user_avatar_absolute_url(user, :icon_small)}'" \
|
||||
html =
|
||||
raw("<img src='#{user_avatar_absolute_url(user, :icon_small)}'" \
|
||||
"alt='avatar' class='atwho-user-img-popover'" \
|
||||
" ref='#{'missing-img' if missing_avatar(user, :icon_small)}'>") +
|
||||
raw('<a onClick="$(this).popover(\'show\')" ' \
|
||||
'class="atwho-user-popover" data-container="body" ' \
|
||||
'data-html="true" tabindex="0" data-trigger="focus" ' \
|
||||
'data-placement="top" data-toggle="popover" data-content="') +
|
||||
'class="atwho-user-popover" data-container="body" ' \
|
||||
'data-html="true" tabindex="0" data-trigger="focus" ' \
|
||||
'data-placement="top" data-toggle="popover" data-content="') +
|
||||
raw(user_description) + raw('" >') + user_name + raw('</a>')
|
||||
|
||||
unless skip_user_status || user_still_in_team
|
||||
html << " #{I18n.t('atwho.res.removed')}"
|
||||
end
|
||||
html
|
||||
end
|
||||
|
||||
# Dirty, dirty hack for displaying images in reports
|
||||
|
|
|
@ -48,9 +48,7 @@
|
|||
|
||||
<div id="results" data-module-id="<%= @my_module.id %>">
|
||||
<% ordered_result_of(@my_module).each do |result| %>
|
||||
<% cache [current_user, result] do %>
|
||||
<%= render partial: "result", locals: { result: result } %>
|
||||
<% end %>
|
||||
<%= render partial: "result", locals: { result: result } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
|
||||
<div id="steps">
|
||||
<% @protocol.steps.order(:position).each do |step| %>
|
||||
<% cache [current_user, step] do %>
|
||||
<%= render partial: "steps/step.html.erb", locals: { step: step } %>
|
||||
<% end %>
|
||||
<%= render partial: "steps/step.html.erb", locals: { step: step } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @protocol.steps.count == 0 %>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<% if experiment.description.present? %>
|
||||
<%= custom_auto_link(experiment.description) %>
|
||||
<%= custom_auto_link(experiment.description, team: current_team) %>
|
||||
<% else %>
|
||||
<em><%=t "projects.reports.elements.experiment.no_description" %></em>
|
||||
<% end %>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<% if my_module.description.present? %>
|
||||
<%= custom_auto_link(my_module.description) %>
|
||||
<%= custom_auto_link(my_module.description, team: current_team) %>
|
||||
<% else %>
|
||||
<em><%=t "projects.reports.elements.module.no_description" %></em>
|
||||
<% end %>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 text-container ql-editor">
|
||||
<%= custom_auto_link(generate_image_tag_from_token(result_text.text, result_text, true),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img)) %>
|
||||
</div>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
<div class="col-xs-12 ql-editor">
|
||||
<% if strip_tags(step.description).present? %>
|
||||
<%= custom_auto_link(generate_image_tag_from_token(step.description, step, true),
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
tags: %w(img)) %>
|
||||
<% else %>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</span>
|
||||
<span class="comment-message">
|
||||
|
||||
<%= custom_auto_link(comment.message) %>
|
||||
<%= custom_auto_link(comment.message, team: current_team) %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<span class="fas fa-tasks"></span>
|
||||
</div>
|
||||
<div class="pull-left checklist-name">
|
||||
<%= custom_auto_link(t('projects.reports.elements.step_checklist.checklist_name', name: checklist.name)) %>
|
||||
<%= custom_auto_link(t('projects.reports.elements.step_checklist.checklist_name', name: checklist.name), team: current_team) %>
|
||||
</div>
|
||||
<div class="pull-left user-time">
|
||||
<%=t 'projects.reports.elements.step_checklist.user_time', timestamp: l(timestamp, format: :full) %>
|
||||
|
@ -25,6 +25,7 @@
|
|||
<input type="checkbox" disabled="disabled" <%= "checked='checked'" if item.checked %>/>
|
||||
<span class="<%= 'checked' if item.checked %>">
|
||||
<%= custom_auto_link(item.text,
|
||||
team: current_team,
|
||||
simple_format: true,
|
||||
wrapper_tag: { wrapper_tag: 'span'}) %>
|
||||
</span>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</span>
|
||||
<span class="comment-message">
|
||||
|
||||
<%= custom_auto_link(comment.message) %>
|
||||
<%= custom_auto_link(comment.message, team: current_team) %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue