From 70fd9afb2bc9722d48bc8087a79b71b2cbf1eb53 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 24 Oct 2013 17:41:55 -0400 Subject: [PATCH] Start on new repo page --- endpoints/web.py | 5 ++ static/css/quay.css | 52 +++++++++++++++ static/directives/repo-circle.html | 2 +- static/js/app.js | 1 + static/js/controllers.js | 38 +++++++++++ static/partials/header.html | 6 +- static/partials/new-repo.html | 103 +++++++++++++++++++++++++++++ 7 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 static/partials/new-repo.html diff --git a/endpoints/web.py b/endpoints/web.py index 3e6b2fc4d..ddfbca3d6 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -67,6 +67,11 @@ def signin(): return index('') +@app.route('/new/') +def new(): + return index('') + + @app.route('/repository/') def repository(): return index('') diff --git a/static/css/quay.css b/static/css/quay.css index fd8e2f109..aaad9aa5f 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -75,6 +75,57 @@ text-decoration: none !important; } +.new-repo .new-header { + font-size: 22px; +} + +.new-repo .new-header .repo-circle { + margin-right: 14px; +} + +.new-repo .new-header .name-container { + display: inline-block; + width: 300px; +} + +.new-repo .description { + margin-left: 10px; + margin-top: 10px; +} + +.new-repo .section { + padding-bottom: 20px; + border-bottom: 1px solid #eee; + margin-bottom: 16px; +} + +.new-repo .repo-option { + margin: 6px; + margin-top: 16px; +} + +.new-repo .repo-option i { + font-size: 18px; + padding-left: 10px; + padding-right: 10px; + width: 42px; + display: inline-block; + text-align: center; +} + +.new-repo .option-description { + display: inline-block; + vertical-align: top; +} + +.new-repo .option-description label { + display: block; +} + +.new-repo .cbox { + margin: 10px; +} + .user-guide h3 { margin-bottom: 20px; } @@ -1051,6 +1102,7 @@ p.editable:hover i { border: 1px solid #eee; margin-top: 10px; padding: 10px; + min-height: 50px; } /* Overrides for typeahead to work with bootstrap 3. */ diff --git a/static/directives/repo-circle.html b/static/directives/repo-circle.html index 62986d4bf..76ebd2cfd 100644 --- a/static/directives/repo-circle.html +++ b/static/directives/repo-circle.html @@ -1,2 +1,2 @@ - + diff --git a/static/js/app.js b/static/js/app.js index 73161f17e..568c19637 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -155,6 +155,7 @@ quayApp = angular.module('quay', ['restangular', 'angularMoment', 'angulartics', when('/guide/', {title: 'User Guide', templateUrl: '/static/partials/guide.html', controller: GuideCtrl}). when('/plans/', {title: 'Plans and Pricing', templateUrl: '/static/partials/plans.html', controller: PlansCtrl}). when('/signin/', {title: 'Signin', templateUrl: '/static/partials/signin.html', controller: SigninCtrl}). + when('/new/', {title: 'Create new repository', templateUrl: '/static/partials/new-repo.html', controller: NewRepoCtrl}). when('/v1/', {title: 'Activation information', templateUrl: '/static/partials/v1-page.html', controller: V1Ctrl}). diff --git a/static/js/controllers.js b/static/js/controllers.js index f624c10b7..72610a23f 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -893,4 +893,42 @@ function V1Ctrl($scope, UserService) { $scope.browseRepos = function() { document.location = '/repository/'; }; +} + +function NewRepoCtrl($scope, UserService) { + $scope.repo = { + 'is_public': 1, + 'description': '', + 'initialize': false + }; + + $scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) { + $scope.user = currentUser; + + if ($scope.user.anonymous) { + document.location = '/signin/'; + } + }, true); + + $scope.editDescription = function() { + if (!$scope.markdownDescriptionEditor) { + var converter = Markdown.getSanitizingConverter(); + var editor = new Markdown.Editor(converter, '-description'); + editor.run(); + $scope.markdownDescriptionEditor = editor; + } + + $('#wmd-input-description')[0].value = $scope.repo.description; + $('#editModal').modal({}); + }; + + $scope.getMarkedDown = function(string) { + if (!string) { return ''; } + return getMarkedDown(string); + }; + + $scope.saveDescription = function() { + $('#editModal').modal('hide'); + $scope.repo.description = $('#wmd-input-description')[0].value; + }; } \ No newline at end of file diff --git a/static/partials/header.html b/static/partials/header.html index 321e08612..8e3f288dc 100644 --- a/static/partials/header.html +++ b/static/partials/header.html @@ -27,9 +27,11 @@ -