app/template/akracing/Product/option.twig line 1

Open in your IDE?
  1. {#
  2. * Plugin Name : ProductOption
  3. *
  4. * Copyright (C) BraTech Co., Ltd. All Rights Reserved.
  5. * http://www.bratech.co.jp/
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. #}
  10. {% if Product.ProductOptions %}
  11.         {% for ProductOption in Product.ProductOptions %}
  12.             {% set value = 'productoption' ~ ProductOption.Option.id %}
  13.             {# ラジオボタン #}
  14.             {% if ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::RADIO_TYPE') %}
  15.                 <div class="ec-blockRadio" style="margin-top: 10px;">
  16.                     <div class="option_Label">
  17.                         <label for="productoption{{ ProductOption.Option.id }}">{{ form[value].vars.label }}</label>{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  18.                         {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  19.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  20.                         {% endif %}
  21.                     </div>
  22.                     {{ form_widget(form[value]) }}
  23.                 </div>
  24.             {# チェックボックス #}
  25.             {% elseif ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::CHECKBOX_TYPE')%}
  26.                 <div class="ec-checkbox" style="margin-top: 10px;">
  27.                     <div class="option_Label">
  28.                         <label for="productoption{{ ProductOption.Option.id }}">{{ form[value].vars.label }}</label>{% if ProductOption.Option.require_min > 0 %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  29.                         {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  30.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  31.                         {% endif %}
  32.                     </div>
  33.                     {{ form_widget(form[value]) }}
  34.                 </div>
  35.             {# プルダウンタイプ #}
  36.             {% elseif  ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::SELECT_TYPE')%}
  37.                 <div class="ec-select" style="margin-top: 10px;">
  38.                     <div class="option_Label">
  39.                         {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  40.                     {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  41.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  42.                     {% endif %}
  43.                     </div>
  44.                     <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  45.                         {{ form_widget(form[value]) }}
  46.                     {{ form_errors(form[value]) }}
  47.                     </div>
  48.                 </div>
  49.             {# 数値入力タイプ #}
  50.             {% elseif ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::NUMBER_TYPE') %}
  51.                 <div class="ec-numberInput" style="margin-top: 10px;">
  52.                     <div class="option_Label">
  53.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  54.                     {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  55.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  56.                     {% endif %}
  57.                     </div>
  58.                     <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  59.                         {{ form_widget(form[value]) }}
  60.                     {{ form_errors(form[value]) }}
  61.                     </div>
  62.                 </div>
  63.             {# 日付タイプ #}
  64.             {% elseif ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::DATE_TYPE') %}
  65.                 <div class="ec-input" style="margin-top: 10px;">
  66.                     <div class="option_Label">
  67.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  68.                     {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  69.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  70.                     {% endif %}
  71.                     </div>
  72.                     <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %} style="position: relative">
  73.                         {{ form_widget(form[value], { attr : { 'data-target' : '#'~form[value].vars.id }}) }}
  74.                     {{ form_errors(form[value]) }}
  75.                     </div>
  76.                 </div>
  77.             {# テキストボックスタイプ #}
  78.             {% elseif ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::TEXT_TYPE') %}
  79.                 <div class="ec-input" style="margin-top: 10px;">
  80.                     <div class="option_Label">
  81.                     {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  82.                     {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  83.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  84.                     {% endif %}
  85.                     </div>
  86.                     <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  87.                         {{ form_widget(form[value]) }}
  88.                     {{ form_errors(form[value]) }}
  89.                     </div>
  90.                 </div>
  91.             {# テキストエリアタイプ #}
  92.             {% elseif ProductOption.Option.type == constant('Plugin\\ProductOption42\\Entity\\Option::TEXTAREA_TYPE')%}
  93.                 <div class="ec-input" style="margin-top: 10px;">
  94.                     <div class="option_Label">
  95.                         {{ form_label(form[value]) }}{% if form[value].vars.required %}<span class="ec-required">{{'common.required'|trans}}</span>{% endif %}
  96.                     {% if ProductOption.Option.description_flg == constant('Plugin\\ProductOption42\\Entity\\Option::DISP_ON') %}
  97.                         &nbsp;<a href="?" id="option_description_link_{{ Product.id }}_{{ ProductOption.Option.id }}" data="{{ Product.id }}"><span class="ec-link ec-font-size-2">{{'productoption.product.option.description.title'|trans}}</span></a>
  98.                     {% endif %}
  99.                     </div>
  100.                     <div {% if form[value].vars.errors is not empty %}class="has-error"{% endif %}>
  101.                         {{ form_widget(form[value]) }}
  102.                     {{ form_errors(form[value]) }}
  103.                     </div>
  104.                 </div>
  105.             {% endif %}
  106.         {% endfor %}
  107. {% endif %}