From 1994005fabece34e9642e65e851a29b1ed10f68a Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Thu, 28 Jun 2012 00:01:01 +0200 Subject: [PATCH] use context in item views --- assets/javascripts/app/views.coffee | 18 +++++++++--------- public/javascripts/application.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/javascripts/app/views.coffee b/assets/javascripts/app/views.coffee index 37298493..8cfbec48 100644 --- a/assets/javascripts/app/views.coffee +++ b/assets/javascripts/app/views.coffee @@ -7,17 +7,17 @@ Travis.Views = RepositoriesItemView: Em.View.extend classes: (-> - color = Travis.Helpers.colorForResult(@getPath('repository.lastBuildResult')) + color = Travis.Helpers.colorForResult(@getPath('context.lastBuildResult')) classes = ['repository', color] - classes.push 'selected' if @getPath('repository.selected') + classes.push 'selected' if @getPath('context.selected') classes.join(' ') - ).property('repository.lastBuildResult', 'repository.selected') + ).property('context.lastBuildResult', 'context.selected') lastBuild: (-> - owner: @getPath('repository.owner') - name: @getPath('repository.name') - id: @getPath('repository.lastBuildId') - ).property('repository.owner', 'repository.name', 'repository.lastBuildId') + owner: @getPath('context.owner') + name: @getPath('context.name') + build_id: @getPath('context.lastBuildId') + ).property() RepositoryView: Em.View.extend templateName: 'repositories/show' @@ -30,8 +30,8 @@ Travis.Views = BuildsItemView: Em.View.extend classes: (-> - Travis.Helpers.colorForResult(@getPath('content.result')) - ).property('content.result') + Travis.Helpers.colorForResult(@getPath('context.result')) + ).property('context.result') BuildView: Em.View.extend templateName: 'builds/show' diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 83710d33..da941509 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1 +1 @@ -minispade.register('templates', "(function() {Ember.TEMPLATES['application']=Ember.Handlebars.compile(\"
\\n Travis CI\\n #\\n
\\n\\n
\\n {{outlet left}}\\n
\\n\\n
\\n {{outlet main}}\\n
\\n\");Ember.TEMPLATES['builds/list']=Ember.Handlebars.compile(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n {{#each build in content}}\\n {{#view Travis.Views.BuildsItemView contextBinding=\\\"build\\\"}}\\n \\n \\n \\n \\n \\n \\n \\n {{/view}}\\n {{/each}}\\n \\n
{{t builds.name}}{{t builds.commit}}{{t builds.message}}{{t builds.duration}}{{t builds.finished_at}}
{{number}}{{formatCommit commit}}{{{formatMessage commit.message short=\\\"true\\\"}}}{{formatDuration duration}}{{formatTime finished_at}}
\\n\\n

\\n \\n

\\n\");Ember.TEMPLATES['builds/show']=Ember.Handlebars.compile(\"
\\n
\\n
\\n
{{t builds.name}}
\\n
{{number}}
\\n
{{t builds.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t builds.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t builds.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t builds.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t builds.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t builds.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t builds.message}}
\\n
{{{formatMessage commit.message}}}
\\n\\n {{#unless isMatrix}}\\n
{{t builds.config}}
\\n
{{formatConfig config}}
\\n {{/unless}}\\n
\\n\\n {{#if isLoaded}}\\n {{#if isMatrix}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.requiredJobs\\\" required=\\\"true\\\"}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.allowedFailureJobs\\\"}}\\n {{else}}\\n {{view Travis.Views.LogView contextBinding=\\\"jobs.firstObject\\\"}}\\n {{/if}}\\n {{/if}}\\n
\\n\");Ember.TEMPLATES['jobs/list']=Ember.Handlebars.compile(\"{{#if view.jobs.length}}\\n \\n \\n \\n \\n {{#each configKeys}}\\n \\n {{/each}}\\n \\n \\n \\n {{#each view.jobs}}\\n \\n \\n \\n \\n {{#each configValues}}\\n \\n {{/each}}\\n \\n {{/each}}\\n \\n
\\n {{#if view.required}}\\n {{t jobs.build_matrix}}\\n {{else}}\\n {{t jobs.allowed_failures}}{{whats_this allow_failure_help}}\\n {{/if}}\\n
{{this}}
#{{number}}{{formatDuration duration}}{{formatTime finished_at}}{{this}}
\\n\\n {{#unless view.required}}\\n
\\n
{{t \\\"jobs.allowed_failures\\\"}}
\\n
\\n

\\n Allowed Failures are items in your build matrix that are allowed to\\n fail without causing the entire build to be shown as failed. This lets you add\\n in experimental and preparatory builds to test against versions or\\n configurations that you are not ready to officially support.\\n

\\n

\\n You can define allowed failures in the build matrix as follows:\\n

\\n
\\n      matrix:\\n        allow_failures:\\n          - rvm: ruby-head\\n        
\\n
\\n
\\n {{/unless}}\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/log']=Ember.Handlebars.compile(\"
{{{formatLog log.body}}}
\\n\\n{{#if sponsor.name}}\\n

\\n {{t builds.messages.sponsored_by}}\\n {{sponsor.name}}\\n

\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/show']=Ember.Handlebars.compile(\"
\\n
\\n
\\n
Job
\\n
{{number}}
\\n
{{t jobs.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t jobs.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t jobs.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t jobs.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t jobs.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t jobs.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t jobs.message}}
\\n
{{formatMessage commit.message}}
\\n
{{t jobs.config}}
\\n
{{formatConfig config}}
\\n
\\n\\n {{view Travis.Views.LogView}}\\n
\\n\\n\");Ember.TEMPLATES['repositories/list']=Ember.Handlebars.compile(\"{{#if content.lastObject.isLoaded}}\\n