Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M memopol
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 32
    • Issues 32
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Political Memory
  • memopol
  • Merge requests
  • !92

Merged
Created Jun 16, 2016 by njoyard@njoyardContributor9 of 9 tasks completed9/9 tasks

Add filters for representatives

  • Overview 4
  • Commits 14
  • Changes 48

Created by: njoyard

This PR adds a filter form that uses django-filters on the representative list with the following criteria:

  • search: identical to the previously existing search box, searches representatives by name
  • chamber: static drop down list to filter by chamber
  • country: static drop down list to filter by country
  • group: autocompleted drop down to filter by all kinds of groups (except chamber and country) : party, committee, delegation, ...

The group URLs (like /legislature/representatives/committee/European Parliament/Committee on Defense whatever) are now 301-redirected to an URL with querystring parameters in order to pre-fill the filter form.

TODO:

  • fix select2 style to match the rest of the form
  • ensure the filter form always submits to the root representative list url instead of the current page url (not really needed but just in case)
  • add a checkbox to choose active/inactive meps postponed until we have an easy way to turn options/selects into a nice bootstrap button group
  • add something more obvious when there are no results
  • add a media block to the root template to allow page templates to add to it not needed, we have a head block already
  • change the way groups are displayed in the ac (add abbreviation, make group type more obvious) doesn't seem possible currently with select2
  • add filter tests
  • check duplicate meps issue again
  • fix missing querystring in page links

Preview:

preview

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: filter-representatives-22d27829