{% macro stream_select_button(widget, command_name, property_name, title_inflected) %}
    <a data-wysihtml5-command="{{ command_name }}" class="btn">Вставить ссылку на {{ title_inflected }}</a>
    <div class="wysihtml5-dialog-place">
      <div class="w-popup-stream-select wysihtml5-dialog wysihtml5-menu" style="display: none" 
           id="{{ widget.id }}-{{ property_name }}">
        <div class="w-buttons">
          <a data-wysihtml5-command="{{ command_name }}"
             data-wysihtml5-command-value="select">Выбрать {{ title_inflected }}</a>
          <a data-wysihtml5-command="{{ command_name }}"
            data-wysihtml5-command-value="create">Создать {{ title_inflected }}</a>
          <a data-wysihtml5-command="{{ command_name }}"
            data-wysihtml5-command-value="delete">Удалить {{ title_inflected }}</a>
          {{ select(widget, property_name) }}
        </div>
      </div>
    </div>
{% endmacro %}

{% macro select(widget, property_name) %}
   <div style="display: none" class='input-place'> 
     <a id="{{ widget.id }}-{{ property_name }}-btn"></a>
     <a id="{{ widget.id }}-{{ property_name }}-create"></a>
     <label></label>
     <input type="hidden" value="" />
     <table class="w-popup-stream-select-items">
       <tbody id="{{ widget.id }}-{{ property_name }}-div"></tbody>
     </table>
   </div>
{% endmacro %}

