mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
Merge pull request #5893 from ivanscinote/SCI-8925-show-paragraphs-checklist
Show paragraphs for checklist items in print protocol and pdf/docx [SCI-8925]
This commit is contained in:
commit
28fe2b8a60
5 changed files with 46 additions and 16 deletions
|
@ -81,11 +81,18 @@ hr {
|
|||
}
|
||||
|
||||
.print-checklist-item {
|
||||
display: flex;
|
||||
margin-bottom: 1em;
|
||||
|
||||
span {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
div {
|
||||
margin-bottom: .7em;
|
||||
margin-left: .7em;
|
||||
white-space: pre-line;
|
||||
}
|
||||
}
|
||||
|
||||
.checklist-checkbox {
|
||||
|
|
|
@ -535,6 +535,23 @@ label {
|
|||
padding-top: 0;
|
||||
}
|
||||
|
||||
.report-checklist-item {
|
||||
-webkit-box-pack: start; // for wkhtmltopdf compatibility
|
||||
display: -webkit-box; // for wkhtmltopdf compatibility
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
margin-top: .5em;
|
||||
|
||||
div:nth-child(2) {
|
||||
margin-top: .2em;
|
||||
}
|
||||
|
||||
> div {
|
||||
margin-left: .7em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover > .report-element-header .checklist-name {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,16 @@ module Reports::Docx::DrawStepChecklist
|
|||
@docx.ul do
|
||||
items.each do |item|
|
||||
li do
|
||||
text SmartAnnotations::TagToText.new(user, team, item.text).text
|
||||
lines = SmartAnnotations::TagToText.new(user, team, item.text).text.split("\n")
|
||||
|
||||
lines.each_with_index do |line, index|
|
||||
# Add the text line
|
||||
text line
|
||||
|
||||
# If this isn't the last line in the array, start a new paragraph for the next line
|
||||
br if index < lines.length - 1
|
||||
end
|
||||
|
||||
text " (#{I18n.t('projects.reports.elements.step_checklist.checked')})", color: '2dbe61' if item.checked
|
||||
end
|
||||
end
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
<% else %>
|
||||
<span class="checklist-checkbox not-checked"></span>
|
||||
<% end %>
|
||||
<%= smart_annotation_parser(checklist_item.text, current_team).html_safe %>
|
||||
</span>
|
||||
<div><%= smart_annotation_parser(checklist_item.text, current_team).html_safe %></div> <%# Should stay in one line %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -14,20 +14,17 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="report-element-body">
|
||||
<ul class="no-style">
|
||||
<% items.each do |item| %>
|
||||
<li>
|
||||
<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'},
|
||||
base64_encoded_imgs: export_all) %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% items.each do |item| %>
|
||||
<div class="report-checklist-item">
|
||||
<div><input type="checkbox" disabled="disabled" <%= "checked='checked'" if item.checked %>/></div>
|
||||
<div class="report-checklist-item-text"><%= custom_auto_link(item.text, # Must be on one line
|
||||
team: current_team,
|
||||
simple_format: false,
|
||||
wrapper_tag: { wrapper_tag: 'span'},
|
||||
base64_encoded_imgs: export_all) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if defined?(children) %>
|
||||
<div class="report-element-children">
|
||||
|
|
Loading…
Reference in a new issue