Initial version of the angular app.

This commit is contained in:
yackob03 2013-09-24 18:21:14 -04:00
parent e107d79612
commit 995ad8b679
7 changed files with 90 additions and 10 deletions

40
static/css/signin.css Normal file
View file

@ -0,0 +1,40 @@
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
font-size: 16px;
height: auto;
padding: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="text"] {
margin-bottom: -1px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}

10
static/js/app.js Normal file
View file

@ -0,0 +1,10 @@
angular.module('quay', ['restangular']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/repository/', {templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
when('/', {templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
otherwise({redirectTo: '/'});
}]).
config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api/');
});

10
static/js/controllers.js Normal file
View file

@ -0,0 +1,10 @@
function RepoListCtrl($scope, Restangular) {
var repositoryFetch = Restangular.all('repository/');
repositoryFetch.getList().then(function(resp) {
$scope.repositories = resp.repositories;
});
}
function LandingCtrl($scope) {
}

View file

@ -0,0 +1 @@
<a ng-href="#/repository/">Repositories</a>

View file

@ -0,0 +1,4 @@
<h2>Repositories</h2>
<div ng-repeat="repository in repositories">
{{repository.namespace}}/{{repository.name}}
</div>

View file

@ -1,15 +1,23 @@
<html> <!DOCTYPE html>
<html ng-app="quay">
<head> <head>
<title>Quay - Private Docker Repository</title> <title>Quay - Private Docker Repository</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<script src="//cdn.jsdelivr.net/underscorejs/1.5.2/underscore-min.js"></script>
<script src="//cdn.jsdelivr.net/restangular/1.1.3/restangular.js"></script>
<script src="static/js/app.js"></script>
<script src="static/js/controllers.js"></script>
</head> </head>
<body> <body>
<h1>Hello World</h1> <h1>Hello World</h1>
<div ng-view></div>
</body> </body>
</html> </html>

View file

@ -1,12 +1,19 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<title>Quay Sign In</title> <title>Quay Sign In</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.no-icons.min.css">
<link rel="stylesheet" href="static/css/signin.css">
</head> </head>
<body> <body>
<form method="post"> <div class="container">
Username: <input type="text" name="username"><br> <form method="post" class="form-signin">
Password: <input type="password" name="password"><br> <input type="text" class="form-control" placeholder="Username" name="username" autofocus>
<input type="submit" value="Sign In"> <input type="password" class="form-control" placeholder="Password" name="password">
</form> <button class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>
</form>
</div>
</body> </body>
</html> </html>