2015-07-12 20:31:15 +00:00
|
|
|
@extends('base')
|
|
|
|
|
2015-07-21 21:11:30 +00:00
|
|
|
@section('sidebar')
|
|
|
|
<div class="page-nav">
|
|
|
|
<h4>Navigation</h4>
|
|
|
|
<ul class="page-nav-list"></ul>
|
|
|
|
</div>
|
|
|
|
<div class="page-actions">
|
|
|
|
<h4>Actions</h4>
|
|
|
|
<div class="list">
|
|
|
|
<a href="{{$page->getUrl() . '/edit'}}" class="muted"><i class="fa fa-pencil"></i>Edit this page</a>
|
|
|
|
<a href="{{$page->getUrl() . '/create'}}" class="muted"><i class="fa fa-file-o"></i>Create Sub-page</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@stop
|
|
|
|
|
2015-07-12 20:31:15 +00:00
|
|
|
@section('content')
|
|
|
|
|
2015-07-15 21:55:49 +00:00
|
|
|
<div class="row">
|
2015-07-21 21:11:30 +00:00
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="breadcrumbs padded-horizontal">
|
2015-07-20 21:05:26 +00:00
|
|
|
<a href="{{$book->getUrl()}}"><i class="fa fa-book"></i>{{ $book->name }}</a>
|
|
|
|
@if($breadCrumbs)
|
|
|
|
@foreach($breadCrumbs as $parentPage)
|
|
|
|
<span class="sep">></span>
|
|
|
|
<a href="{{$parentPage->getUrl()}}">{{ $parentPage->name }}</a>
|
|
|
|
@endforeach
|
|
|
|
@endif
|
|
|
|
</div>
|
2015-07-15 21:55:49 +00:00
|
|
|
</div>
|
2015-07-12 20:31:15 +00:00
|
|
|
</div>
|
2015-07-15 21:55:49 +00:00
|
|
|
|
2015-07-21 21:11:30 +00:00
|
|
|
<div class="page-content">
|
|
|
|
<h1>{{$page->name}}</h1>
|
|
|
|
@if(count($page->children) > 0)
|
|
|
|
<h4 class="text-muted">Sub-pages</h4>
|
|
|
|
<div class="page-list">
|
|
|
|
@foreach($page->children as $childPage)
|
|
|
|
<a href="{{ $childPage->getUrl() }}">{{ $childPage->name }}</a>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
{!! $page->html !!}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2015-07-15 21:55:49 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
// Set up document navigation
|
|
|
|
var pageNav = $('.page-nav-list');
|
|
|
|
var pageContent = $('.page-content');
|
|
|
|
var headers = pageContent.find('h1, h2, h3, h4, h5, h6');
|
|
|
|
headers.each(function() {
|
|
|
|
var header = $(this);
|
|
|
|
var tag = header.prop('tagName');
|
|
|
|
var listElem = $('<li></li>').addClass('nav-'+tag);
|
|
|
|
var link = $('<a></a>').text(header.text().trim()).attr('href', '#');
|
|
|
|
listElem.append(link);
|
|
|
|
pageNav.append(listElem);
|
|
|
|
link.click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
header.smoothScrollTo();
|
|
|
|
})
|
|
|
|
});
|
2015-07-16 18:15:22 +00:00
|
|
|
|
|
|
|
// Set up link hooks
|
|
|
|
var pageId = {{$page->id}};
|
|
|
|
headers.each(function() {
|
|
|
|
var text = $(this).text().trim();
|
|
|
|
var link = '/link/' + pageId + '#' + encodeURIComponent(text);
|
|
|
|
var linkHook = $('<a class="link-hook"><i class="fa fa-link"></i></a>')
|
|
|
|
.attr({"data-content": link, href: link, target: '_blank'});
|
|
|
|
linkHook.click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
goToText(text);
|
|
|
|
});
|
|
|
|
$(this).append(linkHook);
|
|
|
|
});
|
|
|
|
|
|
|
|
function goToText(text) {
|
|
|
|
$('.page-content').find(':contains("'+text+'")').smoothScrollTo();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(window.location.hash) {
|
|
|
|
var text = window.location.hash.replace(/\%20/g, ' ').substr(1);
|
|
|
|
goToText(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
//$('[data-toggle="popover"]').popover()
|
2015-07-15 21:55:49 +00:00
|
|
|
});
|
|
|
|
</script>
|
2015-07-12 20:31:15 +00:00
|
|
|
@stop
|