{"action":"created","issue":{"url":"https://api.github.com/repos/greencommons/commons/issues/212","repository_url":"https://api.github.com/repos/greencommons/commons","labels_url":"https://api.github.com/repos/greencommons/commons/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/greencommons/commons/issues/212/comments","events_url":"https://api.github.com/repos/greencommons/commons/issues/212/events","html_url":"https://github.com/greencommons/commons/issues/212","id":253525853,"number":212,"title":"(L) Enable users to upload resources.","user":{"login":"ptrikutam","id":377117,"avatar_url":"https://avatars1.githubusercontent.com/u/377117?v=4","gravatar_id":"","url":"https://api.github.com/users/ptrikutam","html_url":"https://github.com/ptrikutam","followers_url":"https://api.github.com/users/ptrikutam/followers","following_url":"https://api.github.com/users/ptrikutam/following{/other_user}","gists_url":"https://api.github.com/users/ptrikutam/gists{/gist_id}","starred_url":"https://api.github.com/users/ptrikutam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptrikutam/subscriptions","organizations_url":"https://api.github.com/users/ptrikutam/orgs","repos_url":"https://api.github.com/users/ptrikutam/repos","events_url":"https://api.github.com/users/ptrikutam/events{/privacy}","received_events_url":"https://api.github.com/users/ptrikutam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"nsanta","id":15721,"avatar_url":"https://avatars0.githubusercontent.com/u/15721?v=4","gravatar_id":"","url":"https://api.github.com/users/nsanta","html_url":"https://github.com/nsanta","followers_url":"https://api.github.com/users/nsanta/followers","following_url":"https://api.github.com/users/nsanta/following{/other_user}","gists_url":"https://api.github.com/users/nsanta/gists{/gist_id}","starred_url":"https://api.github.com/users/nsanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsanta/subscriptions","organizations_url":"https://api.github.com/users/nsanta/orgs","repos_url":"https://api.github.com/users/nsanta/repos","events_url":"https://api.github.com/users/nsanta/events{/privacy}","received_events_url":"https://api.github.com/users/nsanta/received_events","type":"User","site_admin":false},"assignees":[{"login":"nsanta","id":15721,"avatar_url":"https://avatars0.githubusercontent.com/u/15721?v=4","gravatar_id":"","url":"https://api.github.com/users/nsanta","html_url":"https://github.com/nsanta","followers_url":"https://api.github.com/users/nsanta/followers","following_url":"https://api.github.com/users/nsanta/following{/other_user}","gists_url":"https://api.github.com/users/nsanta/gists{/gist_id}","starred_url":"https://api.github.com/users/nsanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsanta/subscriptions","organizations_url":"https://api.github.com/users/nsanta/orgs","repos_url":"https://api.github.com/users/nsanta/repos","events_url":"https://api.github.com/users/nsanta/events{/privacy}","received_events_url":"https://api.github.com/users/nsanta/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2017-08-29T04:25:51Z","updated_at":"2017-09-12T18:40:16Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"> Resolve the myriad of issues that entails -- most especially dealing with spammers.\r\n\r\nCurrently, users are able to upload only URL resources. DM says we should be able to upload other types for demo purposes.\r\n\r\n---\r\n### Update 9/8/17\r\n\r\nPlease proceed with this task. This is going to involve a few things, but basically, we want to update the [Add Resource](https://greencommons.herokuapp.com/resources/new) form to accept a PDF (no other file types should be allowed).\r\n\r\nThe form should include:\r\n- A dropdown for Resource type. Here are the current available Resource types: https://github.com/greencommons/commons/blob/master/app/models/resource.rb#L6-L18\r\n- Fields for all metadata (Title, Description, Publisher, Publish Date, Author, etc). \r\n- [A field for privacy](https://github.com/greencommons/commons/blob/master/app/models/concerns/privacy.rb) (this should be set to public or private). We should also include a notice on the form that indicates that even if someone marks a resource as Private, other people will still be able to see it if they have the URL. Marking it private will only prevent it from showing up in search results.\r\n- A field to upload the PDF itself. We should store this in a folder on S3. This might be a larger task, so feel free to create a separate card for this one. Can you check if there is already a folder / connection set up or if this is something we'll need to include?\r\n\r\nOnce the PDF is uploaded, we'd like to use a library like [`pdf-reader`](https://github.com/yob/pdf-reader) (open to other suggestions here) to actually parse the contents of the PDF and keep the full text in the [`long_content` field](https://github.com/greencommons/commons/blob/master/db/schema.rb#L92) of the Resource.\r\n\r\nFeel free to split any of these tasks out into their own cards to make smaller, more logical PRs / commits.\r\n\r\nClarification:  After this task is a completed, a user could specify either a URL or a PDF as the resource.  That is, the URL version of resource upload that exists now would be augmented by this task to have the extra metadata fields."},"comment":{"url":"https://api.github.com/repos/greencommons/commons/issues/comments/328944198","html_url":"https://github.com/greencommons/commons/issues/212#issuecomment-328944198","issue_url":"https://api.github.com/repos/greencommons/commons/issues/212","id":328944198,"user":{"login":"ptrikutam","id":377117,"avatar_url":"https://avatars1.githubusercontent.com/u/377117?v=4","gravatar_id":"","url":"https://api.github.com/users/ptrikutam","html_url":"https://github.com/ptrikutam","followers_url":"https://api.github.com/users/ptrikutam/followers","following_url":"https://api.github.com/users/ptrikutam/following{/other_user}","gists_url":"https://api.github.com/users/ptrikutam/gists{/gist_id}","starred_url":"https://api.github.com/users/ptrikutam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptrikutam/subscriptions","organizations_url":"https://api.github.com/users/ptrikutam/orgs","repos_url":"https://api.github.com/users/ptrikutam/repos","events_url":"https://api.github.com/users/ptrikutam/events{/privacy}","received_events_url":"https://api.github.com/users/ptrikutam/received_events","type":"User","site_admin":false},"created_at":"2017-09-12T18:40:16Z","updated_at":"2017-09-12T18:40:16Z","author_association":"CONTRIBUTOR","body":"Ah, now I understand. That makes sense, and would be awesome if it's not too much effort."}}
{"actor":{"display_login":"ptrikutam"}}