<commit_before><template>

  <div class="top">
    <div class="links">
      <router-link :to="classesLink" :class="{active: classesActive}" @click.native="blur">
        {{$tr('classes')}}
      </router-link>
      <router-link :to="usersLink" :class="{active: usersActive}" @click.native="blur">
        {{$tr('users')}}
      </router-link>
      <router-link :to="dataLink" :class="{active: dataActive}" @click.native="blur">
        {{$tr('data')}}
      </router-link>
      <router-link :to="contentLink" :class="{active: contentActive}" @click.native="blur" v-if="isDeviceOwner">
        {{$tr('content')}}
      </router-link>
    </div>
  </div>

</template>


<script>

  const UserKinds = require('kolibri.coreVue.vuex.constants').UserKinds;
  const constants = require('../../constants');

  module.exports = {
    $trNameSpace: 'topNav',
    $trs: {
      classes: 'Classes',
      users: 'Users',
      content: 'Content',
      data: 'Data',
    },
    methods: {
      blur(evt) {
        evt.target.blur();
      },
    },
    computed: {
      classesLink() {
        return { name: constants.PageNames.CLASS_MGMT_PAGE };
      },
      classesActive() {
        return [
          constants.PageNames.CLASS_MGMT_PAGE,
          constants.PageNames.CLASS_EDIT_MGMT_PAGE,
          constants.PageNames.CLASS_ENROLL_MGMT_PAGE,
        ].includes(this.pageName);
      },
      usersLink() {
        return { name: constants.PageNames.USER_MGMT_PAGE };
      },
      usersActive() {
        return this.pageName === constants.PageNames.USER_MGMT_PAGE;
      },
      dataLink() {
        return { name: constants.PageNames.DATA_EXPORT_PAGE };
      },
      dataActive() {
        return this.pageName === constants.PageNames.DATA_EXPORT_PAGE;
      },
      contentLink() {
        return { name: constants.PageNames.CONTENT_MGMT_PAGE };
      },
      contentActive() {
        return this.pageName === constants.PageNames.CONTENT_MGMT_PAGE;<commit_msg>Add Facilities Config link to top-nav<commit_after><template>

  <div class="top">
    <div class="links">
      <router-link :to="classesLink" :class="{active: classesActive}" @click.native="blur">
        {{$tr('classes')}}
      </router-link>
      <router-link :to="usersLink" :class="{active: usersActive}" @click.native="blur">
        {{$tr('users')}}
      </router-link>
      <router-link :to="facilitiesConfigLink" :class="{active: facilitiesConfigActive}" @click.native="blur">
        {{$tr('facilities')}}
      </router-link>
      <router-link :to="dataLink" :class="{active: dataActive}" @click.native="blur">
        {{$tr('data')}}
      </router-link>
      <router-link :to="contentLink" :class="{active: contentActive}" @click.native="blur" v-if="isDeviceOwner">
        {{$tr('content')}}
      </router-link>
    </div>
  </div>

</template>


<script>

  const UserKinds = require('kolibri.coreVue.vuex.constants').UserKinds;
  const { PageNames } = require('../../constants');

  const linkify = (name) => ({ name });

  const classesSubPages = [
    PageNames.CLASS_EDIT_MGMT_PAGE,
    PageNames.CLASS_ENROLL_MGMT_PAGE,
    PageNames.CLASS_MGMT_PAGE,
  ];

  module.exports = {
    $trNameSpace: 'topNav',
    $trs: {
      classes: 'Classes',
      content: 'Content',
      data: 'Data',
      facilities: 'Facilities',
      users: 'Users',
    },
    methods: {
      blur(evt) {
        evt.target.blur();
      },
    },
    computed: {
      classesLink() {
        return linkify(PageNames.CLASS_MGMT_PAGE);
      },
      classesActive() {
        return classesSubPages.includes(this.pageName);
      },
      facilitiesConfigLink() {
        return linkify(PageNames.FACILITIES_CONFIG_PAGE);
      },
      facilitiesConfigActive() {
        return this.pageName === PageNames.FACILITIES_CONFIG_PAGE;
      },
      usersLink() {
        return linkify(PageNames.USER_MGMT_PAGE);
      },
      usersActive() {
        return this.pageName === PageNames.USER_MGMT_PAGE;
      },
      dataLink() {
        return linkify(PageNames.DATA_EXPORT_PAGE);
      },
      dataActive() {
        return this.pageName === PageNames.DATA_EXPORT_PAGE;
      },
      contentLink() {
        return linkify(PageNames.CONTENT_MGMT_PAGE);
      },
      contentActive() {
        return this.pageName === PageNames.CONTENT_MGMT_PAGE;
{'fraction_non_alphanumeric': 0.16277995843915954, 'fraction_numerical': 0.0, 'mean_word_length': 2.668077900084674, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 36, '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': '1790602', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1371, 'n_words': 210}