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

View file

@ -42,20 +42,24 @@ div.print-report {
.report-project-header-element { .report-project-header-element {
& > .report-element-body .project-name { & > .report-element-body .project-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
&:hover > .report-element-body .project-name { &:hover > .report-element-body .project-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
} }
.report-module-element:hover { .report-module-element:hover {
& > .report-element-body .module-name { & > .report-element-body .module-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
&:hover > .report-element-body .module-name { &:hover > .report-element-body .module-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
} }
@ -72,10 +76,12 @@ div.print-report {
.report-step-element { .report-step-element {
& > .report-element-body .step-name { & > .report-element-body .step-name {
color: $color-black; color: $color-black;
width: 100%;
} }
&:hover > .report-element-body .step-name { &:hover > .report-element-body .step-name {
color: $color-black; color: $color-black;
width: 100%;
} }
} }
@ -92,30 +98,42 @@ div.print-report {
.report-step-table-element { .report-step-table-element {
& > .report-element-header .table-name { & > .report-element-header .table-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
&:hover > .report-element-header .table-name { &:hover > .report-element-header .table-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
} }
.report-step-asset-element { .report-step-asset-element {
& > .report-element-header .file-name { & > .report-element-header .file-name {
color: $color-black; em {
color: $color-black;
white-space: nowrap;
}
} }
&:hover > .report-element-header .file-name { &:hover > .report-element-header .file-name {
color: $color-black; em {
color: $color-black;
white-space: nowrap;
}
} }
} }
.report-step-checklist-element { .report-step-checklist-element {
page-break-inside: avoid;
& > .report-element-header .checklist-name { & > .report-element-header .checklist-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
&:hover > .report-element-header .checklist-name { &:hover > .report-element-header .checklist-name {
color: $color-black; color: $color-black;
white-space: nowrap;
} }
} }
@ -123,12 +141,14 @@ div.print-report {
& > .report-element-header { & > .report-element-header {
.comments-icon,.comments-name { .comments-icon,.comments-name {
color: $color-black !important; color: $color-black !important;
white-space: nowrap;
} }
} }
&:hover > .report-element-header { &:hover > .report-element-header {
.comments-icon,.comments-name { .comments-icon,.comments-name {
color: $color-black !important; color: $color-black !important;
white-space: nowrap;
} }
} }
} }
@ -151,12 +171,14 @@ div.print-report {
& > .report-element-header { & > .report-element-header {
.activity-icon,.activity-name { .activity-icon,.activity-name {
color: $color-black !important; color: $color-black !important;
white-space: nowrap;
} }
} }
&:hover > .report-element-header { &:hover > .report-element-header {
.activity-icon,.activity-name { .activity-icon,.activity-name {
color: $color-black !important; color: $color-black !important;
white-space: nowrap;
} }
} }
} }
@ -165,12 +187,34 @@ div.print-report {
& > .report-element-header { & > .report-element-header {
.repository-icon,.repository-name { .repository-icon,.repository-name {
color: $color-black !important; color: $color-black !important;
white-space: nowrap;
} }
} }
&:hover > .report-element-header { &:hover > .report-element-header {
.repository-icon,.repository-name { .repository-icon,.repository-name {
color: $color-black !important; 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') media: 'all')
end end
def font_awesome_cdn_link_tag def font_awesome_report_pack_tag
stylesheet_link_tag( if running_in_development?
'https://maxcdn.bootstrapcdn.com/font-awesome' \ options = { media: 'all' }
'/4.6.3/css/font-awesome.min.css' wds = Webpacker.dev_server
) options[:host] = "#{wds.host}:#{wds.port}"
stylesheet_pack_tag('fontawesome', options)
else
wicked_pdf_stylesheet_pack_tag 'fontawesome'
end
end end
def assigned_repository_or_snapshot(my_module, element_id, snapshot, repository) def assigned_repository_or_snapshot(my_module, element_id, snapshot, repository)

View file

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

View file

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

View file

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

View file

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