Get file dropping working and wire it up to call the build repo endpoint

This commit is contained in:
Joseph Schorr 2013-10-26 17:20:59 -04:00
parent fc6e3258a8
commit 28f6ff1605
4 changed files with 167 additions and 5 deletions

View file

@ -1,8 +1,21 @@
<div class="container" ng-show="building">
<i class="fa fa-spinner fa-spin fa-3x"></i>
</div>
<div class="container" ng-show="creating">
<i class="fa fa-spinner fa-spin fa-3x"></i>
</div>
<div class="container new-repo" ng-show="!user.anonymous && !creating">
<div class="container" ng-show="uploading">
<span class="message">Uploading file {{ upload_file }}</span>
<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="{{ upload_progress }}" aria-valuemin="0" aria-valuemax="100" style="{{ 'width: ' + upload_progress + '%' }}">
</div>
</div>
</div>
<div class="container new-repo" ng-show="!user.anonymous && !creating && !uploading && !building">
<form method="post" name="newRepoForm" ng-submit="createNewRepo()">
<!-- Header -->
@ -69,7 +82,7 @@
Upload a Dockerfile or a zip file containing a Dockerfile <b>in the root directory</b>
</div>
<input class="file-drop" type="file">
<input id="file-drop" class="file-drop" type="file">
</div>
</div>
</div>
@ -110,6 +123,26 @@
</div><!-- /.modal -->
<!-- Modal message dialog -->
<div class="modal fade" id="missingfileModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">File required</h4>
</div>
<div class="modal-body">
A file is required in order to initialize a repository.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Modal message dialog -->
<div class="modal fade" id="cannotcreateModal">
<div class="modal-dialog">
@ -127,3 +160,22 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Modal message dialog -->
<div class="modal fade" id="couldnotbuildModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Cannot initialize repository</h4>
</div>
<div class="modal-body">
The repository could not be initialized with the selected Dockerfile. Please try again later.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->