From patchwork Fri Aug 13 05:31:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raxel Gutierrez X-Patchwork-Id: 1516534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=F40D5yMy; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GmByr2lnnz9sRf for ; Fri, 13 Aug 2021 15:32:36 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GmByq123Mz3bW6 for ; Fri, 13 Aug 2021 15:32:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=F40D5yMy; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--raxel.bounces.google.com (client-ip=2607:f8b0:4864:20::b4a; helo=mail-yb1-xb4a.google.com; envelope-from=35wmwyqukcvyfyl294cc492.0cadyh05kcf896ghg.cn9yzg.cf4@flex--raxel.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=F40D5yMy; dkim-atps=neutral Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GmByh3nLwz2yxP for ; Fri, 13 Aug 2021 15:32:26 +1000 (AEST) Received: by mail-yb1-xb4a.google.com with SMTP id j9-20020a2581490000b02905897d81c63fso8232638ybm.8 for ; Thu, 12 Aug 2021 22:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9d8RAzpjzTVNi+rsFHZZhK+AaHofgG1oJJ+4EDl9cCI=; b=F40D5yMyRZ4PKUuCya7XwyJfPgu23QBjx/C02glUSwF+EMOuWZQlC362WxWTaDRtyE Y/02FuWd+WrRo3iodLSB4w/onI4F9Jp2HyVQfXR97tzxI3fA+t0s9TB8553osZiBGFyW ZNPlNKm9Xo7vrczAbXuRM6Z/Uj71/EXJF8m41w10RUjyR4XWCvu81jNzzicLYmWbuvor Xyy/nXXVhT/b7JqlGhbhl3X+2Kz5eQDVPZu1/Kj9Zoh4uC82DEcDPB+qHatyl5bdY9uU wf+ScpLxZhnEtJxTyVJuWMfbQXCpSeqJnkE/SzU+DKkI/l+7l88Cl1GLU1Z259pSBA8x 40sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9d8RAzpjzTVNi+rsFHZZhK+AaHofgG1oJJ+4EDl9cCI=; b=tXlUmy1lV5KH83gMO9MseYnw5HROM1pYgLgv6UXLxMKa0D4iLR5l9pMXHecxAFa+4z j2JhDb5OzV70ZsySo/GSXjqLHJ6zvUS7xyf7LXhW3jpsewSUr2/IiF7aPKtQ2BJfNBfp U7s6d8NGNJHIwFbgc0uHVDc/fApe6li7P+uLY73iKuvEzWPEN1t9eWijGxZmx4vgJ8CY FQtOb3wmPNsQM/KVIfge6C5bCKqJoJ7vQhMXkAO42d0WnQIpE6ZkvN/KQQLCXXGv5K62 cad06LH2eRgB5NFJWysGsqcSQzHIEygsyEQC+4JZq50dRGv+cwgqjXGdU4t2hULT4sRJ JmgQ== X-Gm-Message-State: AOAM5325LHA5IcsObiMlcngETdqsYbFYoe0NAVBxsi+cnltQl49BoFKY VkSA82H/4rZ3oFTJODwLkHm16tCyjHYYxjU2Q/JC3Kd06YwCd6JODO73/H38DXBI2FiCU1SdslY y5dhKt+ncvMv68GUjKGU/EIljMDBKv5ALnyUGFCjiW4BpXJj9vri/959y14mwGqnX X-Google-Smtp-Source: ABdhPJzmTZbqWL4f1CpCwka0Ev71f/J4QymwRsMGjRg9Jz+eK9bu4Q3R15U4UaIK4YrOLYUWkx6YF/vL7w== X-Received: from raxel-pw.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2fda]) (user=raxel job=sendgmr) by 2002:a25:9010:: with SMTP id s16mr867809ybl.82.1628832743577; Thu, 12 Aug 2021 22:32:23 -0700 (PDT) Date: Fri, 13 Aug 2021 05:31:18 +0000 In-Reply-To: <20210813053127.2160595-1-raxel@google.com> Message-Id: <20210813053127.2160595-2-raxel@google.com> Mime-Version: 1.0 References: <20210813053127.2160595-1-raxel@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH v3 01/10] api: change parameter to for comments endpoint From: Raxel Gutierrez To: patchwork@lists.ozlabs.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Refactor patch lookup parameter `pk` to `patch_id` for the comments list endpoint to disambiguate from the lookup parameter `comment_id` in an upcoming patch which introduces the comments detail endpoint. This doesn't affect the user-facing API. Signed-off-by: Raxel Gutierrez Reviewed-by: Stephen Finucane --- patchwork/api/comment.py | 6 +++--- patchwork/api/patch.py | 2 +- patchwork/tests/api/test_comment.py | 4 ++-- patchwork/urls.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/patchwork/api/comment.py b/patchwork/api/comment.py index 43b26c6..0c578b4 100644 --- a/patchwork/api/comment.py +++ b/patchwork/api/comment.py @@ -102,12 +102,12 @@ class PatchCommentList(ListAPIView): search_fields = ('subject',) ordering_fields = ('id', 'subject', 'date', 'submitter') ordering = 'id' - lookup_url_kwarg = 'pk' + lookup_url_kwarg = 'patch_id' def get_queryset(self): - if not Patch.objects.filter(pk=self.kwargs['pk']).exists(): + if not Patch.objects.filter(id=self.kwargs['patch_id']).exists(): raise Http404 return PatchComment.objects.filter( - patch=self.kwargs['pk'] + patch=self.kwargs['patch_id'] ).select_related('submitter') diff --git a/patchwork/api/patch.py b/patchwork/api/patch.py index 9d22275..a97a882 100644 --- a/patchwork/api/patch.py +++ b/patchwork/api/patch.py @@ -97,7 +97,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer): def get_comments(self, patch): return self.context.get('request').build_absolute_uri( - reverse('api-patch-comment-list', kwargs={'pk': patch.id})) + reverse('api-patch-comment-list', kwargs={'patch_id': patch.id})) def get_check(self, instance): return instance.combined_check_state diff --git a/patchwork/tests/api/test_comment.py b/patchwork/tests/api/test_comment.py index 5bbebf2..59450d8 100644 --- a/patchwork/tests/api/test_comment.py +++ b/patchwork/tests/api/test_comment.py @@ -90,7 +90,7 @@ class TestPatchComments(utils.APITestCase): kwargs = {} if version: kwargs['version'] = version - kwargs['pk'] = patch.id + kwargs['patch_id'] = patch.id return reverse('api-patch-comment-list', kwargs=kwargs) @@ -142,5 +142,5 @@ class TestPatchComments(utils.APITestCase): def test_list_invalid_patch(self): """Ensure we get a 404 for a non-existent patch.""" resp = self.client.get( - reverse('api-patch-comment-list', kwargs={'pk': '99999'})) + reverse('api-patch-comment-list', kwargs={'patch_id': '99999'})) self.assertEqual(status.HTTP_404_NOT_FOUND, resp.status_code) diff --git a/patchwork/urls.py b/patchwork/urls.py index 6ac9b81..1e6c12a 100644 --- a/patchwork/urls.py +++ b/patchwork/urls.py @@ -332,7 +332,7 @@ if settings.ENABLE_REST_API: api_1_1_patterns = [ path( - 'patches//comments/', + 'patches//comments/', api_comment_views.PatchCommentList.as_view(), name='api-patch-comment-list', ), From patchwork Fri Aug 13 05:31:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raxel Gutierrez X-Patchwork-Id: 1516540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=XwSMz47g; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GmBzC1mfPz9t2b for ; Fri, 13 Aug 2021 15:32:55 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GmBzC11wRz3cHd for ; Fri, 13 Aug 2021 15:32:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=XwSMz47g; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--raxel.bounces.google.com (client-ip=2607:f8b0:4864:20::f4a; helo=mail-qv1-xf4a.google.com; envelope-from=36amwyqukcvcgzm3a5dd5a3.1dbezi16ldg9a7hih.doaz0h.dg5@flex--raxel.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=XwSMz47g; dkim-atps=neutral Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GmByh477bz302N for ; Fri, 13 Aug 2021 15:32:27 +1000 (AEST) Received: by mail-qv1-xf4a.google.com with SMTP id a17-20020a0cefd10000b0290341c3c56ff4so6079322qvt.19 for ; Thu, 12 Aug 2021 22:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ZxY4+rzLWRS8vK8odFksFMJNGMJK56lqJBKveJeABZA=; b=XwSMz47gSbjH5tXHB7BZAEy2GKzWYPtoVm5ntjxwlUl4p648Gbo97LDBoN/VVTdZ+k MqrcVQGQFkmNcucZ/DKuz3mxmbk1WxMZSiDvuAI4PQ5Mx1SUzzj+t8ecoc5u9d5q3nC1 vJv2iaLv33tVt3oaVZbJMTeoIr6s6B4xX8buKfUgzpIpC3rOhPWVZWhf7dLDrT8JiXcy yyQqaraYzNNXHsBX9jgDk8FThxzrGyo2CxhUEP5Wsmtn6Y0SR6MTnKa0eBGiMFYS1IRE 6Nhj8KnVRXi4Eq5ZdTOeHvNMazJQHhr+iYFbd2k/wW1OoqNLW2deK2GEbv4Em7lhwVkK UcIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZxY4+rzLWRS8vK8odFksFMJNGMJK56lqJBKveJeABZA=; b=Y1xRKr5tk4KjhpnaxUqqlbYP+aBr3+3mmxA1IEHIzOujz5TC3UAziND+vum+u1ZWxs N1BRAoNHvgAI/2GWngBMNi21Bx1KhzqzpSZhkmHnKyIb3ponq8MUMqCRaOdZS2yN7gJF fblj9Ze/7LF4qm1hRtQQYXVSaw9SoqKS6aEvx7klc/EORRM1sv81UEG5Bq4ZFKl142Z0 5hI6LL1qHf73FZ3d2OeipeDdPYZEw5gtGFCIsPYwO6LIIYVYJ+19g8X0TjT3gzKTllSK Ir4/kOU9kj/i99ur7D7i5DreG+G/Bxm+ZZ9CpG2fnpGKRFpm7xfbWfMBztak3I2fqGrv aLYQ== X-Gm-Message-State: AOAM533RxTQmbrv4rbBIRsghZGAhCvxhBtlVHXAjnsLhBwTcz5teFJL+ Q8AkJOWCIWvb3tqOAROC94gjdQsexl/eqwCbLNsSCucnMVY9CXcfv1rZj26pPQUyNGIPHaXpPP+ kqExQhsxYIJqE7rxodl1HpW/cFVJdYi2FJJSrJVfsGS93AIUWb5SbeKdMWN/8u7IP X-Google-Smtp-Source: ABdhPJxs+nIFRwFz8N/AJBN6L5AxM9GO9sXXr1qHv75Lip+xLM0+BG9OTV66Ggl5uaRV9dtucdkVG9BR7g== X-Received: from raxel-pw.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2fda]) (user=raxel job=sendgmr) by 2002:a05:6214:f0a:: with SMTP id gw10mr937596qvb.27.1628832744811; Thu, 12 Aug 2021 22:32:24 -0700 (PDT) Date: Fri, 13 Aug 2021 05:31:19 +0000 In-Reply-To: <20210813053127.2160595-1-raxel@google.com> Message-Id: <20210813053127.2160595-3-raxel@google.com> Mime-Version: 1.0 References: <20210813053127.2160595-1-raxel@google.com> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog Subject: [PATCH v3 02/10] patch-detail: clean up patch detail page template From: Raxel Gutierrez To: patchwork@lists.ozlabs.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Clean up submission.html to have hyphen-delimited id and class selectors names for better readability and code health. Signed-off-by: Raxel Gutierrez --- htdocs/css/style.css | 6 ++-- patchwork/templates/patchwork/submission.html | 31 +++++++------------ templates/base.html | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/htdocs/css/style.css b/htdocs/css/style.css index 243caa0..46a91ee 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/style.css @@ -182,17 +182,17 @@ input#reorder-change { } /* patch view */ -table.patchmeta th { +table.patch-meta th { text-align: left; } -table.patchmeta tr th, table.patchmeta tr td { +table.patch-meta tr th, table.patch-meta tr td { text-align: left; padding: 1px 10px; vertical-align: top; } -.submissionlist ul { +.submission-list ul { list-style-type: none; padding: 0; margin: 0; diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index 978559b..2e457cf 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -32,7 +32,7 @@ function toggle_div(link_id, headers_id, label_show, label_hide)

{{ submission.name }}

- +
{% if submission.list_archive_url %} @@ -61,12 +61,11 @@ function toggle_div(link_id, headers_id, label_show, label_hide) {% endif %} - {% if submission.series %} @@ -76,10 +75,8 @@ function toggle_div(link_id, headers_id, label_show, label_hide) {{ submission.series.name }} | - expand -
Message ID
Headersshow - + + show +
Related - show -
Headers - show + @@ -62,7 +62,7 @@ {{ submission.series.name }} | - expand +
Related - show +