Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Nov 21, 2024
1 parent e18471f commit 38f90a6
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 92 deletions.
2 changes: 0 additions & 2 deletions kolibri/plugins/coach/assets/src/routes/planLessonsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ export default [
},
},
{


name: PageNames.LESSON_SELECT_RESOURCES,
path: 'select-resources/:topicId?',
component: LessonResourceSelection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
:text="$tr('numbeOfSelectedResourcesLabel', { count: workingResources.length })"
:primary="true"
:to="goToPreviewSelection()"
:style="{ marginRight: '1em' , marginTop: '0.5em' }"
:style="{ marginRight: '1em', marginTop: '0.5em' }"
/>

<KRouterLink
Expand Down Expand Up @@ -568,19 +568,20 @@
topicsLink(topicId) {
return this.topicListingLink({ ...this.$route.params, topicId });
},
goToPreviewSelection(){
return{
name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES
}
}
goToPreviewSelection() {
return {
name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES,
};
},
},
$trs: {
resources: {
message: '{count} {count, plural, one {resource} other {resources}}',
context: "Only translate 'resource' and 'resources'.",
},
numbeOfSelectedResourcesLabel:{
message:'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} '
numbeOfSelectedResourcesLabel: {
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
},
selectionInformation: {
message:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
ReportsLessonTabs,
workingResourcesBackup,
REPORTS_LESSON_TABS_ID,
showSidePanel:true,
showSidePanel: true,
};
},
computed: {
Expand Down Expand Up @@ -288,7 +288,7 @@
}
},
},
mounted(){
mounted() {
console.log(this.route.params);
},
methods: {
Expand Down Expand Up @@ -391,9 +391,10 @@
context: 'Allows user to undo an action.',
},
numberOfSelectedResource: {
message: '{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context:'Indicates the number of resources selected'
}
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context: 'Indicates the number of resources selected',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
:text="$tr('numbeOfSelectedResourcesLabel', { count: workingResources.length })"
:primary="true"
:to="{ name: PageNames.LESSON_PREVIEW_SELECTED_RESOURCES }"
:style="{ marginRight: '1em' , marginTop: '0.5em' }"
:style="{ marginRight: '1em', marginTop: '0.5em' }"
/>
<KButton
primary
Expand Down Expand Up @@ -157,12 +157,12 @@
saveAndFinishAction$,
};
},
data(){
data() {
return {
PageNames,
}
};
},
computed:{
computed: {
...mapState('lessonSummary', ['workingResources']),
},
methods: {
Expand All @@ -176,10 +176,12 @@
context:
"In the 'Manage lesson resources' coaches can add new/remove resource material to a lesson.",
},
numbeOfSelectedResourcesLabel:{
message:'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
context:"This is the label that shows the number of resources selected in the lesson resource selection page"
}
numbeOfSelectedResourcesLabel: {
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}} ',
context:
'This is the label that shows the number of resources selected in the lesson resource selection page',
},
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>

<SidePanelModal
alignment="right"
sidePanelWidth="700px"
Expand All @@ -7,7 +8,9 @@
@shouldFocusFirstEl="() => null"
>
<template #header>
<h4 class="side-panel-title"> {{ $tr('numberOfSelectedResource',{ count : resourcesTable.length })}}</h4>
<h4 class="side-panel-title">
{{ $tr('numberOfSelectedResource', { count: resourcesTable.length }) }}
</h4>
<router-view @closePanel="() => $router.go(-1)" />
</template>

Expand All @@ -16,16 +19,16 @@
</div>

<div v-else>
<p>{{ coreString('lessonsLabel') }} : {{ currentLesson.title }} </p>
<p>{{ coreString('lessonsLabel') }} : {{ currentLesson.title }}</p>
<p>{{ $tr('sizeLabel') }} : {{ bytesForHumans(currentLesson.size) }}</p>

