<div class="std_block">
  <form class="std_form" id="popup_form" style="display:none;" method="post" action="index.php?r=adm/mediagallery/upload" enctype="multipart/form-data">
    <div>
      <input type="hidden" id="authentic_request_popup_form" name="authentic_request" value="{{ authentic_request }}">

      <div class="form-group">
        <label for="file" class="col-xs-3 control-label">{{ Lang_translate('_FILENAME', 'standard') }}</label>
        <div class="col-xs-9">
          <input type="file" class="fileupload" id="file" name="file" accept="{{ accepted_mime }}">
          {% if max_upload_size %}<span>(Max. {{ max_upload_size }} Mb)</span>{% endif %} 
        </div>
        <div class="nofloat"></div>
      </div>
      <div class="form-group">
        <label for="media_url" class="col-xs-3 control-label">{{ Lang_translate('_MEDIA_URL', 'standard') }}</label>
        <div class="col-xs-9">
          <input type="text" class="form-control" id="media_url" name="media_url">
        </div>
        <div class="nofloat"></div>
      </div>
    </div>
    <div class="form-group text-right">
      <input type="hidden" name="authentic_request" value="{{ authentic_request }}">
      <input type="hidden" name="type" value="{{ type }}">
      <input type="submit" class="button btn btn-primary" id="save" name="save" value="{{ Lang_translate('_UPLOAD', 'standard') }}">
      <input type="reset" class="button btn btn-default" id="popup_form_undo" name="undo" value="{{ Lang_translate('_CANCEL', 'standard') }}">
      <div class="nofloat"></div>
    </div>
  </form>
  {% if msg %}
    <div class="alert alert-{{ msg.class }} text-center">{{ msg.text }}</div>
  {% endif %}
  <button id="popup_form_toggler" type="button" class="button btn btn-primary">{{ Lang_translate('_UPLOAD', 'standard') }}</button>
</div>

<script>
$('#popup_form_toggler, #popup_form_undo').click(function() {
  $('#popup_form').toggle();
  $('#popup_form_toggler').toggle();
});
</script>