Merge pull request #430 from mlorb/ml_sci_826

Display smart annotations in reports [SCi-826]
This commit is contained in:
mlorb 2017-01-20 13:49:40 +01:00 committed by GitHub
commit 2d073c8c04
9 changed files with 38 additions and 18 deletions

View file

@ -854,6 +854,14 @@ a[data-toggle="tooltip"] {
.dataTables_paginate {
float: right;
.pagination {
margin: 2px 0;
}
}
.dataTables_info {
padding-top: 8px;
}
}

View file

@ -1,4 +1,7 @@
class StepsController < ApplicationController
include ActionView::Helpers::TextHelper
include ApplicationHelper
before_action :load_vars, only: [:edit, :update, :destroy, :show]
before_action :load_vars_nested, only: [:new, :create]
before_action :load_paperclip_vars
@ -286,7 +289,7 @@ class StepsController < ApplicationController
message = t(
str,
user: current_user.full_name,
checkbox: chkItem.text,
checkbox: smart_annotation_parser(simple_format(chkItem.text)),
step: chkItem.checklist.step.position + 1,
step_name: chkItem.checklist.step.name,
completed: completed_items,

View file

@ -27,9 +27,10 @@
<div class="row">
<div class="col-xs-12">
<% if experiment.description.present? %>
<%= auto_link(simple_format(experiment.description),
<%= auto_link(smart_annotation_parser(simple_format(experiment.description)),
link: :urls,
html: { target: '_blank' }) %>
sanitize: false,
html: { target: '_blank' }).html_safe %>
<% else %>
<em><%=t "projects.reports.elements.experiment.no_description" %></em>
<% end %>

View file

@ -31,9 +31,10 @@
</span>
<span class="comment-message">
&nbsp;
<%= auto_link(simple_format(comment.message),
link: :urls,
html: { target: '_blank' }) %>
<%= auto_link(smart_annotation_parser(simple_format(comment.message)),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
</span>
</li>
<% end %>

View file

@ -23,8 +23,9 @@
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 text-container ql-editor">
<%= auto_link(result_text.text,
<%= auto_link(smart_annotation_parser(result_text.text),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
</div>
</div>

View file

@ -8,7 +8,10 @@
<span class="glyphicon glyphicon-list"></span>
</div>
<div class="pull-left checklist-name">
<em><%=t 'projects.reports.elements.step_checklist.checklist_name', name: checklist.name %></em>
<%= auto_link(smart_annotation_parser(simple_format(t 'projects.reports.elements.step_checklist.checklist_name', name: checklist.name)),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
</div>
<div class="pull-left user-time">
<%=t 'projects.reports.elements.step_checklist.user_time', timestamp: l(timestamp, format: :full) %>
@ -24,10 +27,10 @@
<li>
<input type="checkbox" disabled="disabled" <%= "checked='checked'" if item.checked %>/>
<span class="<%= 'checked' if item.checked %>">
<%= auto_link(simple_format(item.text),
link: :urls,
html: { target: '_blank' }) %></span>
<%= auto_link(smart_annotation_parser(simple_format(item.text)),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %></span>
</li>
<% end %>
</ul>

View file

@ -31,9 +31,10 @@
</span>
<span class="comment-message">
&nbsp;
<%= auto_link(simple_format(comment.message),
link: :urls,
html: { target: '_blank' }) %>
<%= auto_link(smart_annotation_parser(simple_format(comment.message)),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
</span>
</li>
<% end %>

View file

@ -27,9 +27,10 @@
<div class="row">
<div class="col-xs-12 ql-editor">
<% if strip_tags(step.description).present? %>
<%= auto_link(step.description,
link: :urls,
html: { target: '_blank' }).html_safe %>
<%= auto_link(smart_annotation_parser(step.description),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
<% else %>
<em><%=t "projects.reports.elements.step.no_description" %></em>
<% end %>

View file

@ -1,5 +1,6 @@
<div class="ql-editor">
<%= auto_link(smart_annotation_parser(result.result_text.text),
link: :urls,
sanitize: false,
html: { target: '_blank' }).html_safe %>
</div>