UX: Hide branch/private repo options in admin theme import modal
This commit is contained in:
parent
d96d561180
commit
62043e6904
|
@ -18,6 +18,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
localFile: null,
|
localFile: null,
|
||||||
uploadUrl: null,
|
uploadUrl: null,
|
||||||
urlPlaceholder: "https://github.com/discourse/sample_theme",
|
urlPlaceholder: "https://github.com/discourse/sample_theme",
|
||||||
|
advancedVisible: false,
|
||||||
|
|
||||||
@computed("loading", "remote", "uploadUrl", "local", "localFile")
|
@computed("loading", "remote", "uploadUrl", "local", "localFile")
|
||||||
importDisabled(isLoading, isRemote, uploadUrl, isLocal, localFile) {
|
importDisabled(isLoading, isRemote, uploadUrl, isLocal, localFile) {
|
||||||
|
@ -50,6 +51,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
this.set("localFile", $("#file-input")[0].files[0]);
|
this.set("localFile", $("#file-input")[0].files[0]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleAdvanced() {
|
||||||
|
this.set("advancedVisible", !this.get("advancedVisible"));
|
||||||
|
},
|
||||||
|
|
||||||
importTheme() {
|
importTheme() {
|
||||||
let options = {
|
let options = {
|
||||||
type: "POST"
|
type: "POST"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{#d-modal-body class='upload-selector' title="admin.customize.theme.import_theme"}}
|
{{#d-modal-body class='upload-selector import-theme' title="admin.customize.theme.import_theme"}}
|
||||||
<div class="radios">
|
<div class="radios">
|
||||||
{{radio-button name="upload" id="local" value="local" selection=selection}}
|
{{radio-button name="upload" id="local" value="local" selection=selection}}
|
||||||
<label class="radio" for="local">{{i18n 'upload_selector.from_my_computer'}}</label>
|
<label class="radio" for="local">{{i18n 'upload_selector.from_my_computer'}}</label>
|
||||||
|
@ -15,27 +15,36 @@
|
||||||
{{#if remote}}
|
{{#if remote}}
|
||||||
<div class="inputs">
|
<div class="inputs">
|
||||||
<div class='repo'>
|
<div class='repo'>
|
||||||
{{input value=uploadUrl placeholder=urlPlaceholder}}
|
<div class="label">{{i18n 'admin.customize.theme.import_web_tip'}}</div>
|
||||||
<span class="description">{{i18n 'admin.customize.theme.import_web_tip'}}</span>
|
{{input value=uploadUrl placeholder=urlPlaceholder}}
|
||||||
</div>
|
</div>
|
||||||
<div class='branch'>
|
|
||||||
{{input value=branch placeholder="master"}}
|
{{d-button
|
||||||
<span class="description">{{i18n 'admin.customize.theme.remote_branch'}}</span>
|
class="btn-small advanced-repo"
|
||||||
</div>
|
action=(action "toggleAdvanced")
|
||||||
<div class='check-private'>
|
label='admin.customize.theme.import_web_advanced'}}
|
||||||
<label>
|
|
||||||
{{input type="checkbox" checked=privateChecked}}
|
{{#if advancedVisible}}
|
||||||
{{i18n 'admin.customize.theme.is_private'}}
|
<div class='branch'>
|
||||||
</label>
|
<div class="label">{{i18n 'admin.customize.theme.remote_branch'}}</div>
|
||||||
</div>
|
{{input value=branch placeholder="master"}}
|
||||||
{{#if checkPrivate}}
|
|
||||||
{{#if privateChecked}}
|
|
||||||
{{#if publicKey}}
|
|
||||||
<div class='public-key'>
|
|
||||||
{{i18n 'admin.customize.theme.public_key'}}
|
|
||||||
{{textarea readonly=true value=publicKey}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
|
<div class='check-private'>
|
||||||
|
<label>
|
||||||
|
{{input type="checkbox" checked=privateChecked}}
|
||||||
|
{{i18n 'admin.customize.theme.is_private'}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{{#if checkPrivate}}
|
||||||
|
{{#if privateChecked}}
|
||||||
|
{{#if publicKey}}
|
||||||
|
<div class='public-key'>
|
||||||
|
<div class="label">{{i18n 'admin.customize.theme.public_key'}}</div>
|
||||||
|
{{textarea readonly=true value=publicKey}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
margin: 5px 0 0 0;
|
margin: 5px 0 0 0;
|
||||||
}
|
}
|
||||||
|
.label {
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.radios:last-child:not(:nth-child(2)) {
|
.radios:last-child:not(:nth-child(2)) {
|
||||||
|
@ -49,3 +52,11 @@
|
||||||
padding: 7px 10px;
|
padding: 7px 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.import-theme {
|
||||||
|
min-width: 650px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.advanced-repo {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -3383,6 +3383,7 @@ en:
|
||||||
edit_css_html_help: "You have not edited any CSS or HTML"
|
edit_css_html_help: "You have not edited any CSS or HTML"
|
||||||
delete_upload_confirm: "Delete this upload? (Theme CSS may stop working!)"
|
delete_upload_confirm: "Delete this upload? (Theme CSS may stop working!)"
|
||||||
import_web_tip: "Repository containing theme"
|
import_web_tip: "Repository containing theme"
|
||||||
|
import_web_advanced: "Advanced..."
|
||||||
import_file_tip: ".tar.gz or .dcstyle.json file containing theme"
|
import_file_tip: ".tar.gz or .dcstyle.json file containing theme"
|
||||||
is_private: "Theme is in a private git repository"
|
is_private: "Theme is in a private git repository"
|
||||||
remote_branch: "Branch name (optional)"
|
remote_branch: "Branch name (optional)"
|
||||||
|
|
Loading…
Reference in New Issue