Improve pdf reports

This commit is contained in:
aignatov-bio 2020-07-13 14:29:59 +02:00
parent 6357cf86ba
commit a7fac38fcb
7 changed files with 61 additions and 11 deletions

View file

@ -68,6 +68,7 @@ label {
}
.report-common-table-format {
page-break-inside: avoid;
width: 100%;
tr {
@ -296,6 +297,7 @@ label {
border-radius: 4px;
padding: 2px 4px;
color: $color-white;
white-space: nowrap;
}
}
}

View file

@ -42,20 +42,24 @@ div.print-report {
.report-project-header-element {
& > .report-element-body .project-name {
color: $color-black;
white-space: nowrap;
}
&:hover > .report-element-body .project-name {
color: $color-black;
white-space: nowrap;
}
}
.report-module-element:hover {
& > .report-element-body .module-name {
color: $color-black;
white-space: nowrap;
}
&:hover > .report-element-body .module-name {
color: $color-black;
white-space: nowrap;
}
}
@ -72,10 +76,12 @@ div.print-report {
.report-step-element {
& > .report-element-body .step-name {
color: $color-black;
width: 100%;
}
&:hover > .report-element-body .step-name {
color: $color-black;
width: 100%;
}
}
@ -92,30 +98,42 @@ div.print-report {
.report-step-table-element {
& > .report-element-header .table-name {
color: $color-black;
white-space: nowrap;
}
&:hover > .report-element-header .table-name {
color: $color-black;
white-space: nowrap;
}
}
.report-step-asset-element {
& > .report-element-header .file-name {
color: $color-black;
em {
color: $color-black;
white-space: nowrap;
}
}
&:hover > .report-element-header .file-name {
color: $color-black;
em {
color: $color-black;
white-space: nowrap;
}
}
}
.report-step-checklist-element {
page-break-inside: avoid;
& > .report-element-header .checklist-name {
color: $color-black;
white-space: nowrap;
}
&:hover > .report-element-header .checklist-name {
color: $color-black;
white-space: nowrap;
}
}
@ -123,12 +141,14 @@ div.print-report {
& > .report-element-header {
.comments-icon,.comments-name {
color: $color-black !important;
white-space: nowrap;
}
}
&:hover > .report-element-header {
.comments-icon,.comments-name {
color: $color-black !important;
white-space: nowrap;
}
}
}
@ -151,12 +171,14 @@ div.print-report {
& > .report-element-header {
.activity-icon,.activity-name {
color: $color-black !important;
white-space: nowrap;
}
}
&:hover > .report-element-header {
.activity-icon,.activity-name {
color: $color-black !important;
white-space: nowrap;
}
}
}
@ -165,12 +187,34 @@ div.print-report {
& > .report-element-header {
.repository-icon,.repository-name {
color: $color-black !important;
white-space: nowrap;
}
}
&:hover > .report-element-header {
.repository-icon,.repository-name {
color: $color-black !important;
white-space: nowrap;
}
}
}
.report-result-element {
& > .report-element-header {
.result-icon,
.result-name,
.file-name{
color: $color-black !important;
white-space: nowrap;
}
}
&:hover > .report-element-header {
.result-icon,
.result-name,
.file-name {
color: $color-black !important;
white-space: nowrap;
}
}
}

View file

@ -115,11 +115,15 @@ module ReportsHelper
media: 'all')
end
def font_awesome_cdn_link_tag
stylesheet_link_tag(
'https://maxcdn.bootstrapcdn.com/font-awesome' \
'/4.6.3/css/font-awesome.min.css'
)
def font_awesome_report_pack_tag
if running_in_development?
options = { media: 'all' }
wds = Webpacker.dev_server
options[:host] = "#{wds.host}:#{wds.port}"
stylesheet_pack_tag('fontawesome', options)
else
wicked_pdf_stylesheet_pack_tag 'fontawesome'
end
end
def assigned_repository_or_snapshot(my_module, element_id, snapshot, repository)

View file

@ -17,7 +17,7 @@
<% else %>
<em><%=t 'projects.reports.elements.step_asset.file_name',
file: truncate(asset.file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></em>
length: Constants::FILENAME_TRUNCATION_LENGTH) -%></em>
<% end %>
</div>
<div class="pull-left user-time">

View file

@ -5,7 +5,7 @@
<%= wicked_pdf_stylesheet_link_tag "application" %>
<%= wicked_pdf_stylesheet_link_tag "reports_pdf" %>
<%= bootstrap_cdn_link_tag %>
<%= font_awesome_cdn_link_tag %>
<%= font_awesome_report_pack_tag %>
</head>
<body class="print-footer-body" style="height: 50px">
<div class="print-footer">

View file

@ -5,7 +5,7 @@
<%= wicked_pdf_stylesheet_link_tag "application" %>
<%= wicked_pdf_stylesheet_link_tag "reports_pdf" %>
<%= bootstrap_cdn_link_tag %>
<%= font_awesome_cdn_link_tag %>
<%= font_awesome_report_pack_tag %>
<script>
function number_pages() {

View file

@ -5,7 +5,7 @@
<%= wicked_pdf_stylesheet_link_tag "application" %>
<%= wicked_pdf_stylesheet_link_tag "reports_pdf" %>
<%= bootstrap_cdn_link_tag %>
<%= font_awesome_cdn_link_tag %>
<%= font_awesome_report_pack_tag %>
</head>
<body class="print-report-body">
<div class="print-report">