From: Michael Tremer Date: Sat, 8 Dec 2012 15:11:00 +0000 (+0100) Subject: Add icons to job states. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20e70907fc45687f2c40acfb10e71af33bcb4c7c;p=pbs.git Add icons to job states. --- diff --git a/data/static/css/style.css b/data/static/css/style.css index d033ba5f..34ca0dee 100644 --- a/data/static/css/style.css +++ b/data/static/css/style.css @@ -78,7 +78,7 @@ body { background: #fff; } -.jobs-boxes h4 p { +.jobs-boxes h4 span { font-weight: bold; } diff --git a/data/templates/jobs-detail.html b/data/templates/jobs-detail.html index caa84434..a0c9307a 100644 --- a/data/templates/jobs-detail.html +++ b/data/templates/jobs-detail.html @@ -97,7 +97,7 @@
- {% module JobState(job, cls="lead") %} + {% module JobState(job, cls="lead", show_icon=True) %}
diff --git a/web/ui_modules.py b/web/ui_modules.py index d941e25a..7fda8789 100644 --- a/web/ui_modules.py +++ b/web/ui_modules.py @@ -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 """

%s

""" % (" ".join(classes), text) + if show_icon and icon: + text = """ %s""" % (icon, text) + + return """%s""" % (" ".join(classes), text) class JobsTableModule(UIModule):