NOW MANAGED ON CODEBERG
Standardised export views with base layout, Reduced included export styles
Dan Brown95798a2ebacc
diff --git a/resources/sass/export-styles.scss b/resources/sass/export-styles.scssindex 278e5b6c5..b8682ed05 100644--- a/resources/sass/export-styles.scss+++ b/resources/sass/export-styles.scss@@ -1,16 +1,13 @@@import "variables";@import "mixins";-@import "spacing";@import "html";@import "text";@import "layout";@import "blocks";@import "tables";-@import "header";@import "lists";@import "pages";-html, body {background-color: #FFF;}@@ -40,4 +37,25 @@ pre:after {}pre code {white-space: pre-wrap;+}++.page-break {+ page-break-after: always;+}+@media screen {+ .page-break {+ border-top: 1px solid #DDD;+ }+}++ul.contents ul li {+ list-style: circle;+}++.chapter-hint {+ color: #888;+ margin-top: 32px;+}+.chapter-hint + h1 {+ margin-top: 0;}\ No newline at end of filediff --git a/resources/views/books/export.blade.php b/resources/views/books/export.blade.phpindex 1faa3880e..9cd5618a5 100644--- a/resources/views/books/export.blade.php+++ b/resources/views/books/export.blade.php@@ -1,38 +1,8 @@-<!doctype html>-<html lang="{{ config('app.lang') }}">-<head>- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>- <title>{{ $book->name }}</title>+@extends('export-layout')- @include('partials.export-styles', ['format' => $format])-- <style>- .page-break {- page-break-after: always;- }- .chapter-hint {- color: #888;- margin-top: 32px;- }- .chapter-hint + h1 {- margin-top: 0;- }- ul.contents ul li {- list-style: circle;- }- @media screen {- .page-break {- border-top: 1px solid #DDD;- }- }- </style>- @yield('head')- @include('partials.export-custom-head')-</head>-<body>--<div class="page-content">+@section('title', $book->name)+@section('content')<h1 style="font-size: 4.8em">{{$book->name}}</h1><p>{{ $book->description }}</p>@@ -73,8 +43,4 @@@endif@endforeach--</div>--</body>-</html>+@endsection\ No newline at end of filediff --git a/resources/views/chapters/export.blade.php b/resources/views/chapters/export.blade.phpindex 96d9d7700..18f056f27 100644--- a/resources/views/chapters/export.blade.php+++ b/resources/views/chapters/export.blade.php@@ -1,30 +1,8 @@-<!doctype html>-<html lang="{{ config('app.lang') }}">-<head>- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>- <title>{{ $chapter->name }}</title>+@extends('export-layout')- @include('partials.export-styles', ['format' => $format])-- <style>- .page-break {- page-break-after: always;- }- ul.contents ul li {- list-style: circle;- }- @media screen {- .page-break {- border-top: 1px solid #DDD;- }- }- </style>- @include('partials.export-custom-head')-</head>-<body>--<div class="page-content">+@section('title', $chapter->name)+@section('content')<h1 style="font-size: 4.8em">{{$chapter->name}}</h1><p>{{ $chapter->description }}</p>@@ -42,8 +20,4 @@<h1 id="page-{{$page->id}}">{{ $page->name }}</h1>{!! $page->html !!}@endforeach--</div>--</body>-</html>+@endsection\ No newline at end of filediff --git a/resources/views/export-layout.blade.php b/resources/views/export-layout.blade.phpnew file mode 100644index 000000000..f23b3cca5--- /dev/null+++ b/resources/views/export-layout.blade.php@@ -0,0 +1,15 @@+<!doctype html>+<html lang="{{ config('app.lang') }}">+<head>+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>+ <title>@yield('title')</title>++ @include('partials.export-styles', ['format' => $format])+ @include('partials.export-custom-head')+</head>+<body>+<div class="page-content">+ @yield('content')+</div>+</body>+</html>\ No newline at end of filediff --git a/resources/views/pages/export.blade.php b/resources/views/pages/export.blade.phpindex 1f2e60576..74d17c128 100644--- a/resources/views/pages/export.blade.php+++ b/resources/views/pages/export.blade.php@@ -1,51 +1,13 @@-<!doctype html>-<html lang="{{ config('app.lang') }}">-<head>- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>- <title>{{ $page->name }}</title>+@extends('export-layout')- @include('partials.export-styles', ['format' => $format])+@section('title', $page->name)- @if($format === 'pdf')- <style>- body {- font-size: 14px;- line-height: 1.2;- }+@section('content')+ @include('pages.page-display')- h1, h2, h3, h4, h5, h6 {- line-height: 1.2;- }-- table {- max-width: 800px !important;- font-size: 0.8em;- width: 100% !important;- }-- table td {- width: auto !important;- }- </style>- @endif-- @include('partials.export-custom-head')-</head>-<body>--<div id="page-show">- <div class="page-content">-- @include('pages.page-display')-- <hr>-- <div class="text-muted text-small">- @include('partials.entity-export-meta', ['entity' => $page])- </div>+ <hr>+ <div class="text-muted text-small">+ @include('partials.entity-export-meta', ['entity' => $page])</div>-</div>--</body>-</html>+@endsection\ No newline at end of filediff --git a/resources/views/partials/export-styles.blade.php b/resources/views/partials/export-styles.blade.phpindex 52bfda2a6..967dc19ec 100644--- a/resources/views/partials/export-styles.blade.php+++ b/resources/views/partials/export-styles.blade.php@@ -6,6 +6,27 @@@if ($format === 'pdf')<style>++ /* PDF size adjustments */+ body {+ font-size: 14px;+ line-height: 1.2;+ }++ h1, h2, h3, h4, h5, h6 {+ line-height: 1.2;+ }++ table {+ max-width: 800px !important;+ font-size: 0.8em;+ width: 100% !important;+ }++ table td {+ width: auto !important;+ }+/* Patches for CSS variable colors */a {color: {{ setting('app-color') }};