mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
UX: better title on search page
This commit is contained in:
parent
401fbdbfe7
commit
33f0d80ed5
@ -2,12 +2,13 @@ import { ajax } from 'discourse/lib/ajax';
|
||||
import { translateResults, getSearchKey, isValidSearchTerm } from "discourse/lib/search";
|
||||
import PreloadStore from 'preload-store';
|
||||
import { getTransient, setTransient } from 'discourse/lib/page-tracker';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
queryParams: { q: {}, expanded: false, context_id: {}, context: {}, skip_context: {} },
|
||||
|
||||
titleToken() {
|
||||
return I18n.t('search.results_page');
|
||||
return I18n.t('search.results_page', { term: escapeExpression(this.controllerFor("full-page-search").get('searchTerm')) });
|
||||
},
|
||||
|
||||
model(params) {
|
||||
|
@ -31,8 +31,6 @@ function createSearchResult({ type, linkField, builder }) {
|
||||
href: r.get(linkField),
|
||||
contents: () => builder.call(this, r, attrs.term),
|
||||
className: 'search-link',
|
||||
title: 'search.link_title',
|
||||
titleOptions: { term: escapeExpression(attrs.term) },
|
||||
searchResultId,
|
||||
searchResultType: type,
|
||||
searchContextEnabled: attrs.searchContextEnabled,
|
||||
|
@ -29,7 +29,8 @@ class SearchController < ApplicationController
|
||||
search_args[:ip_address] = request.remote_ip
|
||||
search_args[:user_id] = current_user.id if current_user.present?
|
||||
|
||||
search = Search.new(params[:q], search_args)
|
||||
@search_term = params[:q]
|
||||
search = Search.new(@search_term, search_args)
|
||||
result = search.execute
|
||||
|
||||
result.find_user_data(guardian) if result
|
||||
|
@ -1 +1 @@
|
||||
<% content_for :title do %><%= t 'js.search.results_page' %> - <%= SiteSetting.title %><% end %>
|
||||
<% content_for :title do %><%= I18n.t('search.results_page', term: @search_term) %> - <%= SiteSetting.title %><% end %>
|
||||
|
@ -1349,12 +1349,11 @@ en:
|
||||
one: "1 result for <span class='term'>{{term}}</span>"
|
||||
other: "{{count}} results for <span class='term'>{{term}}</span>"
|
||||
title: "search topics, posts, users, or categories"
|
||||
link_title: "search result for '{{term}}'"
|
||||
no_results: "No results found."
|
||||
no_more_results: "No more results found."
|
||||
searching: "Searching ..."
|
||||
post_format: "#{{post_number}} by {{username}}"
|
||||
results_page: "Search Results"
|
||||
results_page: "Search results for '{{term}}'"
|
||||
more_results: "There are more results. Please narrow your search criteria."
|
||||
cant_find: "Can’t find what you’re looking for?"
|
||||
start_new_topic: "Perhaps start a new topic?"
|
||||
|
@ -1618,6 +1618,7 @@ en:
|
||||
category: 'Categories'
|
||||
topic: 'Results'
|
||||
user: 'Users'
|
||||
results_page: "Search results for '%{term}'"
|
||||
|
||||
sso:
|
||||
login_error: "Login Error"
|
||||
|
Loading…
Reference in New Issue
Block a user