]> git.ipfire.org Git - pbs.git/commitdiff
Add icons to job states.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Dec 2012 15:11:00 +0000 (16:11 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Dec 2012 15:11:00 +0000 (16:11 +0100)
data/static/css/style.css
data/templates/jobs-detail.html
web/ui_modules.py

index d033ba5f6e8cd26d773cd1c5ef05dec4e033df18..34ca0dee2a15188be2f20e0c19aef99496824422 100644 (file)
@@ -78,7 +78,7 @@ body {
        background: #fff;
 }
 
-.jobs-boxes h4 p {
+.jobs-boxes h4 span {
        font-weight: bold;
 }
 
index caa844349fa6b6c6cef904d4c7296031fccb3442..a0c9307a4f49ec22b25271f9d29fea9af25b70fb 100644 (file)
@@ -97,7 +97,7 @@
                        <div class="well well-large well-white ac">
                                <div class="row-fluid">
                                        <div class="span5">
-                                               {% module JobState(job, cls="lead") %}
+                                               {% module JobState(job, cls="lead", show_icon=True) %}
 
                                                <hr>
 
index d941e25a99ad382fd84b958337d126a9a6018b98..7fda8789d6a4b1b4e05424806c9099fc9930d3d1 100644 (file)
@@ -235,7 +235,7 @@ class JobsBoxesModule(UIModule):
 
 
 class JobStateModule(UIModule):
-       def render(self, job, cls=None):
+       def render(self, job, cls=None, show_icon=False):
                state = job.state
 
                _ = self.locale.translate
@@ -244,34 +244,47 @@ class JobStateModule(UIModule):
                if state == "aborted":
                        text = _("Aborted")
                        classes.append("muted")
+                       icon = "icon-warning-sign"
 
                elif state == "dependency_error":
                        text = _("Dependency problem")
                        classes.append("text-warning")
+                       icon = "icon-random"
 
                elif state == "dispatching":
                        text = _("Dispatching")
                        classes.append("text-info")
+                       icon = "icon-download-alt"
 
                elif state == "failed":
                        text = _("Failed")
                        classes.append("text-error")
+                       icon = "icon-remove"
 
                elif state == "finished":
                        text = _("Finished")
                        classes.append("text-success")
+                       icon = "icon-ok"
 
                elif state == "new":
                        text = _("New")
                        classes.append("muted")
+                       icon = "icon-asterisk"
 
                elif state == "pending":
                        text = _("Pending")
                        classes.append("muted")
+                       icon = "icon-time"
 
                elif state == "running":
                        text = _("Running")
+                       classes.append("text-success")
+                       icon = "icon-cogs"
+
+               elif state == "uploading":
+                       text = _("Uploading")
                        classes.append("text-info")
+                       icon = "icon-upload-alt"
 
                # Return just the string, is state is unknown.
                else:
@@ -281,7 +294,10 @@ class JobStateModule(UIModule):
                if cls:
                        classes.append(cls)
 
-               return """<p class="%s">%s</p>""" % (" ".join(classes), text)
+               if show_icon and icon:
+                       text = """<i class="%s"></i> %s""" % (icon, text)
+
+               return """<span class="%s">%s</span>""" % (" ".join(classes), text)
 
 
 class JobsTableModule(UIModule):