#47 - Putting the comments right under the page.

This commit is contained in:
Abijeet 2017-06-11 11:41:33 +05:30
parent 9dbd7fa618
commit fd50efb503
2 changed files with 8 additions and 10 deletions

View File

@ -66,6 +66,10 @@ class Page extends Entity
return $this->hasMany(Attachment::class, 'uploaded_to')->orderBy('order', 'asc'); return $this->hasMany(Attachment::class, 'uploaded_to')->orderBy('order', 'asc');
} }
public function comments() {
return $this->hasMany(Comment::class, 'page_id')->orderBy('created_on', 'asc');
}
/** /**
* Get the url for this page. * Get the url for this page.
* @param string|bool $path * @param string|bool $path

View File

@ -46,10 +46,10 @@
</div> </div>
<div class="container" id="page-show" ng-non-bindable> <div class="container" id="page-show">
<div class="row"> <div class="row">
<div class="col-md-9 print-full-width"> <div class="col-md-9 print-full-width">
<div class="page-content"> <div class="page-content" ng-non-bindable>
<div class="pointer-container" id="pointer"> <div class="pointer-container" id="pointer">
<div class="pointer anim" > <div class="pointer anim" >
@ -66,6 +66,7 @@
@include('partials.entity-meta', ['entity' => $page]) @include('partials.entity-meta', ['entity' => $page])
</div> </div>
@include('comments/comments', ['pageId' => $page->id])
</div> </div>
<div class="col-md-3 print-hidden"> <div class="col-md-3 print-hidden">
@ -109,13 +110,6 @@
</div> </div>
</div> </div>
<div class="container">
<div class="row">
<div class="col-md-9">
@include('comments/comments', ['pageId' => $page->id])
</div>
</div>
</div>
@stop @stop
@section('scripts') @section('scripts')