From 166ec2f29550bcc863813861314cf5709246e5b6 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Wed, 25 Jan 2012 14:58:22 -0800 Subject: [PATCH] Implements action colors as per style guide. Fixes bug 921741. Change-Id: I84cfe9d4ed3c6ae60e6532ec420880bc5cc45fa9 --- .../floating_ips/tables.py | 2 +- .../dashboards/syspanel/users/tables.py | 2 +- horizon/horizon/tables/actions.py | 2 +- .../dashboard/static/dashboard/css/style.css | 57 +++++++++++++------ 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py b/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py index 02012757fc..8309e4aa3d 100644 --- a/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py +++ b/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) class AllocateIP(tables.LinkAction): name = "allocate" verbose_name = _("Allocate IP To Tenant") - attrs = {"class": "ajax-modal btn primary small"} + attrs = {"class": "ajax-modal btn small"} url = "horizon:nova:access_and_security:floating_ips:allocate" def single(self, data_table, request, *args): diff --git a/horizon/horizon/dashboards/syspanel/users/tables.py b/horizon/horizon/dashboards/syspanel/users/tables.py index a5091f8353..6d62282395 100644 --- a/horizon/horizon/dashboards/syspanel/users/tables.py +++ b/horizon/horizon/dashboards/syspanel/users/tables.py @@ -17,7 +17,7 @@ class CreateUserLink(tables.LinkAction): verbose_name = _("Create User") url = "horizon:syspanel:users:create" attrs = { - "class": "ajax-modal btn primary small", + "class": "ajax-modal btn small", } diff --git a/horizon/horizon/tables/actions.py b/horizon/horizon/tables/actions.py index f90c55156f..64c08d6d3d 100644 --- a/horizon/horizon/tables/actions.py +++ b/horizon/horizon/tables/actions.py @@ -42,7 +42,7 @@ class BaseAction(object): def __init__(self): self.attrs = getattr(self, "attrs", {}) - self.classes = [] + self.classes = getattr(self, "classes", []) def allowed(self, request, datum): """ Determine whether this action is allowed for the current request. diff --git a/openstack-dashboard/dashboard/static/dashboard/css/style.css b/openstack-dashboard/dashboard/static/dashboard/css/style.css index a4ba9c020b..50d159c9eb 100644 --- a/openstack-dashboard/dashboard/static/dashboard/css/style.css +++ b/openstack-dashboard/dashboard/static/dashboard/css/style.css @@ -754,6 +754,22 @@ td.actions_column { min-height: 20px; } +td.actions_column .row_actions a, +td.actions_column .row_actions input, +td.actions_column .row_actions button { + background: none; + float: none; + display: block; + padding: 5px 10px; + color: black; + text-align: left; + border-radius: 0; + border: 0 none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + /* Makes size consistent across browsers when mixing "btn-group" and "small" */ .btn-group > .btn.small { height: 12px; @@ -768,27 +784,32 @@ td.actions_column { } .dropdown-menu button { line-height: 18px; /* Matches rule for ".dropdown-menu a" in bootstrap */ + width: 100%; } - -td.actions_column ul.row_actions li:hover { - background-color: #cdcdcd; -} - -td.actions_column ul.row_actions a, -td.actions_column ul.row_actions input, -td.actions_column ul.row_actions button { - background: none; - float: none; - display: block; - padding: 5px 10px; - color: black; - text-align: left; +.btn-group .dropdown-menu .btn { border-radius: 0; - border: 0 none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; } +.dropdown-menu .btn.danger, +.dropdown-menu .btn.danger:hover, +.dropdown-menu .btn.success, +.dropdown-menu .btn.success:hover, +.dropdown-menu .btn.info, .btn.info:hover { + text-shadow: none; /* remove default bootstrap shadowing from button text. */ +} +.dropdown-menu li:hover { + background: none; +} +td.actions_column .dropdown-menu a:hover, +td.actions_column .dropdown-menu button:hover { + background-color: #CDCDCD; +} +.dropdown-menu .btn.danger { + color: #C43C35; +} +.dropdown-menu .btn.danger:hover { + background-color: #f6e0df; +} + /* Overrides for single-action rows (no dropdown) */