Explorar o código

[search] Fixing UTC time and default sort`

Romain Rigaux %!s(int64=13) %!d(string=hai) anos
pai
achega
a2e2f06

+ 1 - 1
apps/search/src/search/templates/index.mako

@@ -253,7 +253,7 @@ ${ commonheader(_('Search'), "search", user) }
 <script>
   $(document).ready(function(){
     $("a[data-dt]").each(function(){
-      $(this).text(moment($(this).data("dt")).add("hours", 7).fromNow());
+      $(this).text(moment($(this).data("dt")).add("hours", 8).fromNow());
     });
     $(".text").click(function(e){
       if ($(e.target).is("div")){

+ 1 - 1
apps/search/src/search/views.py

@@ -42,7 +42,7 @@ def index(request):
     solr_query = {}
     solr_query['q'] = search_form.cleaned_data['query']
     solr_query['fq'] = search_form.cleaned_data['fq']
-    solr_query['sort'] = search_form.cleaned_data['sort']
+    solr_query['sort'] = search_form.cleaned_data['sort'] or 'created_at desc'
     solr_query['rows'] = search_form.cleaned_data['rows'] or 15
     solr_query['start'] = search_form.cleaned_data['start'] or 0
     solr_query['facets'] = search_form.cleaned_data['facets'] or 1