-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Add category icon + blocks settings (#16)
* Initial commit by `discourse_theme` CLI * init * init * community guidelines * init * lint * lint * refactor * refactor * license * lint * lint * lint * lint * lint * blocks * settings * lint
- Loading branch information
Showing
10 changed files
with
188 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// import { inject as service } from "@ember/service"; | ||
import { apiInitializer } from "discourse/lib/api"; | ||
|
||
export default apiInitializer("1.0", () => { | ||
let css = ""; | ||
const categories = settings.category_icons; | ||
if (categories) { | ||
categories.forEach((category) => { | ||
const id = category.id[0]; | ||
const emoji = category.emoji; | ||
|
||
css += `.badge-category__wrapper .badge-category[data-category-id="${id}"]:before { content: "${emoji}"; }\n`; | ||
}); | ||
|
||
const styleElement = document.createElement("style"); | ||
styleElement.type = "text/css"; | ||
styleElement.appendChild(document.createTextNode(css)); | ||
document.head.appendChild(styleElement); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 34 additions & 29 deletions
63
javascripts/discourse/connectors/above-main-container/admin.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
<div class="admin-main-nav"> | ||
<ul class="nav nav-pills"> | ||
{{#if this.currentUser.admin}} | ||
<NavItem @route="admin.dashboard" @label="admin.dashboard.title" /> | ||
<NavItem @route="adminSiteSettings" @label="admin.site_settings.title" /> | ||
<NavItem @route="adminUsers" @label="admin.users.title" /> | ||
{{/if}} | ||
{{#if this.showGroups}} | ||
<NavItem @route="groups" @label="admin.groups.title" /> | ||
{{/if}} | ||
{{#if this.showBadges}} | ||
<NavItem @route="adminBadges" @label="admin.badges.title" /> | ||
{{/if}} | ||
{{#if this.currentUser.admin}} | ||
<NavItem @route="adminEmail" @label="admin.email.title" /> | ||
<NavItem @route="adminLogs" @label="admin.logs.title" /> | ||
<NavItem | ||
@route="adminCustomizeThemes" | ||
@routeParam="themes" | ||
@label="admin.customize.title" | ||
/> | ||
<NavItem @route="adminApi" @label="admin.api.title" /> | ||
{{#if this.siteSettings.enable_backups}} | ||
<NavItem @route="admin.backups" @label="admin.backups.title" /> | ||
{{#if this.currentUser.admin}} | ||
<div class="admin-main-nav"> | ||
<ul class="nav nav-pills"> | ||
{{#if this.currentUser.admin}} | ||
<NavItem @route="admin.dashboard" @label="admin.dashboard.title" /> | ||
<NavItem | ||
@route="adminSiteSettings" | ||
@label="admin.site_settings.title" | ||
/> | ||
<NavItem @route="adminUsers" @label="admin.users.title" /> | ||
{{/if}} | ||
<NavItem @route="adminPlugins" @label="admin.plugins.title" /> | ||
{{/if}} | ||
<PluginOutlet @name="admin-menu" /> | ||
</ul> | ||
</div> | ||
{{#if this.showGroups}} | ||
<NavItem @route="groups" @label="admin.groups.title" /> | ||
{{/if}} | ||
{{#if this.showBadges}} | ||
<NavItem @route="adminBadges" @label="admin.badges.title" /> | ||
{{/if}} | ||
{{#if this.currentUser.admin}} | ||
<NavItem @route="adminEmail" @label="admin.email.title" /> | ||
<NavItem @route="adminLogs" @label="admin.logs.title" /> | ||
<NavItem | ||
@route="adminCustomizeThemes" | ||
@routeParam="themes" | ||
@label="admin.customize.title" | ||
/> | ||
<NavItem @route="adminApi" @label="admin.api.title" /> | ||
{{#if this.siteSettings.enable_backups}} | ||
<NavItem @route="admin.backups" @label="admin.backups.title" /> | ||
{{/if}} | ||
<NavItem @route="adminPlugins" @label="admin.plugins.title" /> | ||
{{/if}} | ||
<PluginOutlet @name="admin-menu" /> | ||
</ul> | ||
</div> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#reply-control { | ||
background: var(--neutral-100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters