<!-- BEGIN: MAIN -->
<style>
  .sub_category:invalid {
  color: #a9a9a9;
  }
</style>
<script src="themes/itbirja/js/add-files-old.js" type="text/javascript"></script>
<div class="centerwrap pt20 mb20">
  <div class="w700" style="margin: auto">
    <h1 class="f32 sm-text-center">Редактирование сертификата</h1>
    <div class="block-response mb15">
      <i class="ico-arrow-left dib v-align-m"></i>
      <a class="dib v-align-m f14 color-gray color-text" href="{PHP.usr.name|cot_url('users', 'm=details&u='$this'&tab=certificates')}">Назад к профилю</a>
    </div>
    <div id="foxPostForm" class="pt0 p15-20 white-bg-border w700">
      <form action="{PRDEDIT_FORM_ID|cot_url('certificates', 'm=edit&id='$this'&a=update)}" id="sendDodjiRequest" method="POST" name="sendDodjiRequest" enctype="multipart/form-data" class="js-form">
        <div>
          <div class="pt20 pb10 long-touch-js">
            <div>
              <label class="semibold" for="wish_description">Название сертификата</label><br/>
              <input name="title" id="wish_name" type="text" class="js-title-input w700 styled-input styled-input--thin f15" placeholder="Введите название..." value="{PRD_EDIT_SHORTTITLE}"/>
              <span class="js-title-error-field color-red hidden"></span>
            </div>
          </div>
        </div>
        <div class="clear"></div>
        <div>
          <div class="pt10 pb10 long-touch-js">
            <div>
              <label class="semibold" for="wish_description">Описание сертификата</label>
              <textarea data-autoresize class="js-description-input text w700 f15 autoheight-js js-stopwords-check" style="height:auto;padding-bottom: 5px;" cols="74" id="wish_description" name="description" rows="5" placeholder="">{PRD_EDIT_TEXT_NOTPARSE}</textarea>
            </div>
            <span class="js-description-error-field color-red hidden"></span>
            <div class="color-gray f12 pt10">
              Максимальная длина - 500 символов. Сейчас: <span class="wishdescused">0</span>
            </div>
          </div>
        </div>
        <div class="clear"></div>
        <div>
          <div class="certificate-file-block pt10 pb20">
            <label class="semibold">Сертификат</label>
            <div class="tooltipster tooltip_circle tooltip_circle--hover ml5" data-tooltip-text="<div class='tooltip-ico-warning'></div>Обязательно загрузите скан сертификата. 1 файл, не более 4Мб.">?</div>
            <div class="js-add-photo">
              <div class="js-template-photo-block" style="display:none;"><div class="add-photo__file-wrapper file-wrapper long-touch-js" style="margin: 0;"><div class="file-wrapper-block-certificate-file" style="<!-- IF {PRD_EDIT_IMAGE} -->background: url('{PRD_EDIT_IMAGE}') 0% 0% / 100%;<!-- ENDIF -->overflow: hidden;height:{PHP.cfg.certificates_sizes.preview.h}px;width:{PHP.cfg.certificates_sizes.preview.w}px;"></div><input type="file" class="js-file-input" accept=".jpeg, .jpg, .gif, .png"><div style="text-align: center; height: 25px; padding-top: 5px;"><span class="js-file-add-button button f14 font-OpenSans link-color dibi mt6i" data-init-text="Выбрать">Выбрать изображение</span><div class="dib js-delete hidden"><span class="f14 font-OpenSans link-color">Удалить</span></div></div><input class="js-photo-size" type="hidden" value=""><input class="js-delete-photo" type="hidden" value="0"></div></div>
              <div class="js-photo__block"></div>
              <div class="js-photo-resize__block mt10"><img src="themes/itbirja/images/empty.png" class="js-photo-resize__image" style="max-width: 100%; height: auto;display:none;" alt="" ></div>
              <div class="js-add-photo_error"></div>
            </div>
            <span class="js-files-error-field color-red hidden"></span>
          </div>
        </div>
        <div class="clear"></div>
        <div class="bottom-form-filed mt0 pt0">
          <input type="submit" value="Сохранить" class="js-sendDodjiRequest__submit green-btn btn--big pull-reset m-wMax w250 mt20"/>
          <!-- IF {PHP.usr.isadmin} -->
            <label class="ml10">
              <input type="checkbox" name="rmoder" value="1"<!-- IF {PHP.item.item_state} == 0 --> checked="checked"<!-- ENDIF -->>
              Опубликовать
            </label>
          <!-- ENDIF -->
          <input type="hidden" name="action" value="submit"/>
          <p class="form_delete_action">вы можете <a href="{PRDEDIT_FORM_ID|cot_url('certificates', 'm=edit&id='$this'&a=update&delete=1')}&x={PHP.sys.xk}">удалить</a> сертификат</p>
        </div>
      </form>
    </div>
  </div>
</div>
<script src="themes/itbirja/js/pages/prd_new_edit.js" type="text/javascript"></script>
<script type="text/javascript" src="themes/itbirja/js/jquery.imgareaselect.min.js"></script>
<script>
  $(document).ready(function() {
      $("#wish_description").keyup(function() {
          updateGigDescCharsCount();
      });
  });

  function updateGigDescCharsCount() {
      var used = $("#wish_description").val().length;
      $(".wishdescused").html(used);
  }

  $(window).load(function() {
      updateGigDescCharsCount();
  });

  var certificatePhoto = new DodjiPhotoModule();
  $(window).load(function () {
  	certificatePhoto.init({
  		selectorBlock: '.certificate-file-block',
  		maxCount: 1,
  		fileWrapperClass: 'file-wrapper-block-certificate-file',
  		fileInputName: 'certificate',
  		widthRatio: {PHP.cfg.certificates_sizes.main.w},
  		heightRatio: {PHP.cfg.certificates_sizes.main.h},
  		minWidth: {PHP.cfg.certificates_sizes.main.w},
  		minHeight: {PHP.cfg.certificates_sizes.main.h},
  		photos: [ ]
  	});
  });
</script>
<script src="themes/itbirja/js/pages/new_certificate.js" type="text/javascript"></script>

<!-- END: MAIN -->