Skip to content

Commit

Permalink
Various code cleanup - deleting stale code, uncommenting necessary co…
Browse files Browse the repository at this point in the history
…de, styles
  • Loading branch information
marcellamaki committed Oct 29, 2021
1 parent 753ec2e commit 794c023
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
v-on="$listeners"
/>
</KModal>
<div v-else>
<h2>{{ $tr('title') }}</h2>
<CategorySearchModalOptions
:selectedCategory="selectedCategory"
:availableLabels="availableLabels"
span="1"
numCols="1"
v-on="$listeners"
/>
</div>

<h2>{{ $tr('title') }}</h2>
<CategorySearchModalOptions
:selectedCategory="selectedCategory"
:availableLabels="availableLabels"
span="1"
numCols="1"
v-on="$listeners"
/>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class="selector"
:value="selectedLanguage"
:label="coreString('languageLabel')"
:style="{ color: $themeTokens.text }"
@change="val => handleChange('languages', val)"
/>
<KSelect
Expand All @@ -15,6 +16,7 @@
class="selector"
:value="selectedLevel"
:label="coreString('levelLabel')"
:style="{ color: $themeTokens.text }"
@change="val => handleChange('grade_levels', val)"
/>
<KSelect
Expand All @@ -23,6 +25,7 @@
class="selector"
:value="selectedChannel"
:label="coreString('channelLabel')"
:style="{ color: $themeTokens.text }"
@change="val => handleChange('channels', val)"
/>
<KSelect
Expand All @@ -31,6 +34,7 @@
class="selector"
:value="selectedAccessibilityFilter"
:label="coreString('accessibility')"
:style="{ color: $themeTokens.text }"
@change="val => handleChange('accessibility_labels', val)"
/>
</div>
Expand Down Expand Up @@ -162,7 +166,6 @@
bottom: 45px;
left: 10px;
font-size: 12px;
color: black;
}
/deep/ .ui-select-label-text.is-floating {
Expand Down
55 changes: 24 additions & 31 deletions kolibri/plugins/learn/assets/src/views/HybridLearningCardGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:title="content.title"
:thumbnail="content.thumbnail"
:kind="content.kind"
:activityLength="content.activity_length"
:activityLength="content.duration"
:isLeaf="content.is_leaf"
:progress="content.progress_fraction || 0"
:numCoachContents="content.num_coach_contents"
Expand All @@ -28,25 +28,26 @@
/>
</KFixedGridItem>
</KFixedGrid>
<HybridLearningLessonCard
v-for="content in contents"
v-else-if="currentPage === 'lessonPage' || (windowIsSmall && isLibraryPage)"
:key="content.id"
:contentNode="content"
:channelThumbnail="content.channel_thumbnail"
:channelTitle="content.channel_title"
:description="content.description"
:activityLength="content.activity_length"
:thumbnail="content.thumbnail || getContentNodeThumbnail(content)"
class="grid-item"
:isMobile="windowIsSmall"
:title="content.title"
:kind="content.kind"
:isLeaf="content.is_leaf"
:progress="content.progress || content.progress_fraction || 0"
:numCoachContents="content.num_coach_contents"
:link="genContentLink(content.id, content.is_leaf)"
/>
<div v-else-if="currentPage === 'lessonPage' || (windowIsSmall && isLibraryPage)">
<HybridLearningLessonCard
v-for="content in contents"
:key="content.id"
:contentNode="content"
:channelThumbnail="content.channel_thumbnail"
:channelTitle="content.channel_title"
:description="content.description"
:activityLength="content.duration"
:thumbnail="content.thumbnail || getContentNodeThumbnail(content)"
class="grid-item"
:isMobile="windowIsSmall"
:title="content.title"
:kind="content.kind"
:isLeaf="content.is_leaf"
:progress="content.progress || content.progress_fraction || 0"
:numCoachContents="content.num_coach_contents"
:link="genContentLink(content.id, content.is_leaf)"
/>
</div>
<CardGrid
v-else-if=" !isBookmarksPage && cardViewStyle === 'card' && windowIsSmall"
>
Expand All @@ -67,7 +68,7 @@
:channelThumbnail="content.channel_thumbnail"
:channelTitle="content.channel_title"
:description="content.description"
:activityLength="content.activity_length"
:activityLength="content.duration"
:currentPage="currentPage"
class="grid-item"
:isMobile="windowIsSmall"
Expand Down Expand Up @@ -98,15 +99,14 @@

<script>
import { validateLinkObject } from 'kolibri.utils.validators';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import { PageNames } from '../constants';
import genContentLink from '../utils/genContentLink';
import HybridLearningContentCardListView from './HybridLearningContentCardListView';
import HybridLearningContentCard from './HybridLearningContentCard';
import HybridLearningLessonCard from './HybridLearningLessonCard';
import ResourceCard from './cards/ResourceCard';
import CardGrid from './cards/CardGrid';
import CopiesModal from './CopiesModal';
export default {
Expand Down Expand Up @@ -142,14 +142,6 @@
type: Number,
required: true,
},
genContentLink: {
type: Function,
validator(value) {
return validateLinkObject(value(1, 'exercise'));
},
default: () => ({}),
required: false,
},
getContentNodeThumbnail: {
type: Function,
default: () => ({}),
Expand All @@ -175,6 +167,7 @@
},
},
methods: {
genContentLink,
openCopiesModal(contentId) {
this.sharedContentId = contentId;
this.uniqueId = this.contents.find(content => content.content_id === contentId).id;
Expand Down
6 changes: 0 additions & 6 deletions kolibri/plugins/learn/assets/src/views/LearnIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@
hasSidebar: true,
};
}
// if (this.pageName === ClassesPageNames.LESSON_PLAYLIST) {
// return {
// immersivePage: false,
// hasSidebar: true,
// };
// }
if (
this.pageName === PageNames.TOPICS_TOPIC ||
this.pageName === PageNames.TOPICS_CHANNEL
Expand Down

0 comments on commit 794c023

Please sign in to comment.