<commit_before>
- var localizationPrefix = '@admin.menus.navbar.';

- function compare(a, b) { return (a.info.priority || 100) - (b.info.priority || 100); }

- function sortedItems(items) {
-   var result = [];
-   Object.keys(items).forEach(function (name) {
-     if (!items[name]) { return; }
-     result.push({ name: name, info: items[name] });
-   });
-   return result.sort(compare);
- }

//- Create next menu level
//-
//- submenu (Object)
mixin _create_submenus(submenu, localizationPrefix)
  - var menu = sortedItems(submenu);
  .dropdown-menu
    each item in menu
      - var info = item.info;
      if (item.submenu)
        .dropdown-submenu
          a.dropdown-item(href=self.link_to(info.to), tabindex='-1')= self.t(localizationPrefix + item.name)
          +_create_submenus(info.submenu, localizationPrefix + item.name + '.')
      else
        a.dropdown-item(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)


nav.navbar.navbar-default.navbar-fixed-top.bg-faded
  .container-fluid
    ul.navbar__hovered.nav.navbar-nav
      each item in sortedItems(self.runtime.navbar)
        - var info = item.info;
        if (info.submenu)
          li.nav-item.dropdown(data-api-path=info.to, data-autoselect=(info.autoselect === false ? 0 : 1))
            a.nav-link(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)
            +_create_submenus(info.submenu, localizationPrefix + item.name + '.')
        else
          li.nav-item(data-api-path=info.to, data-autoselect=(info.autoselect === false ? 0 : 1))
            a.nav-link(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)<commit_msg>Admin: fix navbar styles<commit_after>
- var localizationPrefix = '@admin.menus.navbar.';

- function compare(a, b) { return (a.info.priority || 100) - (b.info.priority || 100); }

- function sortedItems(items) {
-   var result = [];
-   Object.keys(items).forEach(function (name) {
-     if (!items[name]) { return; }
-     result.push({ name: name, info: items[name] });
-   });
-   return result.sort(compare);
- }

//- Create next menu level
//-
//- submenu (Object)
mixin _create_submenus(submenu, localizationPrefix)
  - var menu = sortedItems(submenu);
  .dropdown-menu
    each item in menu
      - var info = item.info;
      if (item.submenu)
        .dropdown-submenu
          a.dropdown-item(href=self.link_to(info.to), tabindex='-1')= self.t(localizationPrefix + item.name)
          +_create_submenus(info.submenu, localizationPrefix + item.name + '.')
      else
        a.dropdown-item(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)


nav.navbar.navbar-light.navbar-fixed-top.bg-faded
  ul.navbar__hovered.nav.navbar-nav
    each item in sortedItems(self.runtime.navbar)
      - var info = item.info;
      if (info.submenu)
        li.nav-item.dropdown(data-api-path=info.to, data-autoselect=(info.autoselect === false ? 0 : 1))
          a.nav-link(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)
          +_create_submenus(info.submenu, localizationPrefix + item.name + '.')
      else
        li.nav-item(data-api-path=info.to, data-autoselect=(info.autoselect === false ? 0 : 1))
          a.nav-link(href=self.link_to(info.to))= self.t(localizationPrefix + item.name)
{'fraction_non_alphanumeric': 0.15938069216757741, 'fraction_numerical': 0.006678809957498482, 'mean_word_length': 3.0036452004860266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1783488', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1116, 'n_words': 189}