{"action":"created","comment":{"url":"https://api.github.com/repos/etalab/udata/pulls/comments/34879600","id":34879600,"diff_hunk":"@@ -115,26 +117,58 @@ <h3 class=\"panel-title\">\n \n {% macro term_facet(name, facet, query, url=None) %}\n <div id=\"collapse-{{name}}\" class=\"list-group collapse in\">\n-{% for term, count in facet.terms %}\n+{% for term, count in facet.terms[:nb_displayed_facets] %}\n     <a href=\"{{ query.to_url(url, **{name: term}) }}\"\n         class=\"list-group-item\">\n         {{ query.adapter.facets[name].labelize('', term) }}\n         <span class=\"badge pull-right\">{{ count }}</span>\n     </a>\n {% endfor %}\n+{% if facet.terms|length > nb_displayed_facets %}\n+    <a href=\"\"\n+        class=\"list-group-item\"\n+        data-toggle=\"collapse\" data-target=\"#collapse-{{name}}-more\">\n+        {{ _('More facets…') }}\n+    </a>\n+    <div id=\"collapse-{{name}}-more\" class=\"list-group collapse\">\n+    {% for term, count in facet.terms[nb_displayed_facets:] %}\n+        <a href=\"{{ query.to_url(url, **{name: term}) }}\"\n+            class=\"list-group-item\">\n+            {{ query.adapter.facets[name].labelize('', term) }}\n+            <span class=\"badge pull-right\">{{ count }}</span>\n+        </a>\n+    {% endfor %}\n+    </div>\n+{% endif %}\n </div>\n {% endmacro %}\n \n \n {% macro model_facet(name, facet, query, url=None) %}\n <div id=\"collapse-{{name}}\" class=\"list-group collapse in\">\n-    {% for obj, count in facet.models %}\n+{% for obj, count in facet.models[:nb_displayed_facets] %}\n+    <a href=\"{{ query.to_url(url, **{name: obj.id|string}) }}\"\n+        class=\"list-group-item\">\n+        {{ obj }}\n+        <span class=\"badge pull-right\">{{ count }}</span>\n+    </a>\n+{% endfor %}\n+{% if facet.models|length > nb_displayed_facets %}\n+    <a href=\"\"\n+        class=\"list-group-item\"\n+        data-toggle=\"collapse\" data-target=\"#collapse-{{name}}-more\">\n+        {{ _('More facets…') }}","path":"udata/templates/macros/search.html","position":52,"original_position":52,"commit_id":"159f62df4faf0756f76df67fbfd2ec1eea15a7a2","original_commit_id":"159f62df4faf0756f76df67fbfd2ec1eea15a7a2","user":{"login":"noirbizarre","id":15725,"avatar_url":"https://avatars.githubusercontent.com/u/15725?v=3","gravatar_id":"","url":"https://api.github.com/users/noirbizarre","html_url":"https://github.com/noirbizarre","followers_url":"https://api.github.com/users/noirbizarre/followers","following_url":"https://api.github.com/users/noirbizarre/following{/other_user}","gists_url":"https://api.github.com/users/noirbizarre/gists{/gist_id}","starred_url":"https://api.github.com/users/noirbizarre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noirbizarre/subscriptions","organizations_url":"https://api.github.com/users/noirbizarre/orgs","repos_url":"https://api.github.com/users/noirbizarre/repos","events_url":"https://api.github.com/users/noirbizarre/events{/privacy}","received_events_url":"https://api.github.com/users/noirbizarre/received_events","type":"User","site_admin":false},"body":"Same as above","created_at":"2015-07-17T10:46:26Z","updated_at":"2015-07-17T10:46:26Z","html_url":"https://github.com/etalab/udata/pull/104#discussion_r34879600","pull_request_url":"https://api.github.com/repos/etalab/udata/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/etalab/udata/pulls/comments/34879600"},"html":{"href":"https://github.com/etalab/udata/pull/104#discussion_r34879600"},"pull_request":{"href":"https://api.github.com/repos/etalab/udata/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/etalab/udata/pulls/104","id":40104903,"html_url":"https://github.com/etalab/udata/pull/104","diff_url":"https://github.com/etalab/udata/pull/104.diff","patch_url":"https://github.com/etalab/udata/pull/104.patch","issue_url":"https://api.github.com/repos/etalab/udata/issues/104","number":104,"state":"open","locked":false,"title":"Limit the number of displayed facets, fix #103","user":{"login":"davidbgk","id":3556,"avatar_url":"https://avatars.githubusercontent.com/u/3556?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbgk","html_url":"https://github.com/davidbgk","followers_url":"https://api.github.com/users/davidbgk/followers","following_url":"https://api.github.com/users/davidbgk/following{/other_user}","gists_url":"https://api.github.com/users/davidbgk/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbgk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbgk/subscriptions","organizations_url":"https://api.github.com/users/davidbgk/orgs","repos_url":"https://api.github.com/users/davidbgk/repos","events_url":"https://api.github.com/users/davidbgk/events{/privacy}","received_events_url":"https://api.github.com/users/davidbgk/received_events","type":"User","site_admin":false},"body":"As a visitor, I want to scan quickly available facets in order to\r\nrefine my search.\r\n\r\n![capture d ecran 2015-07-16 a 09 58 34](https://cloud.githubusercontent.com/assets/3556/8718381/5eca5228-2ba4-11e5-8e7b-dc9c317ad996.png)\r\n","created_at":"2015-07-16T08:20:48Z","updated_at":"2015-07-17T10:46:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14672d83f3d69931d8493d5cf0d122aa0828296a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/etalab/udata/pulls/104/commits","review_comments_url":"https://api.github.com/repos/etalab/udata/pulls/104/comments","review_comment_url":"https://api.github.com/repos/etalab/udata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/etalab/udata/issues/104/comments","statuses_url":"https://api.github.com/repos/etalab/udata/statuses/159f62df4faf0756f76df67fbfd2ec1eea15a7a2","head":{"label":"davidbgk:103-displayed-facets","ref":"103-displayed-facets","sha":"159f62df4faf0756f76df67fbfd2ec1eea15a7a2","user":{"login":"davidbgk","id":3556,"avatar_url":"https://avatars.githubusercontent.com/u/3556?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbgk","html_url":"https://github.com/davidbgk","followers_url":"https://api.github.com/users/davidbgk/followers","following_url":"https://api.github.com/users/davidbgk/following{/other_user}","gists_url":"https://api.github.com/users/davidbgk/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbgk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbgk/subscriptions","organizations_url":"https://api.github.com/users/davidbgk/orgs","repos_url":"https://api.github.com/users/davidbgk/repos","events_url":"https://api.github.com/users/davidbgk/events{/privacy}","received_events_url":"https://api.github.com/users/davidbgk/received_events","type":"User","site_admin":false},"repo":{"id":33595552,"name":"udata","full_name":"davidbgk/udata","owner":{"login":"davidbgk","id":3556,"avatar_url":"https://avatars.githubusercontent.com/u/3556?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbgk","html_url":"https://github.com/davidbgk","followers_url":"https://api.github.com/users/davidbgk/followers","following_url":"https://api.github.com/users/davidbgk/following{/other_user}","gists_url":"https://api.github.com/users/davidbgk/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbgk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbgk/subscriptions","organizations_url":"https://api.github.com/users/davidbgk/orgs","repos_url":"https://api.github.com/users/davidbgk/repos","events_url":"https://api.github.com/users/davidbgk/events{/privacy}","received_events_url":"https://api.github.com/users/davidbgk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidbgk/udata","description":"Social data platform","fork":true,"url":"https://api.github.com/repos/davidbgk/udata","forks_url":"https://api.github.com/repos/davidbgk/udata/forks","keys_url":"https://api.github.com/repos/davidbgk/udata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidbgk/udata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidbgk/udata/teams","hooks_url":"https://api.github.com/repos/davidbgk/udata/hooks","issue_events_url":"https://api.github.com/repos/davidbgk/udata/issues/events{/number}","events_url":"https://api.github.com/repos/davidbgk/udata/events","assignees_url":"https://api.github.com/repos/davidbgk/udata/assignees{/user}","branches_url":"https://api.github.com/repos/davidbgk/udata/branches{/branch}","tags_url":"https://api.github.com/repos/davidbgk/udata/tags","blobs_url":"https://api.github.com/repos/davidbgk/udata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidbgk/udata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidbgk/udata/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidbgk/udata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidbgk/udata/statuses/{sha}","languages_url":"https://api.github.com/repos/davidbgk/udata/languages","stargazers_url":"https://api.github.com/repos/davidbgk/udata/stargazers","contributors_url":"https://api.github.com/repos/davidbgk/udata/contributors","subscribers_url":"https://api.github.com/repos/davidbgk/udata/subscribers","subscription_url":"https://api.github.com/repos/davidbgk/udata/subscription","commits_url":"https://api.github.com/repos/davidbgk/udata/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidbgk/udata/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidbgk/udata/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidbgk/udata/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidbgk/udata/contents/{+path}","compare_url":"https://api.github.com/repos/davidbgk/udata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidbgk/udata/merges","archive_url":"https://api.github.com/repos/davidbgk/udata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidbgk/udata/downloads","issues_url":"https://api.github.com/repos/davidbgk/udata/issues{/number}","pulls_url":"https://api.github.com/repos/davidbgk/udata/pulls{/number}","milestones_url":"https://api.github.com/repos/davidbgk/udata/milestones{/number}","notifications_url":"https://api.github.com/repos/davidbgk/udata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidbgk/udata/labels{/name}","releases_url":"https://api.github.com/repos/davidbgk/udata/releases{/id}","created_at":"2015-04-08T08:51:08Z","updated_at":"2015-05-07T13:55:38Z","pushed_at":"2015-07-17T08:52:35Z","git_url":"git://github.com/davidbgk/udata.git","ssh_url":"git@github.com:davidbgk/udata.git","clone_url":"https://github.com/davidbgk/udata.git","svn_url":"https://github.com/davidbgk/udata","homepage":null,"size":3489,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"etalab:master","ref":"master","sha":"269f7951d6f277c899224373986e65b3fb7958d8","user":{"login":"etalab","id":5313610,"avatar_url":"https://avatars.githubusercontent.com/u/5313610?v=3","gravatar_id":"","url":"https://api.github.com/users/etalab","html_url":"https://github.com/etalab","followers_url":"https://api.github.com/users/etalab/followers","following_url":"https://api.github.com/users/etalab/following{/other_user}","gists_url":"https://api.github.com/users/etalab/gists{/gist_id}","starred_url":"https://api.github.com/users/etalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etalab/subscriptions","organizations_url":"https://api.github.com/users/etalab/orgs","repos_url":"https://api.github.com/users/etalab/repos","events_url":"https://api.github.com/users/etalab/events{/privacy}","received_events_url":"https://api.github.com/users/etalab/received_events","type":"Organization","site_admin":false},"repo":{"id":19141754,"name":"udata","full_name":"etalab/udata","owner":{"login":"etalab","id":5313610,"avatar_url":"https://avatars.githubusercontent.com/u/5313610?v=3","gravatar_id":"","url":"https://api.github.com/users/etalab","html_url":"https://github.com/etalab","followers_url":"https://api.github.com/users/etalab/followers","following_url":"https://api.github.com/users/etalab/following{/other_user}","gists_url":"https://api.github.com/users/etalab/gists{/gist_id}","starred_url":"https://api.github.com/users/etalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etalab/subscriptions","organizations_url":"https://api.github.com/users/etalab/orgs","repos_url":"https://api.github.com/users/etalab/repos","events_url":"https://api.github.com/users/etalab/events{/privacy}","received_events_url":"https://api.github.com/users/etalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/etalab/udata","description":"Social data platform","fork":false,"url":"https://api.github.com/repos/etalab/udata","forks_url":"https://api.github.com/repos/etalab/udata/forks","keys_url":"https://api.github.com/repos/etalab/udata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/etalab/udata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/etalab/udata/teams","hooks_url":"https://api.github.com/repos/etalab/udata/hooks","issue_events_url":"https://api.github.com/repos/etalab/udata/issues/events{/number}","events_url":"https://api.github.com/repos/etalab/udata/events","assignees_url":"https://api.github.com/repos/etalab/udata/assignees{/user}","branches_url":"https://api.github.com/repos/etalab/udata/branches{/branch}","tags_url":"https://api.github.com/repos/etalab/udata/tags","blobs_url":"https://api.github.com/repos/etalab/udata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/etalab/udata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/etalab/udata/git/refs{/sha}","trees_url":"https://api.github.com/repos/etalab/udata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/etalab/udata/statuses/{sha}","languages_url":"https://api.github.com/repos/etalab/udata/languages","stargazers_url":"https://api.github.com/repos/etalab/udata/stargazers","contributors_url":"https://api.github.com/repos/etalab/udata/contributors","subscribers_url":"https://api.github.com/repos/etalab/udata/subscribers","subscription_url":"https://api.github.com/repos/etalab/udata/subscription","commits_url":"https://api.github.com/repos/etalab/udata/commits{/sha}","git_commits_url":"https://api.github.com/repos/etalab/udata/git/commits{/sha}","comments_url":"https://api.github.com/repos/etalab/udata/comments{/number}","issue_comment_url":"https://api.github.com/repos/etalab/udata/issues/comments{/number}","contents_url":"https://api.github.com/repos/etalab/udata/contents/{+path}","compare_url":"https://api.github.com/repos/etalab/udata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/etalab/udata/merges","archive_url":"https://api.github.com/repos/etalab/udata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/etalab/udata/downloads","issues_url":"https://api.github.com/repos/etalab/udata/issues{/number}","pulls_url":"https://api.github.com/repos/etalab/udata/pulls{/number}","milestones_url":"https://api.github.com/repos/etalab/udata/milestones{/number}","notifications_url":"https://api.github.com/repos/etalab/udata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/etalab/udata/labels{/name}","releases_url":"https://api.github.com/repos/etalab/udata/releases{/id}","created_at":"2014-04-25T09:57:34Z","updated_at":"2015-07-14T02:00:54Z","pushed_at":"2015-07-17T08:52:56Z","git_url":"git://github.com/etalab/udata.git","ssh_url":"git@github.com:etalab/udata.git","clone_url":"https://github.com/etalab/udata.git","svn_url":"https://github.com/etalab/udata","homepage":null,"size":4488,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":13,"forks":5,"open_issues":13,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/etalab/udata/pulls/104"},"html":{"href":"https://github.com/etalab/udata/pull/104"},"issue":{"href":"https://api.github.com/repos/etalab/udata/issues/104"},"comments":{"href":"https://api.github.com/repos/etalab/udata/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/etalab/udata/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/etalab/udata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/etalab/udata/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/etalab/udata/statuses/159f62df4faf0756f76df67fbfd2ec1eea15a7a2"}}}}