From f160483af4d51d60fd5c96e4ab20e3f42b76393d Mon Sep 17 00:00:00 2001 From: Joseph Schorr <jschorr@gmail.com> Date: Wed, 2 Oct 2013 00:43:59 -0400 Subject: [PATCH] Handle empty repos --- static/css/quay.css | 6 ++ static/partials/view-repo.html | 103 +++++++++++++++++---------------- 2 files changed, 60 insertions(+), 49 deletions(-) diff --git a/static/css/quay.css b/static/css/quay.css index 6f76d5e42..de3f8746a 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -353,6 +353,12 @@ p.editable:hover i { margin-bottom: 40px; } +.repo .empty-message { + padding: 6px; + font-size: 1.8em; + color: #ccc; +} + .repo dl.dl-horizontal dt { width: 60px; } diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index 08b1dfe53..e0d33f9bb 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -50,60 +50,65 @@ <i class="icon-edit"></i> </p> - <!-- Tab bar --> - <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 class="repo-content" ng-show="!currentTag.image"> + <div class="empty-message">(This repository is empty)</div> </div> - <div id="image-history" style="display: none"> - <div ng-hide="imageHistory"> - <div class="spin"></div> + <div class="repo-content" ng-show="currentTag.image"> + <!-- Tab bar --> + <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 ng-show="imageHistory"> - <table class="images"> - <thead> - <tr> - <td>ID</td> - <td>Created</td> - <td>Comment</td> - </tr> - </thead> + <div id="image-history" style="display: none"> + <div ng-hide="imageHistory"> + <div class="spin"></div> + </div> + + <div ng-show="imageHistory"> + <table class="images"> + <thead> + <tr> + <td>ID</td> + <td>Created</td> + <td>Comment</td> + </tr> + </thead> - <tr ng-repeat="image in imageHistory"> - <td class="image-id" title="{{ image.id }}">{{ image.id }}</td> - <td><span am-time-ago="parseDate(image.created)"></span></td> - <td ng-bind-html-unsafe="getCommentFirstLine(image.comment)"></td> - </tr> - </table> + <tr ng-repeat="image in imageHistory"> + <td class="image-id" title="{{ image.id }}">{{ image.id }}</td> + <td><span am-time-ago="parseDate(image.created)"></span></td> + <td ng-bind-html-unsafe="getCommentFirstLine(image.comment)"></td> + </tr> + </table> + </div> </div> </div>