diff --git a/themes/blueprint/templates/Recommend/SideFacets.phtml b/themes/blueprint/templates/Recommend/SideFacets.phtml index f932a1a28920865359420fcd8b34938b57205043..6d465ca619b315bae5e64c7199c9c0a134086dbe 100644 --- a/themes/blueprint/templates/Recommend/SideFacets.phtml +++ b/themes/blueprint/templates/Recommend/SideFacets.phtml @@ -46,6 +46,9 @@ <? if (isset($rangeFacets[$title])): ?> <? if ($rangeFacets[$title]['type'] == 'date'): ?> <? /* Load the publication date slider UI widget */ $this->headScript()->appendFile('pubdate_slider.js'); ?> + <? /* Set extra text input attributes */ $extraInputAttribs = 'maxlength="4" class="yearbox" '; ?> + <? else: ?> + <? /* No extra attributes by default */ $extraInputAttribs = ''; ?> <? endif; ?> <form action="" name="<?=$this->escapeHtmlAttr($title)?>Filter" id="<?=$this->escapeHtmlAttr($title)?>Filter"> <?=$results->getUrlQuery()->asHiddenFields(array('page' => '/./', 'filter' => "/^{$title}:.*/"))?> @@ -53,9 +56,9 @@ <fieldset class="publishDateLimit" id="<?=$this->escapeHtmlAttr($title)?>"> <legend><?=$this->transEsc($cluster['label'])?></legend> <label for="<?=$this->escapeHtmlAttr($title)?>from"><?=$this->transEsc('date_from')?>:</label> - <input type="text" size="4" maxlength="4" class="yearbox" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" /> + <input type="text" size="4" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" <?=$extraInputAttribs?>/> <label for="<?=$this->escapeHtmlAttr($title)?>to"><?=$this->transEsc('date_to')?>:</label> - <input type="text" size="4" maxlength="4" class="yearbox" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" /> + <input type="text" size="4" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" <?=$extraInputAttribs?>/> <div id="<?=$this->escapeHtmlAttr($title)?>Slider" class="<?=$this->escapeHtmlAttr($rangeFacets[$title]['type'])?>Slider"></div> <input type="submit" value="<?=$this->transEsc('Set')?>" id="<?=$this->escapeHtmlAttr($title)?>goButton"/> </fieldset> diff --git a/themes/blueprint/templates/search/advanced/ranges.phtml b/themes/blueprint/templates/search/advanced/ranges.phtml index 242dbe923088b73887f40d61aaf58e5207fc1508..0baf0ceed73aca46391f43561f7f567934fe2949 100644 --- a/themes/blueprint/templates/search/advanced/ranges.phtml +++ b/themes/blueprint/templates/search/advanced/ranges.phtml @@ -3,14 +3,17 @@ <? foreach ($this->ranges as $current): $escField = $this->escapeHtmlAttr($current['field']); ?> <? if ($current['type'] == 'date'): ?> <? /* Load the publication date slider UI widget */ $this->headScript()->appendFile('pubdate_slider.js'); ?> + <? /* Set extra text input attributes */ $extraInputAttribs = 'maxlength="4" class="yearbox" '; ?> + <? else: ?> + <? /* No extra attributes by default */ $extraInputAttribs = ''; ?> <? endif; ?> <input type="hidden" name="<?=$this->escapeHtmlAttr($current['type'])?>range[]" value="<?=$escField?>"/> <fieldset class="publishDateLimit span-5" id="<?=$escField?>"> <legend><?=$this->transEsc($params->getFacetLabel($current['field']))?></legend> <label for="<?=$escField?>from"><?=$this->transEsc('date_from')?>:</label> - <input type="text" size="4" maxlength="4" class="yearbox" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=$this->escapeHtmlAttr($current['values'][0])?>" /> + <input type="text" size="4" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=$this->escapeHtmlAttr($current['values'][0])?>" <?=$extraInputAttribs?>/> <label for="<?=$escField?>to"><?=$this->transEsc('date_to')?>:</label> - <input type="text" size="4" maxlength="4" class="yearbox" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=$this->escapeHtmlAttr($current['values'][1])?>" /> + <input type="text" size="4" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=$this->escapeHtmlAttr($current['values'][1])?>" <?=$extraInputAttribs?>/> <div id="<?=$escField?>Slider" class="<?=$this->escapeHtmlAttr($current['type'])?>Slider"></div> </fieldset> <? endforeach; ?> diff --git a/themes/bootstrap/templates/Recommend/SideFacets.phtml b/themes/bootstrap/templates/Recommend/SideFacets.phtml index 8a42bdd07516e67779dfb8beb4b9a67b16cbc0e7..f1802b7fe5f8b9e9dbca2bb19b1d599ba8c07f46 100644 --- a/themes/bootstrap/templates/Recommend/SideFacets.phtml +++ b/themes/bootstrap/templates/Recommend/SideFacets.phtml @@ -61,13 +61,14 @@ <?=$results->getUrlQuery()->asHiddenFields(array('page' => "/./", 'filter' => "/^{$title}:.*/"))?> <input type="hidden" name="<?=$this->escapeHtmlAttr($rangeFacets[$title]['type'])?>range[]" value="<?=$this->escapeHtmlAttr($title)?>"/> <div class="row-fluid"> + <? $extraInputAttribs = ($rangeFacets[$title]['type'] == 'date') ? 'maxlength="4" ' : ''; ?> <label class="span6" for="<?=$this->escapeHtmlAttr($title)?>from"> <?=$this->transEsc('date_from')?>:<br/> - <input type="text" maxlength="4" class="span12" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" /> + <input type="text" class="span12" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" <?=$extraInputAttribs?>/> </label> <label class="span6" for="<?=$this->escapeHtmlAttr($title)?>to"> <?=$this->transEsc('date_to')?>:<br/> - <input type="text" maxlength="4" class="span12" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" /> + <input type="text" class="span12" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" <?=$extraInputAttribs?>/> </label> </div> <? if ($rangeFacets[$title]['type'] == 'date'): ?> diff --git a/themes/bootstrap/templates/search/advanced/ranges.phtml b/themes/bootstrap/templates/search/advanced/ranges.phtml index 8401aa07c6eccb46eff02f91a20b4a3607cef91c..344d06a3442c8bdbaa706875067ee9ffa3fae502 100644 --- a/themes/bootstrap/templates/search/advanced/ranges.phtml +++ b/themes/bootstrap/templates/search/advanced/ranges.phtml @@ -1,13 +1,14 @@ <? if (isset($this->ranges) && !empty($this->ranges)): ?> <? $params = $this->searchParams($this->searchClassId); $params->activateAllFacets(); ?> <? foreach ($this->ranges as $current): $escField = $this->escapeHtmlAttr($current['field']); ?> + <? $extraInputAttribs = ($current['type'] == 'date') ? 'maxlength="4" ' : ''; ?> <fieldset class="span4 text-center"> <legend class="text-left"><?=$this->transEsc($params->getFacetLabel($current['field']))?></legend> <input type="hidden" name="<?=$this->escapeHtmlAttr($current['type'])?>range[]" value="<?=$escField?>"/> <label for="<?=$escField?>from"><?=$this->transEsc('date_from')?>:</label> - <input type="text" maxlength="4" class="yearbox span4" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" /> + <input type="text" class="span4" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" <?=$extraInputAttribs?>/> <label for="<?=$escField?>to"><?=$this->transEsc('date_to')?>:</label> - <input type="text" maxlength="4" class="yearbox span4" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" /> + <input type="text" class="span4" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" <?=$extraInputAttribs?>/> <? if ($current['type'] == 'date'): ?> <div class="pad"><input type="text" id="<?=$escField?><?=$this->escapeHtml($current['type'])?>Slider"></div> <? endif; ?> diff --git a/themes/bootstrap3/templates/Recommend/SideFacets.phtml b/themes/bootstrap3/templates/Recommend/SideFacets.phtml index 3188861a37fe0ea9aa54052641d93ff4e32ae033..fee540542207e27d1bc4744f88b3ee41bb127df3 100644 --- a/themes/bootstrap3/templates/Recommend/SideFacets.phtml +++ b/themes/bootstrap3/templates/Recommend/SideFacets.phtml @@ -65,17 +65,18 @@ <?=$results->getUrlQuery()->asHiddenFields(array('page' => "/./", 'filter' => "/^{$title}:.*/"))?> <input type="hidden" name="<?=$this->escapeHtmlAttr($rangeFacets[$title]['type'])?>range[]" value="<?=$this->escapeHtmlAttr($title)?>"/> <div class="row"> + <? $extraInputAttribs = ($rangeFacets[$title]['type'] == 'date') ? 'maxlength="4" ' : ''; ?> <div class="col-sm-6"> <label for="<?=$this->escapeHtmlAttr($title)?>from"> <?=$this->transEsc('date_from')?>: </label> - <input type="text" maxlength="4" class="form-control" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" /> + <input type="text" class="form-control" name="<?=$this->escapeHtmlAttr($title)?>from" id="<?=$this->escapeHtmlAttr($title)?>from" value="<?=isset($rangeFacets[$title]['values'][0])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][0]):''?>" <?=$extraInputAttribs?>/> </div> <div class="col-sm-6"> <label for="<?=$this->escapeHtmlAttr($title)?>to"> <?=$this->transEsc('date_to')?>: </label> - <input type="text" maxlength="4" class="form-control" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" /> + <input type="text" class="form-control" name="<?=$this->escapeHtmlAttr($title)?>to" id="<?=$this->escapeHtmlAttr($title)?>to" value="<?=isset($rangeFacets[$title]['values'][1])?$this->escapeHtmlAttr($rangeFacets[$title]['values'][1]):''?>" <?=$extraInputAttribs?>/> </div> </div> <? if ($rangeFacets[$title]['type'] == 'date'): ?> diff --git a/themes/bootstrap3/templates/search/advanced/ranges.phtml b/themes/bootstrap3/templates/search/advanced/ranges.phtml index 7523ec869c69540620afe84ab5f1ba54c5b8d693..48c1be612729d5e4a35b5c8ab400ab7335e52796 100644 --- a/themes/bootstrap3/templates/search/advanced/ranges.phtml +++ b/themes/bootstrap3/templates/search/advanced/ranges.phtml @@ -1,17 +1,18 @@ <? if (isset($this->ranges) && !empty($this->ranges)): ?> <? $params = $this->searchParams($this->searchClassId); $params->activateAllFacets(); ?> <? foreach ($this->ranges as $current): $escField = $this->escapeHtmlAttr($current['field']); ?> + <? $extraInputAttribs = ($current['type'] == 'date') ? 'maxlength="4" ' : ''; ?> <fieldset class="col-sm-4"> <legend><?=$this->transEsc($params->getFacetLabel($current['field']))?></legend> <input type="hidden" name="<?=$this->escapeHtmlAttr($current['type'])?>range[]" value="<?=$escField?>"/> <div class="row"> <div class="col-sm-6"> <label for="<?=$escField?>from"><?=$this->transEsc('date_from')?>:</label> - <input type="text" maxlength="4" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" class="form-control"/> + <input type="text" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" class="form-control" <?=$extraInputAttribs?>/> </div> <div class="col-sm-6"> <label for="<?=$escField?>to"><?=$this->transEsc('date_to')?>:</label> - <input type="text" maxlength="4" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" class="form-control"/> + <input type="text" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" class="form-control" <?=$extraInputAttribs?>/> </div> </div> <? if ($current['type'] == 'date'): ?>