Handle empty repos

This commit is contained in:
Joseph Schorr 2013-10-02 00:43:59 -04:00
parent 927b280f1a
commit f160483af4
2 changed files with 60 additions and 49 deletions

View file

@ -353,6 +353,12 @@ p.editable:hover i {
margin-bottom: 40px; margin-bottom: 40px;
} }
.repo .empty-message {
padding: 6px;
font-size: 1.8em;
color: #ccc;
}
.repo dl.dl-horizontal dt { .repo dl.dl-horizontal dt {
width: 60px; width: 60px;
} }

View file

@ -50,60 +50,65 @@
<i class="icon-edit"></i> <i class="icon-edit"></i>
</p> </p>
<!-- Tab bar --> <div class="repo-content" ng-show="!currentTag.image">
<ul class="nav nav-tabs"> <div class="empty-message">(This repository is empty)</div>
<li>
<span class="tag-dropdown dropdown" title="Tags">
<i class="icon-bookmark"></i>
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">{{currentTag.name}} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ng-repeat="tag in repo.tags">
<a href="{{ '#/repository/' + repo.namespace + '/' + repo.name + '/tag/' + tag.name }}">{{tag.name}}</a>
</li>
</ul>
</span>
</li>
<li id="current-image-tab" class="active" ng-click="showTab('current-image')"><a href="javascript:void(0)">Current Image</a></li>
<li id="image-history-tab" ng-click="showTab('image-history')"><a href="javascript:void(0)">Image History</a></li>
</ul>
<div id="current-image">
<dl class="dl-horizontal">
<dt>Created</dt>
<dd am-time-ago="parseDate(currentTag.image.created)"></dd>
<dt>ID</dt>
<dd>{{ currentTag.image.id }}</dd>
</dl>
<div ng-show="currentTag.image.comment">
<strong>Description:</strong>
<blockquote style="margin-top: 10px;" ng-bind-html-unsafe="getMarkedDown(currentTag.image.comment)">
</blockquote>
</div>
</div> </div>
<div id="image-history" style="display: none"> <div class="repo-content" ng-show="currentTag.image">
<div ng-hide="imageHistory"> <!-- Tab bar -->
<div class="spin"></div> <ul class="nav nav-tabs">
<li>
<span class="tag-dropdown dropdown" title="Tags">
<i class="icon-bookmark"></i>
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">{{currentTag.name}} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ng-repeat="tag in repo.tags">
<a href="{{ '#/repository/' + repo.namespace + '/' + repo.name + '/tag/' + tag.name }}">{{tag.name}}</a>
</li>
</ul>
</span>
</li>
<li id="current-image-tab" class="active" ng-click="showTab('current-image')"><a href="javascript:void(0)">Current Image</a></li>
<li id="image-history-tab" ng-click="showTab('image-history')"><a href="javascript:void(0)">Image History</a></li>
</ul>
<div id="current-image">
<dl class="dl-horizontal">
<dt>Created</dt>
<dd am-time-ago="parseDate(currentTag.image.created)"></dd>
<dt>ID</dt>
<dd>{{ currentTag.image.id }}</dd>
</dl>
<div ng-show="currentTag.image.comment">
<strong>Description:</strong>
<blockquote style="margin-top: 10px;" ng-bind-html-unsafe="getMarkedDown(currentTag.image.comment)">
</blockquote>
</div>
</div> </div>
<div ng-show="imageHistory"> <div id="image-history" style="display: none">
<table class="images"> <div ng-hide="imageHistory">
<thead> <div class="spin"></div>
<tr> </div>
<td>ID</td>
<td>Created</td> <div ng-show="imageHistory">
<td>Comment</td> <table class="images">
</tr> <thead>
</thead> <tr>
<td>ID</td>
<td>Created</td>
<td>Comment</td>
</tr>
</thead>
<tr ng-repeat="image in imageHistory"> <tr ng-repeat="image in imageHistory">
<td class="image-id" title="{{ image.id }}">{{ image.id }}</td> <td class="image-id" title="{{ image.id }}">{{ image.id }}</td>
<td><span am-time-ago="parseDate(image.created)"></span></td> <td><span am-time-ago="parseDate(image.created)"></span></td>
<td ng-bind-html-unsafe="getCommentFirstLine(image.comment)"></td> <td ng-bind-html-unsafe="getCommentFirstLine(image.comment)"></td>
</tr> </tr>
</table> </table>
</div>
</div> </div>
</div> </div>