mirror of https://github.com/freeCodeCamp/devdocs
parent
144642985d
commit
bff403399c
@ -1,2 +1,16 @@
|
||||
class app.collections.Types extends app.Collection
|
||||
@model: 'Type'
|
||||
|
||||
groups: ->
|
||||
result = []
|
||||
for type in @models
|
||||
(result[@_groupFor(type)] ||= []).push(type)
|
||||
result.filter (e) -> e.length > 0
|
||||
|
||||
GUIDES_RGX = /guide|tutorial/i
|
||||
|
||||
_groupFor: (type) ->
|
||||
if GUIDES_RGX.test(type.name)
|
||||
0
|
||||
else
|
||||
1
|
||||
|
Loading…
Reference in new issue