<div id="ticketLoadingBar" class="ticketLoadingBar"></div>
<div id="ticketAddon" class="ticketAddon">
  <div ng-controller="quickTicketCtrl" id="quickTicketCtrl">
    <div ng-bind-html-unsafe="{{preview_data.preview.embed.html}}"></div>
    <%if (errors.size() > 0) {%>
    <div>
      <ul>
      <% errors.each { error ->
      %>
       <li class="result-message alert alert-error">
         <i class="uiIconError"></i>
         ${error}
       </li>
      <%
        }
      %>
      </ul>
    </div>
    <% } else {%>
    <div id="resultMessage" ng-show="(resultMessage.length > 0)"  class="result-message alert {{resultMessageClass}}">
      <i class="{{resultMessageClassExt}}"></i>
      {{resultMessage}}
      <a ng-show="ticketLink && ticketLink.length > 0" href="{{ticketLink}}">{{ticketLabel}}</a>
    </div>
    <form name="newTicketForm" class="form-horizontal" ng-show="newTicket != null" ng-submit="saveTicket()">
      <h3>{{i18n.reportFeedbackTitle}}</h3>
      <div class="control-group">
        <label class="control-label" for="requestTitleLabel">{{i18n.requestTitleLabel}}</label>
        <div class="controls">
          <input type="text" name="requestTitleLabel" id="requestTitleLabel" placeholder="{{i18n.requestTitleLabel}}" ng-model="newTicket.title" required>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="requestDescription">{{i18n.requestDescriptionLabel}}</label>
        <div class="controls">
          <textarea rows="10" cols="50" id="requestDescription" name="requestDescription" ng-model="newTicket.description" placeholder="{{i18n.requestDescriptionLabel}}" required ckEditorDirective></textarea>
          <span ng-show="(ckeditorErrorMessage.length > 0)" class="{{ckeditorErrorClass}}">{{i18n.validateAddDescription}}</span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="fileToImport">{{i18n.attachement}}</label>
        <div class="controls">
          <div class="uiAction">
            <input type="file" id="fileToImport" accept="*" name="fileToImport" style="display: none;" onchange="angular.element(this).scope().prepareImportFile(this);"  multiple="multiple"/>
            <input id="btUpload" class="btn input-large" type="button" value="{{i18n.chooseFile}}" onclick="angular.element(this).scope().fileUploadClick();">
            <div>
                <ul class="list-group">
                  <li class="list-group-item" ng-repeat="importFile in importFiles" ng-bind-html-unsafe="importFile.name" >
                      {{ importFile.name }}
                  </li>
                </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="uiAction">
        <button ng-show="!scope.fileUploading" ng-disabled="submitInProgress"  type="submit" class="btn btn-primary">{{i18n.reportFeedback}}</button>
      </div>
    </form>
    <%}%>
  </div>
</div>