{"action":"created","comment":{"url":"https://api.github.com/repos/ndlib/curate_nd/pulls/comments/42796923","id":42796923,"diff_hunk":"@@ -0,0 +1,188 @@\n+module CurateHelper\n+\n+  def support_email_link(options = {})\n+    mail_to(t('sufia.help_email'), t('sufia.help_email'), {subject: t('sufia.help_email_subject')}.merge(options)).html_safe\n+  end\n+\n+  def file_size_warning\n+    \"<p class=\\\"alert alert-block\\\"><strong>Please Note:</strong><br />For files larger than #{t('sufia.supported_file_upload_size')} please contact #{support_email_link.html_safe} for assistance.</p>\".html_safe\n+  end\n+\n+  # Loads the object and returns its title\n+  def collection_title_from_pid  value\n+    begin\n+      c = Collection.load_instance_from_solr(value)\n+    rescue => e\n+      logger.warn(\"WARN: Helper method collection_title_from_pid raised an error when loading #{value}.  Error was #{e}\")\n+    end\n+    return c.nil? ? value : c.title\n+  end\n+\n+  # Loads the person object and returns their name\n+  # In this case, the value is in the format: info:fedora/<PID>\n+  # So used split\n+  def creator_name_from_pid value\n+    begin\n+      p = Person.load_instance_from_solr(value.split(\"/\").last)\n+    rescue => e\n+      logger.warn(\"WARN: Helper method create_name_from_pid raised an error when loading #{value}.  Error was #{e}\")\n+    end\n+    return p.nil? ? value : p.name\n+  end\n+\n+  def construct_page_title(*elements)\n+    (elements.flatten.compact + [application_name]).join(\" // \")\n+  end\n+\n+  def curation_concern_page_title(curation_concern)\n+    if curation_concern.persisted?\n+      construct_page_title(curation_concern.title, \"#{curation_concern.human_readable_type} [#{curation_concern.to_param}]\")\n+    else\n+      construct_page_title(\"New #{curation_concern.human_readable_type}\")\n+    end\n+  end\n+\n+  def default_page_title\n+    text = controller_name.singularize.titleize\n+    if action_name\n+      text = \"#{action_name.titleize} \" + text\n+    end\n+    construct_page_title(text)\n+  end\n+\n+  # options[:include_empty]\n+  def curation_concern_attribute_to_html(curation_concern, method_name, label = nil, options = {})\n+    markup = \"\"\n+    label ||= derived_label_for(curation_concern, method_name)\n+    subject = curation_concern.public_send(method_name)\n+    return markup if !subject.present? && !options[:include_empty]\n+    markup << %(<tr><th>#{label}</th>\\n<td><ul class='tabular'>)\n+    [subject].flatten.compact.each do |value|\n+      if method_name == :rights\n+        # Special treatment for license/rights.  A URL from the Sufia gem's config/sufia.rb is stored in the descMetadata of the\n+        # curation_concern.  If that URL is valid in form, then it is used as a link.  If it is not valid, it is used as plain text.\n+        parsedUri = URI.parse(value) rescue nil","path":"app/helpers/curate_helper.rb","position":64,"original_position":64,"commit_id":"269192367eb3f66592da031a5e0490e3d265622c","original_commit_id":"269192367eb3f66592da031a5e0490e3d265622c","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Avoid using `rescue` in its modifier form.<br>Use snake_case for variable names.","created_at":"2015-10-22T19:49:41Z","updated_at":"2015-10-22T19:49:41Z","html_url":"https://github.com/ndlib/curate_nd/pull/245#discussion_r42796923","pull_request_url":"https://api.github.com/repos/ndlib/curate_nd/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/comments/42796923"},"html":{"href":"https://github.com/ndlib/curate_nd/pull/245#discussion_r42796923"},"pull_request":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/ndlib/curate_nd/pulls/245","id":48503838,"html_url":"https://github.com/ndlib/curate_nd/pull/245","diff_url":"https://github.com/ndlib/curate_nd/pull/245.diff","patch_url":"https://github.com/ndlib/curate_nd/pull/245.patch","issue_url":"https://api.github.com/repos/ndlib/curate_nd/issues/245","number":245,"state":"open","locked":false,"title":"Update “new dataset” view to conform to T&R expectations","user":{"login":"danhorst","id":2133,"avatar_url":"https://avatars.githubusercontent.com/u/2133?v=3","gravatar_id":"","url":"https://api.github.com/users/danhorst","html_url":"https://github.com/danhorst","followers_url":"https://api.github.com/users/danhorst/followers","following_url":"https://api.github.com/users/danhorst/following{/other_user}","gists_url":"https://api.github.com/users/danhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/danhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhorst/subscriptions","organizations_url":"https://api.github.com/users/danhorst/orgs","repos_url":"https://api.github.com/users/danhorst/repos","events_url":"https://api.github.com/users/danhorst/events{/privacy}","received_events_url":"https://api.github.com/users/danhorst/received_events","type":"User","site_admin":false},"body":"- Mask deprecated dataset metadata fields\r\n- Add message about a code book to the dataset form\r\n- Clean up the attachment area of the “new record” forms\r\n\r\nAddresses #224 ","created_at":"2015-10-22T19:49:38Z","updated_at":"2015-10-22T19:49:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5591523cea96d834524ef38ca82c38383bbb9b55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ndlib/curate_nd/pulls/245/commits","review_comments_url":"https://api.github.com/repos/ndlib/curate_nd/pulls/245/comments","review_comment_url":"https://api.github.com/repos/ndlib/curate_nd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ndlib/curate_nd/issues/245/comments","statuses_url":"https://api.github.com/repos/ndlib/curate_nd/statuses/269192367eb3f66592da031a5e0490e3d265622c","head":{"label":"ndlib:224-update-dataset-metadata","ref":"224-update-dataset-metadata","sha":"269192367eb3f66592da031a5e0490e3d265622c","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":8654695,"name":"curate_nd","full_name":"ndlib/curate_nd","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/curate_nd","description":"A self-deposit interface for University of Notre Dame's institutional digital repository.","fork":false,"url":"https://api.github.com/repos/ndlib/curate_nd","forks_url":"https://api.github.com/repos/ndlib/curate_nd/forks","keys_url":"https://api.github.com/repos/ndlib/curate_nd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/curate_nd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/curate_nd/teams","hooks_url":"https://api.github.com/repos/ndlib/curate_nd/hooks","issue_events_url":"https://api.github.com/repos/ndlib/curate_nd/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/curate_nd/events","assignees_url":"https://api.github.com/repos/ndlib/curate_nd/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/curate_nd/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/curate_nd/tags","blobs_url":"https://api.github.com/repos/ndlib/curate_nd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/curate_nd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/curate_nd/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/curate_nd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/curate_nd/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/curate_nd/languages","stargazers_url":"https://api.github.com/repos/ndlib/curate_nd/stargazers","contributors_url":"https://api.github.com/repos/ndlib/curate_nd/contributors","subscribers_url":"https://api.github.com/repos/ndlib/curate_nd/subscribers","subscription_url":"https://api.github.com/repos/ndlib/curate_nd/subscription","commits_url":"https://api.github.com/repos/ndlib/curate_nd/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/curate_nd/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/curate_nd/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/curate_nd/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/curate_nd/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/curate_nd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/curate_nd/merges","archive_url":"https://api.github.com/repos/ndlib/curate_nd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/curate_nd/downloads","issues_url":"https://api.github.com/repos/ndlib/curate_nd/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/curate_nd/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/curate_nd/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/curate_nd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/curate_nd/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/curate_nd/releases{/id}","created_at":"2013-03-08T16:19:39Z","updated_at":"2015-10-14T18:24:48Z","pushed_at":"2015-10-22T19:49:39Z","git_url":"git://github.com/ndlib/curate_nd.git","ssh_url":"git@github.com:ndlib/curate_nd.git","clone_url":"https://github.com/ndlib/curate_nd.git","svn_url":"https://github.com/ndlib/curate_nd","homepage":null,"size":8204,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":20,"forks":5,"open_issues":20,"watchers":4,"default_branch":"master"}},"base":{"label":"ndlib:master","ref":"master","sha":"58e7a7cd710df884bc6b0552e2557caeb6fd2088","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":8654695,"name":"curate_nd","full_name":"ndlib/curate_nd","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/curate_nd","description":"A self-deposit interface for University of Notre Dame's institutional digital repository.","fork":false,"url":"https://api.github.com/repos/ndlib/curate_nd","forks_url":"https://api.github.com/repos/ndlib/curate_nd/forks","keys_url":"https://api.github.com/repos/ndlib/curate_nd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/curate_nd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/curate_nd/teams","hooks_url":"https://api.github.com/repos/ndlib/curate_nd/hooks","issue_events_url":"https://api.github.com/repos/ndlib/curate_nd/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/curate_nd/events","assignees_url":"https://api.github.com/repos/ndlib/curate_nd/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/curate_nd/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/curate_nd/tags","blobs_url":"https://api.github.com/repos/ndlib/curate_nd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/curate_nd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/curate_nd/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/curate_nd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/curate_nd/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/curate_nd/languages","stargazers_url":"https://api.github.com/repos/ndlib/curate_nd/stargazers","contributors_url":"https://api.github.com/repos/ndlib/curate_nd/contributors","subscribers_url":"https://api.github.com/repos/ndlib/curate_nd/subscribers","subscription_url":"https://api.github.com/repos/ndlib/curate_nd/subscription","commits_url":"https://api.github.com/repos/ndlib/curate_nd/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/curate_nd/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/curate_nd/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/curate_nd/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/curate_nd/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/curate_nd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/curate_nd/merges","archive_url":"https://api.github.com/repos/ndlib/curate_nd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/curate_nd/downloads","issues_url":"https://api.github.com/repos/ndlib/curate_nd/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/curate_nd/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/curate_nd/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/curate_nd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/curate_nd/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/curate_nd/releases{/id}","created_at":"2013-03-08T16:19:39Z","updated_at":"2015-10-14T18:24:48Z","pushed_at":"2015-10-22T19:49:39Z","git_url":"git://github.com/ndlib/curate_nd.git","ssh_url":"git@github.com:ndlib/curate_nd.git","clone_url":"https://github.com/ndlib/curate_nd.git","svn_url":"https://github.com/ndlib/curate_nd","homepage":null,"size":8204,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":20,"forks":5,"open_issues":20,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/245"},"html":{"href":"https://github.com/ndlib/curate_nd/pull/245"},"issue":{"href":"https://api.github.com/repos/ndlib/curate_nd/issues/245"},"comments":{"href":"https://api.github.com/repos/ndlib/curate_nd/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ndlib/curate_nd/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/ndlib/curate_nd/statuses/269192367eb3f66592da031a5e0490e3d265622c"}}}}