소스 검색

[search] Fixing UTC time and default sort`

Romain Rigaux 13 년 전
부모
커밋
a2e2f06aed
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      apps/search/src/search/templates/index.mako
  2. 1 1
      apps/search/src/search/views.py

+ 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