From 45f704906d4accb39f08c5a7ba4bcf2025e0f23e Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 30 Apr 2020 16:02:38 +0200 Subject: [PATCH] UX: display info about extra files and uploader (#9595) Co-authored-by: David Taylor --- .../admin-customize-themes-show.js | 1 + .../admin/templates/customize-themes-show.hbs | 27 +++++++++++++++++++ config/locales/client.en.yml | 4 +++ 3 files changed, 32 insertions(+) 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 006f1728da0..5440c4260ac 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 9f46d47d690..828eee4c5b6 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 @@ {{/if}} + {{else}} +
+ {{i18n "admin.customize.theme.creator"}} + + {{#user-link user=model.user}} + {{format-username model.user.username}} + {{/user-link}} + +
{{/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}} + {{#if extraFiles.length}} +
+
{{i18n "admin.customize.theme.extra_files"}}
+
+ {{#if model.remote_theme}} + {{i18n "admin.customize.theme.extra_files_remote"}} + {{else}} + {{i18n "admin.customize.theme.extra_files_upload"}} + {{/if}} +
+
    + {{#each extraFiles as |extraFile|}} +
  • {{extraFile.name}}
  • + {{/each}} +
+
+ {{/if}} + {{#if hasSettings}}
{{i18n "admin.customize.theme.theme_settings"}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 61a29cb70ef..2df4bdc6ba6 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"