From 4c28e5460c9ed8307edb2a68daf39540046e4bb7 Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Thu, 7 Apr 2016 08:56:01 -0400 Subject: [PATCH 1/2] task page tweaks --- SingularityUI/app/handlebarsHelpers.coffee | 16 +++++ SingularityUI/app/styles/detailHeader.styl | 15 +++- .../app/templates/taskDetail/taskHistory.hbs | 6 +- .../app/templates/taskDetail/taskOverview.hbs | 68 +++++++++---------- 4 files changed, 62 insertions(+), 43 deletions(-) diff --git a/SingularityUI/app/handlebarsHelpers.coffee b/SingularityUI/app/handlebarsHelpers.coffee index 7370c59e9f..c7988f657c 100644 --- a/SingularityUI/app/handlebarsHelpers.coffee +++ b/SingularityUI/app/handlebarsHelpers.coffee @@ -183,3 +183,19 @@ Handlebars.registerHelper 'ifShellRequestHasOutputFilename', (statuses, options) if status.outputFilename return options.fn @ return options.inverse @ + +Handlebars.registerHelper 'reverseEach', (context, options) -> + ret = '' + if context and context.length > 0 + i = context.length - 1 + while i >= 0 + ret += options.fn(context[i]) + i-- + else + ret = options.inverse(this) + ret + +Handlebars.registerHelper 'ifCurrentState', (state, updates, options) -> + lastState = _.last updates + if lastState.taskState is state then options.fn @ else options.inverse @ + diff --git a/SingularityUI/app/styles/detailHeader.styl b/SingularityUI/app/styles/detailHeader.styl index 3aafb1e30c..30a1ef6407 100644 --- a/SingularityUI/app/styles/detailHeader.styl +++ b/SingularityUI/app/styles/detailHeader.styl @@ -122,8 +122,17 @@ &:hover opacity 0.3 + .task-state-header-label + display table-cell + .task-state-header + padding-top 5px + .breadcrumb li + max-width 66% .title-button - position absolute - right 15px - top 20px + position absolute + right 15px + top 20px + +.medium-weight + font-weight 500 diff --git a/SingularityUI/app/templates/taskDetail/taskHistory.hbs b/SingularityUI/app/templates/taskDetail/taskHistory.hbs index af33ab503d..b18a5e173d 100644 --- a/SingularityUI/app/templates/taskDetail/taskHistory.hbs +++ b/SingularityUI/app/templates/taskDetail/taskHistory.hbs @@ -17,8 +17,8 @@ - {{#each data.taskUpdates}} - + {{#reverseEach data.taskUpdates}} + {{humanizeText taskState}} @@ -33,7 +33,7 @@ {{timestampFromNow timestamp}} - {{/each}} + {{/reverseEach}} {{else}} diff --git a/SingularityUI/app/templates/taskDetail/taskOverview.hbs b/SingularityUI/app/templates/taskDetail/taskOverview.hbs index 59769262b7..29fa1eeead 100644 --- a/SingularityUI/app/templates/taskDetail/taskOverview.hbs +++ b/SingularityUI/app/templates/taskDetail/taskOverview.hbs @@ -1,29 +1,19 @@ -{{#if data.isStillRunning}} - {{! If there's a TaskCleanup object associated with this task, display its info }} - {{#if data.cleanup}} - - {{else}} - {{#if data.isCleaning}} - - {{/if}} - {{/if}} -{{/if}} - {{! Part of taskBase }}
{{! Left side }} -
+ {{#if data.taskUpdates}} + {{#withLast data.taskUpdates}} +
+

{{humanizeText taskState}}

+
+ {{/withLast}} +
-{{#if data.taskUpdates}} -
- {{#withLast data.taskUpdates}} - {{humanizeText taskState}} - as of - {{timestampFromNow timestamp}} - - {{ ../data.task.offer.hostname }} - - {{#if statusMessage}} -
{{ statusMessage }} +{{#if data.isStillRunning}} + {{! If there's a TaskCleanup object associated with this task, display its info }} + {{#if data.cleanup}} + -{{/if}} +
+ {{else}} + {{#if data.isCleaning}} + + {{/if}} + {{/if}} +{{/if}} \ No newline at end of file From 242568f18438f05ebcc36fa00f08bffb0d6aa42d Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Thu, 7 Apr 2016 09:38:02 -0400 Subject: [PATCH 2/2] task page tweaks --- SingularityUI/app/styles/detailHeader.styl | 4 ++-- SingularityUI/app/templates/taskDetail/taskOverview.hbs | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/SingularityUI/app/styles/detailHeader.styl b/SingularityUI/app/styles/detailHeader.styl index 30a1ef6407..11ca16c01b 100644 --- a/SingularityUI/app/styles/detailHeader.styl +++ b/SingularityUI/app/styles/detailHeader.styl @@ -126,8 +126,8 @@ display table-cell .task-state-header padding-top 5px - .breadcrumb li - max-width 66% + li.breadcrumb-wide + max-width 50% .title-button position absolute diff --git a/SingularityUI/app/templates/taskDetail/taskOverview.hbs b/SingularityUI/app/templates/taskDetail/taskOverview.hbs index 29fa1eeead..7fa48005c5 100644 --- a/SingularityUI/app/templates/taskDetail/taskOverview.hbs +++ b/SingularityUI/app/templates/taskDetail/taskOverview.hbs @@ -14,7 +14,7 @@ {{/if}} {{#with data.task}} {{/with}}