diff --git a/apps/questions/models.py b/apps/questions/models.py index 9d0e36732e2..1a6222966d7 100755 --- a/apps/questions/models.py +++ b/apps/questions/models.py @@ -220,6 +220,10 @@ def is_contributor(self, user): return False + @property + def is_solved(self): + return Answer.objects.filter(pk=self.solution_id).exists() + class QuestionMetaData(ModelBase): """Metadata associated with a support question.""" diff --git a/apps/questions/templates/questions/new_question.html b/apps/questions/templates/questions/new_question.html index da81d7ca99e..934d2a1c913 100644 --- a/apps/questions/templates/questions/new_question.html +++ b/apps/questions/templates/questions/new_question.html @@ -45,7 +45,59 @@

{{ _('Summarize your question in a sentence:') }}

{% endif %} {% if tried_search and not form %} - {{ show_results(search_results, current_product, current_category, request) }} + {% if results %} +

{{ _("We've found some articles and previous answered questions that may solve your issue:") }}

+ {% set button_text = _('None of these solve my problem') %} +
+ {% for result in results %} +
+ + {{ result.object.title }} + + {% if result.type == 'document' %} +

+ {{ result.object.current_revision.summary }} +

+ {% elif result.type == 'question' %} +

+ {{ result.object.content|truncate(500) }} +

