Showing
24 changed files
with
406 additions
and
107 deletions
| ... | @@ -107,13 +107,14 @@ class BookController extends Controller | ... | @@ -107,13 +107,14 @@ class BookController extends Controller |
| 107 | 'name' => 'required|string|max:255', | 107 | 'name' => 'required|string|max:255', |
| 108 | 'description' => 'string|max:1000' | 108 | 'description' => 'string|max:1000' |
| 109 | ]); | 109 | ]); |
| 110 | + $book->fill($request->all()); | ||
| 110 | $slug = Str::slug($book->name); | 111 | $slug = Str::slug($book->name); |
| 111 | while($this->bookRepo->countBySlug($slug) > 0 && $book->slug != $slug) { | 112 | while($this->bookRepo->countBySlug($slug) > 0 && $book->slug != $slug) { |
| 112 | $slug += '1'; | 113 | $slug += '1'; |
| 113 | } | 114 | } |
| 114 | $book->slug = $slug; | 115 | $book->slug = $slug; |
| 115 | $book->save(); | 116 | $book->save(); |
| 116 | - return redirect('/books'); | 117 | + return redirect($book->getUrl()); |
| 117 | } | 118 | } |
| 118 | 119 | ||
| 119 | /** | 120 | /** | ... | ... |
| ... | @@ -85,7 +85,8 @@ class PageController extends Controller | ... | @@ -85,7 +85,8 @@ class PageController extends Controller |
| 85 | */ | 85 | */ |
| 86 | public function show($bookSlug, $pageSlug) | 86 | public function show($bookSlug, $pageSlug) |
| 87 | { | 87 | { |
| 88 | - $page = $this->pageRepo->getBySlug($pageSlug); | 88 | + $book = $this->bookRepo->getBySlug($bookSlug); |
| 89 | + $page = $this->pageRepo->getBySlug($pageSlug, $book->id); | ||
| 89 | return view('pages/show', ['page' => $page]); | 90 | return view('pages/show', ['page' => $page]); |
| 90 | } | 91 | } |
| 91 | 92 | ||
| ... | @@ -98,7 +99,8 @@ class PageController extends Controller | ... | @@ -98,7 +99,8 @@ class PageController extends Controller |
| 98 | */ | 99 | */ |
| 99 | public function edit($bookSlug, $pageSlug) | 100 | public function edit($bookSlug, $pageSlug) |
| 100 | { | 101 | { |
| 101 | - $page = $this->pageRepo->getBySlug($pageSlug); | 102 | + $book = $this->bookRepo->getBySlug($bookSlug); |
| 103 | + $page = $this->pageRepo->getBySlug($pageSlug, $book->id); | ||
| 102 | return view('pages/edit', ['page' => $page]); | 104 | return view('pages/edit', ['page' => $page]); |
| 103 | } | 105 | } |
| 104 | 106 | ||
| ... | @@ -112,8 +114,8 @@ class PageController extends Controller | ... | @@ -112,8 +114,8 @@ class PageController extends Controller |
| 112 | */ | 114 | */ |
| 113 | public function update(Request $request, $bookSlug, $pageSlug) | 115 | public function update(Request $request, $bookSlug, $pageSlug) |
| 114 | { | 116 | { |
| 115 | - $page = $this->pageRepo->getBySlug($pageSlug); | ||
| 116 | $book = $this->bookRepo->getBySlug($bookSlug); | 117 | $book = $this->bookRepo->getBySlug($bookSlug); |
| 118 | + $page = $this->pageRepo->getBySlug($pageSlug, $book->id); | ||
| 117 | $page->fill($request->all()); | 119 | $page->fill($request->all()); |
| 118 | $slug = Str::slug($page->name); | 120 | $slug = Str::slug($page->name); |
| 119 | while($this->pageRepo->countBySlug($slug, $book->id) > 0 && $slug != $pageSlug) { | 121 | while($this->pageRepo->countBySlug($slug, $book->id) > 0 && $slug != $pageSlug) { | ... | ... |
| ... | @@ -27,9 +27,9 @@ class PageRepo | ... | @@ -27,9 +27,9 @@ class PageRepo |
| 27 | return $this->page->all(); | 27 | return $this->page->all(); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | - public function getBySlug($slug) | 30 | + public function getBySlug($slug, $bookId) |
| 31 | { | 31 | { |
| 32 | - return $this->page->where('slug', '=', $slug)->first(); | 32 | + return $this->page->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first(); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | public function newFromInput($input) | 35 | public function newFromInput($input) | ... | ... |
| 1 | var elixir = require('laravel-elixir'); | 1 | var elixir = require('laravel-elixir'); |
| 2 | +require('laravel-elixir-livereload'); | ||
| 2 | 3 | ||
| 3 | /* | 4 | /* |
| 4 | |-------------------------------------------------------------------------- | 5 | |-------------------------------------------------------------------------- |
| ... | @@ -12,5 +13,5 @@ var elixir = require('laravel-elixir'); | ... | @@ -12,5 +13,5 @@ var elixir = require('laravel-elixir'); |
| 12 | */ | 13 | */ |
| 13 | 14 | ||
| 14 | elixir(function(mix) { | 15 | elixir(function(mix) { |
| 15 | - mix.sass('styles.scss'); | 16 | + mix.sass('styles.scss').livereload(); |
| 16 | }); | 17 | }); | ... | ... |
| ... | @@ -32,7 +32,7 @@ $button-border-radius: 3px; | ... | @@ -32,7 +32,7 @@ $button-border-radius: 3px; |
| 32 | @include generate-button-colors(#EEE, $primary); | 32 | @include generate-button-colors(#EEE, $primary); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | -.button, button[type="button"], input[type="button"], input[type="submit"] { | 35 | +.button, input[type="button"], input[type="submit"] { |
| 36 | @extend .button-base; | 36 | @extend .button-base; |
| 37 | &.pos { | 37 | &.pos { |
| 38 | @include generate-button-colors(#EEE, $positive); | 38 | @include generate-button-colors(#EEE, $positive); | ... | ... |
| ... | @@ -45,3 +45,40 @@ input[type="text"], input[type="number"], input[type="email"], input[type="searc | ... | @@ -45,3 +45,40 @@ input[type="text"], input[type="number"], input[type="email"], input[type="searc |
| 45 | .form-group { | 45 | .form-group { |
| 46 | margin-bottom: $-s; | 46 | margin-bottom: $-s; |
| 47 | } | 47 | } |
| 48 | + | ||
| 49 | +.inline-input-style { | ||
| 50 | + border: 2px dotted #BBB; | ||
| 51 | + display: block; | ||
| 52 | + width: 100%; | ||
| 53 | + padding: $-xs $-s; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +.title-input label, .description-input label{ | ||
| 57 | + margin-top: $-m; | ||
| 58 | + color: #666; | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.title-input input[type="text"] { | ||
| 62 | + @extend h1; | ||
| 63 | + @extend .inline-input-style; | ||
| 64 | + margin-top: 0; | ||
| 65 | + color: #444; | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +.title-input.page-title { | ||
| 69 | + padding: $-s; | ||
| 70 | +} | ||
| 71 | +.title-input.page-title input[type="text"]{ | ||
| 72 | + //border: 2px dotted #BBB; | ||
| 73 | + margin-bottom: 0; | ||
| 74 | +} | ||
| 75 | +.edit-area { | ||
| 76 | + padding: 0 $-s $-s $-s; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +.description-input textarea { | ||
| 80 | + @extend .inline-input-style; | ||
| 81 | + font-size: $fs-m; | ||
| 82 | + color: #666; | ||
| 83 | + width: 100%; | ||
| 84 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /* | 1 | /* |
| 2 | -* Header Styles | 2 | + * Header Styles |
| 3 | -*/ | 3 | + */ |
| 4 | 4 | ||
| 5 | h1 { | 5 | h1 { |
| 6 | font-size: 3.625em; | 6 | font-size: 3.625em; |
| ... | @@ -23,11 +23,12 @@ h3 { | ... | @@ -23,11 +23,12 @@ h3 { |
| 23 | h4 { | 23 | h4 { |
| 24 | font-size: 1em; | 24 | font-size: 1em; |
| 25 | line-height: 1.375em; | 25 | line-height: 1.375em; |
| 26 | - margin-top: 1.375em; | 26 | + margin-top: 0.78571429em; |
| 27 | - margin-bottom: 1.375em; | 27 | + margin-bottom: 0.43137255em; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | h1, h2, h3, h4 { | 30 | h1, h2, h3, h4 { |
| 31 | + font-weight: 500; | ||
| 31 | .subheader { | 32 | .subheader { |
| 32 | display: block; | 33 | display: block; |
| 33 | font-size: 0.5em; | 34 | font-size: 0.5em; |
| ... | @@ -37,8 +38,8 @@ h1, h2, h3, h4 { | ... | @@ -37,8 +38,8 @@ h1, h2, h3, h4 { |
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | /* | 40 | /* |
| 40 | -* Link styling | 41 | + * Link styling |
| 41 | -*/ | 42 | + */ |
| 42 | a { | 43 | a { |
| 43 | color: $primary; | 44 | color: $primary; |
| 44 | cursor: pointer; | 45 | cursor: pointer; |
| ... | @@ -48,11 +49,14 @@ a { | ... | @@ -48,11 +49,14 @@ a { |
| 48 | text-decoration: underline; | 49 | text-decoration: underline; |
| 49 | color: darken($primary, 20%); | 50 | color: darken($primary, 20%); |
| 50 | } | 51 | } |
| 52 | + i { | ||
| 53 | + padding-right: $-s; | ||
| 54 | + } | ||
| 51 | } | 55 | } |
| 52 | 56 | ||
| 53 | /* | 57 | /* |
| 54 | -* Other HTML Text Elements | 58 | + * Other HTML Text Elements |
| 55 | -*/ | 59 | + */ |
| 56 | p, ul, ol, pre, table, blockquote { | 60 | p, ul, ol, pre, table, blockquote { |
| 57 | margin-top: 0.3em; | 61 | margin-top: 0.3em; |
| 58 | margin-bottom: 1.375em; | 62 | margin-bottom: 1.375em; |
| ... | @@ -136,8 +140,8 @@ span.code { | ... | @@ -136,8 +140,8 @@ span.code { |
| 136 | padding: 1px $-xs; | 140 | padding: 1px $-xs; |
| 137 | } | 141 | } |
| 138 | /* | 142 | /* |
| 139 | -* Text colors | 143 | + * Text colors |
| 140 | -*/ | 144 | + */ |
| 141 | p.pos, p .pos, span.pos, .text-pos { | 145 | p.pos, p .pos, span.pos, .text-pos { |
| 142 | color: $positive; | 146 | color: $positive; |
| 143 | } | 147 | } |
| ... | @@ -159,8 +163,8 @@ p.secondary, p .secondary, span.secondary, .text-secondary { | ... | @@ -159,8 +163,8 @@ p.secondary, p .secondary, span.secondary, .text-secondary { |
| 159 | } | 163 | } |
| 160 | 164 | ||
| 161 | /* | 165 | /* |
| 162 | -* Generic text styling classes | 166 | + * Generic text styling classes |
| 163 | -*/ | 167 | + */ |
| 164 | .underlined { | 168 | .underlined { |
| 165 | text-decoration: underline; | 169 | text-decoration: underline; |
| 166 | } | 170 | } |
| ... | @@ -176,3 +180,13 @@ p.secondary, p .secondary, span.secondary, .text-secondary { | ... | @@ -176,3 +180,13 @@ p.secondary, p .secondary, span.secondary, .text-secondary { |
| 176 | .text-right { | 180 | .text-right { |
| 177 | text-align: right; | 181 | text-align: right; |
| 178 | } | 182 | } |
| 183 | + | ||
| 184 | +/** | ||
| 185 | + * Grouping | ||
| 186 | + */ | ||
| 187 | +.header-group { | ||
| 188 | + margin: $-m 0; | ||
| 189 | + h1, h2, h3, h4, h5, h6 { | ||
| 190 | + margin: 0; | ||
| 191 | + } | ||
| 192 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
resources/assets/sass/_tinymce.scss
0 → 100644
| 1 | + | ||
| 2 | +//.mce-container { | ||
| 3 | +// .mce-menubar, .mce-toolbar-grp { | ||
| 4 | +// position: fixed; | ||
| 5 | +// width: 100%; | ||
| 6 | +// } | ||
| 7 | +// .mce-container-body { | ||
| 8 | +// position: relative; | ||
| 9 | +// overflow: hidden; | ||
| 10 | +// display: block; | ||
| 11 | +// } | ||
| 12 | +//} | ||
| 13 | + | ||
| 14 | +.mce-tinymce.mce-container.fullscreen { | ||
| 15 | + position: fixed; | ||
| 16 | + top: 0; | ||
| 17 | + height: 100%; | ||
| 18 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -7,6 +7,20 @@ | ... | @@ -7,6 +7,20 @@ |
| 7 | @import "blocks"; | 7 | @import "blocks"; |
| 8 | @import "buttons"; | 8 | @import "buttons"; |
| 9 | @import "forms"; | 9 | @import "forms"; |
| 10 | +@import "tinymce"; | ||
| 11 | + | ||
| 12 | +header { | ||
| 13 | + background-color: #f8f8f8; | ||
| 14 | + position: fixed; | ||
| 15 | + display: block; | ||
| 16 | + width: 100%; | ||
| 17 | + z-index: -1; | ||
| 18 | + top: 0; | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +body { | ||
| 22 | + margin-top: 64px; | ||
| 23 | +} | ||
| 10 | 24 | ||
| 11 | header hr { | 25 | header hr { |
| 12 | margin-top: 0; | 26 | margin-top: 0; |
| ... | @@ -27,6 +41,81 @@ header .menu { | ... | @@ -27,6 +41,81 @@ header .menu { |
| 27 | font-size: 1.4em; | 41 | font-size: 1.4em; |
| 28 | } | 42 | } |
| 29 | 43 | ||
| 44 | +.affix { | ||
| 45 | + position: fixed; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +.page-style { | ||
| 49 | + background-color: #FFF; | ||
| 50 | + padding: $-s $-xxl $-xxl $-xxl; | ||
| 51 | + border-radius: 4px; | ||
| 52 | + box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.15); | ||
| 53 | + margin-bottom: $-xxl; | ||
| 54 | + max-width: 100%; | ||
| 55 | +} | ||
| 56 | + | ||
| 57 | +.page-style.editor { | ||
| 58 | + padding: 0 !important; | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.page-content { | ||
| 62 | + @extend .page-style; | ||
| 63 | + min-height: 70vh; | ||
| 64 | + &.right { | ||
| 65 | + float: right; | ||
| 66 | + } | ||
| 67 | + &.left { | ||
| 68 | + float: left; | ||
| 69 | + } | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +.page-list { | ||
| 73 | + a { | ||
| 74 | + display: block; | ||
| 75 | + padding: $-s 0; | ||
| 76 | + border-bottom: 2px dotted #CCC; | ||
| 77 | + &:first-child { | ||
| 78 | + border-top: 2px dotted #CCC; | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +.page-menu { | ||
| 84 | + opacity: 0.6; | ||
| 85 | + transition: opacity ease-in-out 120ms; | ||
| 86 | + &:hover { | ||
| 87 | + opacity: 1; | ||
| 88 | + } | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +.page-nav-list { | ||
| 92 | + $nav-indent: $-s; | ||
| 93 | + li { | ||
| 94 | + //border-left: 1px solid rgba(0, 0, 0, 0.1); | ||
| 95 | + padding-left: $-xs; | ||
| 96 | + } | ||
| 97 | + .nav-H2 { | ||
| 98 | + margin-left: $nav-indent; | ||
| 99 | + font-size: 0.95em; | ||
| 100 | + } | ||
| 101 | + .nav-H3 { | ||
| 102 | + margin-left: $nav-indent*2; | ||
| 103 | + font-size: 0.90em | ||
| 104 | + } | ||
| 105 | + .nav-H4 { | ||
| 106 | + margin-left: $nav-indent*3; | ||
| 107 | + font-size: 0.85em | ||
| 108 | + } | ||
| 109 | + .nav-H5 { | ||
| 110 | + margin-left: $nav-indent*4; | ||
| 111 | + font-size: 0.80em | ||
| 112 | + } | ||
| 113 | + .nav-H6 { | ||
| 114 | + margin-left: $nav-indent*5; | ||
| 115 | + font-size: 0.75em | ||
| 116 | + } | ||
| 117 | +} | ||
| 118 | + | ||
| 30 | .overlay { | 119 | .overlay { |
| 31 | background-color: rgba(0, 0, 0, 0.2); | 120 | background-color: rgba(0, 0, 0, 0.2); |
| 32 | position: fixed; | 121 | position: fixed; | ... | ... |
| ... | @@ -7,18 +7,28 @@ | ... | @@ -7,18 +7,28 @@ |
| 7 | <link href='http://fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,300italic,100,300' rel='stylesheet' type='text/css'> | 7 | <link href='http://fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,300italic,100,300' rel='stylesheet' type='text/css'> |
| 8 | <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> | 8 | <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> |
| 9 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | 9 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |
| 10 | + <script src="/bower/bootstrap/dist/js/bootstrap.js"></script> | ||
| 11 | + <script> | ||
| 12 | + $.fn.smoothScrollTo = function() { | ||
| 13 | + $('body').animate({ | ||
| 14 | + scrollTop: this.offset().top - 60 // Adjust to change final scroll position top margin | ||
| 15 | + }, 800); // Adjust to change animations speed (ms) | ||
| 16 | + return this; | ||
| 17 | + }; | ||
| 18 | + </script> | ||
| 10 | @yield('head') | 19 | @yield('head') |
| 11 | </head> | 20 | </head> |
| 12 | <body> | 21 | <body> |
| 13 | 22 | ||
| 14 | - <header class="container"> | 23 | + <header> |
| 24 | + <div class="container"> | ||
| 15 | <div class="padded-vertical clearfix"> | 25 | <div class="padded-vertical clearfix"> |
| 16 | <div class="logo float left">Oxbow</div> | 26 | <div class="logo float left">Oxbow</div> |
| 17 | <ul class="menu float right"> | 27 | <ul class="menu float right"> |
| 18 | - <li><a href="/books">Books</a></li> | 28 | + <li><a href="/books"><i class="fa fa-book"></i>Books</a></li> |
| 19 | </ul> | 29 | </ul> |
| 20 | </div> | 30 | </div> |
| 21 | - <hr> | 31 | + </div> |
| 22 | </header> | 32 | </header> |
| 23 | 33 | ||
| 24 | <section class="container"> | 34 | <section class="container"> | ... | ... |
| 1 | @extends('base') | 1 | @extends('base') |
| 2 | 2 | ||
| 3 | @section('content') | 3 | @section('content') |
| 4 | - <h2>New Book</h2> | ||
| 5 | 4 | ||
| 5 | + <div class="row"> | ||
| 6 | + | ||
| 7 | + <div class="col-md-3 page-menu"> | ||
| 8 | + <h4>You are creating a new book.</h4> | ||
| 9 | + </div> | ||
| 10 | + | ||
| 11 | + <div class="col-md-9 page-content"> | ||
| 6 | <form action="/books" method="POST"> | 12 | <form action="/books" method="POST"> |
| 7 | - {{ csrf_field() }} | ||
| 8 | @include('books/form') | 13 | @include('books/form') |
| 9 | </form> | 14 | </form> |
| 15 | + </div> | ||
| 16 | + | ||
| 17 | + </div> | ||
| 18 | + | ||
| 10 | @stop | 19 | @stop |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | @extends('base') | 1 | @extends('base') |
| 2 | 2 | ||
| 3 | @section('content') | 3 | @section('content') |
| 4 | - <h2>Edit Book</h2> | ||
| 5 | 4 | ||
| 5 | + | ||
| 6 | + <div class="row"> | ||
| 7 | + | ||
| 8 | + <div class="col-md-3 page-menu"> | ||
| 9 | + <h4>You are editing the details for the book '{{$book->name}}'.</h4> | ||
| 10 | + <hr> | ||
| 11 | + @include('form/delete-button', ['url' => '/books/' . $book->id . '/destroy', 'text' => 'Delete this book']) | ||
| 12 | + </div> | ||
| 13 | + | ||
| 14 | + <div class="col-md-9 page-content"> | ||
| 6 | <form action="/books/{{$book->slug}}" method="POST"> | 15 | <form action="/books/{{$book->slug}}" method="POST"> |
| 7 | - {{ csrf_field() }} | ||
| 8 | <input type="hidden" name="_method" value="PUT"> | 16 | <input type="hidden" name="_method" value="PUT"> |
| 9 | @include('books/form', ['model' => $book]) | 17 | @include('books/form', ['model' => $book]) |
| 10 | </form> | 18 | </form> |
| 19 | + </div> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 11 | @stop | 26 | @stop |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -<div class="form-group"> | 1 | + |
| 2 | - <label for="name">Name</label> | 2 | +{{ csrf_field() }} |
| 3 | +<div class="form-group title-input"> | ||
| 4 | + <label for="name">Book Name</label> | ||
| 3 | @include('form/text', ['name' => 'name']) | 5 | @include('form/text', ['name' => 'name']) |
| 4 | </div> | 6 | </div> |
| 5 | -<div class="form-group"> | 7 | +<div class="form-group description-input"> |
| 6 | <label for="description">Description</label> | 8 | <label for="description">Description</label> |
| 7 | @include('form/textarea', ['name' => 'description']) | 9 | @include('form/textarea', ['name' => 'description']) |
| 8 | </div> | 10 | </div> | ... | ... |
| ... | @@ -2,24 +2,31 @@ | ... | @@ -2,24 +2,31 @@ |
| 2 | 2 | ||
| 3 | @section('content') | 3 | @section('content') |
| 4 | 4 | ||
| 5 | + | ||
| 5 | <div class="row"> | 6 | <div class="row"> |
| 6 | - <div class="col-md-6"> | 7 | + |
| 8 | + <div class="col-md-3 page-menu"> | ||
| 9 | + <h4>Books</h4> | ||
| 7 | <a href="/books/create">+ Add new book</a> | 10 | <a href="/books/create">+ Add new book</a> |
| 8 | </div> | 11 | </div> |
| 9 | - </div> | 12 | + |
| 13 | + <div class="col-md-9"> | ||
| 10 | 14 | ||
| 11 | <div class="row"> | 15 | <div class="row"> |
| 12 | @foreach($books as $book) | 16 | @foreach($books as $book) |
| 13 | - <div class="col-md-4 shaded book"> | 17 | + <div class="col-md-6"> |
| 18 | + <div class="book page-style"> | ||
| 14 | <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> | 19 | <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> |
| 15 | - <p>{{$book->description}}</p> | 20 | + <p class="text-muted">{{$book->description}}</p> |
| 16 | - <div class="buttons"> | ||
| 17 | - <a href="{{$book->getEditUrl()}}" class="button secondary">Edit</a> | ||
| 18 | - @include('form/delete-button', ['url' => '/books/' . $book->id . '/destroy', 'text' => 'Delete']) | ||
| 19 | </div> | 21 | </div> |
| 20 | </div> | 22 | </div> |
| 21 | @endforeach | 23 | @endforeach |
| 22 | </div> | 24 | </div> |
| 23 | 25 | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + | ||
| 24 | 31 | ||
| 25 | @stop | 32 | @stop |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,16 +2,42 @@ | ... | @@ -2,16 +2,42 @@ |
| 2 | 2 | ||
| 3 | @section('content') | 3 | @section('content') |
| 4 | 4 | ||
| 5 | - <h2>{{$book->name}}</h2> | 5 | + |
| 6 | + <div class="row"> | ||
| 7 | + | ||
| 8 | + <div class="col-md-3 page-menu"> | ||
| 9 | + <h4>Book Actions</h4> | ||
| 10 | + <div class="buttons"> | ||
| 11 | + <a href="{{$book->getEditUrl()}}"><i class="fa fa-pencil"></i>Edit Book</a> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + | ||
| 15 | + <div class="page-content col-md-9 float left"> | ||
| 16 | + <h1>{{$book->name}}</h1> | ||
| 6 | <p class="text-muted">{{$book->description}}</p> | 17 | <p class="text-muted">{{$book->description}}</p> |
| 7 | - <a href="{{$book->getUrl() . '/page/create'}}">+ New Page</a> | ||
| 8 | 18 | ||
| 9 | - <h4>Pages:</h4> | 19 | + <div class="clearfix header-group"> |
| 20 | + <h4 class="float">Pages</h4> | ||
| 21 | + <a href="{{$book->getUrl() . '/page/create'}}" class="text-pos float right">+ New Page</a> | ||
| 22 | + </div> | ||
| 23 | + <div class="page-list"> | ||
| 10 | @if(count($book->pages) > 0) | 24 | @if(count($book->pages) > 0) |
| 11 | @foreach($book->pages as $page) | 25 | @foreach($book->pages as $page) |
| 12 | - <a href="{{$page->getUrl()}}">{{$page->name}}</a><br> | 26 | + <a href="{{$page->getUrl()}}">{{$page->name}}</a> |
| 13 | @endforeach | 27 | @endforeach |
| 14 | @else | 28 | @else |
| 15 | <p class="text-muted">This book has no pages</p> | 29 | <p class="text-muted">This book has no pages</p> |
| 16 | @endif | 30 | @endif |
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <p> | ||
| 34 | + | ||
| 35 | + </p> | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + </div> | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + </div> | ||
| 42 | + | ||
| 17 | @stop | 43 | @stop |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -<form action="{{$url}}" method="POST"> | 1 | +<form action="{{$url}}" method="POST" class="inline"> |
| 2 | {{ csrf_field() }} | 2 | {{ csrf_field() }} |
| 3 | <input type="hidden" name="_method" value="DELETE"> | 3 | <input type="hidden" name="_method" value="DELETE"> |
| 4 | <button type="submit" class="button neg">{{ isset($text) ? $text : 'Delete' }}</button> | 4 | <button type="submit" class="button neg">{{ isset($text) ? $text : 'Delete' }}</button> | ... | ... |
| 1 | -<textarea id="{{ $name }}" name="{{ $name }}" | 1 | +<textarea id="{{ $name }}" name="{{ $name }}" rows="5" |
| 2 | @if($errors->has($name)) class="neg" @endif>@if(isset($model) || old($name)){{ old($name) ? old($name) : $model->$name}}@endif</textarea> | 2 | @if($errors->has($name)) class="neg" @endif>@if(isset($model) || old($name)){{ old($name) ? old($name) : $model->$name}}@endif</textarea> |
| 3 | @if($errors->has($name)) | 3 | @if($errors->has($name)) |
| 4 | <div class="text-neg text-small">{{ $errors->first($name) }}</div> | 4 | <div class="text-neg text-small">{{ $errors->first($name) }}</div> | ... | ... |
| 1 | @extends('base') | 1 | @extends('base') |
| 2 | 2 | ||
| 3 | @section('head') | 3 | @section('head') |
| 4 | - <link rel="stylesheet" href="/plugins/css/froala_editor.min.css"> | 4 | + <script src="/bower/tinymce-dist/tinymce.jquery.min.js"></script> |
| 5 | - <link rel="stylesheet" href="/plugins/css/froala_style.min.css"> | 5 | + <script src="/bower/dropzone/dist/min/dropzone.min.js"></script> |
| 6 | - <script src="/plugins/js/froala_editor.min.js"></script> | 6 | + <script src="/js/image-manager.js"></script> |
| 7 | @stop | 7 | @stop |
| 8 | 8 | ||
| 9 | @section('content') | 9 | @section('content') | ... | ... |
| ... | @@ -7,57 +7,12 @@ | ... | @@ -7,57 +7,12 @@ |
| 7 | @stop | 7 | @stop |
| 8 | 8 | ||
| 9 | @section('content') | 9 | @section('content') |
| 10 | + | ||
| 11 | + <div class="row"> | ||
| 10 | <form action="{{$page->getUrl()}}" method="POST"> | 12 | <form action="{{$page->getUrl()}}" method="POST"> |
| 11 | <input type="hidden" name="_method" value="PUT"> | 13 | <input type="hidden" name="_method" value="PUT"> |
| 12 | @include('pages/form', ['model' => $page]) | 14 | @include('pages/form', ['model' => $page]) |
| 13 | </form> | 15 | </form> |
| 14 | - | ||
| 15 | - <section class="overlay" style="display:none;"> | ||
| 16 | - <div id="image-manager"> | ||
| 17 | - <div class="image-manager-left"> | ||
| 18 | - <div class="image-manager-header"> | ||
| 19 | - <button type="button" class="button neg float right" data-action="close">Close</button> | ||
| 20 | - <div class="image-manager-title">Image Library</div> | ||
| 21 | - </div> | ||
| 22 | - <div class="image-manager-display"> | ||
| 23 | - </div> | ||
| 24 | - <form action="/upload/image" class="image-manager-dropzone"> | ||
| 25 | - {{ csrf_field() }} | ||
| 26 | - Drag images or click here to upload | ||
| 27 | - </form> | ||
| 28 | </div> | 16 | </div> |
| 29 | - {{--<div class="sidebar">--}} | ||
| 30 | - | ||
| 31 | - {{--</div>--}} | ||
| 32 | - </div> | ||
| 33 | - </section> | ||
| 34 | - | ||
| 35 | - <script> | ||
| 36 | - $(function() { | ||
| 37 | - //ImageManager.show('#image-manager'); | ||
| 38 | - | ||
| 39 | - tinymce.init({ | ||
| 40 | - selector: '.edit-area textarea', | ||
| 41 | - content_css: '/css/app.css', | ||
| 42 | - body_class: 'container', | ||
| 43 | - plugins: "autoresize image table textcolor paste link imagetools", | ||
| 44 | - content_style: "body {padding-left: 15px !important; padding-right: 15px !important;}", | ||
| 45 | - file_browser_callback: function(field_name, url, type, win) { | ||
| 46 | - ImageManager.show('#image-manager', function(image) { | ||
| 47 | - win.document.getElementById(field_name).value = image.url; | ||
| 48 | - if ("createEvent" in document) { | ||
| 49 | - var evt = document.createEvent("HTMLEvents"); | ||
| 50 | - evt.initEvent("change", false, true); | ||
| 51 | - win.document.getElementById(field_name).dispatchEvent(evt); | ||
| 52 | - } else { | ||
| 53 | - win.document.getElementById(field_name).fireEvent("onchange"); | ||
| 54 | - } | ||
| 55 | - }); | ||
| 56 | - } | ||
| 57 | - }); | ||
| 58 | - | ||
| 59 | - | ||
| 60 | 17 | ||
| 61 | - }); | ||
| 62 | - </script> | ||
| 63 | @stop | 18 | @stop |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -{{ csrf_field() }} | 1 | + |
| 2 | -<div class="page-title row"> | 2 | +<div class="col-md-3 page-menu"> |
| 3 | - <div class="col-md-10"> | 3 | + <h4>You are editing a page</h4> |
| 4 | + <button type="submit" class="button pos">Save Page</button> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<div class="col-md-9 page-style editor"> | ||
| 8 | + | ||
| 9 | + {{ csrf_field() }} | ||
| 10 | + <div class="title-input page-title"> | ||
| 4 | @include('form/text', ['name' => 'name', 'placeholder' => 'Enter Page Title']) | 11 | @include('form/text', ['name' => 'name', 'placeholder' => 'Enter Page Title']) |
| 5 | </div> | 12 | </div> |
| 6 | - <div class="col-md-2"> | 13 | + <div class="edit-area"> |
| 7 | - <button type="submit" class="button pos">Save</button> | ||
| 8 | - </div> | ||
| 9 | -</div> | ||
| 10 | -<div class="edit-area"> | ||
| 11 | @include('form/textarea', ['name' => 'html']) | 14 | @include('form/textarea', ['name' => 'html']) |
| 15 | + </div> | ||
| 16 | + | ||
| 12 | </div> | 17 | </div> |
| 13 | 18 | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +<section class="overlay" style="display:none;"> | ||
| 22 | + <div id="image-manager"> | ||
| 23 | + <div class="image-manager-left"> | ||
| 24 | + <div class="image-manager-header"> | ||
| 25 | + <button type="button" class="button neg float right" data-action="close">Close</button> | ||
| 26 | + <div class="image-manager-title">Image Library</div> | ||
| 27 | + </div> | ||
| 28 | + <div class="image-manager-display"> | ||
| 29 | + </div> | ||
| 30 | + <form action="/upload/image" class="image-manager-dropzone"> | ||
| 31 | + {{ csrf_field() }} | ||
| 32 | + Drag images or click here to upload | ||
| 33 | + </form> | ||
| 34 | + </div> | ||
| 35 | + {{--<div class="sidebar">--}} | ||
| 36 | + | ||
| 37 | + {{--</div>--}} | ||
| 38 | + </div> | ||
| 39 | +</section> | ||
| 40 | + | ||
| 41 | +<script> | ||
| 42 | + $(function() { | ||
| 43 | + //ImageManager.show('#image-manager'); | ||
| 44 | + | ||
| 45 | + tinymce.init({ | ||
| 46 | + selector: '.edit-area textarea', | ||
| 47 | + content_css: '/css/app.css', | ||
| 48 | + body_class: 'container', | ||
| 49 | + relative_urls: false, | ||
| 50 | + height: 600, | ||
| 51 | + plugins: "image table textcolor paste link imagetools", | ||
| 52 | + toolbar: "undo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table | fontsizeselect full", | ||
| 53 | + content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important}", | ||
| 54 | + file_browser_callback: function(field_name, url, type, win) { | ||
| 55 | + ImageManager.show('#image-manager', function(image) { | ||
| 56 | + win.document.getElementById(field_name).value = image.url; | ||
| 57 | + if ("createEvent" in document) { | ||
| 58 | + var evt = document.createEvent("HTMLEvents"); | ||
| 59 | + evt.initEvent("change", false, true); | ||
| 60 | + win.document.getElementById(field_name).dispatchEvent(evt); | ||
| 61 | + } else { | ||
| 62 | + win.document.getElementById(field_name).fireEvent("onchange"); | ||
| 63 | + } | ||
| 64 | + }); | ||
| 65 | + }, | ||
| 66 | + setup: function(editor) { | ||
| 67 | + editor.addButton('full', { | ||
| 68 | + text: 'Expand', | ||
| 69 | + icon: false, | ||
| 70 | + onclick: function() { | ||
| 71 | + var container = $(editor.getContainer()).toggleClass('fullscreen'); | ||
| 72 | + } | ||
| 73 | + }); | ||
| 74 | + } | ||
| 75 | + }); | ||
| 76 | + | ||
| 77 | + | ||
| 78 | + | ||
| 79 | + }); | ||
| 80 | +</script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,11 +2,54 @@ | ... | @@ -2,11 +2,54 @@ |
| 2 | 2 | ||
| 3 | @section('content') | 3 | @section('content') |
| 4 | 4 | ||
| 5 | - <a href="{{$page->getUrl() . '/edit'}}" class="button primary float right">Edit Page</a> | 5 | + <div class="row"> |
| 6 | + <div class="page-menu col-md-3"> | ||
| 7 | + <div class="page-nav"> | ||
| 8 | + <h4>Navigation</h4> | ||
| 9 | + <ul class="page-nav-list"></ul> | ||
| 10 | + </div> | ||
| 11 | + <div class="page-actions"> | ||
| 12 | + <h4>Actions</h4> | ||
| 13 | + <a href="{{$page->getUrl() . '/edit'}}" class="muted"><i class="fa fa-pencil"></i>Edit this page</a> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 6 | 16 | ||
| 17 | + <div class="page-content right col-md-9"> | ||
| 7 | <h1>{{$page->name}}</h1> | 18 | <h1>{{$page->name}}</h1> |
| 8 | - | ||
| 9 | - <div class="page-content"> | ||
| 10 | {!! $page->html !!} | 19 | {!! $page->html !!} |
| 11 | </div> | 20 | </div> |
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <script> | ||
| 24 | + $(document).ready(function() { | ||
| 25 | + | ||
| 26 | + // Set up fixed side menu | ||
| 27 | + $('.page-menu').affix({ | ||
| 28 | + offset: { | ||
| 29 | + top: 10, | ||
| 30 | + bottom: function () { | ||
| 31 | + return (this.bottom = $('.footer').outerHeight(true)) | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + | ||
| 36 | + // Set up document navigation | ||
| 37 | + var pageNav = $('.page-nav-list'); | ||
| 38 | + var pageContent = $('.page-content'); | ||
| 39 | + var headers = pageContent.find('h1, h2, h3, h4, h5, h6'); | ||
| 40 | + var sortedHeaders = []; | ||
| 41 | + headers.each(function() { | ||
| 42 | + var header = $(this); | ||
| 43 | + var tag = header.prop('tagName'); | ||
| 44 | + var listElem = $('<li></li>').addClass('nav-'+tag); | ||
| 45 | + var link = $('<a></a>').text(header.text().trim()).attr('href', '#'); | ||
| 46 | + listElem.append(link); | ||
| 47 | + pageNav.append(listElem); | ||
| 48 | + link.click(function(e) { | ||
| 49 | + e.preventDefault(); | ||
| 50 | + header.smoothScrollTo(); | ||
| 51 | + }) | ||
| 52 | + }); | ||
| 53 | + }); | ||
| 54 | + </script> | ||
| 12 | @stop | 55 | @stop | ... | ... |
-
Please register or sign in to post a comment