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
Zuev V. Egor
2017-06-20 11:55:53 +0300
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
a70cd22f7c0925f4f4eda9fabb74f3b9dff331b8
a70cd22f
1 parent
3903fda6
changes views
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
32 deletions
app/Http/Controllers/HomeController.php
resources/views/home.blade.php
resources/views/pages/sidebar-tree-list.blade.php
app/Http/Controllers/HomeController.php
View file @
a70cd22
...
...
@@ -32,12 +32,14 @@ class HomeController extends Controller
$recents
=
$this
->
signedIn
?
Views
::
getUserRecentlyViewed
(
12
*
$recentFactor
,
0
)
:
$this
->
entityRepo
->
getRecentlyCreated
(
'book'
,
10
*
$recentFactor
);
$recentlyCreatedPages
=
$this
->
entityRepo
->
getRecentlyCreated
(
'page'
,
5
);
$recentlyUpdatedPages
=
$this
->
entityRepo
->
getRecentlyUpdated
(
'page'
,
5
);
$books
=
$this
->
entityRepo
->
getAllPaginated
(
'book'
,
10
);
return
view
(
'home'
,
[
'activity'
=>
$activity
,
'recents'
=>
$recents
,
'recentlyCreatedPages'
=>
$recentlyCreatedPages
,
'recentlyUpdatedPages'
=>
$recentlyUpdatedPages
,
'draftPages'
=>
$draftPages
'draftPages'
=>
$draftPages
,
'books'
=>
$books
]);
}
...
...
resources/views/home.blade.php
View file @
a70cd22
...
...
@@ -18,23 +18,15 @@
<div
class=
"row"
>
<div
class=
"col-sm-4"
>
<div
id=
"recent-drafts"
>
@if(count($draftPages) > 0)
<h4>
{{ trans('entities.my_recent_drafts') }}
</h4>
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
@endif
</div>
@if($signedIn)
<h4>
{{ trans('entities.my_recently_viewed') }}
</h4>
@else
<h4>
{{ trans('entities.books_recent') }}
</h4>
@endif
<h4><a
class=
"no-color"
href=
"{{ baseUrl("
/
pages
/
recently-created
")
}}"
>
{{ trans('entities.books') }}
</a></h4>
<div
id=
"all-books"
>
@include('partials/entity-list', [
'entities' => $recent
s,
'entities' => $book
s,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty
')
'emptyText' => trans('entities.no_pages_recently_created
')
])
</div>
</div>
<div
class=
"col-sm-4"
>
<h4><a
class=
"no-color"
href=
"{{ baseUrl("
/
pages
/
recently-created
")
}}"
>
{{ trans('entities.recently_created_pages') }}
</a></h4>
...
...
@@ -57,6 +49,24 @@
</div>
<div
class=
"col-sm-4"
id=
"recent-activity"
>
<div
id=
"recent-drafts"
>
@if(count($draftPages) > 0)
<h4>
{{ trans('entities.my_recent_drafts') }}
</h4>
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
@endif
</div>
@if($signedIn)
<h4>
{{ trans('entities.my_recently_viewed') }}
</h4>
@else
<h4>
{{ trans('entities.books_recent') }}
</h4>
@endif
@include('partials/entity-list', [
'entities' => $recents,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
])
<h4>
{{ trans('entities.recent_activity') }}
</h4>
@include('partials/activity-list', ['activity' => $activity])
</div>
...
...
resources/views/pages/sidebar-tree-list.blade.php
View file @
a70cd22
<div
class=
"book-tree"
ng-non-bindable
>
@if(isset($page)
&&
$page->tags->count() > 0)
<div
class=
"tag-display"
>
<h6
class=
"text-muted"
>
{{ trans('entities.page_tags') }}
</h6>
<table>
<tbody>
@foreach($page->tags as $tag)
<tr
class=
"tag"
>
<td
@
if
(!$
tag-
>
value) colspan="2" @endif>
<a
href=
"{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}"
>
{{ $tag->name }}
</a></td>
@if($tag->value)
<td
class=
"tag-value"
><a
href=
"{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}"
>
{{$tag->value}}
</a></td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@if (isset($page)
&&
$page->attachments->count() > 0)
<h6
class=
"text-muted"
>
{{ trans('entities.pages_attachments') }}
</h6>
@foreach($page->attachments as $attachment)
...
...
@@ -68,7 +52,16 @@
</li>
@endforeach
</ul>
@if(isset($page)
&&
$page->tags->count() > 0)
<div
class=
"tag-display"
>
<h6
class=
"text-muted"
>
{{ trans('entities.page_tags') }}
</h6>
@foreach($page->tags as $tag)
<span
class=
"tag"
>
<a
href=
"{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}"
>
{{ $tag->name }}
</a>
</span>
@endforeach
</div>
@endif
</div>
...
...
Please
register
or
sign in
to post a comment