]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Pretty up the Yammer import status display a bit
authorBrion Vibber <brion@pobox.com>
Fri, 24 Sep 2010 23:15:45 +0000 (16:15 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 28 Sep 2010 14:44:24 +0000 (07:44 -0700)
plugins/YammerImport/actions/yammeradminpanel.php
plugins/YammerImport/css/admin.css
plugins/YammerImport/css/done.png [new file with mode: 0644]
plugins/YammerImport/css/icon_processing.gif [new file with mode: 0644]

index 2c9f412a24f7d68259cef71188e9a3004ccc85db..12df3c20222903ee377a66ba48221c2000f5d255 100644 (file)
@@ -175,32 +175,37 @@ class YammerAdminPanelForm extends AdminForm
         $steps = array_keys($labels);
         $currentStep = array_search($runner->state(), $steps);
 
+        $this->out->elementStart('div', array('class' => 'yammer-import'));
         foreach ($steps as $step => $state) {
             if ($step < $currentStep) {
                 // This step is done
-                $this->progressBar($labels[$state]['label'],
-                                   $labels[$state]['complete'],
-                                   'complete');
+                $this->progressBar($state,
+                                   'complete',
+                                   $labels[$state]['label'],
+                                   $labels[$state]['complete']);
             } else if ($step == $currentStep) {
                 // This step is in progress
-                $this->progressBar($labels[$state]['label'],
-                                   $labels[$state]['progress'],
-                                   'progress');
+                $this->progressBar($state,
+                                   'progress',
+                                   $labels[$state]['label'],
+                                   $labels[$state]['progress']);
             } else {
                 // This step has not yet been done.
-                $this->progressBar($labels[$state]['label'],
-                                   _m("Waiting..."),
-                                   'waiting');
+                $this->progressBar($state,
+                                   'waiting',
+                                   $labels[$state]['label'],
+                                   _m("Waiting..."));
             }
         }
+        $this->out->elementEnd('div');
     }
 
-    private function progressBar($label, $status, $class)
+    private function progressBar($state, $class, $label, $status)
     {
         // @fixme prettify ;)
-        $this->out->elementStart('div', array('class' => $class));
-        $this->out->element('p', array(), $label);
-        $this->out->element('p', array(), $status);
+        $this->out->elementStart('div', array('class' => "import-step import-step-$state $class"));
+        $this->out->element('div', array('class' => 'import-label'), $label);
+        $this->out->element('div', array('class' => 'import-status'), $status);
         $this->out->elementEnd('div');
     }
 
index c1462237a52080dc7514e78c5227915c9945fa94..28d52d07c6db3d5c8d09bf03efb16c7ce84ba15f 100644 (file)
@@ -1,11 +1,58 @@
+.yammer-import {
+    background-color: #eee;
+
+    border: solid 1px;
+    border-radius: 8px;
+    -moz-border-radius: 8px;
+    -webkit-border-radius: 8px;
+    -opera-border-radius: 8px;
+
+    padding: 16px;
+}
+
+.import-step {
+    padding: 8px;
+}
+.import-label {
+    font-weight: bold;
+}
+.import-status {
+    margin-left: 20px;
+    padding-left: 20px;
+}
+
+
 .waiting {
     color: #888;
 }
 
 .progress {
+    background-color: #fff;
+    border-radius: 8px;
+    -moz-border-radius: 8px;
+    -webkit-border-radius: 8px;
+    -opera-border-radius: 8px;
+}
+
+.progress .import-label {
     color: blue;
 }
 
-.done {
+.progress .import-status {
+    background-image: url(icon_processing.gif);
+    background-repeat: no-repeat;
+}
+
+.complete {
     color: black;
 }
+
+.complete .import-status {
+    background-image: url(done.png);
+    background-repeat: no-repeat;
+}
+
+.import-step-done .import-status {
+    /* override */
+    background: none !important;
+}
diff --git a/plugins/YammerImport/css/done.png b/plugins/YammerImport/css/done.png
new file mode 100644 (file)
index 0000000..1f3f411
Binary files /dev/null and b/plugins/YammerImport/css/done.png differ
diff --git a/plugins/YammerImport/css/icon_processing.gif b/plugins/YammerImport/css/icon_processing.gif
new file mode 100644 (file)
index 0000000..d0bce15
Binary files /dev/null and b/plugins/YammerImport/css/icon_processing.gif differ