mirror of
https://ghfast.top/https://github.com/discourse/discourse-yearly-review.git
synced 2026-07-16 11:47:17 +08:00
21 lines
687 B
JavaScript
21 lines
687 B
JavaScript
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
import YearlyReviewAdminNotice from "discourse/plugins/discourse-yearly-review/discourse/components/yearly-review-admin-notice";
|
|
|
|
export default {
|
|
name: "yearly-review-admin-notice",
|
|
initialize(container) {
|
|
withPluginApi((api) => {
|
|
const siteSettings = container.lookup("service:site-settings");
|
|
|
|
if (!siteSettings.yearly_review_enabled) {
|
|
return;
|
|
}
|
|
|
|
// Only show this in December of the current year (getMonth is 0-based).
|
|
const now = new Date();
|
|
if (now.getMonth() === 11) {
|
|
api.renderInOutlet("admin-dashboard-top", YearlyReviewAdminNotice);
|
|
}
|
|
});
|
|
},
|
|
};
|