<div
v-for="(lesson , index) in resourcesTable"
v-for="(lesson, index) in resourcesTable"
:key="index"
>
<KGrid :style="lessonOrderListButtonBorder">
<KGridItem :layout12="{ span: 6 }">
<div style="display:flex;">
<div style="display: flex">
<div>
<DragSortWidget
moveUpText="up"
Expand All @@ -37,41 +40,35 @@
@moveDown="() => {}"
/>
</div>
<div style="padding:0px 10px">
<span
style="flex: 1"
>
<div style="padding: 0 10px">
<span style="flex: 1">
<LearningActivityIcon
:kind="lesson.learning_activities[0]"
class="icon-style"
/>
</span>
</div>
<div>
<span
class="arrange-item-block"
>
<span class="arrange-item-block">
<span>
<KRouterLink
v-if="lesson.link"
:text="lesson.title"
:to="lesson.link"
style="font-size:14px"
style="font-size: 14px"
/>
</span>
<p style="font-size:12px"> 4MB </p>
<p style="font-size: 12px">4MB</p>
</span>
</div>
</div>
</KGridItem>

<KGridItem :layout12="{ span: 6 }">
<span
class="add-minus-button"
>
<span class="add-minus-button">
<KIconButton
icon="emptyTopic"
@click="()=>{ }"
@click="() => {}"
/>

<KIconButton
Expand All @@ -80,12 +77,10 @@
/>
</span>
</KGridItem>

</KGrid>
</div>
</div>


<template #bottomNavigation>
<div class="bottom-buttons-style">
<KButton
Expand All @@ -110,29 +105,29 @@
import { mapState } from 'vuex';
export default {
name:'ManageSelectedLessonResources',
name: 'ManageSelectedLessonResources',
components: {
DragSortWidget,
LearningActivityIcon,
SidePanelModal
SidePanelModal,
},
mixins:[commonCoreStrings],
data(){
mixins: [commonCoreStrings],
data() {
return {
resources: [],
isLoading:false,
}
isLoading: false,
};
},
computed: {
...mapState('lessonSummary', ['currentLesson', 'workingResources','resourceCache']),
lessonOrderListButtonBorder(){
...mapState('lessonSummary', ['currentLesson', 'workingResources', 'resourceCache']),
lessonOrderListButtonBorder() {
return {
borderBottom: `1px solid ${this.$themePalette.grey.v_200}`,
height:`4em`,
marginTop:`0.5em`
borderBottom: `1px solid ${this.$themePalette.grey.v_200}`,
height: `4em`,
marginTop: `0.5em`,
};
},
resourcesTable(){
resourcesTable() {
return this.workingResources.map(resource => {
const content = this.resourceCache[resource.contentnode_id];
if (!content) {
Expand All @@ -149,44 +144,48 @@
}
return tableRow;
})
});
},
},
methods:{
removeResource(id){
this.resources = this.resources.filter((lesson) => lesson.id !== id);
methods: {
removeResource(id) {
this.resources = this.resources.filter(lesson => lesson.id !== id);
},
closeSidePanel() {
this.$router.go(-2);
},
bytesForHumans,
},
$trs:{
sizeLabel:{
$trs: {
sizeLabel: {
message: 'Size',
context: 'Size of the lesson'
context: 'Size of the lesson',
},
numberOfSelectedResource: {
message: '{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context:'Indicates the number of resources selected'
}
}
}
message:
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context: 'Indicates the number of resources selected',
},
},
};
</script>


<style scoped>
.add-minus-button{
float:right;
.add-minus-button {
float: right;
}
.arrange-item-block{
display:block;
.arrange-item-block {
display: block;
}
.icon-style{
font-size:24px;
.icon-style {
font-size: 24px;
}
.bottom-buttons-style {
position: absolute;
right: 0;
Expand All @@ -199,4 +198,4 @@
border-top: 1px solid black;
}
</style>
</style>
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<template>


<div>

</div>
<div></div>

</template>


<script>
export default {
name: 'ManageSelectedResource',
};
</script>


Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>

<ManageSelectedLessonResources
<ManageSelectedLessonResources
:lessonResourceList="resources"
:lessonObject="lessonObject"
/>
Expand All @@ -21,8 +21,8 @@
return {
resources: [],
lessonObject: {},
}
},
};
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@
export default {
name: 'SectionOrder',
components: {
Draggable,
DragContainer,
DragHandle,
DragSortWidget,
},
components: {
Draggable,
DragContainer,
DragHandle,
DragSortWidget,
},
mixins: [commonCoreStrings],
setup(_, context) {
const {
Expand Down

0 comments on commit 38f90a6

Please sign in to comment.