Skip to content

Commit

Permalink
Merge branch 'master' into ajax-geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Apr 9, 2021
2 parents 4b5479c + 4ebfc4a commit 8cbeedf
Show file tree
Hide file tree
Showing 23 changed files with 1,357 additions and 426 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# sudo apt-get update
sudo apt-get update -y
# sudo apt-get install -y build-essentials
sudo apt-get install libxml2-dev libxslt-dev python-dev
sudo apt-get install -y libxml2-dev libxslt-dev python-dev
# sudo apt-get install py-pip
pip install \
virtualenv wheel
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pip-selfcheck.json
share/
var/
pyvenv.cfg
node_modules/
.env
.vscode/

.python-version
requirements.txt
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
3.4.3 (unreleased)
------------------

- Fix search which include the terms "and", "or" and "not"
[jeffersonbledsoe]

- implement AJAX geoJSON feature (needs ``plone.patternslib>=1.2.2``)
[petschki]

Expand Down
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
collective.collectionfilter
===========================

|CI| |Coverage|

|Workflows|

.. |CI| image:: https://github.com/collective/collective.collectionfilter/workflows/CI/badge.svg
:target: https://github.com/collective/collective.collectionfilter/actions
.. |Coverage| image:: https://coveralls.io/repos/github/collective/collective.collectionfilter/badge.svg
:target: https://coveralls.io/github/collective/collective.collectionfilter
.. |Workflows| image:: http://github-actions.40ants.com/collective/collective.collectionfilter/matrix.svg
:target: https://github.com/collective/collective.collectionfilter/actions


Faceted navigation filter for collection results.

This Plone 5 addon allows you to filter collections results for additional catalog metadata.
Expand Down
3 changes: 2 additions & 1 deletion src/collective/collectionfilter/baseviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def action_url(self):
def urlquery(self):
urlquery = {}
urlquery.update(self.top_request.form)

for it in (
TEXT_IDX,
'b_start',
Expand All @@ -191,7 +192,7 @@ def urlquery(self):
if 'collectionfilter' not in urlquery:
urlquery['collectionfilter'] = '1'

return urlquery
return ((k, vv) for k, v in urlquery.items() for vv in safe_iterable(v))

@property
def ajax_url(self):
Expand Down
6 changes: 6 additions & 0 deletions src/collective/collectionfilter/filteritems.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
from zope.component import getUtility
from zope.globalrequest import getRequest
from zope.i18n import translate
import six

import plone.api


try:
from plone.app.event.browser.event_listing import EventListing
except ImportError:
Expand Down Expand Up @@ -80,6 +82,9 @@ def get_filter_items(

# Recursively transform all to unicode
request_params = safe_decode(request_params)
# Things break if sort_order is not a str
if six.PY2 and "sort_order" in request_params:
request_params["sort_order"] = str(request_params["sort_order"])

# Support for the Event Listing view from plone.app.event
collection_layout = collection.getLayout()
Expand Down Expand Up @@ -109,6 +114,7 @@ def get_filter_items(
# Get all collection results with additional filter defined by urlquery
custom_query.update(urlquery)
custom_query = make_query(custom_query)

catalog_results = ICollection(collection).results(
batch=False,
brains=True,
Expand Down

0 comments on commit 8cbeedf

Please sign in to comment.