Skip to content
Snippets Groups Projects
Commit ec084b22 authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #6401 from ggazzo/fix-5722

sort admin menu by translated name
parents 9077fa3a 4ce4c9db
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ Template.adminFlex.onCreated ->
RocketChat.settings.collectionPrivate = RocketChat.settings.cachedCollectionPrivate.collection
RocketChat.settings.cachedCollectionPrivate.init()
label = ->
return TAPi18n.__(@i18nLabel or @_id)
Template.adminFlex.helpers
groups: ->
......@@ -27,11 +29,14 @@ Template.adminFlex.helpers
if groups.length > 0
query._id =
$in: groups
return RocketChat.settings.collectionPrivate.find(query, { sort: { sort: 1, i18nLabel: 1 } }).fetch()
label: ->
return TAPi18n.__(@i18nLabel or @_id)
RocketChat.settings.collectionPrivate.find(query).fetch()
.map (el) =>
el.label = label.apply(el)
return el
.sort (a, b) =>
if a.label.toLowerCase() >= b.label.toLowerCase() then 1 else -1
label: label
adminBoxOptions: ->
return RocketChat.AdminBox.getOptions()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment