Skip to content
Snippets Groups Projects
Commit 06f254d4 authored by anonymous's avatar anonymous
Browse files

fix layout for range search

parent 00dbfc71
No related branches found
No related tags found
No related merge requests found
ckan.module('odsh_rangesearch', function ($)
{
return {
initialize: function ()
{
var start = $("#ext_startdate")
var end = $("#ext_enddate")
var checkbox = $('#check-rangefilter')
var label = $('#rangesearch-label')
label.click(function ()
{
if (label.hasClass('checked'))
{
start.val('')
end.val('')
}
if (!label.hasClass('disabled'))
$('#date-search-form').submit();
});
var updateCheckbox = function ()
{
var enable = (start.val() || end.val())
label.toggleClass('disabled', !enable);
if (!enable)
$('#date-search-form').submit();
};
start.change(updateCheckbox)
end.change(updateCheckbox)
}
};
});
\ No newline at end of file
...@@ -320,8 +320,14 @@ label.rangesearch.disabled { ...@@ -320,8 +320,14 @@ label.rangesearch.disabled {
display: inline-block; display: inline-block;
} }
.rangesearch a{
color:black;
font-size:14px;
}
.controls input.rangesearch{ .controls input.rangesearch{
width:155px; font-style: normal;
width:187px;
padding: 2px; padding: 2px;
font-size: 12px; font-size: 12px;
line-height: 1.16666667em; line-height: 1.16666667em;
......
...@@ -32,17 +32,12 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11 ...@@ -32,17 +32,12 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11
</div> </div>
{% block datereange_search %} {% block datereange_search %}
{% resource 'odsh/odsh_rangesearch.js' %}
{% set has_range_filter = request.params.get('ext_startdate') or request.params.get('ext_enddate') %} {% set has_range_filter = request.params.get('ext_startdate') or request.params.get('ext_enddate') %}
<section class="module module-narrow module-shallow"> <section class="module module-narrow module-shallow">
<nav> <nav>
<div class="nav-title">{{_('timerange')}}</div> <div class="nav-title">{{_('timerange')}}</div>
<div class="rangesearch-controls"> <div class="rangesearch-controls">
<form id="date-search-form" method="get" action="{% url_for controller='package', action='search' %}" data-module="odsh_rangesearch"> <form id="date-search-form" method="get" action="{% url_for controller='package', action='search' %}">
<div class='span1'>
<label id="rangesearch-label" class="rangesearch {% if has_range_filter %} checked {%else%} disabled {% endif %}"></label>
</div>
<div class='span1'>
<div class='controls rangesearch'> <div class='controls rangesearch'>
{%- set start = request.params['ext_startdate'] -%} {%- set start = request.params['ext_startdate'] -%}
{%- set end = request.params['ext_enddate'] -%} {%- set end = request.params['ext_enddate'] -%}
...@@ -55,7 +50,7 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11 ...@@ -55,7 +50,7 @@ default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[7.6574,53.1632],[11
<label for="ext_enddate">{{_('to')|title}}</label> <label for="ext_enddate">{{_('to')|title}}</label>
<input id="ext_enddate" name="ext_enddate" type="{{ typeEnd }}" value="{{end}}" placeholder="{{ _('Date') }}" <input id="ext_enddate" name="ext_enddate" type="{{ typeEnd }}" value="{{end}}" placeholder="{{ _('Date') }}"
{{ onFocus }} class='rangesearch' /> {{ onFocus }} class='rangesearch' />
</div> <a class='pull-right' href="javascript:{}" onclick="$('#date-search-form').submit();" class="action">{{_('submit date search') }}</a>
</div> </div>
</form> </form>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment