99            v-model =" activeTab" 
1010        >
1111            <b-tab-item  :label =" this.$t('use-license.rich-text-label')"  >
12-                 <div  id =" attribution-richtext" 
13-                     v-html =" this.htmlElement"  />
12+                 <div  id =" attribution-richtext"  >
13+                 <p  xmlns:dct =" http://purl.org/dc/terms/"   xmlns:cc =" http://creativecommons.org/ns#"  >
14+                     <span  v-html =" this.licenseCodeTextSpan"   />
15+                     <LicenseIcons 
16+                         :url =" this.$licenseUrl(this.$props.value.shortName)" 
17+                         :iconsArr =" this.$licenseIconsArr(this.$props.value.shortName)"  />
18+                 </p >
19+                 </div >
1420            </b-tab-item >
1521            <b-tab-item  :label =" this.$t('use-license.html-label')"  >
1622                <div  class =' control'   id =' generated-html-container'  >
1723                    <textarea  id =' attribution-html' 
1824                              class =' textarea' 
19-                               :value =" htmlElement " 
25+                               :value =" htmlLicenseParagraph " 
2026                              readonly 
2127                    />
2228                </div >
5258</template >
5359<script >
5460import  Clipboard  from  ' clipboard' 
55- import  {  workAuthor ,  workLicense  }  from  ' @/utils/attributionHtml ' 
61+ import  LicenseIcons   from  ' ./LicenseIcons ' 
5662
5763export  default  {
5864    name:  ' SelectedLicenseCode'  , 
65+     components:  { 
66+         LicenseIcons 
67+     }, 
5968    props:  [' value'  ], 
6069    data () { 
6170        return  { 
@@ -87,15 +96,20 @@ export default {
8796        licenseURL () { 
8897            return  this .$licenseUrl (this .$props .value .shortName ) 
8998        }, 
90-         workLicenseElement () { 
91-             return  workLicense (this .licenseURL , 
92-                 this .$props .value .shortName ) 
99+         licenseLink () { 
100+             const  short  =  this .$props .value .shortName .toUpperCase () 
101+             const  attrs  =  ' target="_blank" rel="license noopener noreferrer" style="display: inline-block;">'  
102+             return  ` <a href="${ this .licenseURL }  " ${ attrs}${ short}  </a>`  
93103        }, 
94104        authorElement () { 
95-             return  workAuthor ({ 
96-                 creatorName:  this .$props .value .attributionDetails .creatorName , 
97-                 creatorProfileUrl:  this .$props .value .attributionDetails .creatorProfileUrl  
98-             }) 
105+             const  name  =  this .$props .value .attributionDetails .creatorName  
106+             const  profile  =  this .$props .value .attributionDetails .creatorProfileUrl  
107+             if  (name) { 
108+                 const  creatorNameNoLink  =  ` <span rel="cc:attributionName">${ name}  </span>`  
109+                 return  profile 
110+                     ?  ` by <a rel="cc:attributionURL"  href="${ profile}  ">${ creatorNameNoLink}  </a>`  
111+                     :  ` by ${ creatorNameNoLink} `  
112+             } else  return  ' '  
99113        }, 
100114        titleElement () { 
101115            const  workUrl  =  this .$props .value .attributionDetails .workUrl  
@@ -112,14 +126,27 @@ export default {
112126                } 
113127            } 
114128        }, 
115-         htmlElement () { 
116-             const  licenseText  =  this .$t (' code-text.license-text'  , { 
129+         licenseCodeTextSpan () { 
130+             const  attributionCode  =  this .$t (' code-text.license-text'  , { 
117131                workTitle:  this .titleElement , 
118132                byLine:  this .authorElement  
119133            }) 
120-             const  paragraphBeginning  =  ' <p id="license-code" xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#">'  
121-             const  fullLicenseCode  =  ` ${ paragraphBeginning}${ licenseText}${ this .workLicenseElement }  </p>`  
122-             return  fullLicenseCode 
134+             return  ` ${ attributionCode}${ this .licenseLink } `  
135+         }, 
136+         htmlLicenseParagraph () { 
137+             let  short =  this .$props .value .shortName  
138+             const  iconStyle  =  ' style="height:22px!important;margin-left: 3px;vertical-align:text-bottom;opacity:0.7;"'  
139+             const  baseAssetsPath  =  ' https://search.creativecommons.org/static/img'  
140+             let  licenseIcons =  ` <img ${ iconStyle}   src="${ baseAssetsPath}  /cc_icon.svg" />`  
141+             if  (short .includes (' CC0'  )) { 
142+                 short =  ' CC CC0 1.0'  
143+             } 
144+             licenseIcons +=  short .slice (3 , short .length  -  4 ).split (' -'  ).map (license  =>  
145+                 ` <img  ${ iconStyle}   src="${ baseAssetsPath}  /cc-${ license .toLowerCase ()}  _icon.svg" />`  
146+             ).join (' '  ) 
147+             const  licenseIconsLink  =  ` <a href="${ this .licenseURL }  ">${ licenseIcons}  </a>`  
148+             const  ccrelcode  =  ' xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#"'  
149+             return  ` <p ${ ccrelcode}  >${ this .licenseCodeTextSpan }${ licenseIconsLink}  </p>`  
123150        }, 
124151        activeTab:  { 
125152            get () { return  this .currentTab  }, 
@@ -130,7 +157,7 @@ export default {
130157                    this .currentSelection  =  this .currentTab  ===  0  ?  ' richtext'   :  ' html'  
131158                    const  tab  =  this .currentTab  
132159                    this .currentTab  =  2  
133-                     this .copyText  =  this .$t (' copied-label'  ) 
160+                     this .copyText  =  this .$t (' use-license. copied-label'  ) 
134161                    setTimeout (() =>  { 
135162                        this .currentTab  =  tab 
136163                    }, 1 ) 
@@ -165,7 +192,7 @@ export default {
165192    .use-license-hint  span  { 
166193        vertical-align  : middle ; 
167194    } 
168-     div .license-code  { 
195+     .license-code  { 
169196        margin-top  : 0.4rem  ; 
170197        h2 .vocab-h2 { 
171198            font-family  : Roboto Condensed ; 
0 commit comments