Le samedi 29 septembre 2018 à 14:07:03+0200, Mattia Rizzolo a écrit :
> Hi!
> 
> On Mon, Aug 27, 2018 at 11:02:42PM +0200, Pierre-Elliott Bécue wrote:
> > Here is a rough skeleton of patch.
> 
> Thank you for it!
> 
> > I'd just like to hear if the idea seems fine with you. It's supposed to rely
> > on django.contrib.messages that seems implemented in
> > deblayout/templates/debian-base.html.
> 
> Right.  do you also have some way to show how it displays?

I don't know how much work it requires to set up a nm.d.o instance for
testing purposes, but if that helps I can definitely give it a try.

> I tried myself injecting a "message" in a random place and it looked not
> styled at all, which is a pity.
> 
> I'd say it should at least in a similar way as e.g.
> https://nm.debian.org/process/503/keycheck the yellow/orange box.  it
> seems to be because using having messages.ERROR adds "error" to the tags
> and so it doesn't "fallback" to the "important" tags that is used as a
> css class.
> Do you think we should just add an error class to the CSS?  or maybe
> just adding "important" to the tags in the add_message() call.

This is an interesting question.

The way the important div is handled is by getting intel from the context
data to determine either or not it should be disclosed.

In our case, we could definitely do something comparable (we'd have to pass
data through redirect but even though I'm not certain, I think django is
able to do such thing).

BUT.

It'd require a lot more code alteration, to handle a runtime error properly,
while d.c.messages is suited for such thing.

I'd consider either use the same CSS code for important and error, or take
benefit from this opportunity to put in place the message CSS classes.

If you wish I can definitely put the CSS alterations alongside with my
patch.

> Anyway, I like the proposal, please propose further :)

Ack, then we can try to enhance this patch to make it fit your needs and
comply with the coding style of nm.d.o.

Cheers!

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.

Attachment: signature.asc
Description: PGP signature

Reply via email to