From 95798a2ebacc617c5883aa0473e474fdfe4f2f8c Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 4 May 2021 23:15:05 +0100 Subject: [PATCH] Standardised export views with base layout, Reduced included export styles Related to #2666 --- resources/sass/export-styles.scss | 24 +++++++-- resources/views/books/export.blade.php | 42 ++------------- resources/views/chapters/export.blade.php | 34 ++---------- resources/views/export-layout.blade.php | 15 ++++++ resources/views/pages/export.blade.php | 54 +++---------------- .../views/partials/export-styles.blade.php | 21 ++++++++ 6 files changed, 73 insertions(+), 117 deletions(-) create mode 100644 resources/views/export-layout.blade.php diff --git a/resources/sass/export-styles.scss b/resources/sass/export-styles.scss index 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 file diff --git a/resources/views/books/export.blade.php b/resources/views/books/export.blade.php index 1faa3880e..9cd5618a5 100644 --- a/resources/views/books/export.blade.php +++ b/resources/views/books/export.blade.php @@ -1,38 +1,8 @@ - - - - - {{ $book->name }} +@extends('export-layout') - @include('partials.export-styles', ['format' => $format]) - - - @yield('head') - @include('partials.export-custom-head') - - - -
+@section('title', $book->name) +@section('content')

{{$book->name}}

{{ $book->description }}

@@ -73,8 +43,4 @@ @endif @endforeach - -
- - - +@endsection \ No newline at end of file diff --git a/resources/views/chapters/export.blade.php b/resources/views/chapters/export.blade.php index 96d9d7700..18f056f27 100644 --- a/resources/views/chapters/export.blade.php +++ b/resources/views/chapters/export.blade.php @@ -1,30 +1,8 @@ - - - - - {{ $chapter->name }} +@extends('export-layout') - @include('partials.export-styles', ['format' => $format]) - - - @include('partials.export-custom-head') - - - -
+@section('title', $chapter->name) +@section('content')

{{$chapter->name}}

{{ $chapter->description }}

@@ -42,8 +20,4 @@

{{ $page->name }}

{!! $page->html !!} @endforeach - -
- - - +@endsection \ No newline at end of file diff --git a/resources/views/export-layout.blade.php b/resources/views/export-layout.blade.php new file mode 100644 index 000000000..f23b3cca5 --- /dev/null +++ b/resources/views/export-layout.blade.php @@ -0,0 +1,15 @@ + + + + + @yield('title') + + @include('partials.export-styles', ['format' => $format]) + @include('partials.export-custom-head') + + +
+ @yield('content') +
+ + \ No newline at end of file diff --git a/resources/views/pages/export.blade.php b/resources/views/pages/export.blade.php index 1f2e60576..74d17c128 100644 --- a/resources/views/pages/export.blade.php +++ b/resources/views/pages/export.blade.php @@ -1,51 +1,13 @@ - - - - - {{ $page->name }} +@extends('export-layout') - @include('partials.export-styles', ['format' => $format]) +@section('title', $page->name) - @if($format === 'pdf') - - @endif - - @include('partials.export-custom-head') - - - -
-
- - @include('pages.page-display') - -
- -
- @include('partials.entity-export-meta', ['entity' => $page]) -
+
+
+ @include('partials.entity-export-meta', ['entity' => $page])
-
- - - +@endsection \ No newline at end of file diff --git a/resources/views/partials/export-styles.blade.php b/resources/views/partials/export-styles.blade.php index 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')