Explorar o código

HUE-3294 [search] Improved style of the datepicker

Enrico Berti %!s(int64=9) %!d(string=hai) anos
pai
achega
8a205f0

+ 0 - 2
apps/search/src/search/templates/common_search.mako

@@ -406,7 +406,6 @@ ${ dashboard.layout_skeleton() }
       <!-- /ko -->
       <!-- ko if: properties.isDate() && $root.collection.timeFilter && $root.collection.timeFilter.field && $root.collection.timeFilter.field() != field() -->
         <div data-bind="daterangepicker: {start: properties.start, end: properties.end, gap: properties.initial_gap, relatedgap: properties.gap, min: properties.min, max: properties.max}"></div>
-        <br/>
       <!-- /ko -->
     <!-- /ko -->
 
@@ -532,7 +531,6 @@ ${ dashboard.layout_skeleton() }
       <!-- /ko -->
       <!-- ko if: properties.isDate() && $root.collection.timeFilter && $root.collection.timeFilter.field && $root.collection.timeFilter.field() != field() -->
         <div data-bind="daterangepicker: {start: properties.start, end: properties.end, gap: properties.initial_gap, relatedgap: properties.gap, min: properties.min, max: properties.max}"></div>
-        <br/>
       <!-- /ko -->
     <!-- /ko -->
 

+ 5 - 0
desktop/core/src/desktop/static/desktop/css/common_dashboard.css

@@ -302,6 +302,7 @@ body.modal-open {
 .facet-field-switch {
   display: inline;
   margin-top: 10px;
+  margin-left: 3px;
 }
 
 .facet-field-label {
@@ -338,6 +339,10 @@ body.modal-open {
   float: left;
 }
 
+.card-column .simpledaterangepicker .input-prepend {
+  margin-left: 3px;
+}
+
 .card-column.span2 .facet-field-label-fixed-width {
   text-align: left;
   width: auto;

+ 11 - 10
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -1207,6 +1207,14 @@
       }
 
       var _tmpl = $('<div class="simpledaterangepicker">' +
+              '<div class="facet-field-cnt custom">' +
+              '<div class="facet-field-label facet-field-label-fixed-width"></div>' +
+              '<div class="facet-field-switch"><i class="fa fa-calendar muted"></i> <a href="javascript:void(0)">' + KO_DATERANGEPICKER_LABELS.DATE_PICKERS + '</a></div>' +
+              '</div>' +
+              '<div class="facet-field-cnt picker">' +
+              '<div class="facet-field-label facet-field-label-fixed-width"></div>' +
+              '<div class="facet-field-switch"><i class="fa fa-calendar-o muted"></i> <a href="javascript:void(0)">' + KO_DATERANGEPICKER_LABELS.CUSTOM_FORMAT + '</a></div>' +
+              '</div>' +
               '<div class="facet-field-cnt picker">' +
               '<div class="facet-field-label facet-field-label-fixed-width">' + KO_DATERANGEPICKER_LABELS.START + '</div>' +
               '<div class="input-prepend input-group">' +
@@ -1237,14 +1245,10 @@
               '</select>' +
               '<input class="input interval hide" type="hidden" value="" />' +
               '</div>' +
-              '<div class="facet-field-cnt picker">' +
-              '<div class="facet-field-label facet-field-label-fixed-width"></div>' +
-              '<div class="facet-field-switch"><a href="javascript:void(0)"><i class="fa fa-calendar-o"></i> ' + KO_DATERANGEPICKER_LABELS.CUSTOM_FORMAT + '</a></div>' +
-              '</div>' +
               '<div class="facet-field-cnt custom">' +
               '<div class="facet-field-label facet-field-label-fixed-width">' + KO_DATERANGEPICKER_LABELS.START + '</div>' +
               '<div class="input-prepend input-group">' +
-              '<span class="add-on input-group-addon"><i class="fa fa-calendar"></i></span>' +
+              '<span class="add-on input-group-addon"><i class="fa fa-calendar-o"></i></span>' +
               '<input type="text" class="input-large form-control start-date-custom" />' +
               '</div>' +
               '<span class="pointer custom-popover" data-trigger="click" data-toggle="popover" data-placement="right" rel="popover" data-html="true"' +
@@ -1256,7 +1260,7 @@
               '<div class="facet-field-cnt custom">' +
               '<div class="facet-field-label facet-field-label-fixed-width">' + KO_DATERANGEPICKER_LABELS.END + '</div>' +
               '<div class="input-prepend input-group">' +
-              '<span class="add-on input-group-addon"><i class="fa fa-calendar"></i></span>' +
+              '<span class="add-on input-group-addon"><i class="fa fa-calendar-o"></i></span>' +
               '<input type="text" class="input-large form-control end-date-custom" />' +
               '</div>' +
               '</div>' +
@@ -1267,10 +1271,7 @@
               '<input type="text" class="input-large form-control interval-custom" />' +
               '</div>' +
               '</div>' +
-              '<div class="facet-field-cnt custom">' +
-              '<div class="facet-field-label facet-field-label-fixed-width"></div>' +
-              '<div class="facet-field-switch"><a href="javascript:void(0)"><i class="fa fa-calendar"></i> ' + KO_DATERANGEPICKER_LABELS.DATE_PICKERS + '</a></div>' +
-              '</div>' +
+
 
               '</div>'
       );

+ 2 - 2
desktop/core/src/desktop/templates/common_dashboard.mako

@@ -243,8 +243,8 @@
       START: "${_('Start')}",
       END: "${_('End')}",
       INTERVAL: "${_('Interval')}",
-      CUSTOM_FORMAT: "${_('Custom Format')}",
-      DATE_PICKERS: "${_('Date Pickers')}",
+      CUSTOM_FORMAT: "${_('Switch to custom format')}",
+      DATE_PICKERS: "${_('Switch to date pickers')}",
       CUSTOM_POPOVER_TITLE: "${_('e.g.')}",
       CUSTOM_POPOVER_CONTENT: "${_('Start')}: NOW-5DAYS<br/>${_('End')}: NOW<br/>${_('Interval')}: +1HOURS<br/><a href='http://lucene.apache.org/solr/4_10_2/solr-core/org/apache/solr/util/DateMathParser.html' target='_blank'>${_('Read more...')}</a>"
     };