-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from indirectlylit/pageicon
pageicon updates
- Loading branch information
Showing
17 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 49 additions & 7 deletions
56
kolibri/plugins/learn/assets/src/vue/content-icon/index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,80 @@ | ||
<template> | ||
|
||
<img :src="src" :alt="altText"> | ||
<div> | ||
<!-- complete --> | ||
<svg v-if="thisIs('complete', 'audio')" src="./content-icons/complete-audio.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('complete', 'document')" src="./content-icons/complete-document.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('complete', 'exercise')" src="./content-icons/complete-exercise.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('complete', 'video')" src="./content-icons/complete-video.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
|
||
<!-- partial --> | ||
<svg v-if="thisIs('partial', 'audio')" src="./content-icons/partial-audio.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('partial', 'document')" src="./content-icons/partial-document.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('partial', 'exercise')" src="./content-icons/partial-exercise.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('partial', 'video')" src="./content-icons/partial-video.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
|
||
<!-- unstarted --> | ||
<svg v-if="thisIs('unstarted', 'audio')" src="./content-icons/unstarted-audio.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('unstarted', 'document')" src="./content-icons/unstarted-document.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('unstarted', 'exercise')" src="./content-icons/unstarted-exercise.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
<svg v-if="thisIs('unstarted', 'video')" src="./content-icons/unstarted-video.svg" :class="{pageicon: ispageicon}" :title="altText" :width="size" :height="size"></svg> | ||
</div> | ||
|
||
</template> | ||
|
||
|
||
<script> | ||
const PROGRESS_STATES = ['complete', 'partial', 'unstarted']; | ||
const KINDS = ['audio', 'document', 'video']; // not 'exercise' for now | ||
module.exports = { | ||
props: { | ||
ispageicon: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
size: { | ||
type: Number, | ||
default: 30, | ||
}, | ||
progress: { | ||
type: String, | ||
default: 'unstarted', | ||
validator(value) { | ||
return PROGRESS_STATES.indexOf(value) !== -1; | ||
}, | ||
}, | ||
kind: { | ||
type: String, | ||
required: true, | ||
validator(value) { | ||
return KINDS.indexOf(value) !== -1; | ||
}, | ||
}, | ||
}, | ||
computed: { | ||
altText() { | ||
// TODO - I18N | ||
return `${this.progress} - ${this.kind}`; | ||
}, | ||
src() { | ||
// Note: dynamic requires should be used carefully because | ||
// they greedily add items to the webpack bundle. | ||
// See https://webpack.github.io/docs/context.html | ||
return require(`./content-icons/${this.progress}-${this.kind}.svg`); | ||
}, | ||
methods: { | ||
thisIs(progress, kind) { | ||
return this.progress === progress && this.kind === kind; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
|
||
<style lang="stylus" scoped></style> | ||
<style lang="stylus" scoped> | ||
@require '~core-theme.styl' | ||
// replace the correct path | ||
.pageicon [fill='#996189'] | ||
fill: $core-text-default | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters