UX: display info about extra files and uploader (#9595)

UX: display info about extra files and uploader (#9595)

Co-authored-by: David Taylor david@taylorhq.com

diff --git a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js
index 006f172..5440c42 100644
--- a/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js
+++ b/app/assets/javascripts/admin/controllers/admin-customize-themes-show.js
@@ -31,6 +31,7 @@ export default Controller.extend({
   availableComponentsNames: mapBy("availableChildThemes", "name"),
   availableActiveComponentsNames: mapBy("availableActiveChildThemes", "name"),
   childThemesNames: mapBy("model.childThemes", "name"),
+  extraFiles: filterBy("model.theme_fields", "target", "extra_js"),
 
   @discourseComputed("model.editedFields")
   editedFieldsFormatted() {
diff --git a/app/assets/javascripts/admin/templates/customize-themes-show.hbs b/app/assets/javascripts/admin/templates/customize-themes-show.hbs
index 9f46d47..828eee4 100644
--- a/app/assets/javascripts/admin/templates/customize-themes-show.hbs
+++ b/app/assets/javascripts/admin/templates/customize-themes-show.hbs
@@ -126,6 +126,15 @@
         </span>
       {{/if}}
     </div>
+  {{else}}
+    <div class="control-unit">
+      <span class="heading">{{i18n "admin.customize.theme.creator"}}</span>
+      <span>
+        {{#user-link user=model.user}}
+          {{format-username model.user.username}}
+        {{/user-link}}
+      </span>
+    </div>
   {{/if}}
 
   {{#unless model.component}}
@@ -219,6 +228,24 @@
     {{#d-button action=(action "addUploadModal") class="btn-default" icon="plus"}}{{i18n "admin.customize.theme.add"}}{{/d-button}}
   </div>
 
+  {{#if extraFiles.length}}
+    <div class="control-unit">
+      <div class="mini-title">{{i18n "admin.customize.theme.extra_files"}}</div>
+      <div class="description">
+        {{#if model.remote_theme}}
+          {{i18n "admin.customize.theme.extra_files_remote"}}
+        {{else}}
+          {{i18n "admin.customize.theme.extra_files_upload"}}
+        {{/if}}
+      </div>
+      <ul>
+        {{#each extraFiles as |extraFile|}}
+          <li>{{extraFile.name}}</li>
+        {{/each}}
+      </ul>
+    </div>
+  {{/if}}
+
   {{#if hasSettings}}
     <div class="control-unit">
       <div class="mini-title">{{i18n "admin.customize.theme.theme_settings"}}</div>
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 61a29cb..2df4bdc 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -3759,6 +3759,9 @@ en:
           settings: "Settings"
           translations: "Translations"
           extra_scss: "Extra SCSS"
+          extra_files: "Extra files"
+          extra_files_upload: "Export theme to view these files."
+          extra_files_remote: "Export theme or check the git repository to view these files."
           preview: "Preview"
           show_advanced: "Show advanced fields"
           hide_advanced: "Hide advanced fields"
@@ -3822,6 +3825,7 @@ en:
           license: "License"
           version: "Version:"
           authors: "Authored by:"
+          creator: "Created by:"
           source_url: "Source"
           enable: "Enable"
           disable: "Disable"

GitHub sha: 45f70490

This commit appears in #9595 which was approved by davidtaylorhq and eviltrout. It was merged by jjaffeux.