/modules/mod_admin/templates/_action_dialog_zmedia_choose.tpl

http://github.com/zotonic/zotonic · Smarty Template · 60 lines · 51 code · 9 blank · 0 comment · 1 complexity · f6ddaa3818d4662e45a7153a93cfed0b MD5 · raw file

  1. {% tabs id=#tabs %}
  2. <div class="tabbable">
  3. <ul class="nav nav-pills">
  4. <li class="active"><a data-toggle="tab" href="#{{ #tab }}-media">{_ Media on this page _}</a></li>
  5. <li><a data-toggle="tab" href="#{{ #tab }}-search">{_ Search other media _}</a></li>
  6. </ul>
  7. <div class="tab-content">
  8. <div class="tab-pane active" id="{{ #tab }}-media">
  9. <p>{_ Choose a media item from this page to insert in the body text._}</p>
  10. {% with m.rsc[id].o.depiction as ids %}
  11. {% include "_choose_media.tpl" %}
  12. {% endwith %}
  13. <div class="modal-footer">
  14. {% button
  15. class="btn btn-primary"
  16. text=_"Add a new media item"
  17. action={dialog_media_upload subject_id=id stay
  18. action={postback
  19. postback={zmedia_choose}
  20. delegate="action_admin_zmedia_choose"}
  21. action={postback
  22. postback={reload_media rsc_id=id div_id=media_div_id}
  23. delegate="controller_admin_edit"
  24. }
  25. }
  26. %}
  27. </div>
  28. </div>
  29. <div class="tab-pane" id="{{ #tab }}-search">
  30. <div class="form-group">
  31. <label for="{{#input}}" class="control-label">{_ Use the autocompleter to search the media in this site. _}</label>
  32. <div>
  33. <input id="{{#input}}" class="autocompleter do_autofocus col-lg-8 col-md-8 form-control" type="text" value="" />
  34. <ul id="{{#suggestions}}" class="suggestions-list"></ul>
  35. </div>
  36. </div>
  37. {% wire id=#input
  38. type="keyup"
  39. action={typeselect
  40. target=#suggestions
  41. action_with_id={with_args action={link subject_id=subject_id predicate="depiction" element_id=element_id} arg={object_id select_id}
  42. }
  43. action={postback postback={reload_media rsc_id=id div_id=media_div_id} delegate="controller_admin_edit"}
  44. action_with_id={with_args action={zmedia_has_chosen} arg={id select_id}}
  45. action={dialog_close}
  46. cat=m.predicate.object_category["depiction"]
  47. }
  48. %}
  49. </div>
  50. </div>
  51. </div>