Use bind-attr instead of deprecated bindAttr.

This commit is contained in:
Robert Jackson 2014-01-07 20:59:27 -05:00
parent 5260fac6dc
commit cb3d41739b
21 changed files with 63 additions and 63 deletions

View File

@ -10,7 +10,7 @@
# Handlebars
* Can't {{bindAttr}} be just {{attr}}? Who cares it's "bound" in that context?
* Can't {{bind-attr}} be just {{attr}}? Who cares it's "bound" in that context?
{{#each}} isn't {{#bindEach}} either.
* Why is {{#collection contentBinding="foo"}} not just {{#collection foo}}?

View File

@ -35,7 +35,7 @@
{{{formatMessage commit.message short="true" repoBinding=build.repo}}}
</td>
<td class="commit">
<a {{bindAttr href="view.urlGithubCommit"}}>
<a {{bind-attr href="view.urlGithubCommit"}}>
{{formatCommit commit}}
</a>
</td>
@ -44,15 +44,15 @@
</td>
{{#if view.isPullRequestsList}}
<td>
<a {{bindAttr href="view.urlGithubPullRequest"}}>
<a {{bind-attr href="view.urlGithubPullRequest"}}>
#{{pullRequestNumber}}
</a>
</td>
{{/if}}
<td class="duration" {{bindAttr title="duration"}}>
<td class="duration" {{bind-attr title="duration"}}>
{{formatDuration duration}}
</td>
<td class="finished_at timeago" {{bindAttr title="formattedFinishedAt"}}>
<td class="finished_at timeago" {{bind-attr title="formattedFinishedAt"}}>
{{formatTime finishedAt}}
</td>
{{/view}}

View File

@ -15,22 +15,22 @@
<dt>{{t builds.state}}</dt>
<dd class="state">{{capitalize build.state}}</dd>
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
<dd class="finished_at timeago" {{bindAttr title="build.formattedFinishedAt"}}>{{formatTime build.finishedAt}}</dd>
<dd class="finished_at timeago" {{bind-attr title="build.formattedFinishedAt"}}>{{formatTime build.finishedAt}}</dd>
<dt>{{t builds.duration}}</dt>
<dd class="duration" {{bindAttr title="startedAt"}}>{{formatDuration build.duration}}</dd>
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration build.duration}}</dd>
</div>
{{#with build}}
<div class="right">
<dt>{{t builds.commit}}</dt>
<dd class="commit"><a {{bindAttr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
{{#if pullRequest}}
<dt>{{t builds.pull_request}}</dt>
<dd class="pull_request"><a {{bindAttr href="commit.compareUrl"}}>#{{pullRequestNumber}} {{pullRequestTitle}}</a></dd>
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{pullRequestNumber}} {{pullRequestTitle}}</a></dd>
{{else}}
{{#if commit.compareUrl}}
<dt>{{t builds.compare}}</dt>
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
{{/if}}
{{/if}}
{{#if commit.authorName}}

View File

@ -29,10 +29,10 @@
{{/if}}
{{/if}}
</td>
<td class="duration" {{bindAttr title="startedAt"}}>
<td class="duration" {{bind-attr title="startedAt"}}>
{{formatDuration duration}}
</td>
<td class="finished_at timeago" {{bindAttr title="formattedFinishedAt"}}>
<td class="finished_at timeago" {{bind-attr title="formattedFinishedAt"}}>
{{formatTime finishedAt}}
</td>
{{#each value in configValues}}

View File

@ -17,14 +17,14 @@
{{#if view.job.sponsor.name}}
<p class="sponsor">
{{t builds.messages.sponsored_by}}
<a {{bindAttr href="sponsor.url"}}>{{sponsor.name}}</a>
<a {{bind-attr href="sponsor.url"}}>{{sponsor.name}}</a>
</p>
{{/if}}
{{#if view.limited}}
<p class="warning">
This log is too long to be displayed. Please reduce the verbosity of your
build or download the the <a {{bindAttr href="view.plainTextLogUrl"}}>raw log</a>.
build or download the the <a {{bind-attr href="view.plainTextLogUrl"}}>raw log</a>.
</p>
{{/if}}
</div>

View File

@ -1,5 +1,5 @@
{{#if job.isLoaded}}
<div {{bindAttr class="view.color"}}>
<div {{bind-attr class="view.color"}}>
<dl id="summary">
<div class="left">
<dt>Job</dt>
@ -14,22 +14,22 @@
<dt>{{t jobs.state}}</dt>
<dd class="state">{{capitalize job.state}}</dd>
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
<dd class="finished_at timeago" {{bindAttr title="job.formattedFinishedAt"}}>{{formatTime job.finishedAt}}</dd>
<dd class="finished_at timeago" {{bind-attr title="job.formattedFinishedAt"}}>{{formatTime job.finishedAt}}</dd>
<dt>{{t jobs.duration}}</dt>
<dd class="duration" {{bindAttr title="startedAt"}}>{{formatDuration job.duration}}</dd>
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration job.duration}}</dd>
</div>
{{#with job}}
<div class="right">
<dt>{{t jobs.commit}}</dt>
<dd class="commit"><a {{bindAttr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
{{#if build.pullRequest}}
<dt>{{t builds.pull_request}}</dt>
<dd class="pull_request"><a {{bindAttr href="commit.compareUrl"}}>#{{build.pullRequestNumber}} {{build.pullRequestTitle}}</a></dd>
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{build.pullRequestNumber}} {{build.pullRequestTitle}}</a></dd>
{{else}}
{{#if commit.compareUrl}}
<dt>{{t jobs.compare}}</dt>
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
{{/if}}
{{/if}}
{{#if commit.authorName}}

View File

@ -29,13 +29,13 @@
<li class="traviscicom">
<a href="http://travis-ci.com">Travis CI for Private Repositories</a>
</li>
<li {{bindAttr class="view.classProfile"}}>
<li {{bind-attr class="view.classProfile"}}>
<p class="handle">
{{#if signedOut}}
<a class="signed-out" href="#" {{action "signIn" target="Travis"}}>{{t layouts.top.github_login}}</a>
{{/if}}
{{#if signedIn}}
{{#linkTo "profile" class="signed-in"}}<img {{bindAttr src="gravatarUrl"}}/>{{userName}}{{/linkTo}}
{{#linkTo "profile" class="signed-in"}}<img {{bind-attr src="gravatarUrl"}}/>{{userName}}{{/linkTo}}
{{/if}}
{{#if signingIn}}
<span class="signing-in">{{t layouts.top.signing_in}}</span>

View File

@ -2,7 +2,7 @@
</div>
<ul class="tabs">
<li id="tab_accounts" {{bindAttr class="view.classAccounts"}}>
<li id="tab_accounts" {{bind-attr class="view.classAccounts"}}>
<h5><a name="accounts" href="">Accounts</a></h5>
</li>
</ul>

View File

@ -1,5 +1,5 @@
<ul class="tabs">
<li id="tab_hooks" {{bindAttr class="view.classHooks"}}>
<li id="tab_hooks" {{bind-attr class="view.classHooks"}}>
<h5>
{{#with view.account}}
{{#if login}}
@ -9,7 +9,7 @@
</h5>
</li>
{{#if view.displayUser}}
<li id="tab_user" {{bindAttr class="view.classUser"}}>
<li id="tab_user" {{bind-attr class="view.classUser"}}>
<h5>
{{#linkTo "account.profile" view.account}}Profile{{/linkTo}}
</h5>

View File

@ -17,13 +17,13 @@
<ul id="hooks">
{{#each hook in hooks}}
<li {{bindAttr class="hook.active:active"}}>
<a {{bindAttr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
<li {{bind-attr class="hook.active:active"}}>
<a {{bind-attr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
{{#if hook.isSaving}}<span class="loading"></span>{{/if}}
<p class="description">{{hook.description}}</p>
<div class="controls">
<a {{bindAttr href="hook.urlGithubAdmin"}} class="github-admin tool-tip" title="Github service hooks admin page"></a>
<a {{bind-attr href="hook.urlGithubAdmin"}} class="github-admin tool-tip" title="Github service hooks admin page"></a>
<a {{action "toggle" hook}} class="switch">
{{#if hook.active}}
ON
@ -54,8 +54,8 @@
<ul>
{{#each hook in unAdminisetableHooks}}
<li {{bindAttr class="hook.active:active"}}>
<a {{bindAttr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
<li {{bind-attr class="hook.active:active"}}>
<a {{bind-attr href="hook.urlGithub"}} rel="nofollow">{{hook.slug}}</a>
<p class="description">{{hook.description}}</p>
</li>
{{/each}}

View File

@ -1,4 +1,4 @@
<img {{bindAttr src="view.gravatarUrl"}}>
<img {{bind-attr src="view.gravatarUrl"}}>
<dl class="profile">
<div>
@ -6,7 +6,7 @@
{{t profiles.show.github}}:
</dt>
<dd>
<a {{bindAttr href="urlGithub"}}>{{user.login}}</a>
<a {{bind-attr href="urlGithub"}}>{{user.login}}</a>
</dd>
</div>
<div>

View File

@ -2,7 +2,7 @@
{{#each queue in controller}}
<li class="queue">
<h4>{{t queue}}: {{queue.name}}</h4>
<ul {{bindAttr id="queue.id"}}>
<ul {{bind-attr id="queue.id"}}>
{{#each job in queue}}
{{#view Travis.QueueItemView jobBinding="job"}}
{{#if job.repo.slug}}

View File

@ -22,11 +22,11 @@
<p class="summary">
<span class="duration-icon"></span><span class="duration_label">{{t repositories.duration}}:</span>
<abbr class="duration" {{bindAttr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
</p>
<p class="summary">
<span class="finished-icon"></span><span class="finished_at_label">{{t repositories.finished_at}}:</span>
<abbr class="finished_at timeago" {{bindAttr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
</p>
<div class="indicator"><span></span></div>

View File

@ -1,13 +1,13 @@
<ul class="tabs">
<li id="tab_owned" {{bindAttr class="view.classOwned"}}>
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
<h5><a {{action "activate" "owned" target="view"}}>{{t layouts.application.my_repositories}}</a></h5>
</li>
<li id="tab_recent" {{bindAttr class="view.classRecent"}}>
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
<h5><a {{action "activate" "recent" target="view"}}>{{t layouts.application.recent}}</a></h5>
</li>
<li id="tab_search" {{bindAttr class="view.classSearch"}}>
<li id="tab_search" {{bind-attr class="view.classSearch"}}>
<h5><a {{action "activate" "search" target="view"}}>{{t layouts.application.search}}</a></h5>
</li>
</ul>

View File

@ -1,4 +1,4 @@
<div id="repo" {{bindAttr class="view.className"}}>
<div id="repo" {{bind-attr class="view.className"}}>
{{#if view.isEmpty}}
{{view Travis.ReposEmptyView}}
{{else}}
@ -6,7 +6,7 @@
{{#with repo}}
<div id="repo-header">
<h3>{{#linkTo "repo" this}}{{slug}}{{/linkTo}}</h3>
<div class="github-icon"><a {{bindAttr href="controller.urlGithub"}}><img src="/images/icons/github.png" width="21" height="21"/></a></div>
<div class="github-icon"><a {{bind-attr href="controller.urlGithub"}}><img src="/images/icons/github.png" width="21" height="21"/></a></div>
{{view Travis.RepoShowToolsView}}
</div>

View File

@ -3,39 +3,39 @@
{{#if view.displayCancelBuild}}
<li class="icon" title="Cancel Build">
<a href="#" {{action "cancelBuild" target="view"}}
{{bindAttr class="view.canCancelBuild::disabled"}}><img class="icon" src="/images/icons/off.png" width="20"></a>
{{bind-attr class="view.canCancelBuild::disabled"}}><img class="icon" src="/images/icons/off.png" width="20"></a>
</li>
{{/if}}
{{#if view.displayCancelJob}}
<li class="icon" title="Cancel Job">
<a href="#" {{action "cancelJob" target="view"}}
{{bindAttr class="view.canCancelJob::disabled"}}><img class="icon" width="20" src="/images/icons/off.png"/></a>
{{bind-attr class="view.canCancelJob::disabled"}}><img class="icon" width="20" src="/images/icons/off.png"/></a>
</li>
{{/if}}
{{#if view.displayRequeueBuild}}
<li class="icon" title="Restart Build">
<a href="#" {{action "requeueBuild" target="view"}}
{{bindAttr class="view.canRequeueBuild::disabled"}}><img class="icon" src="/images/icons/repeat.png" width="20"></a>
{{bind-attr class="view.canRequeueBuild::disabled"}}><img class="icon" src="/images/icons/repeat.png" width="20"></a>
</li>
{{/if}}
{{#if view.displayRequeueJob}}
<li class="icon" title="Restart Job">
<a href="#" {{action "requeueJob" target="view"}}
{{bindAttr class="view.canRequeueJob::disabled"}}><img src="/images/icons/repeat.png" width="20"></a>
{{bind-attr class="view.canRequeueJob::disabled"}}><img src="/images/icons/repeat.png" width="20"></a>
</li>
{{/if}}
{{!TODO: for some reason showDownloadLog, which just delegates to jobIdForLog
does not refresh 'if' properly, need further investigation}}
{{#if view.jobIdForLog}}
<li class="icon" title="Download Log">
<a class="download-log" {{bindAttr href="view.plainTextLogUrl"}}><img class="icon" src="/images/icons/align-justify.png" width="20"/></a>
<a class="download-log" {{bind-attr href="view.plainTextLogUrl"}}><img class="icon" src="/images/icons/align-justify.png" width="20"/></a>
</li>
{{/if}}
{{#if view.displayCodeClimate}}
<li class="icon" title="Test Coverage with Code Climate">
<a href="#" name="code-climate"
{{action "codeClimatePopup" target="view"}}
{{bindAttr class=":open-popup"}}>
{{bind-attr class=":open-popup"}}>
<img src="/images/icons/code-climate-icon.png"/>
</a>
</li>

View File

@ -1,5 +1,5 @@
<ul class="tabs">
<li id="tab_current" {{bindAttr class="view.classCurrent"}}>
<li id="tab_current" {{bind-attr class="view.classCurrent"}}>
<h5>
{{#if repo.slug}}
{{#linkTo "repo" repo currentWhen="repo.index"}}
@ -8,7 +8,7 @@
{{/if}}
</h5>
</li>
<li id="tab_builds" {{bindAttr class="view.classBuilds"}}>
<li id="tab_builds" {{bind-attr class="view.classBuilds"}}>
<h5>
{{#if repo.slug}}
{{#linkTo "builds" repo}}
@ -17,7 +17,7 @@
{{/if}}
</h5>
</li>
<li id="tab_pull_requests" {{bindAttr class="view.classPullRequests"}}>
<li id="tab_pull_requests" {{bind-attr class="view.classPullRequests"}}>
<h5>
{{#if repo.slug}}
{{#linkTo "pullRequests" repo}}
@ -26,7 +26,7 @@
{{/if}}
</h5>
</li>
<li id="tab_branches" {{bindAttr class="view.classBranches"}}>
<li id="tab_branches" {{bind-attr class="view.classBranches"}}>
<h5>
{{#if repo.slug}}
{{#linkTo "branches" repo}}
@ -35,7 +35,7 @@
{{/if}}
</h5>
</li>
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
<li id="tab_build" {{bind-attr class="view.classBuild"}}>
<h5>
{{#if build.id}}
{{#if repo.slug}}
@ -46,7 +46,7 @@
{{/if}}
</h5>
</li>
<li id="tab_job" {{bindAttr class="view.classJob"}}>
<li id="tab_job" {{bind-attr class="view.classJob"}}>
<h5>
{{#if job.id}}
{{#if repo.slug}}

View File

@ -6,7 +6,7 @@
<li>
<a href="#" name="regenerate-key"
{{action "regenerateKeyPopup" target="view"}}
{{bindAttr class=":open-popup view.canRegenerateKey::disabled"}}>
{{bind-attr class=":open-popup view.canRegenerateKey::disabled"}}>
Regenerate Key
</a>
</li>
@ -14,7 +14,7 @@
</ul>
{{#if view.displayStatusImages}}
<a href="#" id="status-image-popup" name="status-images" class="open-popup" {{action "statusImages" target="view"}}>
<img {{bindAttr src="view.statusImageUrl"}} title="Build Status Images"/>
<img {{bind-attr src="view.statusImageUrl"}} title="Build Status Images"/>
</a>
{{/if}}
@ -58,7 +58,7 @@
<p>
Integrating <a href="https://codeclimate.com">Code Climate's test coverage</a> reporting with your test
suite on Travis CI allows to track changes in coverage over time. If you haven't tried it out already, <a
{{bindAttr href="Travis.config.code_climate_url"}}" target="_blank">sign
{{bind-attr href="Travis.config.code_climate_url"}}" target="_blank">sign
up today</a> to improve your code's quality. New customers get 20% off for the first three months!
</p>

View File

@ -9,25 +9,25 @@
</p>
<p>
<label>{{t repositories.image_url}}:</label>
<input type="text" class="url" {{bindAttr value="view.statusImageUrl"}}></input>
<input type="text" class="url" {{bind-attr value="view.statusImageUrl"}}></input>
</p>
<p>
<label>{{t repositories.markdown}}:</label>
<input type="text" class="markdown" {{bindAttr value="view.markdownStatusImage"}}></input>
<input type="text" class="markdown" {{bind-attr value="view.markdownStatusImage"}}></input>
</p>
<p>
<label>{{t repositories.textile}}:</label>
<input type="text" class="textile" {{bindAttr value="view.textileStatusImage"}}></input>
<input type="text" class="textile" {{bind-attr value="view.textileStatusImage"}}></input>
</p>
<p>
<label>{{t repositories.rdoc}}:</label>
<input type="text" class="rdoc" {{bindAttr value="view.rdocStatusImage"}}></input>
<input type="text" class="rdoc" {{bind-attr value="view.rdocStatusImage"}}></input>
</p>
<p>
<label>{{t repositories.asciidoc}}:</label>
<input type="text" class="asciidoc" {{bindAttr value="view.asciidocStatusImage"}}></input>
<input type="text" class="asciidoc" {{bind-attr value="view.asciidocStatusImage"}}></input>
</p>
<p>
<label>{{t repositories.rst}}:</label>
<input type="text" class="rst" {{bindAttr value="view.rstStatusImage"}}></input>
<input type="text" class="rst" {{bind-attr value="view.rstStatusImage"}}></input>
</p>

View File

@ -37,7 +37,7 @@ Travis.reopen
tabBinding: 'controller.tab'
contextBinding: 'controller'
# hrm. how to parametrize bindAttr?
# hrm. how to parametrize bind-attr?
classCurrent: (->
'active' if @get('tab') == 'current'
).property('tab')

View File

@ -4,7 +4,7 @@
tabBinding: 'controller.tab'
# hrm. how to parametrize bindAttr?
# hrm. how to parametrize bind-attr?
classHome: (->
'active' if @get('tab') == 'home'
).property('tab')