UX: Switch placeholder to an SSH url if importing a private theme

This commit is contained in:
Rishabh 2018-12-20 17:01:38 +05:30
parent a06d310855
commit 3d2c72dd33
2 changed files with 6 additions and 1 deletions

View File

@ -17,6 +17,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
checkPrivate: Ember.computed.match("uploadUrl", /^git/),
localFile: null,
uploadUrl: null,
urlPlaceholder: "https://github.com/discourse/sample_theme",
@computed("loading", "remote", "uploadUrl", "local", "localFile")
importDisabled(isLoading, isRemote, uploadUrl, isLocal, localFile) {
@ -25,6 +26,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
@observes("privateChecked")
privateWasChecked() {
this.get("privateChecked")
? this.set("urlPlaceholder", "git@github.com:discourse/sample_theme.git")
: this.set("urlPlaceholder", "https://github.com/discourse/sample_theme");
const checked = this.get("privateChecked");
if (checked && !this._keyLoading) {
this._keyLoading = true;

View File

@ -15,7 +15,7 @@
{{#if remote}}
<div class="inputs">
<div class='repo'>
{{input value=uploadUrl placeholder="https://github.com/discourse/sample_theme"}}
{{input value=uploadUrl placeholder=urlPlaceholder}}
<span class="description">{{i18n 'admin.customize.theme.import_web_tip'}}</span>
</div>
<div class='branch'>