Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2015-08-31 17:59:45 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
1b29d44689bbcf40fc79ef9b4257fc387d4b64be
1b29d446
1 parent
ee8795dc
Improved empty lists. Fixes #10.
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
40 deletions
app/User.php
resources/assets/sass/styles.scss
resources/views/books/index.blade.php
resources/views/books/show.blade.php
resources/views/chapters/show.blade.php
resources/views/home.blade.php
resources/views/pages/sidebar-tree-list.blade.php
resources/views/partials/activity-list.blade.php
app/User.php
View file @
1b29d44
...
...
@@ -24,7 +24,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*
* @var array
*/
protected
$fillable
=
[
'name'
,
'email'
];
protected
$fillable
=
[
'name'
,
'email'
,
'password'
];
/**
* The attributes excluded from the model's JSON form.
...
...
resources/assets/sass/styles.scss
View file @
1b29d44
...
...
@@ -296,7 +296,9 @@ h1, h2, h3, h4, h5, h6 {
}
}
.book-tree
{
margin-top
:
$-xl
;
}
.book-tree
h4
{
padding
:
$-m
$-s
0
$-s
;
i
{
...
...
@@ -309,7 +311,7 @@ h1, h2, h3, h4, h5, h6 {
.book-tree
.sidebar-page-list
{
list-style
:
none
;
margin
:
0
;
margin-top
:
$-x
l
;
margin-top
:
$-x
s
;
border-left
:
5px
solid
$color-book
;
li
a
{
display
:
block
;
...
...
resources/views/books/index.blade.php
View file @
1b29d44
...
...
@@ -18,16 +18,25 @@
</div>
<div
class=
"page-content"
>
<h1>
Books
</h1>
@foreach($books as $book)
<div
class=
"book"
>
<h3><a
href=
"{{$book->getUrl()}}"
>
{{$book->name}}
</a></h3>
<p
class=
"text-muted"
>
{{$book->description}}
</p>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<h1>
Books
</h1>
@if(count($books) > 0)
@foreach($books as $book)
<div
class=
"book"
>
<h3><a
href=
"{{$book->getUrl()}}"
>
{{$book->name}}
</a></h3>
<p
class=
"text-muted"
>
{{$book->description}}
</p>
</div>
<hr>
@endforeach
@else
<p
class=
"text-muted"
>
No books have been created.
</p>
<a
href=
"/books/create"
class=
"text-pos"
><i
class=
"zmdi zmdi-edit"
></i>
Create one now
</a>
@endif
</div>
<
hr
>
@endforeach
<
div
class=
"col-md-4"
></div
>
</div>
</div>
@stop
\ No newline at end of file
...
...
resources/views/books/show.blade.php
View file @
1b29d44
...
...
@@ -36,27 +36,37 @@
<div
class=
"page-list"
>
<hr>
@foreach($book->children() as $childElement)
<div
class=
"book-child"
>
<h3>
<a
href=
"{{ $childElement->getUrl() }}"
class=
"{{ $childElement->getName() }}"
>
<i
class=
"zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"
></i>
{{ $childElement->name }}
</a>
</h3>
<p
class=
"text-muted"
>
{{$childElement->getExcerpt()}}
</p>
@if($childElement->isA('chapter')
&&
count($childElement->pages) > 0)
<div
class=
"inset-list"
>
@foreach($childElement->pages as $page)
<h4><a
href=
"{{$page->getUrl()}}"
><i
class=
"zmdi zmdi-file-text"
></i>
{{$page->name}}
</a></h4>
@endforeach
</div>
@endif
</div>
@if(count($book->children()) > 0)
@foreach($book->children() as $childElement)
<div
class=
"book-child"
>
<h3>
<a
href=
"{{ $childElement->getUrl() }}"
class=
"{{ $childElement->getName() }}"
>
<i
class=
"zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"
></i>
{{ $childElement->name }}
</a>
</h3>
<p
class=
"text-muted"
>
{{$childElement->getExcerpt()}}
</p>
@if($childElement->isA('chapter')
&&
count($childElement->pages) > 0)
<div
class=
"inset-list"
>
@foreach($childElement->pages as $page)
<h4><a
href=
"{{$page->getUrl()}}"
><i
class=
"zmdi zmdi-file-text"
></i>
{{$page->name}}
</a></h4>
@endforeach
</div>
@endif
</div>
<hr>
@endforeach
@else
<p
class=
"text-muted"
>
No pages or chapters have been created for this book.
</p>
<p>
<a
href=
"{{$book->getUrl() . '/page/create'}}"
class=
"text-page"
><i
class=
"zmdi zmdi-file-text"
></i>
Create a new page
</a>
<em
class=
"text-muted"
>
-or-
</em>
<a
href=
"{{$book->getUrl() . '/chapter/create'}}"
class=
"text-chapter"
><i
class=
"zmdi zmdi-collection-bookmark"
></i>
Add a chapter
</a>
</p>
<hr>
@end
foreach
@end
if
</div>
<p
class=
"text-muted small"
>
...
...
resources/views/chapters/show.blade.php
View file @
1b29d44
...
...
@@ -56,7 +56,14 @@
@endforeach
</div>
@else
<p
class=
"text-muted"
>
No pages are in this chapter
</p>
<hr>
<p
class=
"text-muted"
>
No pages are currently in this chapter.
</p>
<p>
<a
href=
"{{$chapter->getUrl() . '/create-page'}}"
class=
"text-page"
><i
class=
"zmdi zmdi-file-text"
></i>
Create a new page
</a>
<em
class=
"text-muted"
>
-or-
</em>
<a
href=
"{{$book->getUrl() . '/sort'}}"
class=
"text-book"
><i
class=
"zmdi zmdi-book"
></i>
Sort the current book
</a>
</p>
<hr>
@endif
<p
class=
"text-muted small"
>
...
...
resources/views/home.blade.php
View file @
1b29d44
...
...
@@ -7,13 +7,18 @@
<div
class=
"row"
>
<div
class=
"col-md-7"
>
<h2>
Books
</h2>
@foreach($books as $book)
<div
class=
"book"
>
<h3><a
href=
"{{$book->getUrl()}}"
>
{{$book->name}}
</a></h3>
<p
class=
"text-muted"
>
{{$book->description}}
</p>
</div>
<hr>
@endforeach
@if(count($books) > 0)
@foreach($books as $book)
<div
class=
"book"
>
<h3><a
href=
"{{$book->getUrl()}}"
>
{{$book->name}}
</a></h3>
<p
class=
"text-muted"
>
{{$book->description}}
</p>
</div>
<hr>
@endforeach
@else
<p
class=
"text-muted"
>
No books have been created.
</p>
<a
href=
"/books/create"
class=
"text-pos"
><i
class=
"zmdi zmdi-edit"
></i>
Create one now
</a>
@endif
</div>
<div
class=
"col-md-4 col-md-offset-1"
>
<div
class=
"margin-top large"
>
</div>
...
...
resources/views/pages/sidebar-tree-list.blade.php
View file @
1b29d44
<div
class=
"book-tree"
>
<h6
class=
"text-muted"
>
Book Navigation
</h6>
<ul
class=
"sidebar-page-list menu"
>
<li
class=
"book-header"
><a
href=
"{{$book->getUrl()}}"
class=
"book {{ $current->matches($book)? 'selected' : '' }}"
><i
class=
"zmdi zmdi-book"
></i>
{{$book->name}}
</a></li>
@foreach($book->children() as $bookChild)
...
...
resources/views/partials/activity-list.blade.php
View file @
1b29d44
...
...
@@ -9,4 +9,6 @@
</div>
@endforeach
</div>
@else
<p
class=
"text-muted"
>
New activity will show up here.
</p>
@endif
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment