Merge pull request #100 from KL-7/default-status-image-branch
Select current branch in status images popup.
This commit is contained in:
commit
7c97317df6
assets/scripts/app
|
@ -37,14 +37,14 @@
|
|||
<p>
|
||||
<label>{{t repositories.branch}}:</label>
|
||||
{{#if view.branches.isLoaded}}
|
||||
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.branch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
||||
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.statusImageBranch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
||||
{{else}}
|
||||
<span class="loading"></span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.image_url}}:</label>
|
||||
<input type="text" class="url" {{bindAttr value="view.urlStatusImage"}}></input>
|
||||
<input type="text" class="url" {{bindAttr value="view.statusImageUrl"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.markdown}}:</label>
|
||||
|
|
|
@ -173,26 +173,33 @@
|
|||
@get('repo.branches') if @get('active')
|
||||
).property('active', 'repo.branches')
|
||||
|
||||
setStatusImageBranch: (->
|
||||
if @get('repo.branches.isLoaded')
|
||||
@set('statusImageBranch', @get('repo.branches').findProperty('commit.branch', @get('build.commit.branch')))
|
||||
else
|
||||
@set('statusImageBranch', null)
|
||||
).observes('repo.branches', 'repo.branches.isLoaded', 'build.commit.branch')
|
||||
|
||||
urlRepo: (->
|
||||
'https://' + location.host + Travis.Urls.repo(@get('repo.slug'))
|
||||
).property('repo.slug')
|
||||
|
||||
urlStatusImage: (->
|
||||
Travis.Urls.statusImage(@get('repo.slug'), @get('branch.commit.branch'))
|
||||
).property('repo.slug', 'branch')
|
||||
statusImageUrl: (->
|
||||
Travis.Urls.statusImage(@get('repo.slug'), @get('statusImageBranch.commit.branch'))
|
||||
).property('repo.slug', 'statusImageBranch')
|
||||
|
||||
markdownStatusImage: (->
|
||||
"[})](#{@get('urlRepo')})"
|
||||
).property('urlStatusImage')
|
||||
"[})](#{@get('urlRepo')})"
|
||||
).property('statusImageUrl')
|
||||
|
||||
textileStatusImage: (->
|
||||
"!#{@get('urlStatusImage')}!:#{@get('urlRepo')}"
|
||||
).property('urlStatusImage')
|
||||
"!#{@get('statusImageUrl')}!:#{@get('urlRepo')}"
|
||||
).property('statusImageUrl')
|
||||
|
||||
rdocStatusImage: (->
|
||||
"{<img src=\"#{@get('urlStatusImage')}\" alt=\"Build Status\" />}[#{@get('urlRepo')}]"
|
||||
).property('urlStatusImage')
|
||||
"{<img src=\"#{@get('statusImageUrl')}\" alt=\"Build Status\" />}[#{@get('urlRepo')}]"
|
||||
).property('statusImageUrl')
|
||||
|
||||
asciidocStatusImage: (->
|
||||
"image:#{@get('urlStatusImage')}[\"Build Status\", link=\"#{@get('urlRepo')}\"]"
|
||||
).property('urlStatusImage')
|
||||
"image:#{@get('statusImageUrl')}[\"Build Status\", link=\"#{@get('urlRepo')}\"]"
|
||||
).property('statusImageUrl')
|
||||
|
|
Loading…
Reference in New Issue
Block a user