{"action":"created","comment":{"url":"https://api.github.com/repos/18F/identity-idp/pulls/comments/67202495","id":67202495,"diff_hunk":"@@ -0,0 +1,10 @@\n+.clearfix.mxn1.mb1\n+  - login_page = controller_name == 'sessions'\n+  .sm-col.sm-col-6.px1.mb1\n+    = link_to t('upaya.links.sign_up'), new_user_registration_path, \\\n+      class: 'btn btn-primary border-box col-12 center ' \\\n+             \"#{login_page ? 'bg-gray' : 'bg-navy'}\"\n+  .sm-col.sm-col-6.px1.mb1\n+    = link_to t('upaya.links.sign_in'), new_user_session_path, \\\n+      class: 'btn btn-primary border-box col-12 center ' \\\n+             \"#{login_page ? 'bg-navy' : 'bg-gray'}\"","path":"app/views/devise/shared/_auth_nav.html.slim","position":10,"original_position":10,"commit_id":"572770bd833579cc9fa058c83d68d3c471d682fa","original_commit_id":"572770bd833579cc9fa058c83d68d3c471d682fa","user":{"login":"monfresh","id":811150,"avatar_url":"https://avatars.githubusercontent.com/u/811150?v=3","gravatar_id":"","url":"https://api.github.com/users/monfresh","html_url":"https://github.com/monfresh","followers_url":"https://api.github.com/users/monfresh/followers","following_url":"https://api.github.com/users/monfresh/following{/other_user}","gists_url":"https://api.github.com/users/monfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/monfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monfresh/subscriptions","organizations_url":"https://api.github.com/users/monfresh/orgs","repos_url":"https://api.github.com/users/monfresh/repos","events_url":"https://api.github.com/users/monfresh/events{/privacy}","received_events_url":"https://api.github.com/users/monfresh/received_events","type":"User","site_admin":false},"body":"It's generally recommended to avoid logic inside views. For conditional classes, I usually create a helper method. For example:\r\n```ruby\r\n# app/helpers/link_tag_helper.rb\r\nmodule LinkTagHelper\r\n  def sign_up_link_tag(controller)\r\n    link_to(\r\n      t('upaya.links.sign_up'), \r\n      new_user_registration_path,\r\n      class: 'btn btn-primary border-box col-12 center sign_up_bg_color(controller)'\r\n    )\r\n  end\r\n\r\n  def sign_in_link_tag(controller)\r\n    link_to(\r\n      t('upaya.links.sign_in'), \r\n      new_user_session_path,\r\n      class: 'btn btn-primary border-box col-12 center sign_in_bg_color(controller)'\r\n    ) \r\n  end\r\n\r\n  private\r\n\r\n  def sign_up_bg_color(controller)\r\n    return 'bg-gray' if controller == 'sessions'\r\n    'bg-navy'\r\n  end\r\n\r\n  def sign_in_bg_color(controller)\r\n    return 'bg-navy' if controller == 'sessions'\r\n    'bg-gray'\r\n  end\r\nend\r\n```\r\nThen in the view, you would do:\r\n```slim\r\n.sm-col.sm-col-6.px1.mb1\r\n  = sign_up_link_tag(controller_name)\r\n.sm-col.sm-col-6.px1.mb1\r\n  = sign_in_link_tag(controller_name)\r\n```","created_at":"2016-06-15T17:03:20Z","updated_at":"2016-06-15T17:03:20Z","html_url":"https://github.com/18F/identity-idp/pull/170#discussion_r67202495","pull_request_url":"https://api.github.com/repos/18F/identity-idp/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/comments/67202495"},"html":{"href":"https://github.com/18F/identity-idp/pull/170#discussion_r67202495"},"pull_request":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/18F/identity-idp/pulls/170","id":73793777,"html_url":"https://github.com/18F/identity-idp/pull/170","diff_url":"https://github.com/18F/identity-idp/pull/170.diff","patch_url":"https://github.com/18F/identity-idp/pull/170.patch","issue_url":"https://api.github.com/repos/18F/identity-idp/issues/170","number":170,"state":"open","locked":false,"title":"Add signup/login navigation","user":{"login":"brendansudol","id":1060893,"avatar_url":"https://avatars.githubusercontent.com/u/1060893?v=3","gravatar_id":"","url":"https://api.github.com/users/brendansudol","html_url":"https://github.com/brendansudol","followers_url":"https://api.github.com/users/brendansudol/followers","following_url":"https://api.github.com/users/brendansudol/following{/other_user}","gists_url":"https://api.github.com/users/brendansudol/gists{/gist_id}","starred_url":"https://api.github.com/users/brendansudol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendansudol/subscriptions","organizations_url":"https://api.github.com/users/brendansudol/orgs","repos_url":"https://api.github.com/users/brendansudol/repos","events_url":"https://api.github.com/users/brendansudol/events{/privacy}","received_events_url":"https://api.github.com/users/brendansudol/received_events","type":"User","site_admin":false},"body":"**Why**: to make it easy to see where you are\r\nand navigate between sign up & log in pages\r\n\r\npreview:\r\n![image](https://cloud.githubusercontent.com/assets/1060893/16055511/a6e5985e-323f-11e6-9a71-6af9b10bf329.png)\r\n","created_at":"2016-06-14T18:52:48Z","updated_at":"2016-06-15T17:03:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9951882323b5513c3de3a70003020b6cb615142b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/identity-idp/pulls/170/commits","review_comments_url":"https://api.github.com/repos/18F/identity-idp/pulls/170/comments","review_comment_url":"https://api.github.com/repos/18F/identity-idp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/identity-idp/issues/170/comments","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/572770bd833579cc9fa058c83d68d3c471d682fa","head":{"label":"18F:add-auth-navbar","ref":"add-auth-navbar","sha":"572770bd833579cc9fa058c83d68d3c471d682fa","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":50386243,"name":"identity-idp","full_name":"18F/identity-idp","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/identity-idp","description":"18f PoC Identity Provider (IdP)","fork":false,"url":"https://api.github.com/repos/18F/identity-idp","forks_url":"https://api.github.com/repos/18F/identity-idp/forks","keys_url":"https://api.github.com/repos/18F/identity-idp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/identity-idp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/identity-idp/teams","hooks_url":"https://api.github.com/repos/18F/identity-idp/hooks","issue_events_url":"https://api.github.com/repos/18F/identity-idp/issues/events{/number}","events_url":"https://api.github.com/repos/18F/identity-idp/events","assignees_url":"https://api.github.com/repos/18F/identity-idp/assignees{/user}","branches_url":"https://api.github.com/repos/18F/identity-idp/branches{/branch}","tags_url":"https://api.github.com/repos/18F/identity-idp/tags","blobs_url":"https://api.github.com/repos/18F/identity-idp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/identity-idp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/identity-idp/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/identity-idp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/identity-idp/languages","stargazers_url":"https://api.github.com/repos/18F/identity-idp/stargazers","contributors_url":"https://api.github.com/repos/18F/identity-idp/contributors","subscribers_url":"https://api.github.com/repos/18F/identity-idp/subscribers","subscription_url":"https://api.github.com/repos/18F/identity-idp/subscription","commits_url":"https://api.github.com/repos/18F/identity-idp/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/identity-idp/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/identity-idp/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/identity-idp/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/identity-idp/contents/{+path}","compare_url":"https://api.github.com/repos/18F/identity-idp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/identity-idp/merges","archive_url":"https://api.github.com/repos/18F/identity-idp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/identity-idp/downloads","issues_url":"https://api.github.com/repos/18F/identity-idp/issues{/number}","pulls_url":"https://api.github.com/repos/18F/identity-idp/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/identity-idp/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/identity-idp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/identity-idp/labels{/name}","releases_url":"https://api.github.com/repos/18F/identity-idp/releases{/id}","deployments_url":"https://api.github.com/repos/18F/identity-idp/deployments","created_at":"2016-01-25T22:40:59Z","updated_at":"2016-05-29T08:24:38Z","pushed_at":"2016-06-15T17:03:20Z","git_url":"git://github.com/18F/identity-idp.git","ssh_url":"git@github.com:18F/identity-idp.git","clone_url":"https://github.com/18F/identity-idp.git","svn_url":"https://github.com/18F/identity-idp","homepage":"https://upaya-idp-dev.18f.gov/","size":6551,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":11,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"760ab76d20b4f4af20f111bf69fa94bf8fd197a9","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":50386243,"name":"identity-idp","full_name":"18F/identity-idp","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/identity-idp","description":"18f PoC Identity Provider (IdP)","fork":false,"url":"https://api.github.com/repos/18F/identity-idp","forks_url":"https://api.github.com/repos/18F/identity-idp/forks","keys_url":"https://api.github.com/repos/18F/identity-idp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/identity-idp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/identity-idp/teams","hooks_url":"https://api.github.com/repos/18F/identity-idp/hooks","issue_events_url":"https://api.github.com/repos/18F/identity-idp/issues/events{/number}","events_url":"https://api.github.com/repos/18F/identity-idp/events","assignees_url":"https://api.github.com/repos/18F/identity-idp/assignees{/user}","branches_url":"https://api.github.com/repos/18F/identity-idp/branches{/branch}","tags_url":"https://api.github.com/repos/18F/identity-idp/tags","blobs_url":"https://api.github.com/repos/18F/identity-idp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/identity-idp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/identity-idp/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/identity-idp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/identity-idp/languages","stargazers_url":"https://api.github.com/repos/18F/identity-idp/stargazers","contributors_url":"https://api.github.com/repos/18F/identity-idp/contributors","subscribers_url":"https://api.github.com/repos/18F/identity-idp/subscribers","subscription_url":"https://api.github.com/repos/18F/identity-idp/subscription","commits_url":"https://api.github.com/repos/18F/identity-idp/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/identity-idp/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/identity-idp/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/identity-idp/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/identity-idp/contents/{+path}","compare_url":"https://api.github.com/repos/18F/identity-idp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/identity-idp/merges","archive_url":"https://api.github.com/repos/18F/identity-idp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/identity-idp/downloads","issues_url":"https://api.github.com/repos/18F/identity-idp/issues{/number}","pulls_url":"https://api.github.com/repos/18F/identity-idp/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/identity-idp/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/identity-idp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/identity-idp/labels{/name}","releases_url":"https://api.github.com/repos/18F/identity-idp/releases{/id}","deployments_url":"https://api.github.com/repos/18F/identity-idp/deployments","created_at":"2016-01-25T22:40:59Z","updated_at":"2016-05-29T08:24:38Z","pushed_at":"2016-06-15T17:03:20Z","git_url":"git://github.com/18F/identity-idp.git","ssh_url":"git@github.com:18F/identity-idp.git","clone_url":"https://github.com/18F/identity-idp.git","svn_url":"https://github.com/18F/identity-idp","homepage":"https://upaya-idp-dev.18f.gov/","size":6551,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/170"},"html":{"href":"https://github.com/18F/identity-idp/pull/170"},"issue":{"href":"https://api.github.com/repos/18F/identity-idp/issues/170"},"comments":{"href":"https://api.github.com/repos/18F/identity-idp/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/18F/identity-idp/statuses/572770bd833579cc9fa058c83d68d3c471d682fa"}}}}
{"actor":{"display_login":"monfresh"}}