Skip to content
Open
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
48 changes: 22 additions & 26 deletions kolibri/plugins/facility/assets/src/views/ClassEnrollForm.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
<template>

<form>
<PaginatedListContainerWithBackend>
<template #topActions>
<div class="flex-row">
<FilterTextbox
v-model="search"
:placeholder="coreString('searchForUser')"
/>
<PaginationActions
v-model="currentPage"
:itemsPerPage="itemsPerPage"
:totalPageNumber="totalPages"
:numFilteredItems="totalLearners"
/>
</div>
</template>
<template>
<UserTable
v-model="selectedUsers"
:users="usersNotInClass"
:selectable="true"
:emptyMessage="emptyMessageForItems(usersNotInClass)"
:showDemographicInfo="true"
<div>
<div class="flex-row">
<FilterTextbox
v-model="search"
:placeholder="coreString('searchForUser')"
/>
</template>
</PaginatedListContainerWithBackend>
<PaginationActions
v-model="currentPage"
:itemsPerPage="itemsPerPage"
:totalPageNumber="totalPages"
:numFilteredItems="totalLearners"
/>
</div>
</div>
<template>
<UserTable
v-model="selectedUsers"
:users="usersNotInClass"
:selectable="true"
:emptyMessage="emptyMessageForItems(usersNotInClass)"
:showDemographicInfo="true"
/>
</template>
<PaginationActions
v-if="totalPages > 1"
v-model="currentPage"
Expand Down Expand Up @@ -53,15 +51,13 @@
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import FilterTextbox from 'kolibri/components/FilterTextbox';
import UserTable from 'kolibri-common/components/UserTable';
import PaginatedListContainerWithBackend from 'kolibri-common/components/PaginatedListContainerWithBackend';
import PaginationActions from 'kolibri-common/components/PaginationActions';
import SelectionBottomBar from './SelectionBottomBar';

