From nobody Sat Apr 20 02:57:24 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1660310393; cv=none; d=zohomail.com; s=zohoarc; b=TFcObiFbl/pz7QViXwTzf1QZHVwpbPKxR3pj1O0kPoji7LQM5PM5DK64/VjXkiQL/HW/hZxopam8M8K9PBUh5s7zgLa//uM2V0WX3pAXnGukuT2lys3Hzg/NONzW4R69aqPjqCdQvo7bc4XF3+5qgtJH0W5hds1RjhdgV1xMiZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660310393; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=p6ggjw/Dq1yRCdfzbGey0nBwCfmFIP+hoAShDjWssX8=; b=eDUgKnNSoABMskWnYZ74QHKOHBix53Z9fPpZvHiCVE4p+dzs+LtBSN6xOu829okDn86zIqjCT9UZSdQy60ViTdsuDlgbzjY1bejcZUM3P7ntBPrPq/Dvvq71e6rqSf86uuXPJIVGLBdfU/NyeMBeFtIUu/yFVP3AxTAvt47Zr78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1660310393311268.93952864041614; Fri, 12 Aug 2022 06:19:53 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-BR5A1YPhOLuPC42feQSoZQ-1; Fri, 12 Aug 2022 09:19:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0642F811E7A; Fri, 12 Aug 2022 13:19:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F36BF407F3A6; Fri, 12 Aug 2022 13:19:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ABF011946A42; Fri, 12 Aug 2022 13:19:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 972451946A41 for ; Fri, 12 Aug 2022 13:19:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 83FA5407F3A7; Fri, 12 Aug 2022 13:19:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 807CA407F3A6 for ; Fri, 12 Aug 2022 13:19:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 671CD3802B89 for ; Fri, 12 Aug 2022 13:19:44 +0000 (UTC) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-641-hqDGgQJiOF-NE7066dGPuA-1; Fri, 12 Aug 2022 09:19:43 -0400 Received: by mail-wr1-f72.google.com with SMTP id i16-20020adfaad0000000b002207af3c7b2so133015wrc.14 for ; Fri, 12 Aug 2022 06:19:43 -0700 (PDT) Received: from goa-sendmail ([93.56.170.129]) by smtp.gmail.com with ESMTPSA id m2-20020adfdc42000000b0021e47fb24a2sm2107892wrj.19.2022.08.12.06.19.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 06:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660310391; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=p6ggjw/Dq1yRCdfzbGey0nBwCfmFIP+hoAShDjWssX8=; b=QZgop8AMrRMeUAJUnDdp+F1WH+dIWm98G3hEGO9cWhITSukindvKgognP7VAG6BKyAyGIt VNkDXAeT04KxByIZEQYgGecbdXWzdJVvapZu5a5qoqf2JMY7X4UCoQLUTTOtk4wC05USFK zsYor1zmT+keb+4pRam7Vq6S1HXNzpw= X-MC-Unique: BR5A1YPhOLuPC42feQSoZQ-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: hqDGgQJiOF-NE7066dGPuA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=kWPJ6/8K+P4Gd0CJdjTjFuCzPTII5AGYNJPwpwrvjHw=; b=PeGmXVmNhKGbrh50EhD33MFV9NXuzsnBH8X6Q44nHhrd6QZ7z2QTwCOqjqmLFa3Dwd JCR4gYSPNbKNQkDYqy6bOWFDwz/9DZvXVH/Ut3tkYLKJDF3hIzoQUse10lP9eILOUbv2 EvK9im7nZ+JMjO4MBqO8Gg9+zL9cEGNapA7rFXxDCAtLucpChC4ighJ0Q8/pzeYKivbd +n+DRZUxyj1UnaIzAkaKJh6hJRMDC2eXZUjbat2q8apHzEZtZJkTcG8IuF9f66LHNpIl FAEntb04/elofb4kxblnP2SpANrmk5QdTO2pcYZKEZx+Pk/Z12h3jDwAMmAEGbtRPzLS 3aLw== X-Gm-Message-State: ACgBeo0OVXqu1ZOcveBPyGlWNnUBg1oicYRi47fnsYrfYmcztr6ZdgKM yRc/063spqHJIpghQMlfordPbUDb7kKHmeLqpyH0X5Nvi4+ij2I/OKOFjo3j+3nsabtW02nGZbA ur2aShPfTU2EnL0VYjT1nCqLCnHe3n19NZv5V3Y6kzdSoYlbr/nHUw+lKngnD3hhtHGx/CyMkiQ == X-Received: by 2002:a05:6000:185:b0:21e:d661:9ac5 with SMTP id p5-20020a056000018500b0021ed6619ac5mr2132527wrx.649.1660310381940; Fri, 12 Aug 2022 06:19:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Oz56/mKo/I3wvBRjZWHvlj20a2CigD/ozaqlUA9rbUAUoqJC+U3s0kjx8VNh51mfe263Sdw== X-Received: by 2002:a05:6000:185:b0:21e:d661:9ac5 with SMTP id p5-20020a056000018500b0021ed6619ac5mr2132519wrx.649.1660310381689; Fri, 12 Aug 2022 06:19:41 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Fri, 12 Aug 2022 15:19:40 +0200 Message-Id: <20220812131940.195685-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Subject: [Patchew-devel] [PATCH] tags: provide quick access to the newest version of a series X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1660310394722100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/tags.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mods/tags.py b/mods/tags.py index f60abb4..3e667ec 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -13,8 +13,13 @@ from mbox import addr_db_to_rest, parse_address from event import register_handler, emit_event, declare_event from api.models import Message from api.rest import PluginMethodField + +from django.urls import reverse +from django.utils.html import format_html + import rest_framework =20 + REV_BY_PREFIX =3D "Reviewed-by:" BASED_ON_PREFIX =3D "Based-on:" SUPERSEDES_PREFIX =3D "Supersedes:" @@ -189,12 +194,30 @@ series cover letter, patch mail body and their replie= s. ) =20 if message.is_obsolete: + latest_url =3D reverse( + "series_detail", + kwargs=3D{ + "project": message.project.name, + "message_id": message.topic.latest.message_id, + }, + ) + message.status_tags.append( { "title": "Has a newer version: " + message.topic.lates= t.subject, "type": "secondary", "char": "O", "row_class": "obsolete", + "url": latest_url, + } + ) + message.extra_status.append( + { + "icon": "fa-redo-alt", # aka rotate-right in newer ve= rsions + "html": format_html( + 'There is a newer version of th= is series', + latest_url, + ), } ) =20 --=20 2.37.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel