mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 02:10:09 +08:00
Change category label appearance
This commit is contained in:
parent
a38efe6e90
commit
4bf5f91c06
|
@ -1,6 +1,7 @@
|
||||||
import Component from 'flarum/component';
|
import Component from 'flarum/component';
|
||||||
import DiscussionPage from 'flarum/components/discussion-page';
|
import DiscussionPage from 'flarum/components/discussion-page';
|
||||||
import icon from 'flarum/helpers/icon';
|
import icon from 'flarum/helpers/icon';
|
||||||
|
import categoryLabel from 'categories/helpers/category-label';
|
||||||
|
|
||||||
export default class MoveDiscussionModal extends Component {
|
export default class MoveDiscussionModal extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -16,7 +17,7 @@ export default class MoveDiscussionModal extends Component {
|
||||||
m('div.modal-content', [
|
m('div.modal-content', [
|
||||||
m('button.btn.btn-icon.btn-link.close.back-control', {onclick: app.modal.close.bind(app.modal)}, icon('times')),
|
m('button.btn.btn-icon.btn-link.close.back-control', {onclick: app.modal.close.bind(app.modal)}, icon('times')),
|
||||||
m('div.modal-header', m('h3.title-control', discussion
|
m('div.modal-header', m('h3.title-control', discussion
|
||||||
? ['Move ', m('em', discussion.title()), ' from ', m('span.category', {style: 'color: '+discussion.category().color()}, discussion.category().title()), ' to...']
|
? ['Move ', m('em', discussion.title()), ' from ', categoryLabel(discussion.category()), ' to...']
|
||||||
: ['Start a Discussion In...'])),
|
: ['Start a Discussion In...'])),
|
||||||
m('div', [
|
m('div', [
|
||||||
m('ul.category-list', [
|
m('ul.category-list', [
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export default function categoryLabel(category) {
|
export default function categoryLabel(category) {
|
||||||
return m('span.category-label', {style: {color: category.color()}}, category.title());
|
return m('span.category-label', {style: {backgroundColor: category.color()}}, category.title());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
.category-label {
|
.category-label {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
font-weight: bold;
|
font-weight: 600;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
color: #fff;
|
||||||
|
padding: 1px 5px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
.discussion-summary & {
|
.discussion-summary & {
|
||||||
margin-right: 10px;
|
margin-right: 5px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user