<commit_before><template>

  <core-base
    :topLevelPageName="topLevelPageName"
    :appBarTitle="$tr('coachTitle')"
    :navBarNeeded="!isLoading && !currentPageIsImmersive"
  >

    <div class="content">
      <template v-if="!isLoading && !currentPageIsImmersive">
        <class-selector :classes="classList" :currentClassId="classId" @changeClass="changeClass" />
        <top-nav />
      </template>

      <div v-if="userCanAccessPage">
        <component :is="currentPage" />
      </div>
      <auth-message v-else authorizedRole="adminOrCoach" />
    </div>

  </core-base>

</template>


<script>

  import { currentPageIsImmersive } from '../state/getters/main';
  import { PageNames } from '../constants';
  import { isAdmin, isCoach, isSuperuser } from 'kolibri.coreVue.vuex.getters';
  import { TopLevelPageNames } from 'kolibri.coreVue.vuex.constants';
  import authMessage from 'kolibri.coreVue.components.authMessage';
  import topNav from './top-nav';
  import classListPage from './class-list-page';
  import examsPage from './exams-page';
  import createExamPage from './create-exam-page';
  import examReportPage from './exam-report-page';
  import examReportDetailPage from './exam-report-detail-page';
  import groupsPage from './groups-page';
  import coreBase from 'kolibri.coreVue.components.coreBase';
  import learnerExerciseDetailPage from './reports/learner-exercise-detail-page';
  import recentItemsPage from './reports/recent-items-page';
  import channelListPage from './reports/channel-list-page';
  import itemListPage from './reports/item-list-page';
  import learnerListPage from './reports/learner-list-page';
  import classSelector from './class-selector';

  // lessons
  import { LessonsPageNames } from '../lessonsConstants';
  import LessonsRootPage from './lessons/LessonsRootPage';
  import LessonSummaryPage from './lessons/LessonSummaryPage';
  import LessonResourceSelectionPage from './lessons/LessonResourceSelectionPage';

  export default {
    name: 'coachRoot',
    $trs: {
      coachTitle: 'Coach',
    },
    components: {
      authMessage,
      topNav,
      classListPage,
      examsPage,
      createExamPage,
      // reports
      examReportPage,
      examReportDetailPage,
      groupsPage,
      coreBase,
      learnerExerciseDetailPage,
      recentItemsPage,
      channelListPage,
      itemListPage,
      learnerListPage,
      classSelector,
      // lessons
      LessonsRootPage,
      LessonSummaryPage,
      LessonResourceSelectionPage,
    },
    computed: {
      topLevelPageName: () => TopLevelPageNames.COACH,
      currentPage() {
        const pageNameToComponentMap = {
          [PageNames.CLASS_LIST]: 'class-list-page',
          [PageNames.EXAMS]: 'exams-page',
          [PageNames.GROUPS]: 'groups-page',
          [PageNames.CREATE_EXAM]: 'create-exam-page',
          // reports
          [PageNames.RECENT_CHANNELS]: 'channel-list-page',
          [PageNames.RECENT_ITEMS_FOR_CHANNEL]: 'recent-items-page',
          [PageNames.RECENT_LEARNERS_FOR_ITEM]: 'learner-list-page',
          [PageNames.RECENT_LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.TOPIC_CHANNELS]: 'channel-list-page',
          [PageNames.TOPIC_CHANNEL_ROOT]: 'item-list-page',
          [PageNames.TOPIC_ITEM_LIST]: 'item-list-page',
          [PageNames.TOPIC_LEARNERS_FOR_ITEM]: 'learner-list-page',
          [PageNames.TOPIC_LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.LEARNER_LIST]: 'learner-list-page',
          [PageNames.LEARNER_CHANNELS]: 'channel-list-page',
          [PageNames.LEARNER_CHANNEL_ROOT]: 'item-list-page',
          [PageNames.LEARNER_ITEM_LIST]: 'item-list-page',
          [PageNames.LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.EXAM_REPORT]: 'exam-report-page',
          [PageNames.EXAM_REPORT_DETAIL]: 'exam-report-detail-page',

          // lessons
          [LessonsPageNames.ROOT]: 'LessonsRootPage',
          [LessonsPageNames.SUMMARY]: 'LessonSummaryPage',
          [LessonsPageNames.SELECTION_ROOT]: 'LessonResourceSelectionPage',
          [LessonsPageNames.SELECTION]: 'LessonResourceSelectionPage',
        };
        return pageNameToComponentMap[this.pageName];
      },
      showTopNav() {
        return this.pageName !== PageNames.CLASS_LIST && this.userCanAccessPage;
      },
      userCanAccessPage() {
        return this.isCoach || this.isAdmin || this.isSuperuser;
      },
    },
    methods: {
      changeClass(classSelectedId) {
        if (this.pageName === PageNames.EXAM_REPORT) {
          this.$router.push({
            name: PageNames.EXAMS,
            params: { classId: classSelectedId },<commit_msg>Fix top-nav<commit_after><template>

  <core-base
    :topLevelPageName="topLevelPageName"
    :appBarTitle="$tr('coachTitle')"
    :navBarNeeded="!isLoading && !currentPageIsImmersive"
  >

    <div class="content">
      <template v-if="!isLoading && showTopNav">
        <class-selector :classes="classList" :currentClassId="classId" @changeClass="changeClass" />
        <top-nav />
      </template>

      <div v-if="userCanAccessPage">
        <component :is="currentPage" />
      </div>
      <auth-message v-else authorizedRole="adminOrCoach" />
    </div>

  </core-base>

</template>


<script>

  import { currentPageIsImmersive } from '../state/getters/main';
  import { PageNames } from '../constants';
  import { isAdmin, isCoach, isSuperuser } from 'kolibri.coreVue.vuex.getters';
  import { TopLevelPageNames } from 'kolibri.coreVue.vuex.constants';
  import authMessage from 'kolibri.coreVue.components.authMessage';
  import topNav from './top-nav';
  import classListPage from './class-list-page';
  import examsPage from './exams-page';
  import createExamPage from './create-exam-page';
  import examReportPage from './exam-report-page';
  import examReportDetailPage from './exam-report-detail-page';
  import groupsPage from './groups-page';
  import coreBase from 'kolibri.coreVue.components.coreBase';
  import learnerExerciseDetailPage from './reports/learner-exercise-detail-page';
  import recentItemsPage from './reports/recent-items-page';
  import channelListPage from './reports/channel-list-page';
  import itemListPage from './reports/item-list-page';
  import learnerListPage from './reports/learner-list-page';
  import classSelector from './class-selector';

  // lessons
  import { LessonsPageNames } from '../lessonsConstants';
  import LessonsRootPage from './lessons/LessonsRootPage';
  import LessonSummaryPage from './lessons/LessonSummaryPage';
  import LessonResourceSelectionPage from './lessons/LessonResourceSelectionPage';

  export default {
    name: 'coachRoot',
    $trs: {
      coachTitle: 'Coach',
    },
    components: {
      authMessage,
      topNav,
      classListPage,
      examsPage,
      createExamPage,
      // reports
      examReportPage,
      examReportDetailPage,
      groupsPage,
      coreBase,
      learnerExerciseDetailPage,
      recentItemsPage,
      channelListPage,
      itemListPage,
      learnerListPage,
      classSelector,
      // lessons
      LessonsRootPage,
      LessonSummaryPage,
      LessonResourceSelectionPage,
    },
    computed: {
      topLevelPageName: () => TopLevelPageNames.COACH,
      currentPage() {
        const pageNameToComponentMap = {
          [PageNames.CLASS_LIST]: 'class-list-page',
          [PageNames.EXAMS]: 'exams-page',
          [PageNames.GROUPS]: 'groups-page',
          [PageNames.CREATE_EXAM]: 'create-exam-page',
          // reports
          [PageNames.RECENT_CHANNELS]: 'channel-list-page',
          [PageNames.RECENT_ITEMS_FOR_CHANNEL]: 'recent-items-page',
          [PageNames.RECENT_LEARNERS_FOR_ITEM]: 'learner-list-page',
          [PageNames.RECENT_LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.TOPIC_CHANNELS]: 'channel-list-page',
          [PageNames.TOPIC_CHANNEL_ROOT]: 'item-list-page',
          [PageNames.TOPIC_ITEM_LIST]: 'item-list-page',
          [PageNames.TOPIC_LEARNERS_FOR_ITEM]: 'learner-list-page',
          [PageNames.TOPIC_LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.LEARNER_LIST]: 'learner-list-page',
          [PageNames.LEARNER_CHANNELS]: 'channel-list-page',
          [PageNames.LEARNER_CHANNEL_ROOT]: 'item-list-page',
          [PageNames.LEARNER_ITEM_LIST]: 'item-list-page',
          [PageNames.LEARNER_ITEM_DETAILS]: 'learner-exercise-detail-page',
          [PageNames.EXAM_REPORT]: 'exam-report-page',
          [PageNames.EXAM_REPORT_DETAIL]: 'exam-report-detail-page',

          // lessons
          [LessonsPageNames.ROOT]: 'LessonsRootPage',
          [LessonsPageNames.SUMMARY]: 'LessonSummaryPage',
          [LessonsPageNames.SELECTION_ROOT]: 'LessonResourceSelectionPage',
          [LessonsPageNames.SELECTION]: 'LessonResourceSelectionPage',
        };
        return pageNameToComponentMap[this.pageName];
      },
      showTopNav() {
        return (
          this.pageName !== PageNames.CLASS_LIST &&
          this.userCanAccessPage &&
          !this.currentPageIsImmersive
        );
      },
      userCanAccessPage() {
        return this.isCoach || this.isAdmin || this.isSuperuser;
      },
    },
    methods: {
      changeClass(classSelectedId) {
        if (this.pageName === PageNames.EXAM_REPORT) {
          this.$router.push({
            name: PageNames.EXAMS,
            params: { classId: classSelectedId },
{'fraction_non_alphanumeric': 0.12742731185053008, 'fraction_numerical': 0.0, 'mean_word_length': 3.020253164556962, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, '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': '4325449', 'n_tokens_mistral': 2989, 'n_tokens_neox': 2950, 'n_words': 464}