{"action":"created","comment":{"url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/comments/172704949","pull_request_review_id":101768195,"id":172704949,"diff_hunk":"@@ -510,10 +510,15 @@ def prime_menu_items(self, menu_items):\n                 \"\"\"\n                 This is a `MenuItem` for a custom URL. It can be classed as\n                 'active' if the URL matches the request path.\n+                If `apps_settings.CUSTOM_URL_SMART_ACTIVE_CLASSES == True`,\n+                it may also be classed as 'ancestor' if the current URL is a\n+                'child' of the custom link URL.\n                 \"\"\"\n-                request_path = self.request.path\n-                if apply_active_classes and item.link_url == request_path:\n-                    setattr(item, 'active_class', app_settings.ACTIVE_CLASS)\n+                if apply_active_classes:\n+                    request = self.request\n+                    active_class = item.get_active_class_for_request(request)\n+                    if active_class:\n+                        setattr(item, 'active_class', active_class)","path":"wagtailmenus/models/menus.py","position":15,"original_position":15,"commit_id":"afdafca3fa2329d093dd135917c2d0d78995f03f","original_commit_id":"71f5bfc525b22f58aebe02a962272ffaae896788","user":{"login":"inostia","id":14210438,"avatar_url":"https://avatars3.githubusercontent.com/u/14210438?v=4","gravatar_id":"","url":"https://api.github.com/users/inostia","html_url":"https://github.com/inostia","followers_url":"https://api.github.com/users/inostia/followers","following_url":"https://api.github.com/users/inostia/following{/other_user}","gists_url":"https://api.github.com/users/inostia/gists{/gist_id}","starred_url":"https://api.github.com/users/inostia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inostia/subscriptions","organizations_url":"https://api.github.com/users/inostia/orgs","repos_url":"https://api.github.com/users/inostia/repos","events_url":"https://api.github.com/users/inostia/events{/privacy}","received_events_url":"https://api.github.com/users/inostia/received_events","type":"User","site_admin":false},"body":"👍  I wasn't sure if it would create a conflict or not to set it to an empty string.","created_at":"2018-03-07T00:19:26Z","updated_at":"2018-03-07T00:19:26Z","html_url":"https://github.com/rkhleics/wagtailmenus/pull/221#discussion_r172704949","pull_request_url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/comments/172704949"},"html":{"href":"https://github.com/rkhleics/wagtailmenus/pull/221#discussion_r172704949"},"pull_request":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221"}},"in_reply_to_id":172703134},"pull_request":{"url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221","id":173289366,"html_url":"https://github.com/rkhleics/wagtailmenus/pull/221","diff_url":"https://github.com/rkhleics/wagtailmenus/pull/221.diff","patch_url":"https://github.com/rkhleics/wagtailmenus/pull/221.patch","issue_url":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/221","number":221,"state":"open","locked":false,"title":"Implement WAGTAILMENUS_CUSTOM_URL_SMART_ACTIVE_CLASSES setting","user":{"login":"inostia","id":14210438,"avatar_url":"https://avatars3.githubusercontent.com/u/14210438?v=4","gravatar_id":"","url":"https://api.github.com/users/inostia","html_url":"https://github.com/inostia","followers_url":"https://api.github.com/users/inostia/followers","following_url":"https://api.github.com/users/inostia/following{/other_user}","gists_url":"https://api.github.com/users/inostia/gists{/gist_id}","starred_url":"https://api.github.com/users/inostia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inostia/subscriptions","organizations_url":"https://api.github.com/users/inostia/orgs","repos_url":"https://api.github.com/users/inostia/repos","events_url":"https://api.github.com/users/inostia/events{/privacy}","received_events_url":"https://api.github.com/users/inostia/received_events","type":"User","site_admin":false},"body":"This PR introduces the WAGTAILMENUS_CUSTOM_URL_SMART_ACTIVE_CLASSES, which allows a developer to opt-in to highlight custom_urls as an ancestor of a url path - and apply WAGTAILMENUS_ACTIVE_ANCESTOR_CLASS if applicable.","created_at":"2018-03-06T21:40:58Z","updated_at":"2018-03-07T00:19:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"307a8392feeea771563f5f316f553e87143d079f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221/commits","review_comments_url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221/comments","review_comment_url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/221/comments","statuses_url":"https://api.github.com/repos/rkhleics/wagtailmenus/statuses/afdafca3fa2329d093dd135917c2d0d78995f03f","head":{"label":"inostia:jj/smart_custom_links","ref":"jj/smart_custom_links","sha":"afdafca3fa2329d093dd135917c2d0d78995f03f","user":{"login":"inostia","id":14210438,"avatar_url":"https://avatars3.githubusercontent.com/u/14210438?v=4","gravatar_id":"","url":"https://api.github.com/users/inostia","html_url":"https://github.com/inostia","followers_url":"https://api.github.com/users/inostia/followers","following_url":"https://api.github.com/users/inostia/following{/other_user}","gists_url":"https://api.github.com/users/inostia/gists{/gist_id}","starred_url":"https://api.github.com/users/inostia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inostia/subscriptions","organizations_url":"https://api.github.com/users/inostia/orgs","repos_url":"https://api.github.com/users/inostia/repos","events_url":"https://api.github.com/users/inostia/events{/privacy}","received_events_url":"https://api.github.com/users/inostia/received_events","type":"User","site_admin":false},"repo":{"id":123966069,"name":"wagtailmenus","full_name":"inostia/wagtailmenus","owner":{"login":"inostia","id":14210438,"avatar_url":"https://avatars3.githubusercontent.com/u/14210438?v=4","gravatar_id":"","url":"https://api.github.com/users/inostia","html_url":"https://github.com/inostia","followers_url":"https://api.github.com/users/inostia/followers","following_url":"https://api.github.com/users/inostia/following{/other_user}","gists_url":"https://api.github.com/users/inostia/gists{/gist_id}","starred_url":"https://api.github.com/users/inostia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inostia/subscriptions","organizations_url":"https://api.github.com/users/inostia/orgs","repos_url":"https://api.github.com/users/inostia/repos","events_url":"https://api.github.com/users/inostia/events{/privacy}","received_events_url":"https://api.github.com/users/inostia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inostia/wagtailmenus","description":"An app to help you manage and render menus in your Wagtail projects more effectively","fork":true,"url":"https://api.github.com/repos/inostia/wagtailmenus","forks_url":"https://api.github.com/repos/inostia/wagtailmenus/forks","keys_url":"https://api.github.com/repos/inostia/wagtailmenus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inostia/wagtailmenus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inostia/wagtailmenus/teams","hooks_url":"https://api.github.com/repos/inostia/wagtailmenus/hooks","issue_events_url":"https://api.github.com/repos/inostia/wagtailmenus/issues/events{/number}","events_url":"https://api.github.com/repos/inostia/wagtailmenus/events","assignees_url":"https://api.github.com/repos/inostia/wagtailmenus/assignees{/user}","branches_url":"https://api.github.com/repos/inostia/wagtailmenus/branches{/branch}","tags_url":"https://api.github.com/repos/inostia/wagtailmenus/tags","blobs_url":"https://api.github.com/repos/inostia/wagtailmenus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inostia/wagtailmenus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inostia/wagtailmenus/git/refs{/sha}","trees_url":"https://api.github.com/repos/inostia/wagtailmenus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inostia/wagtailmenus/statuses/{sha}","languages_url":"https://api.github.com/repos/inostia/wagtailmenus/languages","stargazers_url":"https://api.github.com/repos/inostia/wagtailmenus/stargazers","contributors_url":"https://api.github.com/repos/inostia/wagtailmenus/contributors","subscribers_url":"https://api.github.com/repos/inostia/wagtailmenus/subscribers","subscription_url":"https://api.github.com/repos/inostia/wagtailmenus/subscription","commits_url":"https://api.github.com/repos/inostia/wagtailmenus/commits{/sha}","git_commits_url":"https://api.github.com/repos/inostia/wagtailmenus/git/commits{/sha}","comments_url":"https://api.github.com/repos/inostia/wagtailmenus/comments{/number}","issue_comment_url":"https://api.github.com/repos/inostia/wagtailmenus/issues/comments{/number}","contents_url":"https://api.github.com/repos/inostia/wagtailmenus/contents/{+path}","compare_url":"https://api.github.com/repos/inostia/wagtailmenus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inostia/wagtailmenus/merges","archive_url":"https://api.github.com/repos/inostia/wagtailmenus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inostia/wagtailmenus/downloads","issues_url":"https://api.github.com/repos/inostia/wagtailmenus/issues{/number}","pulls_url":"https://api.github.com/repos/inostia/wagtailmenus/pulls{/number}","milestones_url":"https://api.github.com/repos/inostia/wagtailmenus/milestones{/number}","notifications_url":"https://api.github.com/repos/inostia/wagtailmenus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inostia/wagtailmenus/labels{/name}","releases_url":"https://api.github.com/repos/inostia/wagtailmenus/releases{/id}","deployments_url":"https://api.github.com/repos/inostia/wagtailmenus/deployments","created_at":"2018-03-05T19:11:52Z","updated_at":"2018-03-05T19:11:54Z","pushed_at":"2018-03-07T00:12:36Z","git_url":"git://github.com/inostia/wagtailmenus.git","ssh_url":"git@github.com:inostia/wagtailmenus.git","clone_url":"https://github.com/inostia/wagtailmenus.git","svn_url":"https://github.com/inostia/wagtailmenus","homepage":"","size":3080,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rkhleics:master","ref":"master","sha":"df1353da4362d8bb5ad4e42d0f306833fe06119e","user":{"login":"rkhleics","id":5148147,"avatar_url":"https://avatars0.githubusercontent.com/u/5148147?v=4","gravatar_id":"","url":"https://api.github.com/users/rkhleics","html_url":"https://github.com/rkhleics","followers_url":"https://api.github.com/users/rkhleics/followers","following_url":"https://api.github.com/users/rkhleics/following{/other_user}","gists_url":"https://api.github.com/users/rkhleics/gists{/gist_id}","starred_url":"https://api.github.com/users/rkhleics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkhleics/subscriptions","organizations_url":"https://api.github.com/users/rkhleics/orgs","repos_url":"https://api.github.com/users/rkhleics/repos","events_url":"https://api.github.com/users/rkhleics/events{/privacy}","received_events_url":"https://api.github.com/users/rkhleics/received_events","type":"Organization","site_admin":false},"repo":{"id":50591665,"name":"wagtailmenus","full_name":"rkhleics/wagtailmenus","owner":{"login":"rkhleics","id":5148147,"avatar_url":"https://avatars0.githubusercontent.com/u/5148147?v=4","gravatar_id":"","url":"https://api.github.com/users/rkhleics","html_url":"https://github.com/rkhleics","followers_url":"https://api.github.com/users/rkhleics/followers","following_url":"https://api.github.com/users/rkhleics/following{/other_user}","gists_url":"https://api.github.com/users/rkhleics/gists{/gist_id}","starred_url":"https://api.github.com/users/rkhleics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkhleics/subscriptions","organizations_url":"https://api.github.com/users/rkhleics/orgs","repos_url":"https://api.github.com/users/rkhleics/repos","events_url":"https://api.github.com/users/rkhleics/events{/privacy}","received_events_url":"https://api.github.com/users/rkhleics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rkhleics/wagtailmenus","description":"An app to help you manage and render menus in your Wagtail projects more effectively","fork":false,"url":"https://api.github.com/repos/rkhleics/wagtailmenus","forks_url":"https://api.github.com/repos/rkhleics/wagtailmenus/forks","keys_url":"https://api.github.com/repos/rkhleics/wagtailmenus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkhleics/wagtailmenus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkhleics/wagtailmenus/teams","hooks_url":"https://api.github.com/repos/rkhleics/wagtailmenus/hooks","issue_events_url":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/events{/number}","events_url":"https://api.github.com/repos/rkhleics/wagtailmenus/events","assignees_url":"https://api.github.com/repos/rkhleics/wagtailmenus/assignees{/user}","branches_url":"https://api.github.com/repos/rkhleics/wagtailmenus/branches{/branch}","tags_url":"https://api.github.com/repos/rkhleics/wagtailmenus/tags","blobs_url":"https://api.github.com/repos/rkhleics/wagtailmenus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkhleics/wagtailmenus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkhleics/wagtailmenus/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkhleics/wagtailmenus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkhleics/wagtailmenus/statuses/{sha}","languages_url":"https://api.github.com/repos/rkhleics/wagtailmenus/languages","stargazers_url":"https://api.github.com/repos/rkhleics/wagtailmenus/stargazers","contributors_url":"https://api.github.com/repos/rkhleics/wagtailmenus/contributors","subscribers_url":"https://api.github.com/repos/rkhleics/wagtailmenus/subscribers","subscription_url":"https://api.github.com/repos/rkhleics/wagtailmenus/subscription","commits_url":"https://api.github.com/repos/rkhleics/wagtailmenus/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkhleics/wagtailmenus/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkhleics/wagtailmenus/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkhleics/wagtailmenus/contents/{+path}","compare_url":"https://api.github.com/repos/rkhleics/wagtailmenus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkhleics/wagtailmenus/merges","archive_url":"https://api.github.com/repos/rkhleics/wagtailmenus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkhleics/wagtailmenus/downloads","issues_url":"https://api.github.com/repos/rkhleics/wagtailmenus/issues{/number}","pulls_url":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls{/number}","milestones_url":"https://api.github.com/repos/rkhleics/wagtailmenus/milestones{/number}","notifications_url":"https://api.github.com/repos/rkhleics/wagtailmenus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkhleics/wagtailmenus/labels{/name}","releases_url":"https://api.github.com/repos/rkhleics/wagtailmenus/releases{/id}","deployments_url":"https://api.github.com/repos/rkhleics/wagtailmenus/deployments","created_at":"2016-01-28T15:19:08Z","updated_at":"2018-03-01T23:24:01Z","pushed_at":"2018-03-07T00:12:37Z","git_url":"git://github.com/rkhleics/wagtailmenus.git","ssh_url":"git@github.com:rkhleics/wagtailmenus.git","clone_url":"https://github.com/rkhleics/wagtailmenus.git","svn_url":"https://github.com/rkhleics/wagtailmenus","homepage":"","size":3062,"stargazers_count":131,"watchers_count":131,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":42,"open_issues":5,"watchers":131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221"},"html":{"href":"https://github.com/rkhleics/wagtailmenus/pull/221"},"issue":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/221"},"comments":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/issues/221/comments"},"review_comments":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221/comments"},"review_comment":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/pulls/221/commits"},"statuses":{"href":"https://api.github.com/repos/rkhleics/wagtailmenus/statuses/afdafca3fa2329d093dd135917c2d0d78995f03f"}},"author_association":"NONE"}}
{"actor":{"display_login":"inostia"}}