export default {
name: 'ClassEnrollForm',
components: {
SelectionBottomBar,
PaginatedListContainerWithBackend,
PaginationActions,
UserTable,
FilterTextbox,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>

<div class="flex-column">
<PaginatedListContainerWithBackend class="paginated-wrapper">
<div class="paginated-wrapper">
<KTable
class="move-down user-roster"
:stickyColumns="stickyColumns"
Expand Down Expand Up @@ -105,7 +105,7 @@
</span>
</template>
</KTable>
</PaginatedListContainerWithBackend>
</div>
<ResetUserPasswordModal
v-if="modalShown === Modals.RESET_USER_PASSWORD"
:id="userToChange.id"
Expand Down Expand Up @@ -141,7 +141,6 @@
import { bulkUserManagementStrings } from 'kolibri-common/strings/bulkUserManagementStrings';
import BirthYearDisplayText from 'kolibri-common/components/userAccounts/BirthYearDisplayText';
import { enhancedQuizManagementStrings } from 'kolibri-common/strings/enhancedQuizManagementStrings';
import PaginatedListContainerWithBackend from 'kolibri-common/components/PaginatedListContainerWithBackend';
import useUser from 'kolibri/composables/useUser';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import { themeTokens } from 'kolibri-design-system/lib/styles/theme';
Expand All @@ -166,7 +165,6 @@
GenderDisplayText,
BirthYearDisplayText,
ResetUserPasswordModal,
PaginatedListContainerWithBackend,
},
setup(props, { emit }) {
const route = useRoute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,58 @@
<template>

<form>
<PaginatedListContainerWithBackend>
<CoreTable>
<template #headers>
<th>
<KCheckbox
showLabel
class="select-all"
:label="coreString('nameLabel')"
:checked="areAllSelected"
:indeterminate="areAnySelected && !areAllSelected"
:disabled="!areAnyAvailable"
:style="{ color: $themeTokens.annotation }"
@change="selectAll($event)"
/>
</th>
<th v-if="windowIsLarge">
{{ coreString('fileSize') }}
</th>
<th v-if="windowIsLarge">
{{ coreString('dateAdded') }}
</th>
<th v-if="windowIsLarge">
{{ coreString('statusLabel') }}
</th>
</template>
<template #tbody>
<tbody v-if="!loading">
<tr
v-for="download in paginatedDownloads"
:key="download.contentnode_id"
:style="download.status !== 'COMPLETED' ? { color: $themeTokens.annotation } : {}"
>
<td :class="{ 'small-resource-details': !windowIsLarge }">
<KCheckbox
:checked="Boolean(selectedDownloadsMap[download.contentnode_id])"
class="download-checkbox"
@change="handleCheckResource(download.contentnode_id, $event)"
>
<KLabeledIcon
v-if="download.metadata"
:icon="getIcon(download.metadata.learning_activities)"
:label="download.metadata.title"
:style="nonCompleteStatus(download) ? { color: $themeTokens.annotation } : {}"
/>
</KCheckbox>
<div
v-if="!windowIsLarge"
class="small-screen-status"
>
<p>
{{ formattedResourceSize(download) }} &nbsp;&nbsp;
{{ formatDownloadRequestedDate(download) }}
</p>
<KIcon
v-if="download.status !== 'IN_PROGRESS'"
:icon="downloadStatusIcon(download)"
:color="download.status === 'PENDING' ? $themeTokens.annotation : null"
class="icon"
/>
<div
v-if="download.status === 'IN_PROGRESS'"
class="inline-loader"
>
<KCircularLoader
:size="20"
:disableDefaultTransition="true"
class="icon"
/>
</div>
<span class="status-text">{{ formattedDownloadStatus(download) }} </span>
</div>
</td>
<td v-if="windowIsLarge">
{{ formattedResourceSize(download) }}
</td>
<td v-if="windowIsLarge">
{{ formatDownloadRequestedDate(download) }}
</td>
<td v-if="windowIsLarge">
<CoreTable>
<template #headers>
<th>
<KCheckbox
showLabel
class="select-all"
:label="coreString('nameLabel')"
:checked="areAllSelected"
:indeterminate="areAnySelected && !areAllSelected"
:disabled="!areAnyAvailable"
:style="{ color: $themeTokens.annotation }"
@change="selectAll($event)"
/>
</th>
<th v-if="windowIsLarge">
{{ coreString('fileSize') }}
</th>
<th v-if="windowIsLarge">
{{ coreString('dateAdded') }}
</th>
<th v-if="windowIsLarge">
{{ coreString('statusLabel') }}
</th>
</template>
<template #tbody>
<tbody v-if="!loading">
<tr
v-for="download in paginatedDownloads"
:key="download.contentnode_id"
:style="download.status !== 'COMPLETED' ? { color: $themeTokens.annotation } : {}"
>
<td :class="{ 'small-resource-details': !windowIsLarge }">
<KCheckbox
:checked="Boolean(selectedDownloadsMap[download.contentnode_id])"
class="download-checkbox"
@change="handleCheckResource(download.contentnode_id, $event)"
>
<KLabeledIcon
v-if="download.metadata"
:icon="getIcon(download.metadata.learning_activities)"
:label="download.metadata.title"
:style="nonCompleteStatus(download) ? { color: $themeTokens.annotation } : {}"
/>
</KCheckbox>
<div
v-if="!windowIsLarge"
class="small-screen-status"
>
<p>
{{ formattedResourceSize(download) }} &nbsp;&nbsp;
{{ formatDownloadRequestedDate(download) }}
</p>
<KIcon
v-if="download.status !== 'IN_PROGRESS'"
:icon="downloadStatusIcon(download)"
Expand All @@ -97,34 +70,59 @@
/>
</div>
<span class="status-text">{{ formattedDownloadStatus(download) }} </span>
</td>
<td class="resource-action">
<KButton
v-if="nonCompleteStatus(download)"
:text="coreString('viewAction')"
appearance="flat-button"
:disabled="true"
/>
<KExternalLink
v-else
:text="coreString('viewAction')"
appearance="flat-button"
:href="genExternalContentURLBackLinkCurrentPage(download.contentnode_id)"
/>
<KButton
:text="coreString('removeAction')"
appearance="flat-button"
@click="markSingleResourceForRemoval(download)"
</div>
</td>
<td v-if="windowIsLarge">
{{ formattedResourceSize(download) }}
</td>
<td v-if="windowIsLarge">
{{ formatDownloadRequestedDate(download) }}
</td>
<td v-if="windowIsLarge">
<KIcon
v-if="download.status !== 'IN_PROGRESS'"
:icon="downloadStatusIcon(download)"
:color="download.status === 'PENDING' ? $themeTokens.annotation : null"
class="icon"
/>
<div
v-if="download.status === 'IN_PROGRESS'"
class="inline-loader"
>
<KCircularLoader
:size="20"
:disableDefaultTransition="true"
class="icon"
/>
</td>
</tr>
</tbody>
</template>
</CoreTable>
<p v-if="!loading && !downloadItemListLength">
{{ coreString('noResourcesDownloaded') }}
</p>
</PaginatedListContainerWithBackend>
</div>
<span class="status-text">{{ formattedDownloadStatus(download) }} </span>
</td>
<td class="resource-action">
<KButton
v-if="nonCompleteStatus(download)"
:text="coreString('viewAction')"
appearance="flat-button"
:disabled="true"
/>
<KExternalLink
v-else
:text="coreString('viewAction')"
appearance="flat-button"
:href="genExternalContentURLBackLinkCurrentPage(download.contentnode_id)"
/>
<KButton
:text="coreString('removeAction')"
appearance="flat-button"
@click="markSingleResourceForRemoval(download)"
/>
</td>
</tr>
</tbody>
</template>
</CoreTable>
<p v-if="!loading && !downloadItemListLength">
{{ coreString('noResourcesDownloaded') }}
</p>
<SelectionBottomBar
:count="Object.keys(selectedDownloadsMap).length"
:size="formattedSelectedSize"
Expand Down Expand Up @@ -155,7 +153,6 @@
import bytesForHumans from 'kolibri/uiText/bytesForHumans';
import CoreTable from 'kolibri/components/CoreTable';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import PaginatedListContainerWithBackend from 'kolibri-common/components/PaginatedListContainerWithBackend';
import PaginationActions from 'kolibri-common/components/PaginationActions';
import { computed, getCurrentInstance } from 'vue';
import { get } from '@vueuse/core';
Expand All @@ -181,7 +178,6 @@
CoreTable,
SelectionBottomBar,
ConfirmationDeleteModal,
PaginatedListContainerWithBackend,
PaginationActions,
},
mixins: [commonCoreStrings],
Expand Down

This file was deleted.

Loading