Skip to content

Commit 18e9d16

Browse files
committed
Add line breaks to event groups tables andadd printe styles
1 parent d2127ef commit 18e9d16

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

app/assets/stylesheets/application.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,3 +497,42 @@ nav.email-templates-menu li a:hover {
497497
input.grey {
498498
background-color: #c4220d;
499499
}
500+
501+
/* Printer styles */
502+
503+
@media print {
504+
header,
505+
input,
506+
footer,
507+
.top-menu {
508+
display: none;
509+
}
510+
511+
body {
512+
color: #000;
513+
background-color: #fff;
514+
}
515+
516+
.container {
517+
width: 100%;
518+
}
519+
520+
table {
521+
break-inside: avoid;
522+
}
523+
524+
h2 {
525+
page-break-inside: avoid;
526+
margin-top: 30px;
527+
}
528+
529+
/* Hacky solution to make avoidance of page break work ^^
530+
https://stackoverflow.com/a/53742871/9328428
531+
*/
532+
h2::after {
533+
content: "";
534+
display: block;
535+
height: 200px;
536+
margin-bottom: -200px;
537+
}
538+
}

app/views/admin/groups/index.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
<tbody>
1414
<tr>
1515
<td>
16-
<%= event_group.applications.map(&:name).join(", ") %>
16+
<%= event_group.applications.map(&:name).join("<br>").html_safe %>
1717
</td>
1818
<td>
1919
<% event_group.coach_applications.map do |application| %>
2020
<%= application.coach.name %>
21+
<br>
2122
<% end %>
2223
</td>
2324
</tr>

0 commit comments

Comments
 (0)