From patchwork Mon Jul 19 23:34:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raxel Gutierrez X-Patchwork-Id: 1507321 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=lXwjfl8Z; 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 4GTJBW66rYz9sRR for ; Tue, 20 Jul 2021 09:36:03 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GTJBW4xcxz3bTf for ; Tue, 20 Jul 2021 09:36:03 +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=lXwjfl8Z; 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::849; helo=mail-qt1-x849.google.com; envelope-from=3wgz2yaukcvki1o5c7ff7c5.3fdg1k38nfibc9jkj.fqc12j.fi7@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=lXwjfl8Z; dkim-atps=neutral Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) (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 4GTJBP0McDz3bT5 for ; Tue, 20 Jul 2021 09:35:57 +1000 (AEST) Received: by mail-qt1-x849.google.com with SMTP id j16-20020ac855100000b029025bf786be09so10599009qtq.20 for ; Mon, 19 Jul 2021 16:35:56 -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=xch3p7E4LOCJprFSxnEkypaNhM86l1z2rp1ppGytIgE=; b=lXwjfl8ZVWlczZT9pWSRdJtMPns2eM+eh31rx+VqzuLSdYBpk8tH20YOQsg2Pq2bZL uGOgdZpEHLVwI4Y5SvbJhwHiCeerRgMWzpjaoso36KtPRQPU6Tir/VduuyPM11G09bol I/7w9cBR6occguin+92YehA0PfnbxxaNJf38MDZ8zp67elNv7PvJ2wkJvHjiGvkolIFI 9Ez8QhqGcAMDy5nDMyhIoveGepXnG4G2GYHua+s44Y1F+2psXoL5/32E3/Mb6O752luy 81JOpf5yjtnFhb2aN+Z08bqyg1AQh3xA4wmD0FifcNt+9OqjNG8u1h8Sz3a2Gv3JjK3o 7PFQ== 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=xch3p7E4LOCJprFSxnEkypaNhM86l1z2rp1ppGytIgE=; b=eNsLDusMvPOD46HLYUJlXtsQfWJztnbDN6wJN9E3XNUJX//VQxcYVGaVQMANjhwKfA 3ze4gbGYwzaPiKeT+8WuTzgJ8zVa4NQStRgn7qT2v1JDPyBg67YBbqShLG0gGmC/aKs9 2UZF5BssDWOQ2IJN3LLFrxvhZw52/vZyfucfw9JB4q2N+nSmgfLJO8e5hLzkrf1Butmz icdKvJu3zN5ADJ7DpGE0CbWjU5qi2CkwQJ1g9fKV6ChSxb8pMxBnSZmKr6h6L8HzLi/A W5EPQZN1wYuqT9bjrxZeqTvqjuv/QIHCXR5eF+unh+zsjVJc1SsKlJDdW+mV+1PQdJ1R SbzA== X-Gm-Message-State: AOAM531u2FYDRL64yF6utSfCSStPstAXe0nbxKlzK2gddGOEiUFiSEr+ Uh1vHhdfsS7XLYvol3uD3h499fihy2+FKLgjaDPHRXTSMPbpK5fa5RtJwi2puTPaMFJWYXWAAyc YuLE6A2jn52zF8ODEZ/6lo5bGjpZpHZppbcK/zejf0DgMKLWqS85nNaM9tQTFrk4C X-Google-Smtp-Source: ABdhPJxnuw/uYlknGfeVCr5bdc/HOXAz+lo1Kzs+LgEpzs3fRfxOpOzg9rDQZuaUAse/CoWK3SP8Ptlx5g== X-Received: from raxel-pw.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2fda]) (user=raxel job=sendgmr) by 2002:a05:6214:188c:: with SMTP id cx12mr19707644qvb.7.1626737754430; Mon, 19 Jul 2021 16:35:54 -0700 (PDT) Date: Mon, 19 Jul 2021 23:34:26 +0000 In-Reply-To: <20210719233428.2045872-1-raxel@google.com> Message-Id: <20210719233428.2045872-4-raxel@google.com> Mime-Version: 1.0 References: <20210719233428.2045872-1-raxel@google.com> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog Subject: [PATCH 3/5] patch-list: improved list action bar ui 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" Added styling to the new patch list html code to make the change property and bundle action forms more usable. Post in mailing list about the design mockups shows how the new UI looks[1]. [1] https://lists.ozlabs.org/pipermail/patchwork/2021-July/006943.html Signed-off-by: Raxel Gutierrez --- htdocs/css/style.css | 64 +++++++++++++++++++++++++++----------------- patchwork/forms.py | 27 ++++++++++++++----- 2 files changed, 59 insertions(+), 32 deletions(-) diff --git a/htdocs/css/style.css b/htdocs/css/style.css index 243caa0..8746083 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/style.css @@ -1,3 +1,7 @@ +:root { + --light-color: #F7F7F7; +} + h2 { font-size: 25px; margin: 18px 0 18px 0; @@ -122,10 +126,6 @@ a.colinactive:hover { div.filters { } -div.patchforms { - margin-top: 1em; -} - /* list order manipulation */ table.patchlist tr.draghover { @@ -149,7 +149,7 @@ input#reorder-change { .paginator { text-align: right; clear: both; - margin: 8px 0 15px; + margin: 8px 0 15px; } .paginator .prev-na, @@ -346,40 +346,54 @@ table.bundlelist td padding-right: 2em; } +.patch-list-actions { + width: 100%; + display: inline-flex; + flex-wrap: wrap; + justify-content: space-between; +} + /* forms that appear for a patch */ +.patchforms { + display: inline-flex; + flex-wrap: wrap; + margin: 16px 0px; +} + div.patchform { - border: thin solid #080808; - padding-left: 0.6em; - padding-right: 0.6em; - float: left; - margin: 0.5em 5em 0.5em 10px; + display: flex; + flex-wrap: wrap; + align-items: center; } -div.patchform h3 { - margin-top: 0em; - margin-left: -0.6em; - margin-right: -0.6em; - padding: 0.3em 0.3em 0.3em 0.6em; - background-color: #222; - color: #999; - font-size: 100%; +.change-property, .archive-patch, .add-bundle { + padding: 4px; + margin-right: 8px; + box-sizing: border-box; + border-radius: 4px; + background-color: var(--light-color); } -div.patchform ul { - list-style-type: none; - padding-left: 0.2em; - margin-top: 0em; +.patchform-submit { + font-weight: bold; + padding: 4px; +} + +#patchform-bundle, #add-to-bundle, #remove-bundle { + margin-left: 16px; } -/* forms */ -table.form { +.create-bundle { + padding: 4px; + margin-right: 8px; + box-sizing: border-box; + border-radius: 4px; } span.help_text { font-size: 80%; } - table.form td { padding: 0.6em; vertical-align: top; diff --git a/patchwork/forms.py b/patchwork/forms.py index 24322c7..b684026 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -122,10 +122,11 @@ class PatchForm(forms.ModelForm): class OptionalModelChoiceField(forms.ModelChoiceField): - no_change_choice = ('*', 'no change') + no_change_choice = ('*', 'No change') to_field_name = None - def __init__(self, *args, **kwargs): + def __init__(self, placeholder, *args, **kwargs): + self.no_change_choice = ('*', placeholder) super(OptionalModelChoiceField, self).__init__( initial=self.no_change_choice[0], *args, **kwargs) @@ -161,17 +162,29 @@ class OptionalBooleanField(forms.TypedChoiceField): class MultiplePatchForm(forms.Form): action = 'update' archived = OptionalBooleanField( - choices=[('*', 'no change'), ('True', 'Archived'), - ('False', 'Unarchived')], + choices=[('*', 'No change'), ('True', 'Archive'), + ('False', 'Unarchive')], coerce=lambda x: x == 'True', - empty_value='*') + empty_value='*', + label="Archived") def __init__(self, project, *args, **kwargs): super(MultiplePatchForm, self).__init__(*args, **kwargs) self.fields['delegate'] = OptionalModelChoiceField( - queryset=_get_delegate_qs(project=project), required=False) + queryset=_get_delegate_qs(project=project), + placeholder="Delegate to", + label="Delegate to", + required=False) self.fields['state'] = OptionalModelChoiceField( - queryset=State.objects.all()) + queryset=State.objects.all(), + placeholder="Change state", + label="Change state") + self.fields['state'].widget.attrs.update( + {'class': 'change-property'}) + self.fields['delegate'].widget.attrs.update( + {'class': 'change-property'}) + self.fields['archived'].widget.attrs.update( + {'class': 'archive-patch'}) def save(self, instance, commit=True): opts = instance.__class__._meta