memopol merge requestshttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests2016-06-14T12:03:38+02:00https://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/50Use Country.get_absolute_url in templates2016-10-03T17:36:00+02:00okhinokhin@laquadrature.netUse Country.get_absolute_url in templates*Created by: jpic*
*Created by: jpic*
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/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/123Add themes2016-10-03T17:37:46+02:00njoyardAdd themes*Created by: njoyard*
Done in this PR
* Add a new "theme" model with related links
* Add many to many relationships with Proposal, Dossier and Position
* Add theme to the admin
* Remove tags from Position
* Add a page to list the...*Created by: njoyard*
Done in this PR
* Add a new "theme" model with related links
* Add many to many relationships with Proposal, Dossier and Position
* Add theme to the admin
* Remove tags from Position
* Add a page to list themes and show a theme with details (description, links, dossiers, proposals, positions)
TODO but in a future PR (**after** v3 design merge, no need to code things that will be destroyed tomorrow):
- add theme(s) selection on public position form
- show themes as tag badges everywhere
- allow filtering dossiers/votes/scores/... by themehttps://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/109Add chamber links and refactor contact block a bit2016-07-19T09:08:23+02:00njoyardAdd chamber links and refactor contact block a bit*Created by: njoyard*
*Created by: njoyard*
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/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/66Fix deployment on master2016-05-20T19:26:00+02:00okhinokhin@laquadrature.netFix deployment on master*Created by: jpic*
*Created by: jpic*
https://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/64Add scores, scoredvotes, recommendations to api2016-10-03T17:36:23+02:00njoyardAdd scores, scoredvotes, recommendations to api*Created by: njoyard*
This PR adds memopol entries to the REST api:
- recommendations
- representative scores
- scored votes (ie. votes with their contribution to the rep score)
- score contribution by dossier (via a new DossierScor...*Created by: njoyard*
This PR adds memopol entries to the REST api:
- recommendations
- representative scores
- scored votes (ie. votes with their contribution to the rep score)
- score contribution by dossier (via a new DossierScore model that maps to a DB view, because django querysets do not seem to enable aggregating over annotated fields)
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*
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/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/110Add sorting to rep list and dossier list2016-10-03T17:37:36+02:00njoyardAdd sorting to rep list and dossier list*Created by: njoyard*
*Created by: njoyard*
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/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/206Moving the csrf exemption to the mixin. #1952017-05-24T14:05:41+02:00okhinokhin@laquadrature.netMoving the csrf exemption to the mixin. #195Closes #195Closes #195okhinokhin@laquadrature.netokhinokhin@laquadrature.nethttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/205Shutting down csrf for now. Some mystic shit is happening in uwsgi. /spend 6h.2017-05-23T18:18:28+02:00okhinokhin@laquadrature.netShutting down csrf for now. Some mystic shit is happening in uwsgi. /spend 6h.Work on #195
Still need to understand what the heck happens here.Work on #195
Still need to understand what the heck happens here.okhinokhin@laquadrature.netokhinokhin@laquadrature.nethttps://git.laquadrature.net/la-quadrature-du-net/memopol/memopol/-/merge_requests/204Let's enforce csrf on home, it seems the cookie is never sent to the client o...2017-05-23T12:22:40+02:00okhinokhin@laquadrature.netLet's enforce csrf on home, it seems the cookie is never sent to the client only…… on this view. /spend 1h
Closes #195… on this view. /spend 1h
Closes #195okhinokhin@laquadrature.netokhinokhin@laquadrature.net