Add a create repo button in a few places

This commit is contained in:
Joseph Schorr 2013-10-28 13:22:18 -04:00
parent 8cb177128b
commit 5175364e62
3 changed files with 17 additions and 5 deletions

View file

@ -204,7 +204,7 @@ function RepoListCtrl($scope, Restangular, UserService) {
});
}
function LandingCtrl($scope, $timeout, Restangular, UserService, KeyService) {
function LandingCtrl($scope, $timeout, $location, Restangular, UserService, KeyService) {
$('.form-signup').popover();
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
@ -230,7 +230,11 @@ function LandingCtrl($scope, $timeout, Restangular, UserService, KeyService) {
};
$scope.browseRepos = function() {
document.location = '/repository/';
$location.path('/repository/');
};
$scope.createRepo = function() {
$location.path('/new/');
};
$scope.register = function() {
@ -906,13 +910,13 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, Restangular) {
});
}
function V1Ctrl($scope, UserService) {
function V1Ctrl($scope, $location, UserService) {
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
$scope.user = currentUser;
}, true);
$scope.browseRepos = function() {
document.location = '/repository/';
$location.path('/repository/');
};
}

View file

@ -61,7 +61,8 @@
<div ng-show="!user.anonymous" class="user-welcome">
<img class="gravatar" src="//www.gravatar.com/avatar/{{ user.gravatar }}?s=128&d=identicon" />
<div class="sub-message">Welcome <b>{{ user.username }}</b>!</div>
<button ng-show="myrepos" class="btn btn-lg btn-primary btn-block" ng-click="browseRepos()">Browse all repositories</button>
<button ng-show="myrepos" class="btn btn-primary" ng-click="browseRepos()">Browse all repositories</button>
<button ng-show="myrepos" class="btn btn-success" ng-click="createRepo()">Create a new repository</button>
</div>
</div> <!-- col -->
</div> <!-- row -->

View file

@ -4,6 +4,13 @@
<div class="container ready-indicator" ng-show="!loading" data-status="{{ loading ? '' : 'ready' }}">
<div class="repo-list" ng-show="!user.anonymous">
<a href="/new/">
<button class="btn btn-success" style="float: right">
<i class="fa fa-upload user-tool" title="Create new repository"></i>
Create Repository
</button>
</a>
<h3>Your Repositories</h3>
<div ng-show="private_repositories.length > 0">
<div class="repo-listing" ng-repeat="repository in private_repositories">