After updating to the latest -dev release, I was surprised to see a red admin menu. It didn't take long to find out it was because of #451270: Add visual indication when working as uid 1. Now, what I'm more interested in is flagging weather I'm on my local development copy of the site, the one on the staging server, or the live sitem, and a colorised admin menu bar it seems like the perfect way to do it. How would admin_menu know which version of the site I'm on - I have no idea! analysing the domain name perhaps? An admin setting? I don't know, but it sure would be a nice feature!

Comments

webchick’s picture

If admin menu placed a nice ID or class around the top bar with the site URL, then sites could put:

#dev-example-com .admin_menu { color: "bright, blinding red"; }
#example-com { color: "normal grey"; }
#localhost-example { color: "potato"; }

Into their theme's style.css. Not optimal because it would need to be in both the user-facing theme and the admin theme, but...

mrfelton’s picture

yeah, that could work

sun’s picture

Status: Active » Needs review
StatusFileSize
new810 bytes
sun’s picture

Alternative: Apply this class via JS. (would overcome the edge case of a stale cache after mirroring a site from production to staging/development server).

sun’s picture

Status: Needs review » Fixed
Issue tags: +revisit before beta

Not really sure whether I like this entire suggestion, issue, and patch, and whether it's not complete nonsense, but for now, I've committed attached patch to all 3.x branches. Note, however, that I'll revisit this later on.

Thanks for reporting, reviewing, and testing!

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

sun’s picture

StatusFileSize
new1.07 KB

oops, here's the patch ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mrfelton’s picture

FYI: I created environment_indicator for this purpose.

emmonsaz’s picture

Issue summary: View changes
StatusFileSize
new876 bytes

Instead of coloring the entire bar (which seems overkill for my tastes), I like the original environment_indicator design option to include a colored button instead: https://vimeo.com/63042899#t=13m32s

However, that doesn't seem to be an option anymore so I've created this patch to simulate the behavior. Note: this is draft quality -- a cleaner solution would move the styling into a CSS file, but I didn't want to modify too many files if no one needed this but me.

Here's the corresponding sample settings.php code:
$conf['admin_menu_environment'] = array('title' => 'local', 'color' => '#0073ba');