<div ng-controller="cameraController" class="media-resource1">
    <h3>Upload Media</h3>
    <div>
        <form id="fileupload" action="{{upload_url}}" method="POST" enctype="multipart/form-data" data-file-upload="options" data-ng-class="{'fileupload-processing': processing() || loadingFiles}">
            <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
            <div class="row fileupload-buttonbar">
                <div class="col-lg-7">
                    <!-- The fileinput-button span is used to style the file input field as button -->
                            <span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
                                <i class="glyphicon glyphicon-plus"></i>
                                <span>Add files...</span>
                                <input type="file" name="files[]" multiple ng-disabled="disabled" accept="image/*" capture="camera">
                            </span>
                    <button type="button" class="btn btn-primary start" data-ng-click="submit()">
                        <i class="glyphicon glyphicon-upload"></i>
                        <span>Start upload</span>
                    </button>
                    <button type="button" class="btn btn-warning cancel" data-ng-click="cancel()">
                        <i class="glyphicon glyphicon-ban-circle"></i>
                        <span>Cancel upload</span>
                    </button>
                    <!-- The global file processing state -->
                    <span class="fileupload-process"></span>
                </div>
                <!-- The global progress state -->
                <div class="col-lg-5 fade" data-ng-class="{in: active()}">
                    <!-- The global progress bar -->
                    <div class="progress progress-striped active" data-file-upload-progress="progress()"><div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
                    <!-- The extended global progress state -->
                    <div class="progress-extended">&nbsp;</div>
                </div>
            </div>
            <div>
                <div class="row media-resource files ng-cloak">
                    <div ng-repeat="file in queue" class="image-container" ng-click="selectImage(file)" data-ng-class="{'processing': file.$processing()}">
                        <div class="col-xs-6 col-sm-3 col-md-2 col-lg-2">
                            <div class="media-wrapper" ng-class="{selected: file.selected}">
                                <div class="image-wrapper">
                                    <div class="centered">
                                        <img ng-src="{{file.url}}" class="img-responsive"/>
                                    </div>
                                </div>
                                <div class="image-title">{{file.name}}</div>
                            </div>
                            <div class="progress progress-striped active fade" data-ng-class="{pending: 'in'}[file.$state()]" data-file-upload-progress="file.$progress()">
                                <div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div>
                            </div>
                            <div class="text-center">
                                <button class="btn btn-primary" data-ng-controller="FileDestroyController" data-ng-click="file.$destroy()" data-ng-hide="!file.$destroy">
                                    <i class="fa fa-trash"></i> Delete
                                </button>
                            </div>
                        </div>

                    </div>
                    <div ng-repeat="file in filequeue" class="image-container" ng-click="selectImage(file)" data-ng-class="{'processing': file.$processing()}">
                        <div class="col-xs-6 col-sm-3 col-md-2 col-lg-2">
                            <div class="media-wrapper" ng-class="{selected: file.selected}">
                                <div class="image-wrapper">
                                    <div class="centered">
                                        <img ng-src="{{file.url}}" class="img-responsive"/>
                                    </div>
                                </div>
                                <div class="image-title">{{file.name}}</div>
                            </div>
                            <div class="progress progress-striped active fade" data-ng-class="{pending: 'in'}[file.$state()]" data-file-upload-progress="file.$progress()">
                                <div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div>
                            </div>
                            <div class="text-center">
                                <button class="btn btn-primary" data-ng-controller="FileDestroyController" data-ng-click="file.$destroy()" data-ng-hide="!file.$destroy">
                                    <i class="fa fa-trash"></i> Delete
                                </button>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </form>
    </div>
</div>