forked from learningequality/studio
-
Notifications
You must be signed in to change notification settings - Fork 0
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 learningequality#4730 from learningequality/revert…
…-4716-update-about-licenses Revert "Update how About License information is displayed in EditSourceModal"
- Loading branch information
Showing
9 changed files
with
111 additions
and
55 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
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
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
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
62 changes: 62 additions & 0 deletions
62
contentcuration/contentcuration/frontend/shared/views/AboutLicensesModal.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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
|
||
<KModal | ||
:title="$tr('licenseInfoHeader')" | ||
:cancelText="$tr('close')" | ||
@cancel="closeModal()" | ||
> | ||
<div v-for="(license, index) in licences" :key="index" class="mb-4 mt-3"> | ||
<h2 class="font-weight-bold mb-1 subheading"> | ||
{{ license.name }} | ||
</h2> | ||
<p class="body-1 grey--text mb-1"> | ||
{{ license.description }} | ||
</p> | ||
<p v-if="license.license_url"> | ||
<ActionLink | ||
:href="getLicenseUrl(license)" | ||
target="_blank" | ||
:text="$tr('learnMoreButton')" | ||
/> | ||
</p> | ||
</div> | ||
</KModal> | ||
|
||
</template> | ||
|
||
<script> | ||
import { mapMutations } from 'vuex'; | ||
import { constantsTranslationMixin } from 'shared/mixins'; | ||
import { LicensesList } from 'shared/leUtils/Licenses'; | ||
export default { | ||
name: 'AboutLicensesModal', | ||
mixins: [constantsTranslationMixin], | ||
computed: { | ||
licences() { | ||
return LicensesList.filter(license => license.id).map(license => ({ | ||
...license, | ||
name: this.translateConstant(license.license_name), | ||
description: this.translateConstant(license.license_name + '_description'), | ||
})); | ||
}, | ||
}, | ||
methods: { | ||
...mapMutations({ | ||
closeModal: 'SET_SHOW_ABOUT_LICENSES', | ||
}), | ||
getLicenseUrl(license) { | ||
const isCC = license.license_url.includes('creativecommons.org'); | ||
const language = window.languageCode || 'en'; | ||
return isCC ? `${license.license_url}deed.${language}` : license.license_url; | ||
}, | ||
}, | ||
$trs: { | ||
close: 'Close', | ||
learnMoreButton: 'Learn More', | ||
licenseInfoHeader: 'About licenses', | ||
}, | ||
}; | ||
</script> |
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