mixin romvariantfiltersidebar(deviceId)
  - var romVariantArticlesForCurrentDevice = []
  - for (var i in contents.romvariants) {
  -   var variantArticle = contents.romvariants[i]
  -   if (variantArticle.metadata.DeviceId == deviceId) {
  -     romVariantArticlesForCurrentDevice.push(variantArticle)
  -   }
  - }

  if romVariantArticlesForCurrentDevice && romVariantArticlesForCurrentDevice.length > 1
    div.sidebar-nav.well
      ul.nav.nav-pills.nav-stacked
        li.nav-header
          h3 Rom variant
          each romVariantArticle in romVariantArticlesForCurrentDevice.sort()
            - var linkCssClass = (romVariantArticle.url == page.url) ? 'active' : null
            li(class=linkCssClass)
             a(href='#{romVariantArticle.url}', title="Show only the files for #{romVariantArticle.metadata.displayName}")
               | #{romVariantArticle.metadata.displayName}

mixin romvariantfiltersidebar(deviceId)
  - var romVariantArticlesForCurrentDevice = []
  - for (var i in contents.romvariants) {
  -   var variantArticle = contents.romvariants[i]
  -   if (variantArticle.metadata.DeviceId == deviceId) {
  -     romVariantArticlesForCurrentDevice.push(variantArticle)
  -   }
  - }

  if romVariantArticlesForCurrentDevice && romVariantArticlesForCurrentDevice.length > 1
    div.sidebar-nav.well
      ul.nav.nav-pills.nav-stacked
        li.nav-header
          h3 Rom variant
          each romVariantArticle in romVariantArticlesForCurrentDevice.sort()
            - var linkCssClass = (romVariantArticle.url == page.url) ? 'active' : null
            - var variantName = romVariantArticle.metadata.displayName ? romVariantArticle.metadata.displayName : romVariantArticle.metadata.name
            li(class=linkCssClass)
             a(href='#{romVariantArticle.url}', title="Show only the files for ROM variant #{variantName}")
               | #{variantName}

Use the correct RomVariant displayName only when available.
Website: Use the correct RomVariant displayName only when available.
