{"action":"created","comment":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments/36355469","id":36355469,"diff_hunk":"@@ -92,53 +106,74 @@ <h2 class=\"subtitle\">\n                         {% endif %}\n                     </td>\n                     <td>\n-                        {{ log.time.0|humane_time }}\n+                        {% if not forloop.first %}\n+                            <input type=\"radio\" name=\"compare-from\" value=\"{{ commit.hexsha }}\"\n+                                {% if forloop.counter == 2 %}\n+                                    checked=\"checked\"\n+                                {% endif %}\n+                            >\n+                        {% endif %}\n+                    </td>\n+                    <td>\n+                        {% if not forloop.last %}\n+                            <input type=\"radio\" name=\"compare-to\" value=\"{{ commit.hexsha }}\"\n+                                {% if forloop.first %}\n+                                    checked=\"checked\"\n+                                {% endif %}\n+                            >\n+                        {% endif %}\n                     </td>\n                     <td>\n-                        <a href=\"{% url \"zds.tutorial.views.view_tutorial\" tutorial.pk tutorial.slug %}?version={{ log.newhexsha }}\" >\n-                            {{ log.message }}\n+                        {{ commit.authored_date|humane_time:commit.author_tz_offset }}","path":"templates/tutorial/tutorial/history.html","position":109,"original_position":109,"commit_id":"f1a37f3a1e72d803ed4865af4c79b157f2ffc29f","original_commit_id":"f1a37f3a1e72d803ed4865af4c79b157f2ffc29f","user":{"login":"yapper-git","id":9322299,"avatar_url":"https://avatars.githubusercontent.com/u/9322299?v=3","gravatar_id":"","url":"https://api.github.com/users/yapper-git","html_url":"https://github.com/yapper-git","followers_url":"https://api.github.com/users/yapper-git/followers","following_url":"https://api.github.com/users/yapper-git/following{/other_user}","gists_url":"https://api.github.com/users/yapper-git/gists{/gist_id}","starred_url":"https://api.github.com/users/yapper-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yapper-git/subscriptions","organizations_url":"https://api.github.com/users/yapper-git/orgs","repos_url":"https://api.github.com/users/yapper-git/repos","events_url":"https://api.github.com/users/yapper-git/events{/privacy}","received_events_url":"https://api.github.com/users/yapper-git/received_events","type":"User","site_admin":false},"body":"Euh c'est le fuseau horaire de la date du commit (l'auteur n'a pas son propre fuseau horaire c'est le commit…)","created_at":"2015-08-05T21:19:30Z","updated_at":"2015-08-05T21:19:30Z","html_url":"https://github.com/zestedesavoir/zds-site/pull/2952#discussion_r36355469","pull_request_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952","_links":{"self":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments/36355469"},"html":{"href":"https://github.com/zestedesavoir/zds-site/pull/2952#discussion_r36355469"},"pull_request":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952"}}},"pull_request":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952","id":41333058,"html_url":"https://github.com/zestedesavoir/zds-site/pull/2952","diff_url":"https://github.com/zestedesavoir/zds-site/pull/2952.diff","patch_url":"https://github.com/zestedesavoir/zds-site/pull/2952.patch","issue_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2952","number":2952,"state":"open","locked":false,"title":"Amélioration de l'outil de diff des tutoriels (fix #2308, #2863, #2930)","user":{"login":"yapper-git","id":9322299,"avatar_url":"https://avatars.githubusercontent.com/u/9322299?v=3","gravatar_id":"","url":"https://api.github.com/users/yapper-git","html_url":"https://github.com/yapper-git","followers_url":"https://api.github.com/users/yapper-git/followers","following_url":"https://api.github.com/users/yapper-git/following{/other_user}","gists_url":"https://api.github.com/users/yapper-git/gists{/gist_id}","starred_url":"https://api.github.com/users/yapper-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yapper-git/subscriptions","organizations_url":"https://api.github.com/users/yapper-git/orgs","repos_url":"https://api.github.com/users/yapper-git/repos","events_url":"https://api.github.com/users/yapper-git/events{/privacy}","received_events_url":"https://api.github.com/users/yapper-git/received_events","type":"User","site_admin":false},"body":"| Q                             | R\r\n| ----------------------------- | -------------------------------------------\r\n| Correction de bugs ?          | oui\r\n| Nouvelle Fonctionnalité ?     | non\r\n| Tickets (_issues_) concernés  | #2308, #2863, #2930\r\n\r\nEn résumé, voici les modifications:\r\n- comparaison dans le bon ordre (ancien=gauche, nouveau=droite) et affichage des fichiers modifiés, supprimés, renommés ou ajoutés corrects (actuellement buggé/foireux)\r\n- génération d'une erreur 404 en cas de sha invalide (si l'utilisateur change l'URL) au lieu d'une 500…\r\n- utilisation de `make_table` au lieu de `make_file` ⇒ évite d'avoir une page HTML dans une autre (interdit sans iframe) + supprime les légendes multiples pour chaque diff + déplace le CSS (autrefois répété) dans un seul endroit\r\n- affichage de scroll pour les diffs seulement si besoin\r\n- utilisation de deux paramètres dans l'URL *from* et *to* (qui offre la possibilité de comparer deux versions quelconques)\r\n- utilisation d'un tag simple pour comparer deux chaînes `{% htmldiff \"string1\" \"string2\" %}` au lieu de deux filtres incompréhensibles avec du `with`…\r\n- ajout de la possibilité de comparer deux versions quelconques avec des radiobutton et un bouton de validation\r\n\r\nNB: Cette PR ne touche pas au code pour les articles (d'ailleurs il est actuellement impossible d'avoir un diff d'un article mais cela sera réglé par la ZEP-12…). Bref cette PR ne concerne que les tutoriels.\r\n\r\n# QA\r\n\r\nTester les pages correspondant à l'historique d'un tutoriel (liste des commits + diffs) dans le cas où le tutoriel vient juste d'être créé (= 1 seul commit), avec plusieurs commits (possibilité de voir les modifications d'un commit donné).\r\nModifier les paramètres `from` et `to` dans l'URL et vérifier que cela génère une erreur 404.\r\nVérifier que les modifications d'un tutoriel (ajout section, correction typos) apparaissent bien dans le diff en question.\r\nVérifier que les bugs sont bien corrigés.","created_at":"2015-07-31T12:06:13Z","updated_at":"2015-08-05T21:19:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7a4c074a7137097f5a0587a9494c53971ca8815","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952/commits","review_comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952/comments","review_comment_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2952/comments","statuses_url":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/f1a37f3a1e72d803ed4865af4c79b157f2ffc29f","head":{"label":"yapper-git:feat-htmldiff","ref":"feat-htmldiff","sha":"f1a37f3a1e72d803ed4865af4c79b157f2ffc29f","user":{"login":"yapper-git","id":9322299,"avatar_url":"https://avatars.githubusercontent.com/u/9322299?v=3","gravatar_id":"","url":"https://api.github.com/users/yapper-git","html_url":"https://github.com/yapper-git","followers_url":"https://api.github.com/users/yapper-git/followers","following_url":"https://api.github.com/users/yapper-git/following{/other_user}","gists_url":"https://api.github.com/users/yapper-git/gists{/gist_id}","starred_url":"https://api.github.com/users/yapper-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yapper-git/subscriptions","organizations_url":"https://api.github.com/users/yapper-git/orgs","repos_url":"https://api.github.com/users/yapper-git/repos","events_url":"https://api.github.com/users/yapper-git/events{/privacy}","received_events_url":"https://api.github.com/users/yapper-git/received_events","type":"User","site_admin":false},"repo":{"id":39951747,"name":"zds-site","full_name":"yapper-git/zds-site","owner":{"login":"yapper-git","id":9322299,"avatar_url":"https://avatars.githubusercontent.com/u/9322299?v=3","gravatar_id":"","url":"https://api.github.com/users/yapper-git","html_url":"https://github.com/yapper-git","followers_url":"https://api.github.com/users/yapper-git/followers","following_url":"https://api.github.com/users/yapper-git/following{/other_user}","gists_url":"https://api.github.com/users/yapper-git/gists{/gist_id}","starred_url":"https://api.github.com/users/yapper-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yapper-git/subscriptions","organizations_url":"https://api.github.com/users/yapper-git/orgs","repos_url":"https://api.github.com/users/yapper-git/repos","events_url":"https://api.github.com/users/yapper-git/events{/privacy}","received_events_url":"https://api.github.com/users/yapper-git/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yapper-git/zds-site","description":"Dépot ZDS","fork":true,"url":"https://api.github.com/repos/yapper-git/zds-site","forks_url":"https://api.github.com/repos/yapper-git/zds-site/forks","keys_url":"https://api.github.com/repos/yapper-git/zds-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yapper-git/zds-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yapper-git/zds-site/teams","hooks_url":"https://api.github.com/repos/yapper-git/zds-site/hooks","issue_events_url":"https://api.github.com/repos/yapper-git/zds-site/issues/events{/number}","events_url":"https://api.github.com/repos/yapper-git/zds-site/events","assignees_url":"https://api.github.com/repos/yapper-git/zds-site/assignees{/user}","branches_url":"https://api.github.com/repos/yapper-git/zds-site/branches{/branch}","tags_url":"https://api.github.com/repos/yapper-git/zds-site/tags","blobs_url":"https://api.github.com/repos/yapper-git/zds-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yapper-git/zds-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yapper-git/zds-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/yapper-git/zds-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yapper-git/zds-site/statuses/{sha}","languages_url":"https://api.github.com/repos/yapper-git/zds-site/languages","stargazers_url":"https://api.github.com/repos/yapper-git/zds-site/stargazers","contributors_url":"https://api.github.com/repos/yapper-git/zds-site/contributors","subscribers_url":"https://api.github.com/repos/yapper-git/zds-site/subscribers","subscription_url":"https://api.github.com/repos/yapper-git/zds-site/subscription","commits_url":"https://api.github.com/repos/yapper-git/zds-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/yapper-git/zds-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/yapper-git/zds-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/yapper-git/zds-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/yapper-git/zds-site/contents/{+path}","compare_url":"https://api.github.com/repos/yapper-git/zds-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yapper-git/zds-site/merges","archive_url":"https://api.github.com/repos/yapper-git/zds-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yapper-git/zds-site/downloads","issues_url":"https://api.github.com/repos/yapper-git/zds-site/issues{/number}","pulls_url":"https://api.github.com/repos/yapper-git/zds-site/pulls{/number}","milestones_url":"https://api.github.com/repos/yapper-git/zds-site/milestones{/number}","notifications_url":"https://api.github.com/repos/yapper-git/zds-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yapper-git/zds-site/labels{/name}","releases_url":"https://api.github.com/repos/yapper-git/zds-site/releases{/id}","created_at":"2015-07-30T13:22:45Z","updated_at":"2015-07-30T13:22:47Z","pushed_at":"2015-08-05T15:32:11Z","git_url":"git://github.com/yapper-git/zds-site.git","ssh_url":"git@github.com:yapper-git/zds-site.git","clone_url":"https://github.com/yapper-git/zds-site.git","svn_url":"https://github.com/yapper-git/zds-site","homepage":null,"size":87244,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"zestedesavoir:dev","ref":"dev","sha":"17ebb29456d4349b30105d737c1ea37cf2fb8a57","user":{"login":"zestedesavoir","id":7406239,"avatar_url":"https://avatars.githubusercontent.com/u/7406239?v=3","gravatar_id":"","url":"https://api.github.com/users/zestedesavoir","html_url":"https://github.com/zestedesavoir","followers_url":"https://api.github.com/users/zestedesavoir/followers","following_url":"https://api.github.com/users/zestedesavoir/following{/other_user}","gists_url":"https://api.github.com/users/zestedesavoir/gists{/gist_id}","starred_url":"https://api.github.com/users/zestedesavoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zestedesavoir/subscriptions","organizations_url":"https://api.github.com/users/zestedesavoir/orgs","repos_url":"https://api.github.com/users/zestedesavoir/repos","events_url":"https://api.github.com/users/zestedesavoir/events{/privacy}","received_events_url":"https://api.github.com/users/zestedesavoir/received_events","type":"Organization","site_admin":false},"repo":{"id":14778920,"name":"zds-site","full_name":"zestedesavoir/zds-site","owner":{"login":"zestedesavoir","id":7406239,"avatar_url":"https://avatars.githubusercontent.com/u/7406239?v=3","gravatar_id":"","url":"https://api.github.com/users/zestedesavoir","html_url":"https://github.com/zestedesavoir","followers_url":"https://api.github.com/users/zestedesavoir/followers","following_url":"https://api.github.com/users/zestedesavoir/following{/other_user}","gists_url":"https://api.github.com/users/zestedesavoir/gists{/gist_id}","starred_url":"https://api.github.com/users/zestedesavoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zestedesavoir/subscriptions","organizations_url":"https://api.github.com/users/zestedesavoir/orgs","repos_url":"https://api.github.com/users/zestedesavoir/repos","events_url":"https://api.github.com/users/zestedesavoir/events{/privacy}","received_events_url":"https://api.github.com/users/zestedesavoir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zestedesavoir/zds-site","description":"Dépot ZDS","fork":false,"url":"https://api.github.com/repos/zestedesavoir/zds-site","forks_url":"https://api.github.com/repos/zestedesavoir/zds-site/forks","keys_url":"https://api.github.com/repos/zestedesavoir/zds-site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zestedesavoir/zds-site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zestedesavoir/zds-site/teams","hooks_url":"https://api.github.com/repos/zestedesavoir/zds-site/hooks","issue_events_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/events{/number}","events_url":"https://api.github.com/repos/zestedesavoir/zds-site/events","assignees_url":"https://api.github.com/repos/zestedesavoir/zds-site/assignees{/user}","branches_url":"https://api.github.com/repos/zestedesavoir/zds-site/branches{/branch}","tags_url":"https://api.github.com/repos/zestedesavoir/zds-site/tags","blobs_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/refs{/sha}","trees_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/{sha}","languages_url":"https://api.github.com/repos/zestedesavoir/zds-site/languages","stargazers_url":"https://api.github.com/repos/zestedesavoir/zds-site/stargazers","contributors_url":"https://api.github.com/repos/zestedesavoir/zds-site/contributors","subscribers_url":"https://api.github.com/repos/zestedesavoir/zds-site/subscribers","subscription_url":"https://api.github.com/repos/zestedesavoir/zds-site/subscription","commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/commits{/sha}","git_commits_url":"https://api.github.com/repos/zestedesavoir/zds-site/git/commits{/sha}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/comments{/number}","issue_comment_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/comments{/number}","contents_url":"https://api.github.com/repos/zestedesavoir/zds-site/contents/{+path}","compare_url":"https://api.github.com/repos/zestedesavoir/zds-site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zestedesavoir/zds-site/merges","archive_url":"https://api.github.com/repos/zestedesavoir/zds-site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zestedesavoir/zds-site/downloads","issues_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues{/number}","pulls_url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls{/number}","milestones_url":"https://api.github.com/repos/zestedesavoir/zds-site/milestones{/number}","notifications_url":"https://api.github.com/repos/zestedesavoir/zds-site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zestedesavoir/zds-site/labels{/name}","releases_url":"https://api.github.com/repos/zestedesavoir/zds-site/releases{/id}","created_at":"2013-11-28T14:23:48Z","updated_at":"2015-07-29T20:17:13Z","pushed_at":"2015-08-05T15:32:13Z","git_url":"git://github.com/zestedesavoir/zds-site.git","ssh_url":"git@github.com:zestedesavoir/zds-site.git","clone_url":"https://github.com/zestedesavoir/zds-site.git","svn_url":"https://github.com/zestedesavoir/zds-site","homepage":null,"size":165569,"stargazers_count":103,"watchers_count":103,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":87,"mirror_url":null,"open_issues_count":244,"forks":87,"open_issues":244,"watchers":103,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952"},"html":{"href":"https://github.com/zestedesavoir/zds-site/pull/2952"},"issue":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2952"},"comments":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2952/comments"},"review_comments":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952/comments"},"review_comment":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/2952/commits"},"statuses":{"href":"https://api.github.com/repos/zestedesavoir/zds-site/statuses/f1a37f3a1e72d803ed4865af4c79b157f2ffc29f"}}}}