FEATURE: log clicks on full page search
This commit is contained in:
parent
bf1a1764ce
commit
54f5b4d4e0
|
@ -286,5 +286,18 @@ export default Ember.Controller.extend({
|
||||||
this._search();
|
this._search();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
logClick(topicId) {
|
||||||
|
if (this.get('model.grouped_search_result.search_log_id') && topicId) {
|
||||||
|
ajax('/search/click', {
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
search_log_id: this.get('model.grouped_search_result.search_log_id'),
|
||||||
|
search_result_id: topicId,
|
||||||
|
search_result_type: 'topic'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
{{track-selected selectedList=selected selectedId=result.topic}}
|
{{track-selected selectedList=selected selectedId=result.topic}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<a class='search-link' href='{{unbound result.url}}'>
|
<a class='search-link' href='{{unbound result.url}}' {{action "logClick" result.topic_id}}>
|
||||||
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}</span>
|
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue