1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Search will pass source down to document being viewed

Backend records search referrer of document being viewed.
This commit is contained in:
McMatts 2018-04-05 14:24:27 +01:00
parent c9e429ea1a
commit 335a1d1f81
2 changed files with 6 additions and 2 deletions

View file

@ -9,10 +9,14 @@
//
// https://documize.com
import { computed } from '@ember/object';
import Component from '@ember/component';
export default Component.extend({
resultPhrase: '',
searchQuery: computed('keywords', function() {
return encodeURIComponent(this.get('keywords'));
}),
didReceiveAttrs() {
this._super(...arguments);

View file

@ -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}}?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">
{{result.document}}
{{#if (gt result.versionId.length 0)}}
@ -16,7 +16,7 @@
{{#if result.template}}
<button type="button" class="mt-3 btn btn-warning text-uppercase font-weight-bold">TEMPLATE</button>
{{/if}}
</a>
{{/link-to}}
</li>
{{/each}}
</ul>