Skip to content

Commit b931dfb

Browse files
committed
Card styling and SelectedLicenseCode methods to computed properties
Signed-off-by: Olga Bulat <obulat@gmail.com>
1 parent 4128112 commit b931dfb

File tree

4 files changed

+38
-33
lines changed

4 files changed

+38
-33
lines changed

src/components/Chooser.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ export default {
4545
}
4646
</script>
4747
<style lang="scss">
48-
.column {
49-
padding:0!important;
50-
}
48+
5149
header.card-header {
5250
justify-content: center;
5351
padding-top:1rem;

src/components/LicenseCard.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export default {
4848
}
4949
</script>
5050
<style lang="scss" scoped>
51+
.column {
52+
padding:0!important;
53+
}
5154
div.card {
5255
height: 580px;
5356
border-top: 10px solid #04A635;

src/components/SelectedLicenseCode.vue

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,6 @@ export default {
6767
}
6868
},
6969
methods: {
70-
authorElement() {
71-
return workAuthor({
72-
creatorName: this.$props.value.attributionDetails.creatorName,
73-
creatorProfileUrl: this.$props.value.attributionDetails.creatorProfileUrl
74-
})
75-
},
76-
titleElement() {
77-
const workUrl = this.$props.value.attributionDetails.workUrl
78-
const workTitle = this.$props.value.attributionDetails.workTitle
79-
if (!workTitle && !workUrl) {
80-
return this.$t('this-work')
81-
} else {
82-
const titleSpan = workTitle ? `<span rel="dc:title">${workTitle}</span>` : this.$t('this-work')
83-
if (workUrl) {
84-
return `<a rel="cc:attributionURL" href="${workUrl}">${titleSpan}</a>`
85-
} else {
86-
return titleSpan
87-
}
88-
}
89-
},
90-
workLicenseElement() {
91-
return workLicense(this.licenseURL,
92-
this.$props.value.shortName)
93-
},
9470
onCopySuccess(e) {
9571
this.success = true
9672
this.$emit('copied', { content: e.text })
@@ -111,13 +87,38 @@ export default {
11187
licenseURL() {
11288
return this.$licenseUrl(this.$props.value.shortName)
11389
},
90+
workLicenseElement() {
91+
return workLicense(this.licenseURL,
92+
this.$props.value.shortName)
93+
},
94+
authorElement() {
95+
return workAuthor({
96+
creatorName: this.$props.value.attributionDetails.creatorName,
97+
creatorProfileUrl: this.$props.value.attributionDetails.creatorProfileUrl
98+
})
99+
},
100+
titleElement() {
101+
const workUrl = this.$props.value.attributionDetails.workUrl
102+
const workTitle = this.$props.value.attributionDetails.workTitle
103+
if (!workTitle && !workUrl) {
104+
return this.$t('this-work')
105+
} else {
106+
const titleSpan = workTitle ? `<span rel="dc:title">${workTitle}</span>` : this.$t('this-work')
107+
if (workUrl) {
108+
return `<a rel="cc:attributionURL" href="${workUrl}">${titleSpan}</a>`
109+
} else {
110+
return titleSpan
111+
}
112+
}
113+
},
114114
htmlElement() {
115115
const licenseText = this.$t('license-text', {
116-
workTitle: this.titleElement(),
117-
byLine: this.authorElement()
116+
workTitle: this.titleElement,
117+
byLine: this.authorElement
118118
})
119-
const licenseIcons = `<span class="license-icons">${this.workLicenseElement()}</span>`
120-
return `<p xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#">${licenseText}${licenseIcons}</p>`
119+
const paragraphBeginning = '<p id="license-code" xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#">'
120+
const fullLicenseCode = `${paragraphBeginning}${licenseText}${this.workLicenseElement}</p>`
121+
return fullLicenseCode
121122
},
122123
activeTab: {
123124
get() { return this.currentTab },

src/components/Stepper.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class='column is-three-fifths-tablet is-half-desktop'>
3-
<div id="stepper" class="card">
2+
<div class='column is-three-fifths-tablet is-half-desktop' id="stepper" >
3+
<div class="card">
44
<header class="card-header">
55
<h2 :class="'vocab-h2'">{{ $t('select-license-heading') }}</h2>
66
</header>
@@ -182,6 +182,9 @@ export default {
182182
.card {
183183
height: 580px;
184184
}
185+
#stepper.column {
186+
padding:0!important;
187+
}
185188
#stepper .card-header {
186189
border-top: 10px solid #05B5DA;
187190
background-color: #05B5DA;

0 commit comments

Comments
 (0)