{"action":"created","comment":{"url":"https://api.github.com/repos/projecthydra/sufia/pulls/comments/61459396","id":61459396,"diff_hunk":"@@ -2,8 +2,15 @@ module Sufia::Forms\n   class WorkForm < CurationConcerns::Forms::WorkForm\n     delegate :depositor, :on_behalf_of, :permissions, to: :model\n \n+    attr_reader :agreement_accepted\n+\n     self.terms += [:collection_ids]\n \n+    def initialize(model, current_ability)\n+      @agreement_accepted = !model.new_record?","path":"app/forms/sufia/forms/work_form.rb","position":9,"original_position":9,"commit_id":"566175e7eba2727de02ceef45650c5125042c77d","original_commit_id":"566175e7eba2727de02ceef45650c5125042c77d","user":{"login":"jcoyne","id":92044,"avatar_url":"https://avatars.githubusercontent.com/u/92044?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoyne","html_url":"https://github.com/jcoyne","followers_url":"https://api.github.com/users/jcoyne/followers","following_url":"https://api.github.com/users/jcoyne/following{/other_user}","gists_url":"https://api.github.com/users/jcoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoyne/subscriptions","organizations_url":"https://api.github.com/users/jcoyne/orgs","repos_url":"https://api.github.com/users/jcoyne/repos","events_url":"https://api.github.com/users/jcoyne/events{/privacy}","received_events_url":"https://api.github.com/users/jcoyne/received_events","type":"User","site_admin":false},"body":"Yep. :+1: ","created_at":"2016-04-28T16:31:15Z","updated_at":"2016-04-28T16:31:15Z","html_url":"https://github.com/projecthydra/sufia/pull/1934#discussion_r61459396","pull_request_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1934","_links":{"self":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/comments/61459396"},"html":{"href":"https://github.com/projecthydra/sufia/pull/1934#discussion_r61459396"},"pull_request":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1934"}}},"pull_request":{"url":"https://api.github.com/repos/projecthydra/sufia/pulls/1934","id":68205028,"html_url":"https://github.com/projecthydra/sufia/pull/1934","diff_url":"https://github.com/projecthydra/sufia/pull/1934.diff","patch_url":"https://github.com/projecthydra/sufia/pull/1934.patch","issue_url":"https://api.github.com/repos/projecthydra/sufia/issues/1934","number":1934,"state":"open","locked":false,"title":"Deposit agreement for works with files","user":{"login":"hectorcorrea","id":568286,"avatar_url":"https://avatars.githubusercontent.com/u/568286?v=3","gravatar_id":"","url":"https://api.github.com/users/hectorcorrea","html_url":"https://github.com/hectorcorrea","followers_url":"https://api.github.com/users/hectorcorrea/followers","following_url":"https://api.github.com/users/hectorcorrea/following{/other_user}","gists_url":"https://api.github.com/users/hectorcorrea/gists{/gist_id}","starred_url":"https://api.github.com/users/hectorcorrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectorcorrea/subscriptions","organizations_url":"https://api.github.com/users/hectorcorrea/orgs","repos_url":"https://api.github.com/users/hectorcorrea/repos","events_url":"https://api.github.com/users/hectorcorrea/events{/privacy}","received_events_url":"https://api.github.com/users/hectorcorrea/received_events","type":"User","site_admin":false},"body":"Fixes #1870 \r\n\r\nDefaults the deposit agreement checkbox to checked when editing a work that already has files. \r\n\r\nThe change in this PR is that the `work_form.rb` now initializes the value of the agreement checkbox to checked/unchecked depending on whether the Work already has already been saved (we assume that on a saved work the user has already accepted the deposit agreement)\r\n\r\n~~There is also some temporary code (see the `.es6` files) to highlight where we could update the JavaScript of the page to have a more sophisticated logic and force the user to re-accept the deposit agreement if they add new Files to the Work (but don't bother them if they only edit the metadata of the work)~~ (I'll push the JavaScript enhancements in a separate PR to keep things cleaner)\r\n\r\nThis is how the Work Edit looks when editing a work that already has Files associated with it.\r\n\r\n![screen shot 2016-04-28 at 7 21 30 am](https://cloud.githubusercontent.com/assets/568286/14884448/e1ceab92-0d12-11e6-8a78-d95bce2568f4.png)\r\n","created_at":"2016-04-28T11:29:55Z","updated_at":"2016-04-28T16:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b60ad5f4224876adf408b7d52f6cbb2f34df6980","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1934/commits","review_comments_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1934/comments","review_comment_url":"https://api.github.com/repos/projecthydra/sufia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecthydra/sufia/issues/1934/comments","statuses_url":"https://api.github.com/repos/projecthydra/sufia/statuses/566175e7eba2727de02ceef45650c5125042c77d","head":{"label":"projecthydra:agreement_checkbox","ref":"agreement_checkbox","sha":"566175e7eba2727de02ceef45650c5125042c77d","user":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"repo":{"id":7653178,"name":"sufia","full_name":"projecthydra/sufia","owner":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra/sufia","description":"Sufia extends the robust Hydra framework to provide a user interface around common repository features and social features. Sufia offers self-deposit and proxy deposit workflows with plans to develop one or more mediated deposit workflows in 2016. Sufia delivers its rich and growing set of features via a modern, responsive UI.","fork":false,"url":"https://api.github.com/repos/projecthydra/sufia","forks_url":"https://api.github.com/repos/projecthydra/sufia/forks","keys_url":"https://api.github.com/repos/projecthydra/sufia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra/sufia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra/sufia/teams","hooks_url":"https://api.github.com/repos/projecthydra/sufia/hooks","issue_events_url":"https://api.github.com/repos/projecthydra/sufia/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra/sufia/events","assignees_url":"https://api.github.com/repos/projecthydra/sufia/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra/sufia/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra/sufia/tags","blobs_url":"https://api.github.com/repos/projecthydra/sufia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra/sufia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra/sufia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra/sufia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra/sufia/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra/sufia/languages","stargazers_url":"https://api.github.com/repos/projecthydra/sufia/stargazers","contributors_url":"https://api.github.com/repos/projecthydra/sufia/contributors","subscribers_url":"https://api.github.com/repos/projecthydra/sufia/subscribers","subscription_url":"https://api.github.com/repos/projecthydra/sufia/subscription","commits_url":"https://api.github.com/repos/projecthydra/sufia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra/sufia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra/sufia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra/sufia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra/sufia/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra/sufia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra/sufia/merges","archive_url":"https://api.github.com/repos/projecthydra/sufia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra/sufia/downloads","issues_url":"https://api.github.com/repos/projecthydra/sufia/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra/sufia/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra/sufia/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra/sufia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra/sufia/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra/sufia/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra/sufia/deployments","created_at":"2013-01-16T20:23:18Z","updated_at":"2016-04-18T19:11:06Z","pushed_at":"2016-04-28T16:07:07Z","git_url":"git://github.com/projecthydra/sufia.git","ssh_url":"git@github.com:projecthydra/sufia.git","clone_url":"https://github.com/projecthydra/sufia.git","svn_url":"https://github.com/projecthydra/sufia","homepage":"http://sufia.io/","size":55436,"stargazers_count":93,"watchers_count":93,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":99,"forks":70,"open_issues":99,"watchers":93,"default_branch":"master"}},"base":{"label":"projecthydra:master","ref":"master","sha":"637ac079694ed776f42d7b5d4efc746f4a10d871","user":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"repo":{"id":7653178,"name":"sufia","full_name":"projecthydra/sufia","owner":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra/sufia","description":"Sufia extends the robust Hydra framework to provide a user interface around common repository features and social features. Sufia offers self-deposit and proxy deposit workflows with plans to develop one or more mediated deposit workflows in 2016. Sufia delivers its rich and growing set of features via a modern, responsive UI.","fork":false,"url":"https://api.github.com/repos/projecthydra/sufia","forks_url":"https://api.github.com/repos/projecthydra/sufia/forks","keys_url":"https://api.github.com/repos/projecthydra/sufia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra/sufia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra/sufia/teams","hooks_url":"https://api.github.com/repos/projecthydra/sufia/hooks","issue_events_url":"https://api.github.com/repos/projecthydra/sufia/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra/sufia/events","assignees_url":"https://api.github.com/repos/projecthydra/sufia/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra/sufia/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra/sufia/tags","blobs_url":"https://api.github.com/repos/projecthydra/sufia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra/sufia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra/sufia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra/sufia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra/sufia/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra/sufia/languages","stargazers_url":"https://api.github.com/repos/projecthydra/sufia/stargazers","contributors_url":"https://api.github.com/repos/projecthydra/sufia/contributors","subscribers_url":"https://api.github.com/repos/projecthydra/sufia/subscribers","subscription_url":"https://api.github.com/repos/projecthydra/sufia/subscription","commits_url":"https://api.github.com/repos/projecthydra/sufia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra/sufia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra/sufia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra/sufia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra/sufia/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra/sufia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra/sufia/merges","archive_url":"https://api.github.com/repos/projecthydra/sufia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra/sufia/downloads","issues_url":"https://api.github.com/repos/projecthydra/sufia/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra/sufia/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra/sufia/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra/sufia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra/sufia/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra/sufia/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra/sufia/deployments","created_at":"2013-01-16T20:23:18Z","updated_at":"2016-04-18T19:11:06Z","pushed_at":"2016-04-28T16:07:07Z","git_url":"git://github.com/projecthydra/sufia.git","ssh_url":"git@github.com:projecthydra/sufia.git","clone_url":"https://github.com/projecthydra/sufia.git","svn_url":"https://github.com/projecthydra/sufia","homepage":"http://sufia.io/","size":55436,"stargazers_count":93,"watchers_count":93,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":99,"forks":70,"open_issues":99,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1934"},"html":{"href":"https://github.com/projecthydra/sufia/pull/1934"},"issue":{"href":"https://api.github.com/repos/projecthydra/sufia/issues/1934"},"comments":{"href":"https://api.github.com/repos/projecthydra/sufia/issues/1934/comments"},"review_comments":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1934/comments"},"review_comment":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1934/commits"},"statuses":{"href":"https://api.github.com/repos/projecthydra/sufia/statuses/566175e7eba2727de02ceef45650c5125042c77d"}}}}