parent
5cd08ab2f5
commit
ec83f83017
|
@ -4,7 +4,8 @@
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"production": "gulp build --production",
|
"production": "gulp build --production",
|
||||||
"dev": "gulp",
|
"dev": "gulp",
|
||||||
"watch": "gulp"
|
"watch": "gulp",
|
||||||
|
"permissions": "chown -R $USER:$USER bootstrap/cache storage public/uploads"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babelify": "^7.3.0",
|
"babelify": "^7.3.0",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h4>
|
<h4>
|
||||||
@if (isset($showPath) && $showPath)
|
@if (isset($showPath) && $showPath)
|
||||||
<a href="{{ $chapter->book->getUrl() }}" class="text-book">
|
<a href="{{ $chapter->book->getUrl() }}" class="text-book">
|
||||||
<i class="zmdi zmdi-book"></i>{{ $chapter->book->name }}
|
<i class="zmdi zmdi-book"></i>{{ $chapter->book->getShortName() }}
|
||||||
</a>
|
</a>
|
||||||
<span class="text-muted"> » </span>
|
<span class="text-muted"> » </span>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
<div class="page {{$page->draft ? 'draft' : ''}} entity-list-item" data-entity-type="page" data-entity-id="{{$page->id}}">
|
<div class="page {{$page->draft ? 'draft' : ''}} entity-list-item" data-entity-type="page" data-entity-id="{{$page->id}}">
|
||||||
<h4>
|
<h4>
|
||||||
|
@if (isset($showPath) && $showPath)
|
||||||
|
<a href="{{ $page->book->getUrl() }}" class="text-book">
|
||||||
|
<i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}
|
||||||
|
</a>
|
||||||
|
<span class="text-muted"> » </span>
|
||||||
|
@if($page->chapter)
|
||||||
|
<a href="{{ $page->chapter->getUrl() }}" class="text-chapter">
|
||||||
|
<i class="zmdi zmdi-collection-bookmark"></i>{{ $page->chapter->getShortName() }}
|
||||||
|
</a>
|
||||||
|
<span class="text-muted"> » </span>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
<a href="{{ $page->getUrl() }}" class="text-page entity-list-item-link"><i class="zmdi zmdi-file-text"></i><span class="entity-list-item-name">{{ $page->name }}</span></a>
|
<a href="{{ $page->getUrl() }}" class="text-page entity-list-item-link"><i class="zmdi zmdi-file-text"></i><span class="entity-list-item-name">{{ $page->name }}</span></a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@if(count($entities) > 0)
|
@if(count($entities) > 0)
|
||||||
@foreach($entities as $index => $entity)
|
@foreach($entities as $index => $entity)
|
||||||
@if($entity->isA('page'))
|
@if($entity->isA('page'))
|
||||||
@include('pages/list-item', ['page' => $entity])
|
@include('pages/list-item', ['page' => $entity, 'showPath' => true])
|
||||||
@elseif($entity->isA('book'))
|
@elseif($entity->isA('book'))
|
||||||
@include('books/list-item', ['book' => $entity])
|
@include('books/list-item', ['book' => $entity])
|
||||||
@elseif($entity->isA('chapter'))
|
@elseif($entity->isA('chapter'))
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<?php namespace Tests;
|
<?php namespace Tests;
|
||||||
|
|
||||||
|
|
||||||
|
use BookStack\Chapter;
|
||||||
|
use BookStack\Page;
|
||||||
|
|
||||||
class EntitySearchTest extends TestCase
|
class EntitySearchTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -75,10 +78,10 @@ class EntitySearchTest extends TestCase
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
|
|
||||||
$pageA = \BookStack\Page::first();
|
$pageA = Page::first();
|
||||||
$pageA->tags()->saveMany($newTags);
|
$pageA->tags()->saveMany($newTags);
|
||||||
|
|
||||||
$pageB = \BookStack\Page::all()->last();
|
$pageB = Page::all()->last();
|
||||||
$pageB->tags()->create(['name' => 'animal', 'value' => 'dog']);
|
$pageB->tags()->create(['name' => 'animal', 'value' => 'dog']);
|
||||||
|
|
||||||
$this->asEditor();
|
$this->asEditor();
|
||||||
|
@ -160,8 +163,8 @@ class EntitySearchTest extends TestCase
|
||||||
|
|
||||||
public function test_ajax_entity_search()
|
public function test_ajax_entity_search()
|
||||||
{
|
{
|
||||||
$page = \BookStack\Page::all()->last();
|
$page = Page::all()->last();
|
||||||
$notVisitedPage = \BookStack\Page::first();
|
$notVisitedPage = Page::first();
|
||||||
|
|
||||||
// Visit the page to make popular
|
// Visit the page to make popular
|
||||||
$this->asEditor()->get($page->getUrl());
|
$this->asEditor()->get($page->getUrl());
|
||||||
|
@ -176,4 +179,20 @@ class EntitySearchTest extends TestCase
|
||||||
$defaultListTest->assertSee($page->name);
|
$defaultListTest->assertSee($page->name);
|
||||||
$defaultListTest->assertDontSee($notVisitedPage->name);
|
$defaultListTest->assertDontSee($notVisitedPage->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_ajax_entity_serach_shows_breadcrumbs()
|
||||||
|
{
|
||||||
|
$chapter = Chapter::first();
|
||||||
|
$page = $chapter->pages->first();
|
||||||
|
$this->asEditor();
|
||||||
|
|
||||||
|
$pageSearch = $this->get('/ajax/search/entities?term=' . urlencode($page->name));
|
||||||
|
$pageSearch->assertSee($page->name);
|
||||||
|
$pageSearch->assertSee($chapter->getShortName());
|
||||||
|
$pageSearch->assertSee($page->book->getShortName());
|
||||||
|
|
||||||
|
$chapterSearch = $this->get('/ajax/search/entities?term=' . urlencode($chapter->name));
|
||||||
|
$chapterSearch->assertSee($chapter->name);
|
||||||
|
$chapterSearch->assertSee($chapter->book->getShortName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue