mirror of
https://github.com/documize/community.git
synced 2025-07-28 01:29:43 +02:00
Search will pass source down to document being viewed
Backend records search referrer of document being viewed.
This commit is contained in:
parent
c9e429ea1a
commit
335a1d1f81
2 changed files with 6 additions and 2 deletions
|
@ -9,10 +9,14 @@
|
||||||
//
|
//
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
|
import { computed } from '@ember/object';
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
resultPhrase: '',
|
resultPhrase: '',
|
||||||
|
searchQuery: computed('keywords', function() {
|
||||||
|
return encodeURIComponent(this.get('keywords'));
|
||||||
|
}),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<ul class="documents">
|
<ul class="documents">
|
||||||
{{#each documents key="id" as |result index|}}
|
{{#each documents key="id" as |result index|}}
|
||||||
<li class="document">
|
<li class="document">
|
||||||
<a class="link" href="s/{{result.spaceId}}/{{result.spaceSlug}}/d/{{ result.documentId }}/{{result.documentSlug}}?currentPageId={{result.itemId}}">
|
{{#link-to 'document.index' result.spaceId result.spaceSlug result.documentId result.documentSlug (query-params currentPageId=result.itemId source=searchQuery) class="link"}}
|
||||||
<div class="title">
|
<div class="title">
|
||||||
{{result.document}}
|
{{result.document}}
|
||||||
{{#if (gt result.versionId.length 0)}}
|
{{#if (gt result.versionId.length 0)}}
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
{{#if result.template}}
|
{{#if result.template}}
|
||||||
<button type="button" class="mt-3 btn btn-warning text-uppercase font-weight-bold">TEMPLATE</button>
|
<button type="button" class="mt-3 btn btn-warning text-uppercase font-weight-bold">TEMPLATE</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</a>
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue