2014-06-23 15:51:40 +03:00
|
|
|
{**
|
|
|
|
* Блок добавления ответа
|
|
|
|
*
|
2015-06-17 08:57:49 +03:00
|
|
|
* @param boolean $item
|
|
|
|
* @param integer $index
|
|
|
|
* @param boolean $allowRemove
|
|
|
|
* @param boolean $showRemove
|
|
|
|
* @param boolean $isTemplate
|
2014-06-23 15:51:40 +03:00
|
|
|
*}
|
|
|
|
|
2015-06-17 08:57:49 +03:00
|
|
|
{$component = 'ls-poll-form-answer-item'}
|
2016-01-18 20:19:18 +02:00
|
|
|
{component_define_params params=[ 'item', 'index', 'allowRemove', 'showRemove', 'isTemplate' ]}
|
2015-06-17 08:57:49 +03:00
|
|
|
|
|
|
|
{$allowUpdate = $allowUpdate|default:true}
|
|
|
|
{$allowRemove = $allowRemove|default:true}
|
|
|
|
{$showRemove = $showRemove|default:true}
|
|
|
|
{$index = $index|default:0}
|
|
|
|
|
|
|
|
<li class="{$component} js-poll-form-answer-item"
|
2015-10-27 11:02:57 +02:00
|
|
|
{if $isTemplate}data-is-template="true"{/if}
|
|
|
|
{if $isTemplate}style="display: none"{/if}>
|
2014-06-23 15:51:40 +03:00
|
|
|
|
2015-10-27 11:02:57 +02:00
|
|
|
{* ID *}
|
|
|
|
{component 'field' template='hidden'
|
|
|
|
name = "answers[{$index}][id]"
|
|
|
|
value = "{if $item}{$item->getId()}{/if}"
|
|
|
|
classes = "js-poll-form-answer-item-id"}
|
2014-06-23 15:51:40 +03:00
|
|
|
|
2015-10-27 11:02:57 +02:00
|
|
|
{* Текст *}
|
|
|
|
{component 'field' template='text'
|
|
|
|
name = 'answers[]'
|
|
|
|
value = ($item) ? $item->getTitle() : ''
|
|
|
|
isDisabled = ! $allowUpdate
|
2015-10-28 13:00:45 +02:00
|
|
|
inputClasses = 'ls-width-full js-poll-form-answer-item-text'}
|
2014-06-23 15:51:40 +03:00
|
|
|
|
2015-10-27 11:02:57 +02:00
|
|
|
{* Кнопка удаления *}
|
|
|
|
{if $allowRemove}
|
|
|
|
{component 'icon'
|
|
|
|
icon='remove'
|
|
|
|
classes="{$component}-remove js-poll-form-answer-item-remove"
|
|
|
|
attributes=[
|
|
|
|
style => "{if ! $showRemove}display: none{/if}"
|
|
|
|
]}
|
|
|
|
{/if}
|
2014-06-23 15:51:40 +03:00
|
|
|
</li>
|