$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');
}
+.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;
+}