DemocracyClub / electionleaflets

:postbox: A Django port of the original PHP code from electionleaflets.org
http://electionleaflets.org/
MIT License
9 stars 17 forks source link

Deploy and review Julian's cropper and annotation system #72

Open symroe opened 9 years ago

symroe commented 9 years ago

From @goatchurchprime on December 11, 2014 8:55

This now does practically everything I imagined it could.

For staff members, there's the ability to enable cropping and apply a crop to a leaflet page (button next to the rotate images). ***You must do a hard reload to get the new image as the URL stays the same. (Must work out an append system to it)

Secondly, if you go to the Edit Leaflet link on a leaflet page you now get a special page (instead of the admin page) that lets you select parts of the pages and apply an annotation to it of different types. (Party, candidate, district, imprint, etc). There are keyboard shortcuts, so you can hit the "C" button and immediately type in the name in the textarea. Control-S saves it if you can't be bothered to press the Save button.

Each annotation is appended into a list; you can click on any one of them or on the overlayed rectangle to get back to one and edit it.

When you Submit it saves JSON into the Description field of the leaflet. It's beyond my pay-grade to do anything that changes the actual backend Django. However, I do know that forms (post/get) are not good for doing dynamic sized lists of attributes, so this may be a necessary hack. I'm not filling in the fields (eg Party, tags) correctly, but could do so with a bit more code.

The JSON in the description is decoded in the overview page for a leaflet so you don't see json on the normal pages. It's all backward compatible with current system.

We could make the UI edit and save categories and tags so that all the other filtering code still works. If there are multiple people marking up the backlog of leaflets it might be necessary to tag those which are open for review and those which have been marked up in a particular round so that they can work together efficiently.

Part of this backlog is being able to go back through the leaflets again and pick out a new thing that is indicative of the campaign strategy. (eg all instances of Labour saying LibDems broke promise on tuition fees.) If the interface works down to 10 seconds per leaflet, then 3 volunteers can mark up 1000 leaflets in about an hour.

One of the annotation types is the "tweet" type, In that case the text area can be the tweet (it includes link and controls the character count) and the image selection box denotes the JPEG area of the image that gets included into the tweet.

I don't have an answer as to how to mark up duplicate leaflets. We can think about this later.

Copied from original issue: electionleaflets/electionleaflets#19

symroe commented 9 years ago

From @goatchurchprime on December 12, 2014 11:56

Here's the marking up interface. We can be the friend of single-issue campaign, like the cycling campaign, who may be motivated to supply volunteers to find and categorize every pro and anti-cycling statement across all leaflets to generate interesting instances and aggregate data. screenshot from 2014-12-12 11 54 24