7
7
aria-controls =" contentIdForA11y1" >
8
8
<h3 class =" title is-3" >Have a Website?</h3 >
9
9
</button >
10
- <div class =" notification" >
11
10
<div class =" content" >
11
+ <span id =" attribution" class =" photo_usage-attribution" ref =" photoAttribution" >
12
+ <a :href =" workLocation"
13
+ v-if =" workTitle && workLocation"
14
+ target =" _blank"
15
+ rel =" noopener" >"{{ workTitle }}"
16
+ </a >
17
+ <p v-if =" !workTitle" >This work</p >
18
+ <p v-if =" workTitle && !workLocation" >{{ workTitle }}</p >
19
+ <span v-if =" attributeToName" >
20
+ by
21
+ <a v-if =" attributeToURL"
22
+ :href =" attributeToURL"
23
+ target =" _blank"
24
+ rel =" noopener" >{{ attributeToName }}</a >
25
+ <span v-else >{{ attributeToName }}</span >
26
+ </span >
27
+ is licensed under
28
+ <a class =" photo_license" :href =" licenseURL" target =" _blank" rel =" noopener" >
29
+ {{ shortLicenseName }}
30
+ </a >
31
+ </span >
32
+ <LicenseIcons
33
+ :url =" licenseURL"
34
+ :iconsArr =" iconsArr"
35
+ />
12
36
<CopyButton id =" copy-richtext-btn"
13
37
el =" #generated-richtext-container"
14
38
title =" Copy the attribution to paste into your blog or document"
101
125
</div >
102
126
</div >
103
127
</div >
104
- </div >
105
128
</b-collapse >
106
129
</div >
107
130
</template >
108
131
<script >
109
132
import CopyButton from ' ./CopyButton'
110
133
import LicenseIcons from ' ./LicenseIcons'
134
+ import LicenseIconography from ' @creativecommons/vocabulary/vocabulary.common'
111
135
import attributionHtml from ' @/utils/attributionHtml'
112
136
import licenseUrl from ' @/utils/licenseUrl'
137
+ import shortNameToIconsArray from ' @/utils/licenseUtils'
113
138
114
139
export default {
115
140
name: ' HTMLGenerator' ,
116
141
props: [' shortLicenseName' ],
117
142
components: {
118
143
CopyButton,
119
- LicenseIcons
144
+ LicenseIcons,
145
+ LicenseIconography
120
146
},
121
147
data () {
122
148
return {
@@ -136,10 +162,18 @@ export default {
136
162
attributeToName: this .attributeToName ,
137
163
attributeToURL: this .attributeToURL ,
138
164
},
139
- licenseUrl ( this .$props . shortLicenseName ) ,
165
+ this .licenseURL ,
140
166
this .$props .shortLicenseName
141
167
);
142
168
}
169
+ },
170
+ computed: {
171
+ licenseURL () {
172
+ return licenseUrl (this .$props .shortLicenseName )
173
+ },
174
+ iconsArr () {
175
+ return this .$props .shortLicenseName .toLowerCase ().slice (3 , this .$props .shortLicenseName .length - 4 ).split (' -' )
176
+ }
143
177
}
144
178
}
145
179
</script >
@@ -160,4 +194,8 @@ export default {
160
194
.field {
161
195
margin-bottom : 0px ;
162
196
}
197
+
198
+ #attribution p {
199
+ display : inline
200
+ }
163
201
</style >
0 commit comments