memopol merge requestshttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests2016-07-05T22:33:08+02:00https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/99Small update to dossier list/details2016-07-05T22:33:08+02:00njoyardSmall update to dossier list/details*Created by: njoyard*
*Created by: njoyard*
https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/97Add search to dossiers2016-10-03T17:37:18+02:00njoyardAdd search to dossiers*Created by: njoyard*
Add a search form to dossiers, enables searching by title or reference.*Created by: njoyard*
Add a search form to dossiers, enables searching by title or reference.https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/96Configurable scores with exponential decay2016-10-03T17:37:15+02:00njoyardConfigurable scores with exponential decay*Created by: njoyard*
This PR implements exponential decay as shown in #63.
It also introduces a new Setting model to store administration preferences. For now they only contain score decay parameters ; default value are chosen so th...*Created by: njoyard*
This PR implements exponential decay as shown in #63.
It also introduces a new Setting model to store administration preferences. For now they only contain score decay parameters ; default value are chosen so that score calculation stays the same as what we currently have.
There are no tests in the memopol_settings app because there is no business logic, only a model and an admin view. It is a separate app because it will most likely be used by the memopol app in the future (it has no reason to be in representatives_recommendations, but it can't be in memopol because then there would be a circular dependency between representatives_recommendations and memopol).https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/95Switch to pgsql-only2016-10-03T17:37:13+02:00njoyardSwitch to pgsql-only*Created by: njoyard*
This PR switches the project to PostgreSQL only. This is necessary for future updates.
Some views and tests have been fixed to not rely on default database ordering (hence the fixture changes).*Created by: njoyard*
This PR switches the project to PostgreSQL only. This is necessary for future updates.
Some views and tests have been fixed to not rely on default database ordering (hence the fixture changes).https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/92Add filters for representatives2016-10-03T17:37:10+02:00njoyardAdd filters for representatives*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...*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:
* [x] fix select2 style to match the rest of the form
* [x] 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)
* [x] ~~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*
* [x] add something more obvious when there are no results
* [x] ~~add a media block to the root template to allow page templates to add to it~~ *not needed, we have a head block already*
* [x] ~~change the way groups are displayed in the ac (add abbreviation, make group type more obvious)~~ *doesn't seem possible currently with select2*
* [x] add filter tests
* [x] check duplicate meps issue again
* [x] fix missing querystring in page links
Preview:
![preview](https://framapic.org/gierm9d1M2ym/dqpVBqKOA2Ud.png)https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/91Fix deps2016-06-14T12:03:38+02:00njoyardFix deps*Created by: njoyard*
* Update to django-representatives and django-representatives-votes with controlled dependencies versions
* Update to responsediff 0.6, with updated fixtures
* Fix some version numbers (no need to depend on stric...*Created by: njoyard*
* Update to django-representatives and django-representatives-votes with controlled dependencies versions
* Update to responsediff 0.6, with updated fixtures
* Fix some version numbers (no need to depend on strict minor revisions)
https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/90Add country flags (and import template tags)2016-10-03T17:37:03+02:00njoyardAdd country flags (and import template tags)*Created by: njoyard*
This PR adds country flags to the Countries page.
It also imports template tags from django-representatives[-votes] so that they can be removed from there later.*Created by: njoyard*
This PR adds country flags to the Countries page.
It also imports template tags from django-representatives[-votes] so that they can be removed from there later.https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/89[Abandoned] Enhance pager2016-10-03T17:37:01+02:00njoyard[Abandoned] Enhance pager*Created by: njoyard*
**Abandoned. PR kept for future reference**
Change pager icons and tooltips to be more descriptive ; add "go to page" feature*Created by: njoyard*
**Abandoned. PR kept for future reference**
Change pager icons and tooltips to be more descriptive ; add "go to page" featurehttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/88Allow former meps2016-10-03T17:36:58+02:00njoyardAllow former meps*Created by: njoyard*
This PR enables importing and using inactive MEPs in memopol. Inactive MEPs are shown in grayscale and listing pages have an toggle between showing active MEPs only (default) or all MEPs.
![example](https://fram...*Created by: njoyard*
This PR enables importing and using inactive MEPs in memopol. Inactive MEPs are shown in grayscale and listing pages have an toggle between showing active MEPs only (default) or all MEPs.
![example](https://framapic.org/3rQyc0QeDLXc/WVbq1FMNColc.png)
It also enables pagination on group lists, as well as active vs all filtering.https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/87Remove versioned database and add quickstart script instead2016-10-03T17:36:55+02:00njoyardRemove versioned database and add quickstart script instead*Created by: njoyard*
Everything is in the title :)*Created by: njoyard*
Everything is in the title :)https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/86Move from LESS to SCSS2016-10-03T17:36:53+02:00njoyardMove from LESS to SCSS*Created by: njoyard*
`lesscpy` is not fully LESS-compliant. Instead `django-libsass` relies on `libsass`, which is a fully compliant C/C++ implementation of SASS/SCSS.
The reason for that change: I came across a lesscpy bug while ad...*Created by: njoyard*
`lesscpy` is not fully LESS-compliant. Instead `django-libsass` relies on `libsass`, which is a fully compliant C/C++ implementation of SASS/SCSS.
The reason for that change: I came across a lesscpy bug while adding new style to inactive meps, tried to fix it in lesscpy but seeing how poorly written it was made me change my mind - there is no other less implementation that does not require nodejs (actually there is one, but it is even less compliant).https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/85Integrate views removed from d-r[-v]2016-10-03T17:36:51+02:00njoyardIntegrate views removed from d-r[-v]*Created by: njoyard*
A quick summary of the changes made:
- Gave names to API views because their default names conflicted with other view names
- Added tags to make group/chamber/country URLs (1)
- Moved views each to its own file ...*Created by: njoyard*
A quick summary of the changes made:
- Gave names to API views because their default names conflicted with other view names
- Added tags to make group/chamber/country URLs (1)
- Moved views each to its own file and integrated views removed from d-r[-v]
- Integrated URLs removed from d-r[-v]
- Made URLs more homogenous ~~(allow singular & plural ; all URLs default to singular)~~ : moved /groups/ to /group/ and added 301 redirect from old to new
(1) I prefer using tags instead of using get_absolute_url. As models are defined in a dependency, they cannot "know" what the user application wants to use as the "canonical model url" (for example for groups it may be rep list filtered by this group, or a detail page for the group, or whatever). I could have made inherited models in memopol just to override get_absolute_url, but then making sure foreign keys use overriden models is not made easy AT ALL by django. It's possible, but the code is horrible.https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/84Add import scripts for old data, fixes #582016-10-03T17:36:47+02:00njoyardAdd import scripts for old data, fixes #58*Created by: njoyard*
This PR adds two import scripts for old memopol data.
Links to exported data:
* [recommendations.csv](https://framabin.org/?ad32ff1675bd62b5#74mkMfNTLRNT4f4tGkJpgxUmRe02Zgp5ImosoBrSAvg=)
* [positions.csv](http...*Created by: njoyard*
This PR adds two import scripts for old memopol data.
Links to exported data:
* [recommendations.csv](https://framabin.org/?ad32ff1675bd62b5#74mkMfNTLRNT4f4tGkJpgxUmRe02Zgp5ImosoBrSAvg=)
* [positions.csv](https://framabin.org/?089bceff87c480cc#EfiUTwUi/Umz6JuqGaPOhwTKpHesnqVdQ8u2CsUVcs0=)
#### Recommendations
Export old recommendation data to a `|`-separated CSV file with the following query:
```sql
SELECT CONCAT(r.description, '|', r.weight, '|', r.recommendation, '|',
r.part, '|', p.title, '|', p.ponderation)
FROM votes_recommendation r
LEFT JOIN votes_proposal p ON r.proposal_id = p.id
WHERE p.institution = 'EU'
```
Then run the import script using :
```sh
cat recommendations.csv | memopol_import_recommendations
```
#### Positions
Export old position data to a `|`-separated CSV file with the following query:
```sql
SELECT CONCAT(o.content, '|', o.url, '|', o.title, '|', ro.date, '|',
r.first_name, '|', r.last_name)
FROM reps_opinion o
INNER JOIN reps_opinionrep ro ON ro.opinion_id = o.id
INNER JOIN reps_representative r ON r.id = ro.representative_id
WHERE o.institution='EU'
```
Then run the import script using :
```sh
cat positions.csv | memopol_import_positions
```https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/83Enhance representative details, fixes #742016-10-03T17:36:44+02:00njoyardEnhance representative details, fixes #74*Created by: njoyard*
This PR adds contact information on the representative page:
- social network and websites
- email addresses, phone number and postal addresses
![preview](https://framapic.org/4lFSBXV00nSt/9VLkllVvPkmq.png)*Created by: njoyard*
This PR adds contact information on the representative page:
- social network and websites
- email addresses, phone number and postal addresses
![preview](https://framapic.org/4lFSBXV00nSt/9VLkllVvPkmq.png)https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/82Add group icons2016-10-03T17:36:41+02:00njoyardAdd group icons*Created by: njoyard*
Previews :
![1](https://framapic.org/b2EEtbt3NuSB/1veWYO55pRbX.png)
![2](https://framapic.org/cmkoxbmebjH1/mmMsj7r9fW8L.png)
![3](https://framapic.org/DU7yaeWtuugm/UMoMhDZjpJcI.png)
We should also add frenc...*Created by: njoyard*
Previews :
![1](https://framapic.org/b2EEtbt3NuSB/1veWYO55pRbX.png)
![2](https://framapic.org/cmkoxbmebjH1/mmMsj7r9fW8L.png)
![3](https://framapic.org/DU7yaeWtuugm/UMoMhDZjpJcI.png)
We should also add french groups when applicablehttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/80[WIP] Add import scripts for old data, fixes #582016-10-03T17:36:39+02:00njoyard[WIP] Add import scripts for old data, fixes #58*Created by: njoyard*
This PR adds two import scripts for old memopol data.
Links to exported data:
* [recommendations.csv](https://framabin.org/?ad32ff1675bd62b5#74mkMfNTLRNT4f4tGkJpgxUmRe02Zgp5ImosoBrSAvg=)
* [positions.csv](http...*Created by: njoyard*
This PR adds two import scripts for old memopol data.
Links to exported data:
* [recommendations.csv](https://framabin.org/?ad32ff1675bd62b5#74mkMfNTLRNT4f4tGkJpgxUmRe02Zgp5ImosoBrSAvg=)
* [positions.csv](https://framabin.org/?089bceff87c480cc#EfiUTwUi/Umz6JuqGaPOhwTKpHesnqVdQ8u2CsUVcs0=)
#### Recommendations
Export old recommendation data to a `|`-separated CSV file with the following query:
```sql
SELECT CONCAT(r.description, '|', r.weight, '|', r.recommendation, '|',
r.part, '|', p.title, '|', p.ponderation)
FROM votes_recommendation r
LEFT JOIN votes_proposal p ON r.proposal_id = p.id
WHERE p.institution = 'EU'
```
Then run the import script using :
```sh
cat recommendations.csv | memopol_import_recommendations
```
#### Positions
Export old position data to a `|`-separated CSV file with the following query:
```sql
SELECT CONCAT(o.content, '|', o.url, '|', o.title, '|', ro.date, '|',
r.first_name, '|', r.last_name)
FROM reps_opinion o
INNER JOIN reps_opinionrep ro ON ro.opinion_id = o.id
INNER JOIN reps_representative r ON r.id = ro.representative_id
WHERE o.institution='EU'
```
Then run the import script using :
```sh
cat positions.csv | memopol_import_positions
```https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/78Rewrite score computing, fixes #692016-10-03T17:36:36+02:00njoyardRewrite score computing, fixes #69*Created by: njoyard*
This PR removes static, asynchronous representative score updates by replacing plain models with views in the `representatives_recommendations` app:
* `votescores` computes the score consequence of each vote on ...*Created by: njoyard*
This PR removes static, asynchronous representative score updates by replacing plain models with views in the `representatives_recommendations` app:
* `votescores` computes the score consequence of each vote on the representative score ; it is mapped to the new VoteScore model that replaces ScoredVote (which extended Vote and computed scores in python).
* `dossierscores` was introduced in a previous changeset but was rewritten to use `votescores`; it aggregates votes over proposals from a single dossier and returns the score contribution of each dossier on representatives scores. It is mapped to the DossierScore model.
* `representativescore` aggregates scores from the `dossierscores` view over all dossiers for each representative and gives a direct queryable access to the score of each representative. It is mapped to the RepresentativeScore model.
This PR also removes score update facilities as they now don't have any use.
TL;DR: no more manual score updates, scores are computed on the fly.https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/77Enhance dossiers views, fixes #702016-10-03T17:36:33+02:00njoyardEnhance dossiers views, fixes #70*Created by: njoyard*
Dossier list:
![dossier list](https://framapic.org/OChfK78WhmMT/LlSAnZN22HMS.png)
Dossier details:
![dossier details](https://framapic.org/mnQvP6zBKkBd/kSEAX5pb2QcF.png)*Created by: njoyard*
Dossier list:
![dossier list](https://framapic.org/OChfK78WhmMT/LlSAnZN22HMS.png)
Dossier details:
![dossier details](https://framapic.org/mnQvP6zBKkBd/kSEAX5pb2QcF.png)https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/75Enhance footer links2016-10-03T17:36:31+02:00okhinokhin@laquadrature.netEnhance footer links*Created by: djangocreation*
In response to issue #71
*Created by: djangocreation*
In response to issue #71
https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/67Completed hacker guide with crazy slides2016-05-21T06:39:30+02:00okhinokhin@laquadrature.netCompleted hacker guide with crazy slides*Created by: jpic*
*Created by: jpic*