+
+ {% if result.object.is_solved %} + {{ _('Solved') }} + {% endif %} + + {% if result.object.num_answers > 0 %} + {{ ngettext('1 reply', '{n} replies', + result.object.num_answers)|f(n=result.object.num_answers) }} + {% else %} + {{ _('No replies') }} + {% endif %} + + + {{ ngettext('1 person has this problem', '{n} people have this problem', + result.object.num_votes)|f(n=result.object.num_votes) }} + + + {{ ngettext('1 new this week', '{n} new this week', + result.object.num_votes_past_week)|f(n=result.object.num_votes_past_week) }} + +
{# .thread-meta #} + {% endif %} +
{# .result #} + {% endfor %} +
{# .search-results #} + {% else %}{# No search results at all. #} +

{{ _('This question has not been asked before.') }}

+ {% set button_text = _('Provide more details') %} + {% endif %} +
+ + + + + +
{% endif %} {% endblock %} diff --git a/apps/questions/templates/questions/questions.html b/apps/questions/templates/questions/questions.html index 74ef2284f47..ff1b9b3736c 100644 --- a/apps/questions/templates/questions/questions.html +++ b/apps/questions/templates/questions/questions.html @@ -71,7 +71,7 @@

{{ question.title }}

{% include 'questions/includes/have_problem.html' %}
- {% if question.solution %} + {% if question.is_solved %} {{ _('Solved') }} {% endif %} diff --git a/apps/questions/tests/test_models.py b/apps/questions/tests/test_models.py index 3bbc2bba3c1..1732d3da2f8 100644 --- a/apps/questions/tests/test_models.py +++ b/apps/questions/tests/test_models.py @@ -283,6 +283,14 @@ def test_no_notification_on_update(self): q.save() assert not QuestionReplyEvent.is_notifying(q.creator, q) + def test_is_solved_property(self): + a = Answer.objects.all()[0] + q = a.question + assert not q.is_solved + q.solution = a + q.save() + assert q.is_solved + class AddExistingTagTests(TaggingTestCaseBase): """Tests for the add_existing_tag helper function.""" diff --git a/apps/questions/views.py b/apps/questions/views.py index 4a6aaebeeb9..2cf7bf26064 100644 --- a/apps/questions/views.py +++ b/apps/questions/views.py @@ -174,14 +174,14 @@ def new_question(request, template=None): search = request.GET.get('search', '') if search: try: - search_results = _search_suggestions( - search, locale_or_default(request.locale)) + results = _search_suggestions( + search, locale_or_default(request.locale)) except SearchError: # Just quietly advance the user to the next step. - search_results = [] + results = [] tried_search = True else: - search_results = [] + results = [] tried_search = False if request.GET.get('showform'): @@ -201,7 +201,8 @@ def new_question(request, template=None): form = None return jingo.render(request, template, - {'form': form, 'search_results': search_results, + {'form': form, + 'results': results, 'tried_search': tried_search, 'products': products, 'current_product': product, @@ -772,34 +773,21 @@ def _search_suggestions(query, locale): query -- full text to search on locale -- locale to limit to - Items returned are dicts: - { 'url': URL where the article can be viewed, - 'title': Title of the article, - 'excerpt_html': Excerpt of the article with search terms hilighted, - formatted in HTML } + Items are dicts of: + { + 'type': + 'object': + } - Weights wiki pages infinitely higher than questions at the moment. + Returns up to 3 wiki pages, then up to 3 questions. TODO: ZOMFG this needs to be refactored and the search app should provide an internal API. Seriously. """ - def prepare(result, model, attr, searcher, result_to_id): - """Turn a search result from a Sphinx client into a dict for templates. - Return {} if an object corresponding to the result cannot be found. - - """ - try: - obj = model.objects.get(pk=result_to_id(result)) - except ObjectDoesNotExist: - return {} - return {'url': obj.get_absolute_url(), - 'title': obj.title, - 'excerpt_html': searcher.excerpt(getattr(obj, attr), query)} - - max_suggestions = settings.QUESTIONS_MAX_SUGGESTIONS - query_limit = max_suggestions + settings.QUESTIONS_SUGGESTION_SLOP + # Max number of search results per type. + WIKI_RESULTS = QUESTIONS_RESULTS = 3 # Search wiki pages: wiki_searcher = WikiClient() @@ -813,28 +801,33 @@ def prepare(result, model, attr, searcher, result_to_id): 'value': [-x for x in settings.SEARCH_DEFAULT_CATEGORIES if x < 0]}] raw_results = wiki_searcher.query(query, filters=filters, - limit=query_limit) + limit=WIKI_RESULTS) # Lazily build excerpts from results. Stop when we have enough: - results = islice((p for p in - (prepare(r, Document, 'html', wiki_searcher, - lambda x: x['id']) - for r in raw_results) if p), - max_suggestions) - results = list(results) - - # If we didn't find enough wiki pages to fill the page, pad it out with - # other questions: - if len(results) < max_suggestions: - question_searcher = QuestionsClient() - # questions app is en-US only. - raw_results = question_searcher.query(query, - limit=query_limit - len(results)) - results.extend(islice((p for p in - (prepare(r, Question, 'content', - question_searcher, - lambda x: x['attrs']['question_id']) - for r in raw_results) if p), - max_suggestions - len(results))) + results = [] + for r in raw_results: + try: + doc = Document.objects.select_related('current_revision').\ + get(pk=r['id']) + results.append({ + 'type': 'document', + 'object': doc, + }) + except Document.DoesNotExist: + pass + + question_searcher = QuestionsClient() + # questions app is en-US only. + raw_results = question_searcher.query(query, + limit=QUESTIONS_RESULTS) + for r in raw_results: + try: + q = Question.objects.get(pk=r['attrs']['question_id']) + results.append({ + 'type': 'question', + 'object': q + }) + except Question.DoesNotExist: + pass return results diff --git a/media/css/questions.css b/media/css/questions.css index bf3203a4023..ac327142d49 100644 --- a/media/css/questions.css +++ b/media/css/questions.css @@ -1551,3 +1551,16 @@ a#activate-watch, a#remove-watch { display: block; font-size: 120%; } + +/* AAQ search result tweaks */ +.search-results { + margin-top: 10px; +} + +.result .thread-meta { + padding: 10px 15px 10px 50px; +} + +.thread-meta .this-week { + border-right: none; +} diff --git a/media/css/search-advanced.css b/media/css/search-advanced.css new file mode 100644 index 00000000000..ceb4d67fb66 --- /dev/null +++ b/media/css/search-advanced.css @@ -0,0 +1,377 @@ +/* Bug 501880 -- advanced search */ +.show-search-tabs { + padding: 0.5em; + display: inline-block; +} +input.search-empty-query { + padding: 5px; +} +input.search-empty-submit { + -moz-border-radius: 8px; + padding: 5px 10px; +} +div.search-empty { + margin: 1em 0 1.5em; +} +div.search-empty form { + margin-top: 1em; +} +/* END Bug 501880 */ + +/* advanced search styling */ +body.advanced_search .botbar +, body.advanced_search .topbar +{ + display: none; +} + +/* tabs styling */ +.ui-tabs { + padding: 0 0.2em; + font-size: 120%; + margin-bottom: 2em; +} +a.tablink { + outline: none; +} + +#tab-wrapper { + margin: 0; padding: 0; + -moz-box-shadow: 0 4px 9px #888; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + background: #fff; + color: #333; +} + +/* form styling */ +#search-tabs { + margin-top: 1em; +} +#search-tabs .container { + clear: left; +} +#search-tabs label { + cursor: pointer; + display: block; + float: left; + width: 8em; + padding: 0.5em; + margin: 0.3em 0; +} +#search-tabs select { + cursor: pointer; + margin: 0.8em 0; +} +#search-tabs input[type="text"] { + margin: 0.6em 0; +} +#search-tabs .container .checkboxes, +#search-tabs .container .radios { + padding: 0.8em; + overflow: auto; +} +#search-tabs .container .checkboxes ul, +#search-tabs .container .radios ul { + padding: 0; margin: 0; + overflow: auto; +} +#search-tabs .container .radios li, +#search-tabs .container .checkboxes li { + padding: 0; + margin: 0.4em 0.3em; + float: left; + display: block; + width: 48%; +} +#search-tabs .container .radios li { + width: 30%; +} +#search-tabs .container .radios li label, +#search-tabs .container .checkboxes li label { + padding: 0; + margin: 0; + float: none; + width: 100% +} +#search-tabs .search-tips-small { + font-size: 80%; + margin: 0 0.5em 0 11.2em; + color: #999; + font-family: Helvetica, Arial, sans-serif; + width: auto; + float: none; +} +#search-tabs input[type="text"] { + border: #9b9b9b 1px solid; + padding: 0.2em; + width: 30em; +} +#search-tabs input[type="text"]:hover { + background: #e7f7f8; +} +#search-tabs label[for="id_include_archived"] { + width: 13em; +} +.submit-search { + clear: left; + border-top: 1px solid #e0e0e0; + text-align: right; + margin-top: 1em; + padding: 1em 2em 0 0; +} +.submit-search input { + border: none; + background: url('../img/search/submit-button-bg.png') repeat-x #4acc0c bottom; + cursor: pointer; + font-size: 1.143em; + padding: 0.4em 0.6em; + border: 0; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + color: #ffffff; + font-weight: bold; +} +form .showhide-input input { + width: 7em !important; +} + +/* jquery ui styling for tabs and datepicker */ +.ui-tabs-nav { + height: 2.2em; + font-weight: bold; + margin-left: 2em; +} +.ui-tabs .ui-tabs-nav { + list-style-image:none; + list-style-position:outside; + list-style-type:none; + padding:0.2em 0.2em 0; + position:relative; +} +.ui-tabs .ui-tabs-nav li { + border-bottom-width:0 !important; + float:left; + padding:0; + position:relative; + background: #e9f1f4; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; +} + +.ui-tabs .ui-tabs-nav li a { + float:left; + padding:0.5em 1em; + text-decoration:none; + color: #000; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { + border-bottom-width:0; + padding-bottom:20px; + background: url('../img/search/active-tab.png') no-repeat bottom center; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a { + color: #fff; + background: #393939; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -moz-border-radius-bottomright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { + cursor:text; +} +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { + cursor:pointer; +} +.ui-tabs .ui-tabs-panel { + -moz-background-clip:border; + -moz-background-inline-policy:continuous; + -moz-background-origin:padding; + background:transparent none repeat scroll 0 0; + border-width:0; + display:block; + padding:1.4em; +} +.ui-tabs .ui-tabs-hide { + display:none !important; +} +.ui-datepicker { + background: #eee; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; +} +.ui-datepicker { + padding:0.2em 0.2em 0; + width:17em; +} +.ui-datepicker .ui-datepicker-header { + padding:0.2em 0; + position:relative; +} +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { + height:1.8em; + position:absolute; + top:2px; + width:1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { + top:1px; +} +.ui-datepicker .ui-datepicker-prev { + left:2px; + background: url('../img/icons/toleft.gif') no-repeat top left; +} +.ui-datepicker .ui-datepicker-next { + right:2px; + background: url('../img/icons/toright.gif') no-repeat top right; +} +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { + display: none; +} +.ui-datepicker .ui-datepicker-title { + line-height:1.8em; + margin:0 2.3em; + text-align:center; +} +.ui-datepicker .ui-datepicker-title select { + float:left; + font-size:1em; + margin:1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width:100%; +} +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { + width:49%; +} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { + float:right; +} +.ui-datepicker table { + border-collapse:collapse; + font-size:0.9em; + margin:0 0 0.4em; + width:100%; +} +.ui-datepicker th { + border:0 none; + font-weight:bold; + padding:0.7em 0.3em; + text-align:center; +} +.ui-datepicker td { + border:0 none; + padding:1px; +} +.ui-datepicker td span, .ui-datepicker td a { + display:block; + padding:0.2em; + text-align:right; + text-decoration:none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image:none; + border-bottom:0 none; + border-left:0 none; + border-right:0 none; + margin:0.7em 0 0; + padding:0 0.2em; +} +.ui-datepicker .ui-datepicker-buttonpane button { + cursor:pointer; + float:right; + margin:0.5em 0.2em 0.4em; + overflow:visible; + padding:0.2em 0.6em 0.3em; + width:auto; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float:left; +} +.ui-datepicker.ui-datepicker-multi { + width:auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float:left; +} +.ui-datepicker-multi .ui-datepicker-group table { + margin:0 auto 0.4em; + width:95%; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width:50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width:33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width:25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { + border-left-width:0; +} +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width:0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear:left; +} +.ui-datepicker-row-break { + clear:both; + width:100%; +} +.ui-datepicker-rtl { + direction:rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + left:auto; + right:2px; +} +.ui-datepicker-rtl .ui-datepicker-next { + left:2px; + right:auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + left:auto; + right:1px; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left:1px; + right:auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear:right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float:left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { + float:right; +} +.ui-datepicker-rtl .ui-datepicker-group { + float:right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { + border-left-width:1px; + border-right-width:0; +} +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width:1px; + border-right-width:0; +} +.ui-datepicker-cover { + display:block; + height:200px; + left:-4px; + position:absolute; + top:-4px; + width:200px; + z-index:-1; +} diff --git a/media/css/search.css b/media/css/search.css index 7278effca4f..b54e20b6042 100644 --- a/media/css/search.css +++ b/media/css/search.css @@ -86,380 +86,3 @@ input.search-refine-submit:hover { background-color: #f90; } /* END Bug 527859 */ -/* Bug 501880 -- advanced search */ -.show-search-tabs { - padding: 0.5em; - display: inline-block; -} -input.search-empty-query { - padding: 5px; -} -input.search-empty-submit { - -moz-border-radius: 8px; - padding: 5px 10px; -} -div.search-empty { - margin: 1em 0 1.5em; -} -div.search-empty form { - margin-top: 1em; -} -/* END Bug 501880 */ - -/* advanced search styling */ -body.advanced_search .botbar -, body.advanced_search .topbar -{ - display: none; -} - -/* tabs styling */ -.ui-tabs { - padding: 0 0.2em; - font-size: 120%; - margin-bottom: 2em; -} -a.tablink { - outline: none; -} - -#tab-wrapper { - margin: 0; padding: 0; - -moz-box-shadow: 0 4px 9px #888; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - background: #fff; - color: #333; -} - -/* form styling */ -#search-tabs { - margin-top: 1em; -} -#search-tabs .container { - clear: left; -} -#search-tabs label { - cursor: pointer; - display: block; - float: left; - width: 8em; - padding: 0.5em; - margin: 0.3em 0; -} -#search-tabs select { - cursor: pointer; - margin: 0.8em 0; -} -#search-tabs input[type="text"] { - margin: 0.6em 0; -} -#search-tabs .container .checkboxes, -#search-tabs .container .radios { - padding: 0.8em; - overflow: auto; -} -#search-tabs .container .checkboxes ul, -#search-tabs .container .radios ul { - padding: 0; margin: 0; - overflow: auto; -} -#search-tabs .container .radios li, -#search-tabs .container .checkboxes li { - padding: 0; - margin: 0.4em 0.3em; - float: left; - display: block; - width: 48%; -} -#search-tabs .container .radios li { - width: 30%; -} -#search-tabs .container .radios li label, -#search-tabs .container .checkboxes li label { - padding: 0; - margin: 0; - float: none; - width: 100% -} -#search-tabs .search-tips-small { - font-size: 80%; - margin: 0 0.5em 0 11.2em; - color: #999; - font-family: Helvetica, Arial, sans-serif; - width: auto; - float: none; -} -#search-tabs input[type="text"] { - border: #9b9b9b 1px solid; - padding: 0.2em; - width: 30em; -} -#search-tabs input[type="text"]:hover { - background: #e7f7f8; -} -#search-tabs label[for="id_include_archived"] { - width: 13em; -} -.submit-search { - clear: left; - border-top: 1px solid #e0e0e0; - text-align: right; - margin-top: 1em; - padding: 1em 2em 0 0; -} -.submit-search input { - border: none; - background: url('../img/search/submit-button-bg.png') repeat-x #4acc0c bottom; - cursor: pointer; - font-size: 1.143em; - padding: 0.4em 0.6em; - border: 0; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - color: #ffffff; - font-weight: bold; -} -form .showhide-input input { - width: 7em !important; -} - -/* jquery ui styling for tabs and datepicker */ -.ui-tabs-nav { - height: 2.2em; - font-weight: bold; - margin-left: 2em; -} -.ui-tabs .ui-tabs-nav { - list-style-image:none; - list-style-position:outside; - list-style-type:none; - padding:0.2em 0.2em 0; - position:relative; -} -.ui-tabs .ui-tabs-nav li { - border-bottom-width:0 !important; - float:left; - padding:0; - position:relative; - background: #e9f1f4; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - -moz-border-radius-bottomright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-right-radius: 0; - -webkit-border-bottom-left-radius: 0; -} - -.ui-tabs .ui-tabs-nav li a { - float:left; - padding:0.5em 1em; - text-decoration:none; - color: #000; -} -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { - border-bottom-width:0; - padding-bottom:20px; - background: url('../img/search/active-tab.png') no-repeat bottom center; -} -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a { - color: #fff; - background: #393939; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - -moz-border-radius-bottomright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-right-radius: 0; - -webkit-border-bottom-left-radius: 0; -} -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { - cursor:text; -} -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { - cursor:pointer; -} -.ui-tabs .ui-tabs-panel { - -moz-background-clip:border; - -moz-background-inline-policy:continuous; - -moz-background-origin:padding; - background:transparent none repeat scroll 0 0; - border-width:0; - display:block; - padding:1.4em; -} -.ui-tabs .ui-tabs-hide { - display:none !important; -} -.ui-datepicker { - background: #eee; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; -} -.ui-datepicker { - padding:0.2em 0.2em 0; - width:17em; -} -.ui-datepicker .ui-datepicker-header { - padding:0.2em 0; - position:relative; -} -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { - height:1.8em; - position:absolute; - top:2px; - width:1.8em; -} -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { - top:1px; -} -.ui-datepicker .ui-datepicker-prev { - left:2px; - background: url('../img/icons/toleft.gif') no-repeat top left; -} -.ui-datepicker .ui-datepicker-next { - right:2px; - background: url('../img/icons/toright.gif') no-repeat top right; -} -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { - display: none; -} -.ui-datepicker .ui-datepicker-title { - line-height:1.8em; - margin:0 2.3em; - text-align:center; -} -.ui-datepicker .ui-datepicker-title select { - float:left; - font-size:1em; - margin:1px 0; -} -.ui-datepicker select.ui-datepicker-month-year { - width:100%; -} -.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { - width:49%; -} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { - float:right; -} -.ui-datepicker table { - border-collapse:collapse; - font-size:0.9em; - margin:0 0 0.4em; - width:100%; -} -.ui-datepicker th { - border:0 none; - font-weight:bold; - padding:0.7em 0.3em; - text-align:center; -} -.ui-datepicker td { - border:0 none; - padding:1px; -} -.ui-datepicker td span, .ui-datepicker td a { - display:block; - padding:0.2em; - text-align:right; - text-decoration:none; -} -.ui-datepicker .ui-datepicker-buttonpane { - background-image:none; - border-bottom:0 none; - border-left:0 none; - border-right:0 none; - margin:0.7em 0 0; - padding:0 0.2em; -} -.ui-datepicker .ui-datepicker-buttonpane button { - cursor:pointer; - float:right; - margin:0.5em 0.2em 0.4em; - overflow:visible; - padding:0.2em 0.6em 0.3em; - width:auto; -} -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { - float:left; -} -.ui-datepicker.ui-datepicker-multi { - width:auto; -} -.ui-datepicker-multi .ui-datepicker-group { - float:left; -} -.ui-datepicker-multi .ui-datepicker-group table { - margin:0 auto 0.4em; - width:95%; -} -.ui-datepicker-multi-2 .ui-datepicker-group { - width:50%; -} -.ui-datepicker-multi-3 .ui-datepicker-group { - width:33.3%; -} -.ui-datepicker-multi-4 .ui-datepicker-group { - width:25%; -} -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { - border-left-width:0; -} -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width:0; -} -.ui-datepicker-multi .ui-datepicker-buttonpane { - clear:left; -} -.ui-datepicker-row-break { - clear:both; - width:100%; -} -.ui-datepicker-rtl { - direction:rtl; -} -.ui-datepicker-rtl .ui-datepicker-prev { - left:auto; - right:2px; -} -.ui-datepicker-rtl .ui-datepicker-next { - left:2px; - right:auto; -} -.ui-datepicker-rtl .ui-datepicker-prev:hover { - left:auto; - right:1px; -} -.ui-datepicker-rtl .ui-datepicker-next:hover { - left:1px; - right:auto; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane { - clear:right; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button { - float:left; -} -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { - float:right; -} -.ui-datepicker-rtl .ui-datepicker-group { - float:right; -} -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { - border-left-width:1px; - border-right-width:0; -} -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { - border-left-width:1px; - border-right-width:0; -} -.ui-datepicker-cover { - display:block; - height:200px; - left:-4px; - position:absolute; - top:-4px; - width:200px; - z-index:-1; -} diff --git a/settings.py b/settings.py index d262211b296..6cd0ffb9dd4 100644 --- a/settings.py +++ b/settings.py @@ -347,9 +347,11 @@ def JINJA_CONFIG(): 'css/to-delete.css', 'css/questions.css', 'css/tags.css', + 'css/search.css', ), 'search': ( 'css/search.css', + 'css/search-advanced.css', ), 'wiki': ( 'css/users.autocomplete.css', @@ -562,14 +564,6 @@ def JINJA_CONFIG(): # String must not contain double quotes! IMAGE_ALLOWED_MIMETYPES = 'image/jpeg,image/png,image/gif' -# Max number of wiki pages or other questions to suggest might answer the -# question you're about to ask -QUESTIONS_MAX_SUGGESTIONS = 5 -# Number of extra suggestion results to pull from Sphinx to make up for -# possibly deleted wiki pages or question. To be safe, set this to the number -# of things that could be deleted between indexer runs. -QUESTIONS_SUGGESTION_SLOP = 3 - # How long do we cache the question counts (in seconds)? QUESTIONS_COUNT_TTL = 900 # 15 minutes.