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:
parent
c9e429ea1a
commit
335a1d1f81
2 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue