mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 16:48:55 +08:00
FEATURE: link to filtered badge list from notification
When notified on a badge link to the badge page filtered on username
This commit is contained in:
parent
ca3e2b4da3
commit
e6c1f1db52
@ -29,7 +29,9 @@ export default Ember.Component.extend({
|
|||||||
badgeSlug = badgeName.replace(/[^A-Za-z0-9_]+/g, '-').toLowerCase();
|
badgeSlug = badgeName.replace(/[^A-Za-z0-9_]+/g, '-').toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Discourse.getURL('/badges/' + badgeId + '/' + badgeSlug);
|
var username = it.get('data.username');
|
||||||
|
username = username ? "?username=" + username.toLowerCase() : "";
|
||||||
|
return Discourse.getURL('/badges/' + badgeId + '/' + badgeSlug + username);
|
||||||
}
|
}
|
||||||
|
|
||||||
const topicId = it.get('topic_id');
|
const topicId = it.get('topic_id');
|
||||||
|
@ -44,7 +44,7 @@ class BadgeGranter
|
|||||||
I18n.with_locale(@user.effective_locale) do
|
I18n.with_locale(@user.effective_locale) do
|
||||||
notification = @user.notifications.create(
|
notification = @user.notifications.create(
|
||||||
notification_type: Notification.types[:granted_badge],
|
notification_type: Notification.types[:granted_badge],
|
||||||
data: { badge_id: @badge.id, badge_name: @badge.display_name, badge_slug: @badge.slug }.to_json)
|
data: { badge_id: @badge.id, badge_name: @badge.display_name, badge_slug: @badge.slug, username: @user.username}.to_json)
|
||||||
user_badge.update_attributes notification_id: notification.id
|
user_badge.update_attributes notification_id: notification.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user