diff --git a/memopol/fixtures/one_representative.json b/memopol/fixtures/one_representative.json index feae25c6d9f2a9163fd8d3856a154073bbb8ccb1..fab6f04f2e0f55b870a9a1af6c1a647513bbfb32 100644 --- a/memopol/fixtures/one_representative.json +++ b/memopol/fixtures/one_representative.json @@ -60,6 +60,27 @@ "model": "representatives.website", "pk": 297 }, +{ + "fields": { + "country": null, + "name": "European Parliament", + "abbreviation": "EP" + }, + "model": "representatives.chamber", + "pk": 1 +}, +{ + "fields": { + "updated": "2015-12-27T16:03:31.046Z", + "name": "European Parliament", + "created": "2015-12-27T16:03:31.046Z", + "kind": "chamber", + "abbreviation": "EP", + "chamber": 1 + }, + "model": "representatives.group", + "pk": 1 +}, { "fields": { "updated": "2015-12-27T16:03:31.046Z", @@ -67,7 +88,8 @@ "created": "2015-12-27T16:03:31.046Z", "kind": "committee", "abbreviation": "EMPL", - "fingerprint": "7f0e6d2c3342dde2c6077e127a418a19e0e891bb" + "fingerprint": "7f0e6d2c3342dde2c6077e127a418a19e0e891bb", + "chamber": 1 }, "model": "representatives.group", "pk": 3 @@ -79,7 +101,8 @@ "created": "2015-12-27T16:03:31.100Z", "kind": "committee", "abbreviation": "JURI", - "fingerprint": "bc1a051072a9f2caf7c5c7105bccd13834b4d89d" + "fingerprint": "bc1a051072a9f2caf7c5c7105bccd13834b4d89d", + "chamber": 1 }, "model": "representatives.group", "pk": 9 @@ -91,7 +114,8 @@ "created": "2015-12-27T16:03:31.388Z", "kind": "committee", "abbreviation": "CULT", - "fingerprint": "a169e2d7e6009d3c089e4de43c0f3e0fc312fca4" + "fingerprint": "a169e2d7e6009d3c089e4de43c0f3e0fc312fca4", + "chamber": 1 }, "model": "representatives.group", "pk": 20 @@ -103,7 +127,8 @@ "created": "2015-12-27T16:03:31.402Z", "kind": "group", "abbreviation": "SD", - "fingerprint": "729890eba3ce20f90808b32110871d1fe41b53b6" + "fingerprint": "729890eba3ce20f90808b32110871d1fe41b53b6", + "chamber": 1 }, "model": "representatives.group", "pk": 21 @@ -115,7 +140,8 @@ "created": "2015-12-27T16:03:31.510Z", "kind": "committee", "abbreviation": "ITRE", - "fingerprint": "17ff1a9fe036e400612c9153c1647a8258c34d63" + "fingerprint": "17ff1a9fe036e400612c9153c1647a8258c34d63", + "chamber": 1 }, "model": "representatives.group", "pk": 23 @@ -127,7 +153,8 @@ "created": "2015-12-27T16:03:31.521Z", "kind": "committee", "abbreviation": "REGI", - "fingerprint": "7a2a03e6d40e5af34f3dc6bccd8e1900e2de3abf" + "fingerprint": "7a2a03e6d40e5af34f3dc6bccd8e1900e2de3abf", + "chamber": 1 }, "model": "representatives.group", "pk": 24 @@ -139,7 +166,8 @@ "created": "2015-12-27T16:03:31.768Z", "kind": "committee", "abbreviation": "ECON", - "fingerprint": "2da973401cd76bb56b36f3a9162cda13d2f2d8f3" + "fingerprint": "2da973401cd76bb56b36f3a9162cda13d2f2d8f3", + "chamber": 1 }, "model": "representatives.group", "pk": 30 @@ -163,7 +191,8 @@ "created": "2015-12-27T16:03:32.489Z", "kind": "group", "abbreviation": "PSE", - "fingerprint": "53961127dd190ceb0568d2290e195570ed907164" + "fingerprint": "53961127dd190ceb0568d2290e195570ed907164", + "chamber": 1 }, "model": "representatives.group", "pk": 41 @@ -175,7 +204,8 @@ "created": "2015-12-27T16:03:33.606Z", "kind": "committee", "abbreviation": "ENVI", - "fingerprint": "9d81a89ff2836afbe40dc4109b085c00bf0b1fdd" + "fingerprint": "9d81a89ff2836afbe40dc4109b085c00bf0b1fdd", + "chamber": 1 }, "model": "representatives.group", "pk": 48 @@ -187,7 +217,8 @@ "created": "2015-12-27T16:03:34.712Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "6482a4de9bdda2ae85fb71f78de0cfd49441a0e6" + "fingerprint": "6482a4de9bdda2ae85fb71f78de0cfd49441a0e6", + "chamber": 1 }, "model": "representatives.group", "pk": 64 @@ -199,7 +230,8 @@ "created": "2015-12-27T16:03:34.756Z", "kind": "group", "abbreviation": "PSE", - "fingerprint": "bdcddf45a869f242e80961303a719a3e0f29d795" + "fingerprint": "bdcddf45a869f242e80961303a719a3e0f29d795", + "chamber": 1 }, "model": "representatives.group", "pk": 67 @@ -211,7 +243,8 @@ "created": "2015-12-27T16:03:36.124Z", "kind": "committee", "abbreviation": "FEMM", - "fingerprint": "07290c78bb6679e36a5413d2b8122ff4c1477889" + "fingerprint": "07290c78bb6679e36a5413d2b8122ff4c1477889", + "chamber": 1 }, "model": "representatives.group", "pk": 77 @@ -223,7 +256,8 @@ "created": "2015-12-27T16:03:36.219Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "171567aaa5ebc7bbdcf3fa3b8a293f9ade40c03a" + "fingerprint": "171567aaa5ebc7bbdcf3fa3b8a293f9ade40c03a", + "chamber": 1 }, "model": "representatives.group", "pk": 79 @@ -235,7 +269,8 @@ "created": "2015-12-27T16:03:37.137Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "e2ece7c8073aa5d8ed32a003ecb5989eb363fe95" + "fingerprint": "e2ece7c8073aa5d8ed32a003ecb5989eb363fe95", + "chamber": 1 }, "model": "representatives.group", "pk": 86 @@ -247,7 +282,8 @@ "created": "2015-12-27T16:03:40.000Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "25ea9a5e8434c4c550c2fa4d7d8b79769f5eb8c0" + "fingerprint": "25ea9a5e8434c4c550c2fa4d7d8b79769f5eb8c0", + "chamber": 1 }, "model": "representatives.group", "pk": 97 @@ -259,7 +295,8 @@ "created": "2015-12-27T16:03:42.041Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "ae4f709686238bb59f0e8d3f1f1362d6c6777744" + "fingerprint": "ae4f709686238bb59f0e8d3f1f1362d6c6777744", + "chamber": 1 }, "model": "representatives.group", "pk": 101 @@ -271,7 +308,8 @@ "created": "2015-12-27T16:03:47.768Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "fe7cabd2bfa99251e4f9bb2d700ec2a1898c312b" + "fingerprint": "fe7cabd2bfa99251e4f9bb2d700ec2a1898c312b", + "chamber": 1 }, "model": "representatives.group", "pk": 111 @@ -283,7 +321,8 @@ "created": "2015-12-27T16:03:58.940Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "6d1f6a5bcc43f05a7cfdee1d2bc7b0d0cc5db6dc" + "fingerprint": "6d1f6a5bcc43f05a7cfdee1d2bc7b0d0cc5db6dc", + "chamber": 1 }, "model": "representatives.group", "pk": 121 @@ -295,7 +334,8 @@ "created": "2015-12-27T16:04:34.387Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "920d936c976ee2b6fff4ce760dfb154d926dc2d1" + "fingerprint": "920d936c976ee2b6fff4ce760dfb154d926dc2d1", + "chamber": 1 }, "model": "representatives.group", "pk": 141 @@ -307,7 +347,8 @@ "created": "2015-12-27T16:04:50.770Z", "kind": "delegation", "abbreviation": "", - "fingerprint": "35588fd232a2f314c16242334bad5f5190b4efae" + "fingerprint": "35588fd232a2f314c16242334bad5f5190b4efae", + "chamber": 1 }, "model": "representatives.group", "pk": 150 diff --git a/static/images/chamber-an.png b/static/images/chamber-an.png new file mode 100644 index 0000000000000000000000000000000000000000..0a43283d1167b83a79ae38c5062932e2268eee75 Binary files /dev/null and b/static/images/chamber-an.png differ diff --git a/static/images/chamber-ep.png b/static/images/chamber-ep.png new file mode 100644 index 0000000000000000000000000000000000000000..4d93e9a9f0cfd984d4b386587c25ce98d57b0bef Binary files /dev/null and b/static/images/chamber-ep.png differ diff --git a/static/images/chamber-sen.png b/static/images/chamber-sen.png new file mode 100644 index 0000000000000000000000000000000000000000..7a23430901649d71904a2781e134b00e64288617 Binary files /dev/null and b/static/images/chamber-sen.png differ diff --git a/static/less/base.less b/static/less/base.less index b98940ff54627561191bab62972d21def549ac02..a1b33fbc270ca6cab4463fa9a4f688e2cf1a80fc 100644 --- a/static/less/base.less +++ b/static/less/base.less @@ -5,6 +5,7 @@ @import 'table'; @import 'legislature'; @import 'positions'; +@import 'chambers'; body { background: #E5E5E5; diff --git a/static/less/chambers.less b/static/less/chambers.less new file mode 100644 index 0000000000000000000000000000000000000000..7cc04d7687de1c610e4ab768cc7519e84a51b3ae --- /dev/null +++ b/static/less/chambers.less @@ -0,0 +1,20 @@ +.chamber-icon { + display: inline-block; + width: 1.5em; + height: 1.5em; + + vertical-align: bottom; + background-size: 100%; + + &.chamber-icon-an { + background-image: url(../images/chamber-an.png); + } + + &.chamber-icon-ep { + background-image: url(../images/chamber-ep.png); + } + + &.chamber-icon-sen { + background-image: url(../images/chamber-sen.png); + } +} diff --git a/templates/base.html b/templates/base.html index bb38eb9446cf60125bfd776f31c590854ebde2f6..f6c43a93e0a78ca3445ceb2be28cd9ab208d96b7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -13,7 +13,7 @@ {% compress css %} <link rel="stylesheet" href="{% static 'libs/bootstrap/dist/css/bootstrap.min.css' %}" type="text/css" /> <link rel="stylesheet" href="{% static 'libs/fontawesome/css/font-awesome.min.css' %}" type="text/css" /> - <link rel="stylesheet" href="{% static 'libs/flag-icon-css/css/flag-icon.min.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'libs/flag-icon-css/css/flag-icon.min.css' %}" type="text/css" />" <link rel="stylesheet" href="{% static 'less/base.less' %}" type="text/less" /> {% endcompress %} {% compress js %} diff --git a/templates/representatives/_representative_block.haml b/templates/representatives/_representative_block.haml index ecdc69bc59812b3e1b76aa84b946c0cfbca0925b..769f0853309f4bd20f7bc51546faecf32759fa21 100644 --- a/templates/representatives/_representative_block.haml +++ b/templates/representatives/_representative_block.haml @@ -18,6 +18,11 @@ %th Score %td = representative.score.score|score_label + %tr + %th Chamber + %td< + %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=representative.main_mandate.group.chamber.name %}"} + = representative.main_mandate.group.chamber|chamber_icon %tr %th Country %td< diff --git a/templates/representatives/group_list.haml b/templates/representatives/group_list.haml index bf7fc5a8e24cabf8e1d5cee21353c8b0e2ce2ebc..7c1cee018b34962a607ebf5aaba4fa0dc42c0fbd 100644 --- a/templates/representatives/group_list.haml +++ b/templates/representatives/group_list.haml @@ -1,16 +1,23 @@ - extends 'base.html' +- load representatives_tags + - block content %table.table - for group in object_list %tr - if group.kind != 'country' and group.kind != 'chamber' %td - %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=group.chamber.name %}"}= group.chamber.name + %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=group.chamber.name %}"} + = group.chamber|chamber_icon %td %a{'href': '{{ group.get_absolute_url }}'} - if group.abbreviation ={group.abbreviation} %td - %a{'href': '{{ group.get_absolute_url }}'}= group.name + %a{'href': '{{ group.get_absolute_url }}'}= + - if group.kind == 'chamber' + = group|chamber_icon + - else + = group.name diff --git a/templates/representatives/representative_grid.haml b/templates/representatives/representative_grid.haml index d8c1dddb08b65e5bfb3f80f2a711f2e22e3df870..f28e964752752e17f969f507201069af5635a5c8 100644 --- a/templates/representatives/representative_grid.haml +++ b/templates/representatives/representative_grid.haml @@ -15,6 +15,9 @@ %li.name %a{'href': "{{ representative.get_absolute_url }}"} = representative.full_name + %li.chamber + %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=representative.main_mandate.group.chamber.name %}"} + = representative.main_mandate.group.chamber|chamber_icon %li.country %a{'href': "{{ representative.country.get_absolute_url }}"} = representative.country|country_flag diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml index 525f375cff9bb0f4fe3a49c5b24c305e05ae153f..5cb5e7f3532fc32a1a4b913906e5f47c3e6794c8 100644 --- a/templates/representatives/representative_list.haml +++ b/templates/representatives/representative_list.haml @@ -27,6 +27,8 @@ - trans 'Photo' %th - trans 'Name' + %th + - trans 'Chamber' %th - trans 'Country' %th @@ -44,6 +46,10 @@ %a{'href': "{{ representative.get_absolute_url }}"} = representative.full_name + %td + %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=representative.main_mandate.group.chamber.name %}"} + = representative.main_mandate.group.chamber + %td %a{'href': "{{ representative.country.get_absolute_url }}"} = representative.country