1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 16:04:24 +03:00
ifhub.club/application/frontend/components/poll/poll.form.item.tpl

45 lines
1.4 KiB
Smarty
Raw Normal View History

2014-06-23 15:51:40 +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
*}
{$component = 'ls-poll-form-answer-item'}
{component_define_params params=[ 'item', 'index', 'allowRemove', 'showRemove', 'isTemplate' ]}
{$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>