FEATURE: log clicks on full page search

This commit is contained in:
Arpit Jalan 2017-12-01 22:35:09 +05:30
parent bf1a1764ce
commit 54f5b4d4e0
2 changed files with 14 additions and 1 deletions

View File

@ -286,5 +286,18 @@ export default Ember.Controller.extend({
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'
}
});
}
}
}
});

View File

@ -77,7 +77,7 @@
{{track-selected selectedList=selected selectedId=result.topic}}
{{/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>
</a>