Skip to content

Commit

Permalink
Dev: twigging of question types -> datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Mar 6, 2018
1 parent 7d6e1d7 commit 71e7fbf
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 242 deletions.
3 changes: 2 additions & 1 deletion application/config/internal.php
Expand Up @@ -246,6 +246,7 @@
'ngT' => 'ngT',
'createUrl' => 'LS_Twig_Extension::createUrl',
'json_decode' => 'LS_Twig_Extension::json_decode',
'json_encode' => 'CJSON::encode',
),
'filters' => array(
'jencode' => 'CJSON::encode',
Expand All @@ -270,7 +271,7 @@
'Question' => array('qid', 'parent_qid', 'sid', 'gid', 'type', 'title', 'question', 'help', 'other', 'mandatory', 'language', 'scale_qid'),
'QuestionGroups' => array('gid', 'sid', 'group_name', 'group_order', 'description', 'language', 'randomization_group', 'grelevance')
),
'functions' => array('include', 'dump', 'flatEllipsizeText', 'getLanguageData', 'array_flip', 'array_intersect_key', 'registerPublicCssFile', 'registerTemplateCssFile', 'registerGeneralScript', 'registerTemplateScript', 'registerScript', 'registerPackage', 'unregisterPackage', 'registerCssFile', 'registerScriptFile', 'unregisterScriptFile', 'unregisterScriptForAjax', 'listCoreScripts', 'listScriptFiles', 'getAllQuestionClasses', 'intval', 'count', 'empty', 'reset', 'renderCaptcha', 'getPost', 'getParam', 'getQuery', 'isset', 'str_replace', 'assetPublish', 'image', 'imageSrc', 'sprintf', 'gT', 'ngT', 'createUrl', 'json_decode'),
'functions' => array('include', 'dump', 'flatEllipsizeText', 'getLanguageData', 'array_flip', 'array_intersect_key', 'registerPublicCssFile', 'registerTemplateCssFile', 'registerGeneralScript', 'registerTemplateScript', 'registerScript', 'registerPackage', 'unregisterPackage', 'registerCssFile', 'registerScriptFile', 'unregisterScriptFile', 'unregisterScriptForAjax', 'listCoreScripts', 'listScriptFiles', 'getAllQuestionClasses', 'intval', 'count', 'empty', 'reset', 'renderCaptcha', 'getPost', 'getParam', 'getQuery', 'isset', 'str_replace', 'assetPublish', 'image', 'imageSrc', 'sprintf', 'gT', 'ngT', 'createUrl', 'json_decode', 'json_encode'),
),

),
Expand Down
39 changes: 0 additions & 39 deletions application/views/survey/questions/answer/date/dropdown/answer.php

This file was deleted.

@@ -0,0 +1,37 @@
{#
/**
* Date Html, dropdown style
*
* @var $sRows : the rows, generated with the view rows/*.php
*
* @var $name
* @var $dateoutput
* @var $checkconditionFunction
* @var $dateformatdetails
* @var $dateformat
*/ #}


<!-- Date, dropdown layout -->

<!-- answer -->
<div class="{{coreClass}} form-group form-inline" role="group" aria-labelledby="ls-question-text-{{name}}">
{# // rows/*.php #}
{{sRows}}
</div>

<!-- For Expression Manager ? -->
<input
class="text"
type="text"
size="10"
name="{{name}}"
style="display: none"
id="answer{{name}}"
value="{{dateoutput}}"
maxlength="10"
onchange="{{checkconditionFunction}}"
title="{{ sprintf(gT('Date in the format : %s'), dateformat) }}"
/>
<input type="hidden" id="dateformat{{name}}" value="{{dateformatdetails}}"/>
<!-- end of answer -->

This file was deleted.

@@ -0,0 +1 @@
<span class="hidden-xs">{{datepart}}</span>

This file was deleted.

@@ -0,0 +1,25 @@
{# <?php
/**
* Day dropdown Html
* @var $dayId
* @var $currentdate
*/
?> #}

<!-- day -->
<label for="day{{dayId}}" class="sr-only">
{{gT('Day')}}
</label>
<select id="day{{dayId}}" name="day{{dayId}}" class="form-control day">
<option value="">
{{gT('Day')}}
</option>

{% for i in 1..31 %}
<option value="{{sprintf('%02d', i)}}" {{ (i == currentdate) ? 'selected' : '' }}>
{{ sprintf('%02d', i) }}
</option>
{% endfor %}
</select>

<!-- end of day -->

This file was deleted.

@@ -0,0 +1,27 @@
{# <?php
/**
* Hour dropdown Html
* @var $hourId
* @var $currenthour
* @var $datepart
*/
?> #}
<!-- hour -->
<label for="hour{{hourId}}" class="sr-only">
{{gT('Hour')}}
</label>

<select id="hour{{hourId}}" name="hour{{hourId}}" class="hour form-control">
<option value="">{{gT('Hour')}}</option>
{% for i in 0..23 %}
<option value="{{i}}" {% if i is same as(currenthour) %} 'selected' {% endif %} >
{% if (datepart=='H') %}
{{sprintf('%02d', i)}}
{% else %}
{{i}}
{% endif %}
</option>
{% endfor %}
</select>

<!-- end of hour -->

This file was deleted.

@@ -0,0 +1,32 @@
{# <?php
/**
* Minute dropdown Html
* @var $minuteId
* @var $currentminute
* @var $dropdown_dates_minute_step
* @var $datepart
*/
?> #}

<!-- minute -->
<label for="minute{{minuteId}}" class="sr-only">
{{ gT('Minute') }}
</label>
<select id="minute{{minuteId}}" name="minute{{minuteId}}" class="minute form-control">
<option value="">
{{ gT('Minute') }}
</option>
{% for i in 0..59 %}
{% if i is divisible by(dropdown_dates_minute_step) %}
<option value="{{i}}" {% if i is same as(currentminute) %} 'selected' {% endif %} >
{% if datepart is same as('i') %}
{{sprintf('%02d', i)}}
{% else %}
{{i}}
{% endif %}
</option>
{% endif %}
{% endfor %}
</select>

<!-- end of minute -->

This file was deleted.

@@ -0,0 +1,25 @@
{# <?php
/**
* Month dropdown Html
* @var $monthId
* @var $currentmonth
* @var $montharray
*/
?> #}

<!-- month -->
<label for="month{{monthId}}" class="sr-only">
{{gT('Month')}}
</label>
<select id="month{{monthId}}" name="month{{monthId}}" class="month form-control">
<option value="">
{{gT('Month')}}
</option>
{% for i in 1..12 %}
<option value="{{sprintf('%02d', i)}}" {% if i is same as(currentmonth) %} 'selected' {% endif %} >
{{montharray[(i-1)]}}
</option>
{% endfor %}
</select>

<!-- end of month -->

This file was deleted.

@@ -0,0 +1,31 @@
{# <?php
/**
* Year dropdown Html
* @var $yearId
* @var $currentyear
* @var $yearmax
* @var $reverse
* @var $yearmin
* @var $step
*/
?> #}

<!-- year -->
<label for="year{{yearId}}" class="sr-only">
{{gT('Year')}}
</label>

<select id="year{{yearId}}" name="year{{yearId}}" class="year form-control">
<option value="">
{{gT('Year')}}
</option>
{% for i in yearmin..(yearmax) %}
{% if loop.index is divisible by(step) %}
<option value="{{i}}"{% if i is same as(currentyear) %} 'selected' {% endif %} >
{{i}}
</option>
{% endif %}
{% endfor %}
</select>

<!-- end of year -->

0 comments on commit 71e7fbf

Please sign in to comment.