2019-04-05 19:27:14 +03:00
|
|
|
<div class="theme-validation-container">
|
|
|
|
<header class="modal-header" data-test-modal="upload-theme">
|
|
|
|
<h1>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.theme}}
|
|
|
|
{{#if this.hasWarningsOrErrors}}
|
|
|
|
Upload successful with {{#if this.validationErrors}}errors{{else}}warnings{{/if}}
|
2019-04-05 19:27:14 +03:00
|
|
|
{{else}}
|
|
|
|
Upload successful!
|
|
|
|
{{/if}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{else if (or this.validationErrors this.fatalValidationErrors)}}
|
2019-04-05 19:27:14 +03:00
|
|
|
Invalid theme
|
2016-09-14 20:34:07 +03:00
|
|
|
{{else}}
|
2019-04-05 19:27:14 +03:00
|
|
|
Upload a theme
|
2016-09-14 20:34:07 +03:00
|
|
|
{{/if}}
|
2019-04-05 19:27:14 +03:00
|
|
|
</h1>
|
|
|
|
</header>
|
2020-05-28 19:11:21 +03:00
|
|
|
<a class="close" href="#" role="button" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
|
2016-08-17 18:01:46 +03:00
|
|
|
|
2019-04-05 19:27:14 +03:00
|
|
|
<div class="modal-body">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.theme}}
|
|
|
|
{{#if this.hasWarningsOrErrors}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<p>
|
2021-02-12 12:19:25 +03:00
|
|
|
The theme <strong>"{{this.themeName}}"</strong> was installed successfully but we detected some {{if this.validationErrors "errors" "warnings"}}.
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.canActivateTheme}}
|
2021-02-12 12:19:25 +03:00
|
|
|
You are still able to activate and use the theme but it is recommended to fix these {{if this.validationErrors "errors" "warnings"}} before you do so.
|
2019-04-05 19:27:14 +03:00
|
|
|
{{/if}}
|
|
|
|
</p>
|
2017-06-06 09:09:52 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.validationErrors}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<div>
|
|
|
|
<h2 class="mb0 mt4 f5 fw6">Errors</h2>
|
|
|
|
<p class="mb2">Highly recommended to fix, functionality <strong>could</strong> be restricted</p>
|
2017-06-06 09:09:52 +03:00
|
|
|
</div>
|
2019-04-05 19:27:14 +03:00
|
|
|
<ul class="pa0">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.validationErrors as |error|}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<li class="theme-validation-item theme-error">
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhThemeErrorLi @error={{error}} />
|
2019-04-05 19:27:14 +03:00
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
2017-06-06 09:09:52 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.validationWarnings}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<div>
|
|
|
|
<h2 class="mb0 mt4 f5 fw6">Warnings</h2>
|
2017-06-06 09:09:52 +03:00
|
|
|
</div>
|
2019-04-05 19:27:14 +03:00
|
|
|
<ul class="pa0">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.validationWarnings as |error|}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<li class="theme-validation-item theme-warning">
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhThemeErrorLi @error={{error}} />
|
2019-04-05 19:27:14 +03:00
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
2017-06-06 09:09:52 +03:00
|
|
|
{{/if}}
|
2019-04-05 19:27:14 +03:00
|
|
|
{{else}}
|
|
|
|
<p>
|
2019-12-13 17:20:29 +03:00
|
|
|
"{{this.themeName}}" uploaded successfully.
|
|
|
|
{{#if this.canActivateTheme}}Do you want to activate it now?{{/if}}
|
2019-04-05 19:27:14 +03:00
|
|
|
</p>
|
|
|
|
{{/if}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{else if this.displayOverwriteWarning}}
|
2016-09-14 20:34:07 +03:00
|
|
|
<p>
|
2019-12-13 17:20:29 +03:00
|
|
|
The theme folder <strong>"{{this.fileThemeName}}"</strong> already exists. Do you want to overwrite it?
|
2016-09-14 20:34:07 +03:00
|
|
|
</p>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{else if (or this.validationErrors this.fatalValidationErrors)}}
|
2019-04-16 00:39:05 +03:00
|
|
|
|
2019-04-05 19:27:14 +03:00
|
|
|
<p>
|
|
|
|
This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme.
|
|
|
|
</p>
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.fatalValidationErrors}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<div>
|
|
|
|
<h2 class="mb0 mt4 f5 fw6">Fatal Errors</h2>
|
|
|
|
<p class="mb2">Must-fix to activate theme</p>
|
2017-06-06 09:09:52 +03:00
|
|
|
</div>
|
2019-04-16 00:39:05 +03:00
|
|
|
|
2019-04-05 19:27:14 +03:00
|
|
|
<ul class="pa0">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.fatalValidationErrors as |error|}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<li class="theme-validation-item theme-fatal-error">
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhThemeErrorLi @error={{error}} />
|
2019-04-05 19:27:14 +03:00
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
2017-06-06 09:09:52 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.validationErrors}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<div>
|
|
|
|
<h2 class="mb0 mt4 f5 fw6">Errors</h2>
|
|
|
|
<p class="mb2">Highly recommended to fix, functionality <strong>could</strong> be restricted</p>
|
2017-06-06 09:09:52 +03:00
|
|
|
</div>
|
2019-04-05 19:27:14 +03:00
|
|
|
<ul class="pa0">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#each this.validationErrors as |error|}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<li class="theme-validation-item theme-error">
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhThemeErrorLi @error={{error}} />
|
2019-04-05 19:27:14 +03:00
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
2017-06-06 09:09:52 +03:00
|
|
|
{{/if}}
|
2019-04-05 19:27:14 +03:00
|
|
|
{{else}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFileUploader
|
|
|
|
@url={{this.uploadUrl}}
|
|
|
|
@paramName="file"
|
|
|
|
@accept={{this.accept}}
|
|
|
|
@labelText="Click to select or drag-and-drop your theme zip file here."
|
|
|
|
@validate={{action "validateTheme"}}
|
|
|
|
@uploadStarted={{action "uploadStarted"}}
|
|
|
|
@uploadFinished={{action "uploadFinished"}}
|
|
|
|
@uploadSuccess={{action "uploadSuccess"}}
|
|
|
|
@uploadFailed={{action "uploadFailed"}}
|
|
|
|
@listenTo="themeUploader" />
|
2019-04-05 19:27:14 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2016-08-17 18:01:46 +03:00
|
|
|
</div>
|
|
|
|
|
2021-07-08 16:05:30 +03:00
|
|
|
<div class="modal-footer {{if (and this.theme this.hasWarningsOrErrors) "top-shadow"}}">
|
2019-12-13 17:20:29 +03:00
|
|
|
<div class="flex items-center justify-between {{if (or this.displayOverwriteWarning this.canActivateTheme this.validationErrors this.fatalValidationErrors) "flex-auto"}}">
|
|
|
|
<button {{action "closeModal"}} disabled={{this.closeDisabled}} class="gh-btn" data-test-close-button>
|
|
|
|
<span>{{#if this.theme}}Close{{else}}Cancel{{/if}}</span>
|
2016-08-17 18:01:46 +03:00
|
|
|
</button>
|
2019-04-05 19:27:14 +03:00
|
|
|
<div class="flex items-center">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.displayOverwriteWarning}}
|
2019-04-05 19:27:14 +03:00
|
|
|
<button {{action "confirmOverwrite"}} class="gh-btn gh-btn-red" data-test-overwrite-button>
|
|
|
|
<span>Overwrite</span>
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.canActivateTheme}}
|
2019-04-16 00:39:05 +03:00
|
|
|
<button {{action "activate"}} class="gh-btn" data-test-activate-now-button>
|
2019-12-13 17:20:29 +03:00
|
|
|
<span>Activate{{#if this.validationErrors}} with errors{{/if}}</span>
|
2019-04-16 00:39:05 +03:00
|
|
|
</button>
|
2019-04-05 19:27:14 +03:00
|
|
|
{{/if}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if (or this.validationErrors this.fatalValidationErrors)}}
|
2021-03-05 15:16:43 +03:00
|
|
|
<button {{action "reset"}} class="gh-btn gh-btn-black ml2" data-test-try-again-button>
|
2019-04-05 19:27:14 +03:00
|
|
|
<span>Retry</span>
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-17 18:01:46 +03:00
|
|
|
</div>
|