-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathLicenseDetailsCard.vue
129 lines (127 loc) · 3.65 KB
/
LicenseDetailsCard.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
<div class="selected-license-card">
<h3 class="vocab ha h3a">
{{ $t('license-details-card.heading') }}
</h3>
<h4 class="vocab h4b hb">
<a
:href="licenseUrl('web')"
class="license-name"
>
{{ fullName }} ({{ shortName }})
<LicenseIcons
:url="licenseUrl('web')"
:icons-arr="iconsList"
/>
</a>
</h4>
<p class="chooser-selected-description">
<b>{{ slug.toUpperCase() }}</b>
{{ $t(licenseKey) }}
</p>
<section class="license-visual-info">
<ul class="license-list">
<transition-group name="highlight">
<li
v-for="item in iconsList"
:key="item"
:class="['license-list-item', item]"
>
<span class="readable-string">
<b v-if="item!=='zero'">{{ item.toUpperCase() }}:</b>
<b v-else>CC0:</b>
{{ $t(`license-details-card.item-description.${item}`) }}
</span>
</li>
</transition-group>
</ul>
</section>
</div>
</template>
<script>
import { licenseSlug } from '../utils/license-utilities'
import LicenseIcons from './LicenseIcons'
import { mapGetters } from 'vuex'
export default {
name: 'LicenseDetailsCard',
components: {
LicenseIcons
},
computed: {
...mapGetters(['shortName', 'fullName', 'iconsList', 'licenseUrl']),
licenseDescription() {
const descriptionString = `${this.slug}-description`
return this.$t(descriptionString)
},
licenseKey() {
return `license-details-card.full-description.${this.slug}`
},
slug() {
return licenseSlug(this.shortName)
}
}
}
</script>
<style lang="scss">
.select-license-card {
margin-bottom: 32px;
}
.license-name {
vertical-align: middle;
display: inline-block;
margin-top: 8px;
}
.license-name .photo-license-icons {
height: 35px;
vertical-align: middle;
}
.license-name .photo-license-icon {
height: 35px;
opacity: 1;
}
.license-visual-info {
margin-top: 16px;
}
.license-list-item {
position: relative;
padding-bottom: 8px;
}
.license-list-item span {
vertical-align: middle;
display:inline-block;
}
.license-list-item span b {
display: inline-block;
width: 36px;
}
.license-list-item::before{
position: absolute;
left: 0;
top: 0;
display: inline-block;
width: 35px;
height: 35px;
border-radius: 50%;
content: "";
background-size: 35px 35px;
}
.license-list-item.zero::before {
background-image: url("../assets/license-icons/cc-cc0_icon.svg");
}
.license-list-item.by::before {
background-image: url("../assets/license-icons/cc-by_icon.svg");
}
.license-list-item.nc::before {
background-image: url("../assets/license-icons/cc-nc_icon.svg");
}
.license-list-item.nd::before {
background-image: url("../assets/license-icons/cc-nd_icon.svg");
}
.license-list-item.sa::before {
background-image: url("../assets/license-icons/cc-sa_icon.svg");
}
.readable-string {
padding-left:51px;
line-height:35px;
}
</style>