Loading feedback

This commit is contained in:
jendib 2013-08-16 17:14:50 +02:00
parent 988f55de3f
commit d1644dcbc0
7 changed files with 67 additions and 42 deletions

View File

@ -1 +0,0 @@
- Loading feedback for document (list), document.view, tag.default

View File

@ -3,7 +3,7 @@
/** /**
* Navigation controller. * Navigation controller.
*/ */
App.controller('Navigation', function($scope, $state, $rootScope, User, Restangular) { App.controller('Navigation', function($scope, $http, $state, $rootScope, User, Restangular) {
$rootScope.userInfo = User.userInfo(); $rootScope.userInfo = User.userInfo();
/** /**
@ -16,4 +16,8 @@ App.controller('Navigation', function($scope, $state, $rootScope, User, Restangu
}); });
$event.preventDefault(); $event.preventDefault();
}; };
$scope.isLoading = function() {
return $http.pendingRequests.length > 0;
};
}); });

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -60,6 +60,10 @@
<div class="navbar" ng-controller="Navigation"> <div class="navbar" ng-controller="Navigation">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container"> <div class="container">
<div class="brand loader" ng-class="{hide: !isLoading() }">
<img src="img/loader.gif" />
</div>
<a class="brand hidden-phone" href="#">Sismics Docs</a> <a class="brand hidden-phone" href="#">Sismics Docs</a>
<ul class="nav" ng-show="!userInfo.anonymous"> <ul class="nav" ng-show="!userInfo.anonymous">

View File

@ -1,40 +1,44 @@
<div class="text-right"> <img src="img/loader.gif" ng-show="!document" />
<div class="btn-group">
<button class="btn btn-danger" ng-click="deleteDocument(document)"><span class="icon-trash icon-white"></span> Delete</button>
<button class="btn btn-primary" ng-click="editDocument(document.id)"><span class="icon-pencil icon-white"></span> Edit</button>
</div>
</div>
<div class="page-header"> <div ng-show="document">
<h1>{{ document.title }} <small>{{ document.create_date | date: 'yyyy-MM-dd' }}</small></h1> <div class="text-right">
<p> <div class="btn-group">
<button class="btn btn-small btn-inverse" ng-click="share()"><span class="icon-share icon-white"></span> Share</button> <button class="btn btn-danger" ng-click="deleteDocument(document)"><span class="icon-trash icon-white"></span> Delete</button>
<button class="btn btn-small" ng-repeat="share in document.shares" ng-click="showShare(share)"><span class="icon-ok"></span> {{ share.name ? share.name : 'shared' }}</button> <button class="btn btn-primary" ng-click="editDocument(document.id)"><span class="icon-pencil icon-white"></span> Edit</button>
</p> </div>
<ul class="inline"> </div>
<li ng-repeat="tag in document.tags"><span class="label label-info" ng-style="{ 'background': tag.color }">{{ tag.name }}</span></li>
</ul> <div class="page-header">
</div> <h1>{{ document.title }} <small>{{ document.create_date | date: 'yyyy-MM-dd' }}</small></h1>
<p>
<p ng-bind-html="document.description | newline"></p> <button class="btn btn-small btn-inverse" ng-click="share()"><span class="icon-share icon-white"></span> Share</button>
<button class="btn btn-small" ng-repeat="share in document.shares" ng-click="showShare(share)"><span class="icon-ok"></span> {{ share.name ? share.name : 'shared' }}</button>
<ul class="thumbnails thumbnails-file" ui-sortable="fileSortableOptions" ng-model="files" ng-show="files.length > 0"> </p>
<li class="span2 text-center thumbnail-container" ng-repeat="file in files"> <ul class="inline">
<div class="thumbnail"> <li ng-repeat="tag in document.tags"><span class="label label-info" ng-style="{ 'background': tag.color }">{{ tag.name }}</span></li>
<a ng-click="openFile(file)"> </ul>
<img class="thumbnail-file" ng-src="api/file/{{ file.id }}/data?thumbnail=true" tooltip="{{ file.mimetype }}" tooltip-placement="top" /> </div>
</a>
<div class="caption"> <p ng-bind-html="document.description | newline"></p>
<div class="pull-left">
<div class="btn handle"><span class="icon-resize-horizontal"></span></div> <ul class="thumbnails thumbnails-file" ui-sortable="fileSortableOptions" ng-model="files" ng-show="files.length > 0">
</div> <li class="span2 text-center thumbnail-container" ng-repeat="file in files">
<p class="pull-right"> <div class="thumbnail">
<button class="btn btn-danger" ng-click="deleteFile(file)"><span class="icon-trash icon-white"></span></button> <a ng-click="openFile(file)">
</p> <img class="thumbnail-file" ng-src="api/file/{{ file.id }}/data?thumbnail=true" tooltip="{{ file.mimetype }}" tooltip-placement="top" />
<div class="clearfix"></div> </a>
</div> <div class="caption">
</div> <div class="pull-left">
</li> <div class="btn handle"><span class="icon-resize-horizontal"></span></div>
</ul> </div>
<p class="pull-right">
<div ui-view="file"></div> <button class="btn btn-danger" ng-click="deleteFile(file)"><span class="icon-trash icon-white"></span></button>
</p>
<div class="clearfix"></div>
</div>
</div>
</li>
</ul>
<div ui-view="file"></div>
</div>

View File

@ -27,12 +27,16 @@
</div> </div>
<div class="span8 well"> <div class="span8 well" ng-if="stats.length >= 0">
<h1>{{ tags.length }} <small>tag{{ tags.length > 1 ? 's' : '' }}</small></h1> <h1>{{ tags.length }} <small>tag{{ tags.length > 1 ? 's' : '' }}</small></h1>
<dl class="dl-horizontal" ng-repeat="stat in stats | orderBy: '-count'"> <dl class="dl-horizontal" ng-repeat="stat in stats | orderBy: '-count'">
<dt>{{ stat.name }} <span class="badge badge-info" ng-style="{ 'background': stat.color }">{{ stat.count }}</span></dt> <dt>{{ stat.name }} <span class="badge badge-info" ng-style="{ 'background': stat.color }">{{ stat.count }}</span></dt>
<dd><progress percent="stat.count / getStatCount() * 100" class="progress-info"></progress></dd> <dd><progress percent="stat.count / getStatCount() * 100" class="progress-info"></progress></dd>
</dl> </dl>
</div> </div>
<div class="span8 well" ng-if="!stats">
<img src="img/loader.gif" />
</div>
</div> </div>
</div> </div>

View File

@ -43,6 +43,16 @@
} }
} }
// $http loader
.loader {
position: relative;
top: -2px;
&.hide {
visibility: hidden;
}
}
// Tags list // Tags list
.table-tags { .table-tags {
tbody td { tbody td {