diff --git a/REQUIREMENTS.txt b/REQUIREMENTS.txt index 22a94caa..ab2d4e1f 100644 --- a/REQUIREMENTS.txt +++ b/REQUIREMENTS.txt @@ -9,7 +9,12 @@ Markdown==2.3.1 #PIL==1.1.7 Pillow Pygments==2.7.4 -Whoosh==2.5.6 + +# Updates for Django 2 & Python 3.7 +git+https://github.com/Xpirix/whoosh.git@a306553 +pickle5==0.0.12 +django-haystack==3.2.1 + argparse==1.2.1 #cab==0.2.0 # Not used anymore..- #distribute==0.7.3 @@ -20,7 +25,6 @@ django-debug-toolbar==1.11.1 django-endless-pagination==2.0 django-extensions==1.2.0 django-generic-aggregation==0.3.2 -django-haystack==2.4.0 #django-olwidget==0.61.0 unmaintained, use this fork git+https://github.com/Christophe31/olwidget.git django-pagination==1.0.7 @@ -30,7 +34,7 @@ git+https://github.com/enikesha/django-ratings.git django-simple-ratings==0.3.2 # SIMPLEMENU git+https://github.com/elpaso/django-simplemenu.git -django-taggit==0.14.0 +django-taggit==2.0.0 django-taggit-autosuggest==0.2.7 django-taggit-templatetags==0.4.6dev0 django-templatetag-sugar==0.1 @@ -55,3 +59,4 @@ django-user-map djangorestframework==3.12.2 django-rest-auth==0.9.5 drf-yasg +django-matomo==0.1.6 \ No newline at end of file diff --git a/dockerize/docker-compose.yml b/dockerize/docker-compose.yml index 2ee672fb..eb50ecfd 100644 --- a/dockerize/docker-compose.yml +++ b/dockerize/docker-compose.yml @@ -1,117 +1,119 @@ -db: - container_name: qgis-plugins-db - image: kartoza/postgis:9.6-2.4 - environment: - - ALLOW_IP_RANGE=0.0.0.0/0 - - POSTGRES_USER=docker - - POSTGRES_PASS=docker - volumes: - - ./backups:/backups - restart: unless-stopped +version: "3.8" +services: + db: + container_name: qgis-plugins-db + image: kartoza/postgis:9.6-2.4 + environment: + - ALLOW_IP_RANGE=0.0.0.0/0 + - POSTGRES_USER=docker + - POSTGRES_PASS=docker + volumes: + - ./backups:/backups + restart: unless-stopped -web: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-web - build: docker - hostname: uwsgi - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - DEBUG=False - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq - - worker:worker - restart: unless-stopped - user: root - command: uwsgi --ini /uwsgi.conf + web: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-web + build: docker + hostname: uwsgi + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - DEBUG=False + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq + - worker:worker + restart: unless-stopped + user: root + command: uwsgi --ini /uwsgi.conf -devweb: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-devweb - build: docker - hostname: uwsgi - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq - - worker:worker - restart: unless-stopped - user: root - ports: - # for django test server - - "62202:8080" - # for ssh - - "62203:22" + devweb: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-devweb + build: docker + hostname: uwsgi + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq + - worker:worker + restart: unless-stopped + user: root + ports: + # for django test server + - "62202:8080" + # for ssh + - "62203:22" -rabbitmq: - image: library/rabbitmq:3.6 - hostname: rabbitmq - environment: - - RABBIT_PASSWORD=rabbit_test_password - - USER=rabbit_user - - RABBITMQ_NODENAME=rabbit - restart: unless-stopped + rabbitmq: + image: library/rabbitmq:3.6 + hostname: rabbitmq + environment: + - RABBIT_PASSWORD=rabbit_test_password + - USER=rabbit_user + - RABBITMQ_NODENAME=rabbit + restart: unless-stopped -worker: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-worker - build: docker - hostname: uwsgi - working_dir: /home/web/django_project - command: celery -A plugins worker -l info - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq + worker: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-worker + build: docker + hostname: uwsgi + working_dir: /home/web/django_project + command: celery -A plugins worker -l info + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq -nginx: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-nginx - image: nginx - hostname: nginx - volumes: - - ./sites-enabled:/etc/nginx/conf.d:ro - # I dont use volumes_from as I want to use the ro modifier - - ./static:/home/web/static:ro - - ./static:/home/web/media:ro - - ./logs:/var/log/nginx - links: - - web:uwsgi - ports: - - "62201:8080" - restart: unless-stopped + nginx: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-nginx + image: nginx + hostname: nginx + volumes: + - ./sites-enabled:/etc/nginx/conf.d:ro + # I dont use volumes_from as I want to use the ro modifier + - ./static:/home/web/static:ro + - ./static:/home/web/media:ro + - ./logs:/var/log/nginx + links: + - web:uwsgi + ports: + - "62201:8080" + restart: unless-stopped diff --git a/dockerize/docker/Dockerfile b/dockerize/docker/Dockerfile index 9ce83a88..3bd21f73 100644 --- a/dockerize/docker/Dockerfile +++ b/dockerize/docker/Dockerfile @@ -12,7 +12,7 @@ RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > RUN apt-get update && apt-get install -y libsasl2-dev python-dev libldap2-dev libssl-dev ADD REQUIREMENTS.txt /REQUIREMENTS.txt RUN pip install -r /REQUIREMENTS.txt -RUN pip install uwsgi +RUN pip install uwsgi freezegun==1.3.1 # https://docs.docker.com/examples/running_ssh_service/ # Sudo is needed by pycharm when it tries to pip install packages diff --git a/dockerize/docker/REQUIREMENTS.txt b/dockerize/docker/REQUIREMENTS.txt index 2b324a66..d74ab808 100644 --- a/dockerize/docker/REQUIREMENTS.txt +++ b/dockerize/docker/REQUIREMENTS.txt @@ -1,7 +1,7 @@ django==2.2.25 django-auth-ldap python-ldap -django-taggit +django-taggit==2.0.0 django-tinymce==3.4.0 psycopg2 # Updates for Django 2 @@ -21,8 +21,11 @@ django-sortable-listview sorl-thumbnail django-extensions django-debug-toolbar==1.11.1 -whoosh -django-haystack + +# Updates for Django 2 & Python 3.7 +git+https://github.com/Xpirix/whoosh.git@a306553 +pickle5==0.0.12 +django-haystack==3.2.1 # Feedjack==0.9.18 # So use George's fork rather @@ -50,3 +53,4 @@ django-rest-multiple-models==2.1.3 django-preferences==1.0.0 PyWavefront==1.3.3 +django-matomo==0.1.6 diff --git a/qgis-app/REQUIREMENTS_plugins.txt b/qgis-app/REQUIREMENTS_plugins.txt index f7dca41a..fa9c03ac 100644 --- a/qgis-app/REQUIREMENTS_plugins.txt +++ b/qgis-app/REQUIREMENTS_plugins.txt @@ -1,7 +1,7 @@ django==2.2.25 django-auth-ldap python-ldap -django-taggit +django-taggit==2.0.0 django-tinymce==3.4.0 psycopg2 # Updates for Django 2 @@ -21,5 +21,8 @@ django-sortable-listview sorl-thumbnail django-extensions django-debug-toolbar==1.11.1 -whoosh -django-haystack + +# Updates for Django 2 & Python 3.7 +git+https://github.com/Xpirix/whoosh.git@a306553 +pickle5==0.0.12 +django-haystack==3.2.1 diff --git a/qgis-app/plugins/forms.py b/qgis-app/plugins/forms.py index 0361d287..5147bacc 100644 --- a/qgis-app/plugins/forms.py +++ b/qgis-app/plugins/forms.py @@ -195,7 +195,7 @@ def clean_package(self): """ package = self.cleaned_data.get("package") try: - self.cleaned_data.update(validator(package, plugin_is_new=True)) + self.cleaned_data.update(validator(package)) except ValidationError as e: msg = _( "There were errors reading plugin package (please check also your plugin's metadata)." diff --git a/qgis-app/plugins/migrations/0004_merge_20231122_0223.py b/qgis-app/plugins/migrations/0004_merge_20231122_0223.py index f7e5c5be..8251bc87 100644 --- a/qgis-app/plugins/migrations/0004_merge_20231122_0223.py +++ b/qgis-app/plugins/migrations/0004_merge_20231122_0223.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.25 on 2023-11-23 07:56 +# Generated by Django 2.2.25 on 2023-11-30 05:13 from django.db import migrations diff --git a/qgis-app/plugins/templates/plugins/plugin_detail.html b/qgis-app/plugins/templates/plugins/plugin_detail.html index 5cc7a7e1..bc48879e 100644 --- a/qgis-app/plugins/templates/plugins/plugin_detail.html +++ b/qgis-app/plugins/templates/plugins/plugin_detail.html @@ -38,6 +38,44 @@ }); }); }); + + // Handle URL anchor for tabs + $(window).load(function() { + + // Store the current scroll position + var scrollPosition = 0; + + // Handle tab clicks + $('.nav-tabs a').on('click', function (e) { + e.preventDefault(); + + // Store the current scroll position + scrollPosition = $(window).scrollTop(); + + // Update the URL without triggering a reload + window.location.hash = this.hash; + + // Show the tab + $(this).tab('show'); + }); + + // Restore the scroll position on tab change + $('.nav-tabs a').on('shown.bs.tab', function (e) { + $(window).scrollTop(scrollPosition); + }); + + // Activate the tab based on the URL fragment + var hash = window.location.hash; + if (hash) { + $('.nav-tabs a[href="' + hash + '"]').tab('show'); + } + + // Scroll to the top when the page loads + setTimeout(() => { + $(window).scrollTop(0); + }) + + }); {% endblock %} {% block extracss %} diff --git a/qgis-app/plugins/templates/plugins/plugin_list.html b/qgis-app/plugins/templates/plugins/plugin_list.html index 513a8d09..c959d4f8 100644 --- a/qgis-app/plugins/templates/plugins/plugin_list.html +++ b/qgis-app/plugins/templates/plugins/plugin_list.html @@ -1,4 +1,5 @@ {% extends 'plugins/plugin_base.html' %}{% load i18n bootstrap_pagination humanize static sort_anchor range_filter thumbnail %} +{% load local_timezone %} {% block extrajs %} - + + +{% tracking_code %} diff --git a/qgis-app/templates/matomo/tracking_code.html b/qgis-app/templates/matomo/tracking_code.html new file mode 100644 index 00000000..175a75a4 --- /dev/null +++ b/qgis-app/templates/matomo/tracking_code.html @@ -0,0 +1,23 @@ + + + \ No newline at end of file