mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:02:46 +08:00
Feature - allow user and group specific cards styling (#5989)
This commit is contained in:
parent
12fd0b827e
commit
0c2f590c64
|
@ -9,7 +9,7 @@ export default Ember.Component.extend(CardContentsBase, CleansUp, {
|
|||
elementId: 'group-card',
|
||||
triggeringLinkClass: 'mention-group',
|
||||
classNames: ['no-bg'],
|
||||
classNameBindings: ['visible:show', 'showBadges', 'hasCardBadgeImage', 'isFixed:fixed'],
|
||||
classNameBindings: ['visible:show', 'showBadges', 'hasCardBadgeImage', 'isFixed:fixed', 'groupClass'],
|
||||
allowBackgrounds: setting('allow_profile_backgrounds'),
|
||||
showBadges: setting('enable_badges'),
|
||||
|
||||
|
@ -23,6 +23,9 @@ export default Ember.Component.extend(CardContentsBase, CleansUp, {
|
|||
@computed('group.user_count', 'group.members.length')
|
||||
moreMembersCount: (memberCount, maxMemberDisplay) => memberCount - maxMemberDisplay,
|
||||
|
||||
@computed('group.name')
|
||||
groupClass: (name) => name ? `group-card-${name}` : '',
|
||||
|
||||
@computed('group')
|
||||
groupPath(group) {
|
||||
return `${Discourse.BaseUri}/groups/${group.name}`;
|
||||
|
|
|
@ -9,7 +9,7 @@ import CleansUp from 'discourse/mixins/cleans-up';
|
|||
export default Ember.Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
||||
elementId: 'user-card',
|
||||
triggeringLinkClass: 'mention',
|
||||
classNameBindings: ['visible:show', 'showBadges', 'user.card_background::no-bg', 'isFixed:fixed'],
|
||||
classNameBindings: ['visible:show', 'showBadges', 'user.card_background::no-bg', 'isFixed:fixed', 'usernameClass'],
|
||||
allowBackgrounds: setting('allow_profile_backgrounds'),
|
||||
showBadges: setting('enable_badges'),
|
||||
|
||||
|
@ -34,6 +34,9 @@ export default Ember.Component.extend(CardContentsBase, CanCheckEmails, CleansUp
|
|||
return !this.siteSettings.prioritize_username_in_ux && name && name.trim().length > 0;
|
||||
},
|
||||
|
||||
@computed('username')
|
||||
usernameClass : (username) => username ? `user-card-${username}` : '',
|
||||
|
||||
@computed('username', 'topicPostCount')
|
||||
togglePostsLabel(username, count) {
|
||||
return I18n.t("topic.filter_to", { username, count });
|
||||
|
|
Loading…
Reference in New Issue
Block a user