#360 Tranfer the hub edit mode to the widgets
Merged by abompard. Opened by abompard.
abompard/fedora-hubs edit-mode-widgets  into  develop

Download 360.patch

Some widgets display no chrome when there is no data. However, in edit mode, the chrome should be displayed anyway or the widget can't be configured, removed, or moved on the page.

This change allows widgets to be informed of the display mode and display the panel chrome accordingly.

This is tiny nitpick, but I recommend using False rather than an empty string here (unless there's a reason not to that I'm not seeing). I know empty strings cast to False`, but usingFalse`` explicitly is easier to read.

Small nitpick, but otherwise looks good. Feel free to take or leave my suggestion and merge when ready!

Looks good to me.

@jcline: my reasoning here is that what we would get from the URL's query string is an empty string if the edit mode is off. I always try to have the second argument of .get() be as similar as possible (at least of the same type) as what I would get if there was an actual value.
It comes from a bad experience where I once used .get("arg", False) in a query string and forgot to convert it to boolean, which worked when arg was absent but failed in some cases.

Actually, now that I think of it, I should use the type keyword of args.get()

I'll change that and merge the PR.

@abompard That's a fair argument for the stringy approach and wasn't something I considered. Also, I didn't know about the type keyword either, it looks nice!

rebased

Pull-Request has been merged by abompard

Metadata