-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganised and split out export templates & styles
Moved export templates elements into their own folder for better grouping of logical usage. Within the base export template, added some body classes to allow easier targeted customisation via custom head css. Split content of export templates into smaller partials for easier future customization. Closes #3443
- Loading branch information
1 parent
e00d88f
commit 8801244
Showing
17 changed files
with
152 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@extends('layouts.export') | ||
|
||
@section('title', $book->name) | ||
|
||
@section('content') | ||
|
||
<h1 style="font-size: 4.8em">{{$book->name}}</h1> | ||
<p>{{ $book->description }}</p> | ||
|
||
@include('exports.parts.book-contents-menu', ['children' => $bookChildren]) | ||
|
||
@foreach($bookChildren as $bookChild) | ||
@if($bookChild->isA('chapter')) | ||
@include('exports.parts.chapter-item', ['chapter' => $bookChild]) | ||
@else | ||
@include('exports.parts.page-item', ['page' => $bookChild, 'chapter' => null]) | ||
@endif | ||
@endforeach | ||
|
||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@extends('layouts.export') | ||
|
||
@section('title', $chapter->name) | ||
|
||
@section('content') | ||
|
||
<h1 style="font-size: 4.8em">{{$chapter->name}}</h1> | ||
<p>{{ $chapter->description }}</p> | ||
|
||
@include('exports.parts.chapter-contents-menu', ['pages' => $pages]) | ||
|
||
@foreach($pages as $page) | ||
@include('exports.parts.page-item', ['page' => $page, 'chapter' => null]) | ||
@endforeach | ||
|
||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
resources/views/exports/parts/book-contents-menu.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@if(count($children) > 0) | ||
<ul class="contents"> | ||
@foreach($children as $bookChild) | ||
<li><a href="#{{$bookChild->getType()}}-{{$bookChild->id}}">{{ $bookChild->name }}</a></li> | ||
@if($bookChild->isA('chapter') && count($bookChild->visible_pages) > 0) | ||
@include('exports.parts.chapter-contents-menu', ['pages' => $bookChild->visible_pages]) | ||
@endif | ||
@endforeach | ||
</ul> | ||
@endif |
7 changes: 7 additions & 0 deletions
7
resources/views/exports/parts/chapter-contents-menu.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@if (count($pages) > 0) | ||
<ul class="contents"> | ||
@foreach($pages as $page) | ||
<li><a href="#page-{{$page->id}}">{{ $page->name }}</a></li> | ||
@endforeach | ||
</ul> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="page-break"></div> | ||
<h1 id="chapter-{{$chapter->id}}">{{ $chapter->name }}</h1> | ||
|
||
<p>{{ $chapter->description }}</p> | ||
|
||
@if(count($chapter->visible_pages) > 0) | ||
@foreach($chapter->visible_pages as $page) | ||
@include('exports.parts.page-item', ['page' => $page, 'chapter' => $chapter]) | ||
@endforeach | ||
@endif |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="page-break"></div> | ||
|
||
@if (isset($chapter)) | ||
<div class="chapter-hint">{{$chapter->name}}</div> | ||
@endif | ||
|
||
<h1 id="page-{{$page->id}}">{{ $page->name }}</h1> | ||
{!! $page->html !!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{-- Fetch in our standard export styles --}} | ||
<style> | ||
@if (!app()->runningUnitTests()) | ||
{!! file_get_contents(public_path('/dist/export-styles.css')) !!} | ||
@endif | ||
</style> | ||
|
||
{{-- Apply any additional styles that can't be applied via our standard SCSS export styles --}} | ||
@if ($format === 'pdf') | ||
<style> | ||
/* Patches for CSS variable colors within PDF exports */ | ||
a { | ||
color: {{ setting('app-color') }}; | ||
} | ||
blockquote { | ||
border-left-color: {{ setting('app-color') }}; | ||
} | ||
</style> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters