Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kolibri/core/auth/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class Meta:
"learner_can_delete_account",
"learner_can_login_with_no_password",
"show_download_button_in_learn",
"enable_mark_attendance",
"extra_fields",
"description",
"location",
Expand Down
4 changes: 3 additions & 1 deletion kolibri/plugins/coach/frontend/views/home/HomePage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</KGridItem>
<KGridItem :layout12="{ span: 6 }">
<KGrid gutter="16">
<KGridItem v-if="facilityConfig.enable_mark_attendance">
<KGridItem v-if="currentLanguage === 'en' && facilityConfig.enable_mark_attendance">
<AttendanceBlock />
</KGridItem>
<KGridItem>
Expand All @@ -29,6 +29,7 @@

<script>

import { currentLanguage } from 'kolibri/utils/i18n';
import useFacilities from 'kolibri-common/composables/useFacilities';
import CoachAppBarPage from '../../CoachAppBarPage';
import commonCoach from '../../common';
Expand Down Expand Up @@ -56,6 +57,7 @@

return {
facilityConfig,
currentLanguage,
};
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
import useUser from 'kolibri/composables/useUser';
import useSnackbar from 'kolibri/composables/useSnackbar';
import useFacilities from 'kolibri-common/composables/useFacilities';
import { createTranslator } from 'kolibri/utils/i18n';
import { createTranslator, currentLanguage } from 'kolibri/utils/i18n';
import FacilityAppBarPage from '../FacilityAppBarPage';
import RemovePinModal from './RemovePinModal';
import ChangePinModal from './ChangePinModal';
Expand Down Expand Up @@ -281,7 +281,8 @@
]),
...mapGetters(['facilityPageLinks']),
...mapGetters('facilityConfig', ['getFacilityDataLoading']),
settingsList: () => settingsList,
settingsList: () =>
currentLanguage === 'en' ? settingsList.concat('enable_mark_attendance') : settingsList,
settingsHaveChanged() {
return !isEqual(this.settings, this.settingsCopy);
},
Expand Down Expand Up @@ -431,6 +432,10 @@
message: "Show 'download' button with resources",
context: "Option on 'Facility settings' page.\n",
},
enableMarkAttendance: {
message: 'Allow coaches to take attendance (English only)',
context: "Option on 'Facility settings' page.",
},
/* eslint-enable kolibri/vue-no-unused-translations */
saveFailure: {
message: 'There was a problem saving your settings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ describe('facility config page view', () => {
it('has all of the settings', () => {
const wrapper = makeWrapper();
const checkboxes = wrapper.findAllComponents({ name: 'KCheckbox' });
expect(checkboxes.length).toEqual(6);
expect(checkboxes.length).toEqual(7);
const labels = [
'Allow learners to edit their username',
'Allow learners to edit their full name',
'Allow learners to create accounts',
'Require password for learners',
'Allow learners to edit their password when signed in',
"Show 'download' button with resources",
'Allow coaches to take attendance (English only)',
];
labels.forEach((label, idx) => {
expect(checkboxes.at(idx).props().label).toEqual(label);
Expand Down
Loading