display smart annotations in reports - without rich text fields

This commit is contained in:
Mojca Lorber 2017-01-19 14:13:57 +01:00
parent 1793e2a8f4
commit 44de927cf4
6 changed files with 31 additions and 14 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

@ -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(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 %>