From 8171fdbeeca045930d48235a28ecc5e521371787 Mon Sep 17 00:00:00 2001 From: Sumandari Date: Sat, 16 Oct 2021 20:49:31 +0800 Subject: [PATCH 1/2] fix detail layout and desc order list hub --- qgis-app/templates/base/base.html | 3 +++ qgis-app/templates/base/detail.html | 2 +- qgis-app/urls.py | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/qgis-app/templates/base/base.html b/qgis-app/templates/base/base.html index 36ad103c..1fac01b3 100644 --- a/qgis-app/templates/base/base.html +++ b/qgis-app/templates/base/base.html @@ -15,6 +15,9 @@

QGIS {{ resource_name }}

div.style-polaroid, div.span12.license { margin-left: 1em; } + div.span12.license { + margin-bottom: 5em; + } .style-title { margin-bottom: 0; padding-bottom: 0; diff --git a/qgis-app/templates/base/detail.html b/qgis-app/templates/base/detail.html index 8aeec4a3..5a36080e 100644 --- a/qgis-app/templates/base/detail.html +++ b/qgis-app/templates/base/detail.html @@ -19,7 +19,7 @@

{{ object_detail.name }}

-
+
Name
diff --git a/qgis-app/urls.py b/qgis-app/urls.py index e4acdea4..9a000bba 100644 --- a/qgis-app/urls.py +++ b/qgis-app/urls.py @@ -120,9 +120,9 @@ '/planet/', # '/community-map/', '/plugins/', - '/styles/?is_galery=true', - '/geopackages/?is_galery=true', - '/models/?is_galery=true', + '/styles/?order_by=-upload_date&&is_galery=true', + '/geopackages/?order_by=-upload_date&&is_galery=true', + '/models/?order_by=-upload_date&&is_galery=true', FlatPage.objects.all(), simplemenu.models.URLItem.objects.all(), ) From 61ab32a99c301509a0c82eb79831d229675528ee Mon Sep 17 00:00:00 2001 From: Sumandari Date: Fri, 29 Oct 2021 08:01:38 +0800 Subject: [PATCH 2/2] fixed typo --- qgis-app/base/views/processing_view.py | 10 +++++----- qgis-app/templates/base/list.html | 4 ++-- qgis-app/templates/base/list_galery.html | 16 ++++++++-------- qgis-app/urls.py | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/qgis-app/base/views/processing_view.py b/qgis-app/base/views/processing_view.py index 076b89d2..b24b7520 100644 --- a/qgis-app/base/views/processing_view.py +++ b/qgis-app/base/views/processing_view.py @@ -315,7 +315,7 @@ def get_context_data(self, **kwargs): context['count'] = self.get_queryset().count() context['order_by'] = self.request.GET.get('order_by', None) context['queries'] = self.request.GET.get('q', None) - context['is_galery'] = self.request.GET.get('is_galery', None) + context['is_gallery'] = self.request.GET.get('is_gallery', None) return context def get_queryset(self): @@ -325,16 +325,16 @@ def get_queryset(self): def get_template_names(self): context = self.get_context_data() - is_galery = context['is_galery'] - if is_galery: + is_gallery = context['is_gallery'] + if is_gallery: self.paginate_by = settings.PAGINATION_DEFAULT_PAGINATION return 'base/list_galery.html' else: return 'base/list.html' def get_paginate_by(self, queryset): - is_galery = self.request.GET.get('is_galery', None) - if is_galery: + is_gallery = self.request.GET.get('is_gallery', None) + if is_gallery: return settings.PAGINATION_DEFAULT_PAGINATION_HUB return settings.PAGINATION_DEFAULT_PAGINATION diff --git a/qgis-app/templates/base/list.html b/qgis-app/templates/base/list.html index 75a051ef..5cc7eecd 100644 --- a/qgis-app/templates/base/list.html +++ b/qgis-app/templates/base/list.html @@ -141,7 +141,7 @@

{% if title %}{{title}}{% else %}{% trans "All" %} {{ resource_name }}s{% en // galery or list view const url = window.location.href.split('?')[0]; - const isGalery = new URLSearchParams(window.location.search).get("is_galery"); + const isGalery = new URLSearchParams(window.location.search).get("is_gallery"); console.log(isGalery) if (isGalery && isGalery === 'true') { $('.list-grid').find('.is-galery').addClass('disabled') @@ -154,7 +154,7 @@

{% if title %}{{title}}{% else %}{% trans "All" %} {{ resource_name }}s{% en this.href = url; }) $('.list-grid a.is-galery').each(function(){ - this.href = url + '?is_galery=true'; + this.href = url + '?is_gallery=true'; }) // change color for sorted head diff --git a/qgis-app/templates/base/list_galery.html b/qgis-app/templates/base/list_galery.html index 2e9c6d05..ff9f1817 100644 --- a/qgis-app/templates/base/list_galery.html +++ b/qgis-app/templates/base/list_galery.html @@ -140,26 +140,26 @@

// Add arguments in pagination const orderBy = new URLSearchParams(window.location.search).get("order_by"); const queries = new URLSearchParams(window.location.search).get("q"); - const is_galery = 'is_galery=true' + const is_gallery = 'is_gallery=true' if (orderBy){ $(".pagination li a").each(function(){ - this.href += 'order_by=' + orderBy +'&&' + is_galery + '&&'; + this.href += 'order_by=' + orderBy +'&&' + is_gallery + '&&'; }) } if (queries){ $(".pagination li a").each(function(){ - this.href += 'q=' + queries +'&&' + is_galery + '&&'; + this.href += 'q=' + queries +'&&' + is_gallery + '&&'; }) } if (!orderBy && !queries){ $(".pagination li a").each(function(){ - this.href += is_galery + '&&'; + this.href += is_gallery + '&&'; }) } // galery or list view const url = window.location.href.split('?')[0]; - const isGalery = new URLSearchParams(window.location.search).get("is_galery"); + const isGalery = new URLSearchParams(window.location.search).get("is_gallery"); if (isGalery && isGalery === 'true') { $('.list-grid').find('.is-galery').addClass('disabled') } else { @@ -170,7 +170,7 @@
this.href = url; }) $('.list-grid a.is-galery').each(function(){ - this.href = url + '?is_galery=true'; + this.href = url + '?is_gallery=true'; }) // edit search input from base template, in order to use it for styles @@ -207,10 +207,10 @@
const order = $('div.filter-sort').find('a').attr('data') const sort_by = $('div.filter-sort').find('select').val() let current_query = new URLSearchParams(window.location.search).get("q"); - let is_galery = new URLSearchParams(window.location.search).get("is_galery"); + let is_gallery = new URLSearchParams(window.location.search).get("is_gallery"); if (current_query === null) current_query = ''; - location.href = location.protocol + '//' + location.host + location.pathname + `?order_by=${order}${sort_by}&&is_galery=${is_galery}` + location.href = location.protocol + '//' + location.host + location.pathname + `?order_by=${order}${sort_by}&&is_gallery=${is_gallery}` } {% endblock %} diff --git a/qgis-app/urls.py b/qgis-app/urls.py index 9a000bba..e6863577 100644 --- a/qgis-app/urls.py +++ b/qgis-app/urls.py @@ -120,9 +120,9 @@ '/planet/', # '/community-map/', '/plugins/', - '/styles/?order_by=-upload_date&&is_galery=true', - '/geopackages/?order_by=-upload_date&&is_galery=true', - '/models/?order_by=-upload_date&&is_galery=true', + '/styles/?order_by=-upload_date&&is_gallery=true', + '/geopackages/?order_by=-upload_date&&is_gallery=true', + '/models/?order_by=-upload_date&&is_gallery=true', FlatPage.objects.all(), simplemenu.models.URLItem.objects.all(), )