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 20, 2024
1 parent 3648fc5 commit dd36619
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
>
<div class="move-handle">
<DragSortWidget
:moveUpText="()=>moveResourceUpButtonDescription$()"
:moveDownText="()=>moveResourceDownButtonDescription$()"
:moveUpText="() => moveResourceUpButtonDescription$()"
:moveDownText="() => moveResourceDownButtonDescription$()"
:isFirst="index === 0"
:isLast="index === resourceListItems.length - 1"
@moveUp="moveUpOne(index)"
Expand Down Expand Up @@ -110,9 +110,9 @@
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import CoachContentLabel from 'kolibri-common/components/labels/CoachContentLabel';
import useSnackbar from 'kolibri/composables/useSnackbar';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import { coachStrings } from '../../common/commonCoachStrings';
import { PageNames } from '../../../constants';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
// This is a simplified version of ResourceListTable that is supposed to work
// outside of the LessonSummaryPage workflow.
Expand All @@ -137,8 +137,8 @@
noResourcesInLessonLabel$,
createSnackbar,
clearSnackbar,
moveResourceUpButtonDescription$,
moveResourceDownButtonDescription$
moveResourceUpButtonDescription$,
moveResourceDownButtonDescription$,
};
},
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<!-- Mousedown.prevent is needed to avoid user selection -->
<DragSortWidget
class="sort-widget"
:moveUpText="()=>moveResourceUpButtonDescription$()"
:moveDownText="()=>moveResourceDownButtonDescription$()"
:moveUpText="() => moveResourceUpButtonDescription$()"
:moveDownText="() => moveResourceDownButtonDescription$()"
:isFirst="index === 0"
:isLast="index === entries.length - 1"
@moveUp="moveUpOne(index)"
Expand Down Expand Up @@ -117,10 +117,10 @@
const { moveResourceUpButtonDescription$, moveResourceDownButtonDescription$ } =
searchAndFilterStrings;
return {
return {
moveResourceUpButtonDescription$,
moveResourceDownButtonDescription$
}
moveResourceDownButtonDescription$,
};
},
props: {
title: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,81 +1,73 @@
<template>

<div>
<p>{{ coreString('lessonsLabel') }} : {{ lessonObject.title }} </p>
<p>{{ coreString('lessonsLabel') }} : {{ lessonObject.title }}</p>

<p>{{ $tr('sizeLabel') }} : {{ bytesForHumans(lessonObject.size) }}</p>

<div
v-for="(lesson , index) in resources"
v-for="(lesson, index) in resources"
:key="index"
>
<KGrid :style="lessonOrderListButtonBorder">
<KGridItem :layout12="{ span: 6 }">
<div style="display:flex;">
<div style="display: flex">
<div>
<DragSortWidget
:moveUpText="()=> upLabel$()"
:moveDownText="()=> downLabel$()"
:moveUpText="() => upLabel$()"
:moveDownText="() => downLabel$()"
:noDrag="true"
:isFirst="index === 0"
:isLast="index === resources.length - 1"
@moveUp="() => {}"
@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"
class="icon-style"
/>
</span>
</div>
<div>
<span
class="arrange-item-block"
>
<span class="arrange-item-block">
<span>
<KRouterLink
<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="()=>{ }"
icon="emptyTopic"
@click="() => {}"
/>

<KIconButton
icon="minus"
@click="removeResource(lesson.id)"
@click="removeResource(lesson.id)"
/>
</span>
</KGridItem>

</KGrid>
</div>

<div class="bottom-buttons-style">
<KButton
:primary="true"
text="save & finish"
@click="()=>{ }"
@click="() => {}"
/>
</div>
</div>
Expand All @@ -86,82 +78,79 @@
<script>
import DragSortWidget from 'kolibri.coreVue.components.DragSortWidget';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import LearningActivityIcon from 'kolibri-common/components/ResourceDisplayAndSearch/LearningActivityIcon.vue';
import bytesForHumans from 'kolibri.utils.bytesForHumans';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
export default {
name:'ManageSelectedLessonResources',
name: 'ManageSelectedLessonResources',
components: {
DragSortWidget,
LearningActivityIcon
LearningActivityIcon,
},
mixins:[commonCoreStrings],
setup(){
const {
upLabel$,
downLabel$,
} = searchAndFilterStrings;
mixins: [commonCoreStrings],
setup() {
const { upLabel$, downLabel$ } = searchAndFilterStrings;
return {
upLabel$,
downLabel$,
}
};
},
props:{
lessonResourceList:{
props: {
lessonResourceList: {
type: Array,
required:true
required: true,
},
lessonObject:{
lessonObject: {
type: Object,
required:true
required: true,
},
},
data(){
data() {
return {
resources: this.lessonResourceList,
}
};
},
computed: {
lessonOrderListButtonBorder(){
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`,
};
},
},
methods:{
removeResource(id){
this.resources = this.resources.filter((lesson) => lesson.id !== id);
methods: {
removeResource(id) {
this.resources = this.resources.filter(lesson => lesson.id !== id);
},
bytesForHumans,
},
$trs:{
sizeLabel:{
$trs: {
sizeLabel: {
message: 'Size',
context: 'Size of the lesson'
}
}
}
context: 'Size of the lesson',
},
},
};
</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 {
Expand All @@ -176,4 +165,4 @@
border-top: 1px solid black;
}
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@
<div>
<DragSortWidget
class="sort-widget"
:moveUpText="()=> upLabel$()"
:moveDownText="()=>downLabel$()"
:moveUpText="() => upLabel$()"
:moveDownText="() => downLabel$()"
:noDrag="true"
:isFirst="index === 0"
:isLast="index === activeQuestions.length - 1"
Expand Down Expand Up @@ -450,7 +450,7 @@
createSnackbar,
upLabel$,
downLabel$
downLabel$,
};
},
data() {
Expand Down Expand Up @@ -513,7 +513,6 @@
},
];
},
},
created() {
const { query } = this.$route;
Expand Down Expand Up @@ -658,10 +657,10 @@
this.deleteActiveSelectedQuestions();
this.createSnackbar(this.questionsDeletedNotification$({ count }));
},
upLabel(){
upLabel() {
return this.$tr('up');
},
downLabel(){
downLabel() {
return this.$tr('down');
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
>
<DragSortWidget
class="drag-title"
:moveUpText="()=> upLabel$()"
:moveDownText="()=> downLabel$()"
:moveUpText="() => upLabel$()"
:moveDownText="() => downLabel$()"
:noDrag="true"
:isFirst="index === 0"
:isLast="index === sectionOrderList.length - 1"
Expand Down Expand Up @@ -98,9 +98,9 @@
import DragContainer from 'kolibri-common/components/sortable/DragContainer';
import DragHandle from 'kolibri-common/components/sortable/DragHandle';
import DragSortWidget from 'kolibri-common/components/sortable/DragSortWidget';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import { PageNames } from '../../../constants/index';
import { injectQuizCreation } from '../../../composables/useQuizCreation';
import { searchAndFilterStrings } from 'kolibri-common/strings/searchAndFilterStrings';
import useDrag from './useDrag.js';
export default {
Expand Down Expand Up @@ -147,10 +147,7 @@
updateQuiz,
} = injectQuizCreation();
const {
upLabel$,
downLabel$,
} = searchAndFilterStrings;
const { upLabel$, downLabel$ } = searchAndFilterStrings;
const { moveDownOne, moveUpOne } = useDrag();
Expand Down Expand Up @@ -322,13 +319,13 @@
);
return displaySectionTitle(section, sectionIndexOrder).toUpperCase();
},
upLabel(){
upLabel() {
return this.$tr('up');
},
downLabel(){
downLabel() {
return this.$tr('down');
},
},
},
$trs: {
up: {
message: 'Up',
Expand Down
Loading

0 comments on commit dd36619

Please sign in to comment.