participedia / frontend

DEPRECATED - see https://github.com/participedia/api/ instead
MIT License
3 stars 2 forks source link

Add download hyperlinks to user-uploaded files in data sidebar (in reader view) #685

Open jesicarson opened 7 years ago

jesicarson commented 7 years ago

Via slack from @plscully to myself @dethe & @andreadelrio:

plscully [6:26 AM] How will users attach pdfs to cases and how will they be displayed? For ex., see the display for "file attachments" at the end of this case on the Drupal site. It's not optimal, but it can be found https://participedia.net/en/cases/strong-starts-children-albuquerque-new-mexico-usa ... And here is the same case on xyz with no display of the file attachment. Perhaps file attachments have not yet been moved to xyz, but I also don't see a way to either upload a file via the "media" input fields. https://participedia.xyz/case/440

plscully [6:48 AM] The file attachments question arose when I received this note from Graham Smith earlier today re: an agreement he has made with one of the leading public participation practitioner organizations in the UK to give us a bunch of their cases. "There are a whole bunch of 'dialogue projects' http://www.sciencewise-erc.org.uk/cms/sciencewise-dialogue-projects/ each of which will form a case. But for each case, there are a host of PDFs. See for example http://www.sciencewise-erc.org.uk/cms/synthetic-biology - scroll down and you will find 14 different PDFs - all of which we would need to house. On the current site they just appear as PDF icons at the bottom of the page - is there going to be a cleaner way of doing this on the new site? Can we create a URL on the platform for each PDF document so that they can be listed in a similar way to know? Note that we need to house the documents and not link to the sciencewise site."

jesicarson commented 6 years ago

Decisions needed:

scottofletcher commented 6 years ago

I recently uploaded to a site that allowed .docx, .doc, .txt, .pdf but converted everything into PDF to make it available to other users. Is that possible/desirable? I don't actually have MS Word but use Google Docs to edit .docx or convert to .pdf

jesicarson commented 6 years ago

I think if people don't want their files to be editable, they can convert to pdf themselves before uploading. There might also be instances where people want others to be able to download editable files, like spreadsheets - although we should also think about how to push people to dataverse for that kind of stuff in future - or word docs. I use gdocs for everything too :P

plscully commented 6 years ago

I agree that it's best not to automatically convert everything to pdf. The potential of making some of the shared information less accessible outweighs the convenience factor. For a funny view on this see http://www.caitlinrivers.com/blog/send-me-your-data-pdf-is-fine-said-no-one-ever-how-to-share-your-data-effectively

dethe commented 6 years ago

People typically publish data sets in PDF in order to claim openness while making it as difficult as possible to actually re-use the data. There is an excellent project called Tabula for extracting tabular data from PDF obfuscation (http://tabula.technology/), but we should not inflict such issues on our users.

PDF can also semi-ensure layout remains consistent on different machines and platforms, but unless people are publishing poetry I think openness is more valuable than layout.

jesicarson commented 6 years ago

I was able to upload a PDF to this case: https://participedia.xyz/case/5015 via the edit form. And if you click edit, you can see the file listed in the form - so it's there somewhere. However, there is nowhere on the frontend that a visitor can access the file. Need to list it in the data sidebar under "Files" with a hyperlink to download.

jesicarson commented 6 years ago

Hyperlinks are generally long and messy.. maybe the file upload should have a title option with limited characters? Or Scott suggested listing them at the end of the narrative rather than the data sidebar. Thoughts?

dethe commented 6 years ago

We used to have an option to give links a title, but it got removed. I think we should be able to give them meaningful titles, but then people do have to actually use that.

plscully commented 6 years ago

Would it be possible to give users the option to give links a title, but if they choose not too, the link is automatically shortened? Perhaps the shortened url could even be branded Participedia.

scottofletcher commented 6 years ago

1 - I don't think people are going to use the title field 2 - is it possible to automatically make the text's first couple lines its title? For eg. when I enter a link on Facebook or click 'Share to Twitter' on an article/webpage, it automatically generates the title (or, if it's a pdf or something with out an immediately obvious title, it uses the first 5-7 words)

dethe commented 6 years ago
  1. We can provide an option for a title so users who care about making their links usable have a way to do that.
  2. We could make the title mandatory, then they have to put something there.
  3. Automating the title is possible, but not trivial. A lot of engineering goes into finding the title from a random page. We could grab the contents of the <title> tag and hope for the best, if they are linking to a page (and not, say, a PDF), but often that will include a bunch of stuff from their CMS, which may or may not have a useful title. That wouldn't be terribly difficult and we could test to see if it is useful or not.
jesicarson commented 6 years ago

I vote for dethe's option 1 (but this should be a new issue, and P2)

jesicarson commented 6 years ago

...As in, we still need a way to see files and access them via the data sidebar for public launch. but fixing long messy links can wait till P2 unless dethe thinks it makes sense to just do it all at once. his call.

plscully commented 6 years ago

I'm fine with going with Dethe's option 1 for now. ... However, does this mean that we could end up with long urls in the sidebar data when people don't use the title field? ... And if so, is it easy and advisable to install an automated url shortener ? ... One other option is that we simply don't display the file links in the sidebar data. My sense is that it's a low priority item for what is prime real estate.

dethe commented 6 years ago

We don't even need a URL shortener, if we have a title, we can fill it with random words, like "fabulous gazelle" or "grouchy lemur" and if they don't update the title that's the link text. Makes as much sense as a bare URL, but a bit friendlier.

scottofletcher commented 6 years ago

I still think this should all be at the bottom of the page like on . net.....

plscully commented 6 years ago

Agreed, it is not critical that links appear in the sidebar data

jesicarson commented 6 years ago

Files and links need to be accessible on reader view somewhere.