From 4913b626adb5ec0f01a188e81efff3f59df5ceb9 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Fri, 19 Jun 2020 13:48:02 +0200 Subject: [PATCH 1/4] mep --- coinmanager/db.sqlite3 | Bin 610304 -> 610304 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/coinmanager/db.sqlite3 b/coinmanager/db.sqlite3 index 787b121246632e2a1131bfe867b871937e7d1a44..1a77e745c02702d51f9fc30995b7a6bb3d88a911 100755 GIT binary patch delta 237 zcmZozpxUrNb%HeGv57LyjK>-iS`!#s6PQ{Pm|GKAwkEJHlxOGWVEoO(#xRwK*=zc_ z1#AM_lN4CB7@62)rZ+5PRo=c)ku{rzjg^^!iSz&TJN9fU+uhVy53w+DmrUo4E9&!aV6kMg~R(x&~&thL+nu39vD zJQ+n9P{4K(K{jRzGQ From 6c7d0eff23d804b65e26585a5068ee7e36ccc6b0 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Fri, 19 Jun 2020 14:00:03 +0200 Subject: [PATCH 2/4] format issues --- ISSUES | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ISSUES b/ISSUES index 1a016da..1caf580 100644 --- a/ISSUES +++ b/ISSUES @@ -1,22 +1,15 @@ # griechenland -- 2015: 2€ sondermünze mit Titel "85-15 Gr. Demokratie" gibts nicht -- hier gibts 2 x das jahr 2016, ich habe die untere genommen +- 2015 sondermünze: Titel "85-15 Gr. Demokratie" gibts nicht +- 2 x zeile 2016, ich habe die untere genommen # irland -- 2006, 20 Cent: hier steht ein A, was heißt das? +- 2006 20 Cent: hier steht A # italien -- was bedeutet die blaue kreuz farbe? insbesondere 2012 2 cent wurde von lea gefunden (und jeanette?). -- 2010 sondermünze 1: was heißt a? - -# malta -- auch hier ist wieder die blaue kreuz farbe +- 2010 sondermünze 1: hier steht a # Niederlande -- 2007 sondermünze hjier steht ein F - -# slowenien -- auch hier ist wieder die blaue kreuz farbe +- 2007 sondermünze: hier steht F # blaue kreuze zypern, slowenien, malta, italien From 8373dd26d354f9acdcb8101251f6b8e8d6acee14 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Mon, 22 Jun 2020 13:38:32 +0200 Subject: [PATCH 3/4] exlucde db one and for all --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d064533..c468a2b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Pipfile.lock **/work_data/* **/__pycache__/* coinmanager/static/* +coinmanager/db.sqlite3 From db7362302300172425cdb220480dae1245932161 Mon Sep 17 00:00:00 2001 From: koksnuss Date: Mon, 22 Jun 2020 18:59:03 +0200 Subject: [PATCH 4/4] add auth and session system --- coinmanager/coinc/static/coinc/main.js | 39 +++++++++++++++ .../coinc/static/coinc/modules/modal.mjs | 4 +- coinmanager/coinc/static/coinc/styles.css | 4 +- .../coinc/templates/coinc/controlbar.html | 21 +++++++- .../coinc/templates/coinc/country.html | 2 +- coinmanager/coinc/templates/header.html | 3 ++ .../templates/registration/logged_out.html | 2 + .../coinc/templates/registration/login.html | 48 +++++++++++++++++++ coinmanager/coinc/urls.py | 6 ++- coinmanager/coinc/views.py | 8 ---- .../coinmanager/production_settings.py | 3 ++ coinmanager/coinmanager/settings.py | 3 ++ 12 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 coinmanager/coinc/templates/registration/logged_out.html create mode 100644 coinmanager/coinc/templates/registration/login.html diff --git a/coinmanager/coinc/static/coinc/main.js b/coinmanager/coinc/static/coinc/main.js index f723641..f12b186 100644 --- a/coinmanager/coinc/static/coinc/main.js +++ b/coinmanager/coinc/static/coinc/main.js @@ -231,6 +231,45 @@ $(document).ready(function() { // Buttons // + // login + $('#do_login').click(function() { + let modal = new Modal('login', login); + modal.show(); + }); + + function login(args, form_data) { + $.ajax({ + type: 'POST', + url: '/coinc/accounts/login/', + data: form_data, + success: function(response) { + window.open(window.location.href, '_self'); + //detach('#login'); + //$('button#do_login').addClass('d-none'); + //$('button#begin_edit').removeClass('d-none'); + //$('button#do_logout').removeClass('d-none'); + } + }); + + } + + // logout + $('#do_logout').click(function() { + let data = { csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val() }; + $.ajax({ + type: 'POST', + data: data, + url: '/coinc/accounts/logout/', + success: function(response) { + window.open(window.location.href, '_self'); + //detach('login'); + //$('button#do_logout').addClass('d-none'); + //$('button#begin_edit').addClass('d-none'); + //$('button#do_login').removeClass('d-none'); + } + }); + }); + // go home $('thead tr:first-child th').click(function() { diff --git a/coinmanager/coinc/static/coinc/modules/modal.mjs b/coinmanager/coinc/static/coinc/modules/modal.mjs index 2a71e05..b5bebd6 100644 --- a/coinmanager/coinc/static/coinc/modules/modal.mjs +++ b/coinmanager/coinc/static/coinc/modules/modal.mjs @@ -93,7 +93,9 @@ class Modal { /*submit modal */ submit() { let response = {}; - $(this.div + ' input[type=text]').each(function() { + $(this.div + ' input[type=text], ' + + this.div + ' input[type=password], ' + + this.div + ' input[type=hidden]').each(function() { response[$(this).attr('name')] = $(this).val(); }); this.callback(this.callback_arguments, response); diff --git a/coinmanager/coinc/static/coinc/styles.css b/coinmanager/coinc/static/coinc/styles.css index 16c5e2c..acd1663 100644 --- a/coinmanager/coinc/static/coinc/styles.css +++ b/coinmanager/coinc/static/coinc/styles.css @@ -47,9 +47,9 @@ a:visited { /* Controlbar */ -button#begin_edit { +div#button_control { position: fixed; - z-index: 1060; + z-index: 1030; right: 15px; bottom: 15px; } diff --git a/coinmanager/coinc/templates/coinc/controlbar.html b/coinmanager/coinc/templates/coinc/controlbar.html index 9387442..0dd940f 100644 --- a/coinmanager/coinc/templates/coinc/controlbar.html +++ b/coinmanager/coinc/templates/coinc/controlbar.html @@ -2,7 +2,15 @@ div.{{ user.name }} { background-color: {{ user.color }} !important; }{% endfor %} - +
+ {% csrf_token %} + {% if user.is_authenticated %} + + + {% else %} + + {% endif %} +