Browse Source

Implements action colors as per style guide. Fixes bug 921741.

Change-Id: I84cfe9d4ed3c6ae60e6532ec420880bc5cc45fa9
Gabriel Hurley 7 years ago
parent
commit
166ec2f295

+ 1
- 1
horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py View File

@@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__)
32 32
 class AllocateIP(tables.LinkAction):
33 33
     name = "allocate"
34 34
     verbose_name = _("Allocate IP To Tenant")
35
-    attrs = {"class": "ajax-modal btn primary small"}
35
+    attrs = {"class": "ajax-modal btn small"}
36 36
     url = "horizon:nova:access_and_security:floating_ips:allocate"
37 37
 
38 38
     def single(self, data_table, request, *args):

+ 1
- 1
horizon/horizon/dashboards/syspanel/users/tables.py View File

@@ -17,7 +17,7 @@ class CreateUserLink(tables.LinkAction):
17 17
     verbose_name = _("Create User")
18 18
     url = "horizon:syspanel:users:create"
19 19
     attrs = {
20
-        "class": "ajax-modal btn primary small",
20
+        "class": "ajax-modal btn small",
21 21
     }
22 22
 
23 23
 

+ 1
- 1
horizon/horizon/tables/actions.py View File

@@ -42,7 +42,7 @@ class BaseAction(object):
42 42
 
43 43
     def __init__(self):
44 44
         self.attrs = getattr(self, "attrs", {})
45
-        self.classes = []
45
+        self.classes = getattr(self, "classes", [])
46 46
 
47 47
     def allowed(self, request, datum):
48 48
         """ Determine whether this action is allowed for the current request.

+ 38
- 17
openstack-dashboard/dashboard/static/dashboard/css/style.css View File

@@ -754,6 +754,22 @@ td.actions_column {
754 754
   min-height: 20px;
755 755
 }
756 756
 
757
+td.actions_column .row_actions a,
758
+td.actions_column .row_actions input,
759
+td.actions_column .row_actions button {
760
+  background: none;
761
+  float: none;
762
+  display: block;
763
+  padding: 5px 10px;
764
+  color: black;
765
+  text-align: left;
766
+  border-radius: 0;
767
+  border: 0 none;
768
+  -webkit-box-shadow: none;
769
+  -moz-box-shadow: none;
770
+  box-shadow: none;
771
+}
772
+
757 773
 /* Makes size consistent across browsers when mixing "btn-group" and "small" */
758 774
 .btn-group > .btn.small {
759 775
   height: 12px;
@@ -768,27 +784,32 @@ td.actions_column {
768 784
 }
769 785
 .dropdown-menu button {
770 786
   line-height: 18px; /* Matches rule for ".dropdown-menu a" in bootstrap */
787
+  width: 100%;
771 788
 }
772
-
773
-td.actions_column ul.row_actions li:hover {
774
-  background-color: #cdcdcd;
789
+.btn-group .dropdown-menu .btn {
790
+  border-radius: 0;
775 791
 }
776
-
777
-td.actions_column ul.row_actions a,
778
-td.actions_column ul.row_actions input,
779
-td.actions_column ul.row_actions button {
792
+.dropdown-menu .btn.danger,
793
+.dropdown-menu .btn.danger:hover,
794
+.dropdown-menu .btn.success,
795
+.dropdown-menu .btn.success:hover,
796
+.dropdown-menu .btn.info, .btn.info:hover {
797
+  text-shadow: none; /* remove default bootstrap shadowing from button text. */
798
+}
799
+.dropdown-menu li:hover {
780 800
   background: none;
781
-  float: none;
782
-  display: block;
783
-  padding: 5px 10px;
784
-  color: black;
785
-  text-align: left;
786
-  border-radius: 0;
787
-  border: 0 none;
788
-  -webkit-box-shadow: none;
789
-  -moz-box-shadow: none;
790
-  box-shadow: none;
791 801
 }
802
+td.actions_column .dropdown-menu a:hover,
803
+td.actions_column .dropdown-menu button:hover {
804
+  background-color: #CDCDCD;
805
+}
806
+.dropdown-menu .btn.danger {
807
+  color: #C43C35;
808
+}
809
+.dropdown-menu .btn.danger:hover {
810
+  background-color: #f6e0df;
811
+}
812
+
792 813
 
793 814
 /* Overrides for single-action rows (no dropdown) */
794 815
 

Loading…
Cancel
Save