Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Highlight people on homepage #5351

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

chrismytton
Copy link
Contributor

⚠️ Not ready to be merged yet!

This 3 featured person cards to the homepage. It needs @zarino to come in and make it pretty now.

This is what it looks like if I fiddle the CSS to show all the info on a person card:

screen shot 2016-03-16 at 16 56 11

Fixes #5263

@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 16, 2016 15:56 Active
@zarino zarino force-pushed the 5263-highlight-people-on-homepage branch from a83f7f6 to f66fa8c Compare March 16, 2016 16:27
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 16, 2016 16:27 Active
@zarino
Copy link
Member

zarino commented Mar 16, 2016

Currently looks like this:

screen shot 2016-03-16 at 16 28 14

@chrismytton – Note the incorrect page header – "Estonia"!?!?

@tmtmtmtm – I have a feeling you'll want to pick new wording for the subheading I've added. /cc @MyfanwyNixon

@chrismytton
Copy link
Contributor Author

Note the incorrect page header – "Estonia"!?!?

Haha, yes my fault, I set the country so the image_proxy_url helper would work. I'll fix that.

@chrismytton chrismytton force-pushed the 5263-highlight-people-on-homepage branch from f66fa8c to d2fac49 Compare March 16, 2016 16:35
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 16, 2016 16:35 Active
@chrismytton
Copy link
Contributor Author

@zarino I've rebased this onto master, so you'll need to to a hard reset if you want to make further changes:

git checkout 5263-highlight-people-on-homepage && git fetch origin && git reset --hard 5263-highlight-people-on-homepage

@MyfanwyNixon
Copy link
Contributor

I'd prefer:

The world's richest open dataset on politicians

@tmtmtmtm
Copy link
Contributor

Yay. Generally looking great. I think we might need to explain better what this section is though, or find a way to integrate it better with the page as a whole. Could probably do with something to make it obvious that the four featured sections are far from all we have.

We'll also want to change the legislative info section — now that it's being shown in a different context, it'll need to make sense there. Switching the constituency to the country would probably be a good first step (then we can also use that to link through to them actually in context too). Though we probably something to show dates or similar as well would be useful — especially if we pick people with a long political history. (Hmmm… actually this makes me realise that we probably want a 'History' tab RSN on the term page too, so that you can see which earlier / later terms the person was also part of…)

@tmtmtmtm
Copy link
Contributor

If we're going to make the claim of 'richest dataset', might also be nice to give an indication of scale somewhere. (We're currently at 2.6 million pieces of data — more if we include the 'positions' stuff that's still just in the 'unstable' section)

@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 17, 2016 09:26 Active
@zarino
Copy link
Member

zarino commented Mar 17, 2016

Now looks like this:

screen shot 2016-03-17 at 09 26 39

@MyfanwyNixon
Copy link
Contributor

The world's most extensive open dataset on politicians

Millions of pieces of data, including:

[social media profiles] [biographical data] [Contact details] [Identifiers]

@MyfanwyNixon
Copy link
Contributor

Jinx!

@zarino
Copy link
Member

zarino commented Mar 17, 2016

2.6 makes it sound much more scientific ;-)

@MyfanwyNixon
Copy link
Contributor

@zarino - no arguments from me, I was just future-proofing :)

@tmtmtmtm
Copy link
Contributor

If only we were capable of using technology to count them so the number could be automatically up to date at all times… ;)

@chrismytton
Copy link
Contributor Author

If only we were capable of using technology to count them so the number could be automatically up to date at all times… ;)

Is that data being exposed anywhere that we can pull it from? Would certainly be good if that number was automatically kept up to date!

@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 17, 2016 16:12 Active
@tmtmtmtm
Copy link
Contributor

bin/count_statements.rb — though we should probably tweak that a little bit before using the number anywhere. At the minute it's counting any string value anywhere, which means it's counting things like

        {
          "lang": "bar",
          "name": "Aadu Must",
          "note": "multilingual"
        },

as three statements.

@tmtmtmtm
Copy link
Contributor

I've added a statement_count to each entry in countries.json. We can use that to generate the "2.6 million pieces of data" statement (I think we should always round down to that form (2.6 million, 2.7 million etc), though it would be nice if the full count was available by hovering.

chrismytton and others added 5 commits March 18, 2016 09:01
This logic is a bit involved at the moment but can hopefully be cleaned
up by pushing some of it into everypolitician-popolo. In the meantime
moving it into this helper hides most of the complexity from the route
handler.
At the moment they are hard-coded in app.rb but they could potentially
be moved out to a config file.
@chrismytton chrismytton force-pushed the 5263-highlight-people-on-homepage branch from 32b9cc0 to aefb344 Compare March 18, 2016 08:05
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 18, 2016 08:05 Active
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 18, 2016 08:38 Active
This handles getting people and their memberships out of the popolo and
restructuring them for the templates.

This code could be much nicer with a few changes to
everypolitician-popolo. In particular it would be nice if that lib
handled filtering by term. Other useful things would be if it always
defined methods so that you could call methods without needing to know
if they existed on the target person.
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 18, 2016 15:48 Active
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 18, 2016 16:01 Active
@tmtmtmtm tmtmtmtm deployed to everypolitician-viewer-pr-5351 March 18, 2016 16:15 Active
@chrismytton
Copy link
Contributor Author

I was hoping this would be mostly finished today but rawgit being down derailed me somewhat. Anyway, this is nearly there now, but still needs a bit of work so that the people on the homepage don't get all of the terms that they've been in listed as memberships. The people are read from featured_people.yml but that's currently empty, so nothing will appear on the homepage currently (I have left an example of what to put in that file though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants