From 05d2785ec6425c7d43eb5c6b41cd9c3729c37727 Mon Sep 17 00:00:00 2001 From: ReAnzu Date: Tue, 27 Feb 2018 18:14:07 -0600 Subject: [PATCH] Added a Manage tokens tab to the user panel --- client/css/user-view.styl | 20 +++++- client/html/user.tpl | 3 + client/html/user_tokens.tpl | 29 ++++++++ client/js/api.js | 4 +- client/js/controllers/user_controller.js | 78 ++++++++++++++++++++- client/js/models/user_token.js | 76 +++++++++++++++++++++ client/js/views/user_tokens_view.js | 86 ++++++++++++++++++++++++ client/js/views/user_view.js | 12 +++- config.yaml.dist | 12 ++-- server/szurubooru/api/user_token_api.py | 32 +++++---- server/szurubooru/func/user_tokens.py | 2 +- 11 files changed, 332 insertions(+), 22 deletions(-) create mode 100644 client/html/user_tokens.tpl create mode 100644 client/js/models/user_token.js create mode 100644 client/js/views/user_tokens_view.js diff --git a/client/css/user-view.styl b/client/css/user-view.styl index 12cba75e..46f3044a 100644 --- a/client/css/user-view.styl +++ b/client/css/user-view.styl @@ -1,6 +1,6 @@ #user width: 100% - max-width: 35em + max-width: 45em nav.text-nav margin-bottom: 1.5em @@ -37,6 +37,24 @@ height: 1px clear: both + #user-tokens + .token-flex-container + width: 100% + display: flex; + flex-direction column; + padding-bottom: 0.5em; + + .token-flex-row + display: flex; + flex-direction: row; + justify-content: space-between; + padding-top: 0.25em; + padding-bottom: 0.25em; + border-bottom: black solid 1px; + + form + width: auto; + #user-delete form width: 100% diff --git a/client/html/user.tpl b/client/html/user.tpl index 28e34e67..cbf4f18f 100644 --- a/client/html/user.tpl +++ b/client/html/user.tpl @@ -6,6 +6,9 @@ --><% if (ctx.canEditAnything) { %>
  • '>Account settings
  • <% } %><% if (ctx.canListTokens) { %>
  • '>Manage tokens
  • <% } %><% if (ctx.canDelete) { %>
  • '>Account deletion
  • <% } %>