mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Search history recording
1. Record all search queries. 2. Replaced typeahead with form style for faster search result fetch/rendering.
This commit is contained in:
parent
a6828e6b7f
commit
b4c4decb3b
4 changed files with 77 additions and 32 deletions
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -13,7 +13,14 @@ import Route from '@ember/routing/route';
|
|||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
queryParams: {
|
||||
filter: {
|
||||
replace: true,
|
||||
refreshModel: false,
|
||||
}
|
||||
},
|
||||
|
||||
activate() {
|
||||
this.get('browser').setTitle('Search');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -11,25 +11,30 @@
|
|||
<div class="container">
|
||||
<div class="view-search mt-5">
|
||||
<div class="heading">Search</div>
|
||||
<div class="form-group mt-4">
|
||||
{{focus-input type="text" value=filter class="form-control mb-4" placeholder='a OR b, x AND y, "phrase mat*"'}}
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-1" class="form-check-input" checked=matchDoc}}
|
||||
<label class="form-check-label" for="search-1"> document title</label>
|
||||
<form onsubmit={{action 'onSearch'}}>
|
||||
<div class="form-group mt-4">
|
||||
{{focus-input type="text" value=filter class="form-control mb-4" placeholder='a OR b, x AND y, "phrase mat*"'}}
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-1" class="form-check-input" checked=matchDoc}}
|
||||
<label class="form-check-label" for="search-1"> document title</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-2" class="form-check-input" checked=matchContent}}
|
||||
<label class="form-check-label" for="search-2"> content</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-3" class="form-check-input" checked=matchTag}}
|
||||
<label class="form-check-label" for="search-3"> tag name</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-4" class="form-check-input" checked=matchFile}}
|
||||
<label class="form-check-label" for="search-4"> attachment name</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-2" class="form-check-input" checked=matchContent}}
|
||||
<label class="form-check-label" for="search-2"> content</label>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-success" {{action 'onSearch'}}>Search</button>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-3" class="form-check-input" checked=matchTag}}
|
||||
<label class="form-check-label" for="search-3"> tag name</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
{{input type="checkbox" id="search-4" class="form-check-input" checked=matchFile}}
|
||||
<label class="form-check-label" for="search-4"> attachment name</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{search/search-results results=results}}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<ul class="documents">
|
||||
{{#each documents key="id" as |result index|}}
|
||||
<li class="document">
|
||||
<a class="link" href="s/{{result.spaceId}}/{{result.spaceSlug}}/d/{{ result.documentId }}/{{result.documentSlug}}?page={{ result.itemId }}">
|
||||
<a class="link" href="s/{{result.spaceId}}/{{result.spaceSlug}}/d/{{ result.documentId }}/{{result.documentSlug}}?currentPageId={{result.itemId}}">
|
||||
<div class="title">
|
||||
{{result.document}}
|
||||
{{#if (gt result.versionId.length 0)}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue