unserver-unify
Version:
69 lines (68 loc) • 3.26 kB
HTML
<div class="modal-header">
<button class="close" ng-click="$dismiss()" type="button">
<span aria-hidden="true">
×
</span>
<span class="sr-only">
Close
</span>
</button>
<h3 class="modal-title">
{{ 'Upload File' | translate }} - {{ setting.title | translate }}
<span ng-if="setting.maxSize">
( < {{ setting.maxSize*1024 | fileSize}} )
</span>
</h3>
</div>
<div class="modal-body form-horizontal">
<div class="form-group">
<div class="col-md-12">
<img class="img-thumbnail" ng-if="setting.image && (setting.imageUrl || setting.ctrl.imageUrl)" ng-src="{{ setting.imageUrl || setting.ctrl.imageUrl }}"/>
<span ng-show="setting.image&&setting.maxheight">
<input accept="image/*" file-model="testfile" image="imageobj" ng-image-compress on-change="imageUploaded()" resize-max-height="{{setting.maxheight}}" resize-max-width="{{setting.maxwidth}}" resize-quality="0.8" resize-type="image/jpg" style="display:none" type="file"/>
<button class="btn btn-primary" ng-class="{'pull-right': setting.ctrl.imageUrl}" onclick="$(this).prev().click()" translate="">
Select File
</button>
</span>
<!--
<span ng-show="!setting.maxheight">
<input accept="{{ setting.accept || (setting.image ? 'image/*' : '') }}" nv-file-select="" style="display:none" type="file" uploader="uploader"/>
<button class="btn btn-default" ng-class="{'pull-right': setting.ctrl.imageUrl}" onclick="$(this).prev().click()">
{{ {eng:'Select File', chn:'选择文件'}|trans }}
</button>
</span>
-->
<button class="btn btn-danger" ng-click="recordvoice()" ng-if="setting.audiorecord&&ctrl.allowmedia">
{{ 'Direct Record' | translate }}
</button>
<button class="btn btn-danger" ng-click="recordvideo()" ng-if="setting.videorecord&&ctrl.allowmedia">
{{ 'Record Video' | translate }}
</button>
</div>
<img class="img-thumbnail" ng-if="setting.image&&setting.maxheight&&imageobj" ng-src="{{ imageobj.compressed.dataURL }}"/>
</div>
<div ng-repeat="item in uploader.queue">
<div class="uploader_thumb" ng-if="!setting.maxheight&&uploader.isHTML5 && uploader.queue.length >0" ng-thumb="{ file: item._file, height: 100 }">
</div>
<div ng-if="!setting.maxheight&&uploader.isHTML5 && uploader.queue.length >0" style="word-wrap: break-word">
<strong>
{{ { eng : 'File Name', chn : '文件名'} | trans }}
</strong>
: {{ item.file.name }},
<strong>
{{ { eng : 'Size', chn : '文件大小'} | trans }}
</strong>
: {{ item.file.size / 1024 | number:2 }} KB
</div>
<div class="progress" style="">
<div class="progress-bar" ng-style="{ 'width': uploader.progress + '%' }" role="progressbar">
</div>
</div>
<button class="btn btn-u btn-block" ng-click="item.upload()" >
{{ { eng : 'Upload', chn : '上传'} | trans }}
</button>
<label ng-show="item.file.size >setting.maxSize * 1024">
{{'The selected file is too large. The maximum upload size is' | translate}} {{ setting.maxSize }}KB.
</label>
</div>
</div>