From e21bee64941b749fd0ef6954896a40319f2beabe Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 15 May 2013 17:20:46 +0200 Subject: [PATCH] Make sure that commit data is always fresh by using #with Commit data in job and build view is sometimes unbound, make sure it's refreshed when commit does change. --- assets/scripts/app/templates/builds/show.hbs | 20 ++++++++--------- assets/scripts/app/templates/jobs/show.hbs | 23 ++++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/assets/scripts/app/templates/builds/show.hbs b/assets/scripts/app/templates/builds/show.hbs index 5dc0751b..5d43ac76 100644 --- a/assets/scripts/app/templates/builds/show.hbs +++ b/assets/scripts/app/templates/builds/show.hbs @@ -21,29 +21,29 @@
{{formatDuration build.duration}}
- {{#if commit}} + {{#with build.commit}}
{{t builds.commit}}
-
{{formatCommit build.commit}}
+
{{formatCommit this}}
{{#if build.pullRequest}}
{{t builds.pull_request}}
-
#{{build.pullRequestNumber}} {{build.pullRequestTitle}}
+
#{{build.pullRequestNumber}} {{build.pullRequestTitle}}
{{else}} - {{#if commit.compareUrl}} + {{#if compareUrl}}
{{t builds.compare}}
-
{{pathFrom build.commit.compareUrl}}
+
{{pathFrom compareUrl}}
{{/if}} {{/if}} - {{#if commit.authorName}} + {{#if authorName}}
{{t builds.author}}
-
{{build.commit.authorName}}
+
{{authorName}}
{{/if}} - {{#if commit.committerName}} + {{#if committerName}}
{{t builds.committer}}
-
{{build.commit.committerName}}
+
{{committerName}}
{{/if}}
- {{/if}} + {{/with}}
{{t builds.message}}
{{formatMessage build.commit.message}}
diff --git a/assets/scripts/app/templates/jobs/show.hbs b/assets/scripts/app/templates/jobs/show.hbs index 92f4066d..c9b998df 100644 --- a/assets/scripts/app/templates/jobs/show.hbs +++ b/assets/scripts/app/templates/jobs/show.hbs @@ -19,32 +19,31 @@
{{formatDuration job.duration}}
- {{#if commit}} + {{#with job.commit}}
{{t jobs.commit}}
-
{{formatCommit commit}}
+
{{formatCommit this}}
{{#if job.build.pullRequest}}
{{t builds.pull_request}}
-
#{{job.build.pullRequestNumber}} {{job.build.pullRequestTitle}}
+
#{{job.build.pullRequestNumber}} {{job.build.pullRequestTitle}}
{{else}} - {{#if commit.compareUrl}} + {{#if compareUrl}}
{{t jobs.compare}}
-
{{pathFrom commit.compareUrl}}
+
{{pathFrom compareUrl}}
{{/if}} {{/if}} - {{#if commit.authorName}} + {{#if authorName}}
{{t jobs.author}}
-
{{commit.authorName}}
+
{{authorName}}
{{/if}} - {{#if commit.committerName}} + {{#if committerName}}
{{t jobs.committer}}
-
{{commit.committerName}}
+
{{committerName}}
{{/if}}
- {{/if}} - + {{/with}}
{{t jobs.message}}
-
{{formatMessage commit.message}}
+
{{formatMessage job.commit.message}}
{{t jobs.config}}
{{formatConfig job.config}}