mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-22 16:18:44 +08:00
This commit removes the filter that would remove themeable site settings from all setting lists, so they are easier to find for admins. To do this, we show the value of the site's default theme for that theme site setting, disable the setting component, and provide a link to the site's default theme for quick editing. --------- Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
32 lines
1,005 B
Text
Vendored
32 lines
1,005 B
Text
Vendored
/* eslint-disable ember/no-classic-components */
|
|
import Component from "@ember/component";
|
|
import { concat, fn, hash } from "@ember/helper";
|
|
import { action } from "@ember/object";
|
|
import { includes } from "truth-helpers";
|
|
import UppyImageUploader from "discourse/components/uppy-image-uploader";
|
|
|
|
const BACKGROUND_SIZE_COVER = ["welcome_banner_image"];
|
|
|
|
export default class Upload extends Component {
|
|
@action
|
|
uploadDone(upload) {
|
|
this.set("value", upload.url);
|
|
}
|
|
|
|
<template>
|
|
<UppyImageUploader
|
|
@imageUrl={{this.value}}
|
|
@placeholderUrl={{this.setting.placeholder}}
|
|
@previewSize={{if
|
|
(includes BACKGROUND_SIZE_COVER this.setting.setting)
|
|
"cover"
|
|
}}
|
|
@onUploadDone={{this.uploadDone}}
|
|
@onUploadDeleted={{fn (mut this.value) null}}
|
|
@additionalParams={{hash for_site_setting=true}}
|
|
@type="site_setting"
|
|
@id={{concat "site-setting-image-uploader-" this.setting.setting}}
|
|
@disabled={{@disabled}}
|
|
/>
|
|
</template>
|
|
}
|