From 08c77b6ce510e12b4540fe299c0f74cd03855c16 Mon Sep 17 00:00:00 2001 From: janmax <mail-github@jmx.io> Date: Mon, 23 Oct 2017 19:29:24 +0200 Subject: [PATCH] Updated Bootstrap and fixed group in importer script --- Makefile | 2 +- core/templates/base.html | 4 ++-- grady/settings/default.py | 14 ++++++++++++-- grady/settings/live.py | 2 +- package.json | 5 +++-- util/importer.py | 4 ++-- yarn.lock | 35 +++++++++++++---------------------- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index c53e5fae..ecdf60d6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ APP_LIST ?= core grady util -.PHONY: collectstatics run install migrations-check isort isort-check build-webpack +.PHONY: collectstatic run install migrations-check isort isort-check build-webpack collectstatic: ./manage.py compress diff --git a/core/templates/base.html b/core/templates/base.html index 13028a97..8ac759ae 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -25,7 +25,7 @@ {# Load other javascript #} <script src="{% static 'node_modules/jquery/dist/jquery.min.js' %}"></script> - <script src="{% static 'node_modules/tether/dist/js/tether.min.js' %}"></script> + <script src="{% static 'node_modules/popper.js/dist/umd/popper.min.js' %}"></script> <script src="{% static 'node_modules/bootstrap/dist/js/bootstrap.min.js' %}"></script> {# sortable table stuff #} @@ -35,7 +35,7 @@ </head> {# Navbar contaning: Brand - Title - User menu bar <---> (Username - Logout || Login form) #} -<nav class="navbar navbar-toggleable navbar-light bg-faded"> +<nav class="navbar navbar-expand navbar-light bg-light"> <a class="navbar-brand" href="{% url 'start' %}"> <img src="{% static 'res/brand.png' %}" width="30" height="30" class="d-inline-block align-top" alt=""> Grady diff --git a/grady/settings/default.py b/grady/settings/default.py index cdd76ebd..ab3a61db 100644 --- a/grady/settings/default.py +++ b/grady/settings/default.py @@ -79,6 +79,14 @@ WSGI_APPLICATION = 'grady.wsgi.application' DATABASES = { 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'postgres', + 'USER': 'postgres', + 'PASSWORD': 'postgres', + 'HOST': 'postgres', + 'PORT': '5432', + }, + 'filestorage': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'default_db.sqlite3'), }, @@ -114,7 +122,9 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.10/howto/static-files/ STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'static/') +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "static"), +] FIXTURE_DIRS = ['/core/fixtures/'] @@ -136,8 +146,8 @@ MESSAGE_TAGS = { } COMPRESS_ENABLED = not DEBUG - COMPRESS_OFFLINE = True +COMPRESS_ROOT = '/compress/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/grady/settings/live.py b/grady/settings/live.py index 1fc921d7..0a113760 100644 --- a/grady/settings/live.py +++ b/grady/settings/live.py @@ -16,7 +16,7 @@ ALLOWED_HOSTS = ['localhost', 'grady.janmax.org'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'dev', + 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'postgres', diff --git a/package.json b/package.json index 2b2e00a0..6e3d2560 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,10 @@ "author": "Jan Maximilian Michal", "license": "MIT", "dependencies": { - "bootstrap": "4.0.0-alpha.6", + "ace-editor-builds": "^1.2.4", + "bootstrap": "4.0.0-beta.2", "datatables.net": "^1.10.15", "datatables.net-bs4": "^1.10.15", - "ace-editor-builds" : "^1.2.4" + "popper.js": "^1.12.3" } } diff --git a/util/importer.py b/util/importer.py index 36202ce8..b20b0b51 100644 --- a/util/importer.py +++ b/util/importer.py @@ -139,7 +139,7 @@ class GradyUserFactory: user.save() if created and store_pw: - store_password(username, group, password) + store_password(username, groupname, password) group = Group.objects.get(name=groupname) user.groups.clear() # remove all other groups @@ -181,7 +181,7 @@ class GradyUserFactory: def add_user(username, group, **kwargs): - user = GradyUserFactory().update_or_create_user_in_group( + user = GradyUserFactory().make_user_in_group( username, group, store_pw=True, **kwargs ) diff --git a/yarn.lock b/yarn.lock index 38b7843d..ea349739 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,36 +6,27 @@ ace-editor-builds@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/ace-editor-builds/-/ace-editor-builds-1.2.4.tgz#5213874b1b23f9d79ac62d106e32970e2af3727f" -bootstrap@4.0.0-alpha.6: - version "4.0.0-alpha.6" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-alpha.6.tgz#4f54dd33ac0deac3b28407bc2df7ec608869c9c8" - dependencies: - jquery ">=1.9.1" - tether "^1.4.0" +bootstrap@4.0.0-beta.2: + version "4.0.0-beta.2" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-beta.2.tgz#4d67d2aa2219f062cd90bc1247e6747b9e8fd051" datatables.net-bs4@^1.10.15: - version "1.10.15" - resolved "https://registry.yarnpkg.com/datatables.net-bs4/-/datatables.net-bs4-1.10.15.tgz#c0599859ebc1f6ef586ab14cf1f6a07a7243cf1e" - dependencies: - datatables.net ">=1.10.13" - jquery ">=1.7" - -datatables.net@>=1.10.13: - version "2.1.1" - resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-2.1.1.tgz#6f1103ef08054642aecf85e7e25efd592822ee78" + version "1.10.16" + resolved "https://registry.yarnpkg.com/datatables.net-bs4/-/datatables.net-bs4-1.10.16.tgz#9eee67cfa8565bd3807a603a188305f7d0e20e32" dependencies: + datatables.net "1.10.16" jquery ">=1.7" -datatables.net@^1.10.15: - version "1.10.15" - resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.10.15.tgz#c789077bbfe385e75ff5a233fa5f23251a72df68" +datatables.net@1.10.16, datatables.net@^1.10.15: + version "1.10.16" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.10.16.tgz#4b052d1082824261b68eed9d22741b711d3d2469" dependencies: jquery ">=1.7" -jquery@>=1.7, jquery@>=1.9.1: +jquery@>=1.7: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" -tether@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a" +popper.js@^1.12.3: + version "1.12.5" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.12.5.tgz#229e4dea01629e1f1a1e26991ffade5024220fa6" -- GitLab