From c747461076e727956fc5ece847d99d21e74b0925 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Fri, 1 May 2020 18:27:23 +0200 Subject: [PATCH] finish: add/manage users --- coinmanager/coinc/static/coinc/main.js | 89 ++++++++++++------- coinmanager/coinc/static/coinc/styles.css | 1 - .../coinc/templates/coinc/username.html | 6 +- coinmanager/coinc/views.py | 18 ++-- 4 files changed, 68 insertions(+), 46 deletions(-) diff --git a/coinmanager/coinc/static/coinc/main.js b/coinmanager/coinc/static/coinc/main.js index a26f98a..594e453 100644 --- a/coinmanager/coinc/static/coinc/main.js +++ b/coinmanager/coinc/static/coinc/main.js @@ -23,16 +23,19 @@ import { Cookie } from './modules/cookie.mjs'; $(document).ready(function() { - function render_login(name, color) { + function render_login(input_name, input_color) { // manage user login + let color = decodeURIComponent(input_color); + let name = decodeURIComponent(input_name); new Cookie('coinc-name', name) - $('label#for_select_usernames').html('Wilkommen zurück'); + render_login_color(color); let option = $('div.username option[value=' + name + ']'); - - if (!option) { - $('div.username select').append($('