From 2a15e239c3c381d4a751cdbeba281e0557618869 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 22 Oct 2014 20:28:16 -0700 Subject: [PATCH] Improved state card --- .../http/www_static/polymer/state-card.html | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/http/www_static/polymer/state-card.html b/homeassistant/components/http/www_static/polymer/state-card.html index ad618a7372d..95470205e61 100755 --- a/homeassistant/components/http/www_static/polymer/state-card.html +++ b/homeassistant/components/http/www_static/polymer/state-card.html @@ -10,15 +10,16 @@ :host { position: relative; background-color: white; - padding: 20px 20px 50px 20px; + padding: 20px 20px 55px 20px; width: 100%; - font-weight: 300; border-radius: 2px; } .header { text-transform: capitalize; + font-weight: 300; + font-size: 1.5rem; } @@ -27,8 +28,22 @@ color: darkgrey; } - .content { + .state-attributes { margin-top: 10px; + font-size: 1rem; + } + + .state-attributes .key { + white-space: nowrap; + width: 85px; + float: left; + clear: left; + overflow: hidden; + text-overflow: ellipsis; + } + + .state-attributes .value { + margin-left: 95px; } .actions { @@ -47,7 +62,10 @@
- {{entity_id | makeReadable}} + + + + {{state | makeReadable}}
@@ -59,9 +77,12 @@ -
+
@@ -128,7 +149,15 @@ // used as filter makeReadable: function(value) { - return value.replace("_", " ") + if(typeof value == "string") { + return value.replace(/_/g, " "); + + } else if(Array.isArray(value)) { + return value.join(", "); + + } else { + return value; + } }, objectKeys: function(obj) {