2024-06-03 15:18:14 +08:00
|
|
|
import Component from "@glimmer/component";
|
2024-07-01 10:40:37 +08:00
|
|
|
import { tracked } from "@glimmer/tracking";
|
|
|
|
import { action } from "@ember/object";
|
2024-06-06 21:07:08 +08:00
|
|
|
import i18n from "discourse-common/helpers/i18n";
|
|
|
|
import AdminConfigAreaCard from "admin/components/admin-config-area-card";
|
|
|
|
import AdminConfigAreasAboutContactInformation from "admin/components/admin-config-area-cards/about/contact-information";
|
|
|
|
import AdminConfigAreasAboutGeneralSettings from "admin/components/admin-config-area-cards/about/general-settings";
|
|
|
|
import AdminConfigAreasAboutYourOrganization from "admin/components/admin-config-area-cards/about/your-organization";
|
2024-06-03 15:18:14 +08:00
|
|
|
|
|
|
|
export default class AdminConfigAreasAbout extends Component {
|
2024-07-01 10:40:37 +08:00
|
|
|
@tracked saving = false;
|
|
|
|
|
|
|
|
get generalSettings() {
|
|
|
|
return {
|
|
|
|
title: this.#lookupSettingFromData("title"),
|
|
|
|
siteDescription: this.#lookupSettingFromData("site_description"),
|
|
|
|
extendedSiteDescription: this.#lookupSettingFromData(
|
|
|
|
"extended_site_description"
|
|
|
|
),
|
|
|
|
aboutBannerImage: this.#lookupSettingFromData("about_banner_image"),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
get contactInformation() {
|
|
|
|
return {
|
|
|
|
communityOwner: this.#lookupSettingFromData("community_owner"),
|
|
|
|
contactEmail: this.#lookupSettingFromData("contact_email"),
|
|
|
|
contactURL: this.#lookupSettingFromData("contact_url"),
|
|
|
|
contactUsername: this.#lookupSettingFromData("site_contact_username"),
|
|
|
|
contactGroupName: this.#lookupSettingFromData("site_contact_group_name"),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
get yourOrganization() {
|
|
|
|
return {
|
|
|
|
companyName: this.#lookupSettingFromData("company_name"),
|
|
|
|
governingLaw: this.#lookupSettingFromData("governing_law"),
|
|
|
|
cityForDisputes: this.#lookupSettingFromData("city_for_disputes"),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
setSavingStatus(status) {
|
|
|
|
this.saving = status;
|
|
|
|
}
|
|
|
|
|
|
|
|
#lookupSettingFromData(name) {
|
|
|
|
return this.args.data.findBy("setting", name);
|
2024-06-06 21:07:08 +08:00
|
|
|
}
|
2024-06-03 15:18:14 +08:00
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="admin-config-area">
|
2024-06-06 21:07:08 +08:00
|
|
|
<h2>{{i18n "admin.config_areas.about.header"}}</h2>
|
2024-06-03 15:18:14 +08:00
|
|
|
<div class="admin-config-area__primary-content">
|
2024-06-06 21:07:08 +08:00
|
|
|
<AdminConfigAreaCard
|
|
|
|
@heading="admin.config_areas.about.general_settings"
|
|
|
|
@primaryActionLabel="admin.config_areas.about.update"
|
2024-07-01 10:40:37 +08:00
|
|
|
class="admin-config-area-about__general-settings-section"
|
2024-06-06 21:07:08 +08:00
|
|
|
>
|
|
|
|
<AdminConfigAreasAboutGeneralSettings
|
2024-07-01 10:40:37 +08:00
|
|
|
@generalSettings={{this.generalSettings}}
|
|
|
|
@setGlobalSavingStatus={{this.setSavingStatus}}
|
|
|
|
@globalSavingStatus={{this.saving}}
|
2024-06-06 21:07:08 +08:00
|
|
|
/>
|
|
|
|
</AdminConfigAreaCard>
|
|
|
|
<AdminConfigAreaCard
|
|
|
|
@heading="admin.config_areas.about.contact_information"
|
|
|
|
@primaryActionLabel="admin.config_areas.about.update"
|
2024-07-01 10:40:37 +08:00
|
|
|
class="admin-config-area-about__contact-information-section"
|
2024-06-06 21:07:08 +08:00
|
|
|
>
|
|
|
|
<AdminConfigAreasAboutContactInformation
|
2024-07-01 10:40:37 +08:00
|
|
|
@contactInformation={{this.contactInformation}}
|
|
|
|
@setGlobalSavingStatus={{this.setSavingStatus}}
|
|
|
|
@globalSavingStatus={{this.saving}}
|
2024-06-06 21:07:08 +08:00
|
|
|
/>
|
|
|
|
</AdminConfigAreaCard>
|
|
|
|
<AdminConfigAreaCard
|
|
|
|
@heading="admin.config_areas.about.your_organization"
|
|
|
|
@primaryActionLabel="admin.config_areas.about.update"
|
2024-07-01 10:40:37 +08:00
|
|
|
class="admin-config-area-about__your-organization-section"
|
2024-06-06 21:07:08 +08:00
|
|
|
>
|
|
|
|
<AdminConfigAreasAboutYourOrganization
|
2024-07-01 10:40:37 +08:00
|
|
|
@yourOrganization={{this.yourOrganization}}
|
|
|
|
@setGlobalSavingStatus={{this.setSavingStatus}}
|
|
|
|
@globalSavingStatus={{this.saving}}
|
2024-06-06 21:07:08 +08:00
|
|
|
/>
|
|
|
|
</AdminConfigAreaCard>
|
2024-06-03 15:18:14 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
}
|