Commits

ewdurbin committed 0cab60b

rework logic and styling for status box

Comments (0)

Files changed (2)

static/styles/styles.css

 }
 
 /* Document Navigation */
-#status h4
-{
-  font-family: Arial, Verdana, Geneva, "Bitstream Vera Sans", Helvetica, sans-serif;
-  font-size: 94%;
-  font-weight: bold;
-  padding: 3px 0 4px 12px;
-  margin:0 0 0 0;
-  text-align: left;
-  z-index: 0;
-  color:#FFFFFF;
-  -moz-border-radius-topleft: 11px;
-  background-color: #FC234A;
-}
-
 #document-navigation h4 a, .homepage-box h4 a, .externallinks h4 a
 {
   background: #4C83A3;

templates/standard_template.pt

           // <![CDATA[
           successCallback: function(data) {
             if (data.incidents.length > 0) {
-              var div = document.getElementById('status');
-              var reports = "</br><h4 class='status'>Status</h4>\n";
+              var div = document.getElementById('statusdiv');
+              var reports = "</br><h4 id='statusbox'>Status</h4>\n";
+              var outage = 0;
+              var maintenance = 0;
               for (i in data.incidents) {
                 var incident = data.incidents[i];
                 var message, status = incident.status;
                 if (status === 'scheduled') {
                   message = '<li><a href="' + incident.shortlink + '">' + incident.name + ' scheduled.</a></li>\n';
                   reports += message;
+                  maintenance += 1;
                 } else if (status === 'in_progress') {
                   message = '<li><a href="' + incident.shortlink + '">' + incident.name + ' is currently in progress.' + '</a></li>\n';
                   reports += message;
+                  maintenance += 1;
                 } else if (status !== 'resolved' && status !== 'postmortem' && status !== 'completed') {
                   message = '<li><a href="' + incident.shortlink + '">' + incident.name + ': ' + incident.status + '</a></li>\n';
                   reports += message;
+                  outage += 1;
                 }
               }
+              if (outage + maintenance === 0) {
+                reports += "<li><a href='http://status.python.org'>Nothing to report</a></li>";
+              }
               div.innerHTML=reports;
+              if (outage > 0) {
+                var statusbox = document.getElementById("statusbox");
+                statusbox.style.background = '#FC234A';
+              }
             }
           }
           // ]]>