From c2e9a766f719d8f622868cbbaba5091c0e4b05d6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 2 Oct 2013 14:50:02 -0400 Subject: [PATCH] Make the account settings view a tiny bit nicer looking --- endpoints/api.py | 9 +++++---- static/css/quay.css | 14 ++++++++++++++ static/partials/user-admin.html | 14 ++++++++------ templates/index.html | 2 +- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/endpoints/api.py b/endpoints/api.py index a550a58cf..0e2140831 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -348,7 +348,7 @@ def delete_permissions(namespace, repository, username): abort(403) # Permission denied -def subscription_view(stripe_subscription, used_repos): +def subscription_view(stripe_subscription, used_repos): return { 'currentPeriodStart': stripe_subscription.current_period_start, 'currentPeriodEnd': stripe_subscription.current_period_end, @@ -401,8 +401,9 @@ def get_subscription(): if user.stripe_id: private_repos = model.get_private_repo_count(user.username) cus = stripe.Customer.retrieve(user.stripe_id) - return jsonify(subscription_view(cus.subscription, private_repos)) - + if cus.subscription: + return jsonify(subscription_view(cus.subscription, private_repos)) + abort(404) @@ -418,4 +419,4 @@ def cancel_subscription(): cus.cancel_subscription() return make_response('Deleted', 204) - abort(404) \ No newline at end of file + abort(404) diff --git a/static/css/quay.css b/static/css/quay.css index df169c03e..ab085d01f 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -638,6 +638,20 @@ p.editable:hover i { border: inherit; } +.user-admin .panel-plan { + text-align: center; +} + +.user-admin .plan-description { + font-size: 1.2em; + margin-bottom: 10px; +} + +.user-admin .used-description { + font-size: 1.2em; + margin-bottom: 10px; +} + /* Overrides for the markdown editor. */ .wmd-panel .btn-toolbar { diff --git a/static/partials/user-admin.html b/static/partials/user-admin.html index 2173898e1..185aa2959 100644 --- a/static/partials/user-admin.html +++ b/static/partials/user-admin.html @@ -1,4 +1,4 @@ -
+
@@ -17,8 +17,8 @@ Subscribed
-
- {{ plan.privateRepos }} Private Repositories
+
+
{{ plan.privateRepos }} Private Repositories
@@ -33,13 +33,15 @@ Plan Usage
- {{ subscription.usedPrivateRepos }} of {{ subscribedPlan.privateRepos }} private repositories used +
+ {{ subscription.usedPrivateRepos }} of {{ subscribedPlan.privateRepos }} private repositories used +
-
+
- \ No newline at end of file + diff --git a/templates/index.html b/templates/index.html index 118864f33..335a7690c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -70,7 +70,7 @@