mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 03:26:21 +08:00
The customize routes add CSS classes that make these admin config pages look different from the ones under /admin/config. We want all config routes to be under /admin/config as well. This commit moves the emoji, user fields, and permalinks pages out of customize and into config, updating all references and adding more rails routes as needed. Also renames admin emojis route to emoji, emoji is singular and plural.
44 lines
1.3 KiB
Text
Vendored
44 lines
1.3 KiB
Text
Vendored
import Component from "@glimmer/component";
|
|
import EmberObject, { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import BackButton from "discourse/components/back-button";
|
|
import AdminConfigAreaCard from "admin/components/admin-config-area-card";
|
|
import EmojiUploader from "admin/components/emoji-uploader";
|
|
|
|
export default class AdminConfigAreasEmojisNew extends Component {
|
|
@service router;
|
|
@service currentUser;
|
|
@service adminEmojis;
|
|
|
|
get emojiGroups() {
|
|
return this.adminEmojis.emojiGroups;
|
|
}
|
|
|
|
@action
|
|
emojiUploaded(emoji, group) {
|
|
emoji.url += "?t=" + new Date().getTime();
|
|
emoji.group = group;
|
|
emoji.created_by = this.currentUser.username;
|
|
this.adminEmojis.emojis = [
|
|
...this.adminEmojis.emojis,
|
|
EmberObject.create(emoji),
|
|
];
|
|
this.router.transitionTo("adminEmojis.index");
|
|
}
|
|
|
|
<template>
|
|
<BackButton @route="adminEmojis.index" @label="admin.emoji.back" />
|
|
<div class="admin-config-area">
|
|
<div class="admin-config-area__primary-content admin-emoji-form">
|
|
<AdminConfigAreaCard @heading="admin.emoji.add">
|
|
<:content>
|
|
<EmojiUploader
|
|
@emojiGroups={{this.emojiGroups}}
|
|
@done={{this.emojiUploaded}}
|
|
/>
|
|
</:content>
|
|
</AdminConfigAreaCard>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
}
|