Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Fix attribution HTML glyph reference and fix historical usages as well (#990)
sarayourfriendc1eb22053f97
diff --git a/src/static/static/img/.DO_NOT_MOVE_THIS_DIRECTORY_OR_ITS_CONTENTS.md b/src/static/static/img/.DO_NOT_MOVE_THIS_DIRECTORY_OR_ITS_CONTENTS.mdnew file mode 100644index 000000000..2d49cab38--- /dev/null+++ b/src/static/static/img/.DO_NOT_MOVE_THIS_DIRECTORY_OR_ITS_CONTENTS.md@@ -0,0 +1,9 @@+# DO NOT MOVE THIS DIRECTORY OR ITS CONTENTS++As the title says, don't do it 😁++For historical reasons (pre-Openverse, back in the CC Search days) we need to serve these files at `/static/img/*.svg`. Nuxt serves static files at the top level, so anything immediately inside the `src/static` directory will just be served directly at `/` (like `/favicon.ico`). The nested `static` directories are absolutely necessary to maintain existing static assets being served at the root _and_ these historical static assets that need to be served at `/static`.++If you do happen to move these files you will break the references to these glyphs in the attribution HTML copied users from single result pages throughout the entire history of CC Search and Openverse.++Thank you for not moving or renaming these files ❤️diff --git a/src/static/static/img/cc-by_icon.svg b/src/static/static/img/cc-by_icon.svgnew file mode 100644index 000000000..83a036342--- /dev/null+++ b/src/static/static/img/cc-by_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M14.973 0c4.213 0 7.768 1.446 10.66 4.34C28.544 7.25 30 10.803 30 15c0 4.215-1.43 7.723-4.287 10.526C22.678 28.51 19.098 30 14.973 30c-4.054 0-7.571-1.474-10.553-4.42C1.474 22.633 0 19.107 0 15S1.474 7.34 4.42 4.34C7.313 1.446 10.83 0 14.973 0zm.054 2.706c-3.41 0-6.295 1.196-8.652 3.589-2.447 2.5-3.67 5.402-3.67 8.706 0 3.321 1.214 6.196 3.642 8.624 2.429 2.429 5.322 3.642 8.679 3.642 3.339 0 6.25-1.222 8.732-3.67 2.358-2.267 3.536-5.133 3.536-8.598 0-3.41-1.197-6.311-3.589-8.705-2.392-2.392-5.285-3.588-8.678-3.588zm4.018 8.57v6.134H17.33v7.286h-4.66V17.41h-1.714v-6.134a.93.93 0 01.28-.683.933.933 0 01.684-.281h6.161c.25 0 .474.093.67.28a.912.912 0 01.294.684zM12.91 7.42c0-1.41.696-2.116 2.09-2.116s2.09.705 2.09 2.116c0 1.393-.697 2.09-2.09 2.09-1.393 0-2.09-.697-2.09-2.09z"/>+ </g>+</svg>diff --git a/src/static/static/img/cc-cc0_icon.svg b/src/static/static/img/cc-cc0_icon.svgnew file mode 100644index 000000000..809a487b1--- /dev/null+++ b/src/static/static/img/cc-cc0_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M4.443 4.36C7.3 1.447 10.807 0 14.97 0c4.196 0 7.777 1.462 10.725 4.39a14.365 14.365 0 013.214 4.843C29.639 11.037 30 12.964 30 15c0 2.055-.36 3.984-1.093 5.788-.714 1.785-1.781 3.362-3.193 4.737a15.399 15.399 0 01-4.978 3.32A14.972 14.972 0 0114.969 30c-1.983 0-3.883-.374-5.705-1.125-1.804-.767-3.428-1.869-4.874-3.298-1.428-1.446-2.516-3.069-3.266-4.873A14.701 14.701 0 010 15c0-1.982.374-3.882 1.124-5.704a15.224 15.224 0 013.32-4.937zM23.73 6.312C21.319 3.903 18.424 2.7 15.03 2.7c-3.429 0-6.316 1.2-8.655 3.591a13.054 13.054 0 00-2.731 4.044A11.899 11.899 0 002.7 15c0 1.607.32 3.154.945 4.653a12.806 12.806 0 002.73 3.992 12.651 12.651 0 003.993 2.68c1.482.607 3.038.913 4.663.913 1.608 0 3.154-.31 4.654-.935a12.9 12.9 0 004.097-2.71C26.12 21.307 27.3 18.447 27.3 15c0-1.66-.306-3.234-.914-4.716a12.033 12.033 0 00-2.657-3.97zM8.802 15c0-3.961 1.246-8.634 6.198-8.634s6.197 4.673 6.197 8.634c0 3.962-1.245 8.634-6.197 8.634-4.953 0-6.198-4.672-6.198-8.634zm6.755-5.305A2.291 2.291 0 0015 9.622c-2.547 0-2.668 3.633-2.668 5.377 0 .562.014 1.313.116 2.08l3.298-6.06c.342-.592.168-1.016-.19-1.324zM17.668 15c0-.683-.025-1.654-.2-2.584l-3.686 6.366c-.514.772-.157 1.209.41 1.45.05.02.105.037.157.052l.095.031c.172.043.356.064.557.064 2.546 0 2.667-3.634 2.667-5.379z"/>+ </g>+</svg>diff --git a/src/static/static/img/cc-nc_icon.svg b/src/static/static/img/cc-nc_icon.svgnew file mode 100644index 000000000..27d8a1726--- /dev/null+++ b/src/static/static/img/cc-nc_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M14.973 0c4.214 0 7.768 1.446 10.66 4.339C28.544 7.232 30 10.786 30 15c0 4.215-1.429 7.723-4.287 10.527C22.678 28.51 19.097 30 14.973 30c-4.072 0-7.59-1.482-10.553-4.446C1.474 22.607 0 19.09 0 15c0-4.107 1.474-7.66 4.42-10.66C7.313 1.446 10.83 0 14.973 0zM3.375 10.956c-.446 1.232-.67 2.58-.67 4.045 0 3.321 1.214 6.196 3.642 8.624 2.447 2.412 5.34 3.617 8.679 3.617 3.375 0 6.285-1.223 8.733-3.67.875-.839 1.561-1.714 2.061-2.626l-5.651-2.518a3.866 3.866 0 01-1.433 2.317c-.76.598-1.657.943-2.693 1.031v2.304h-1.74v-2.304c-1.661-.017-3.18-.615-4.554-1.794l2.063-2.089c.981.91 2.098 1.366 3.348 1.366.517 0 .96-.116 1.326-.349.366-.231.55-.615.55-1.151 0-.376-.135-.68-.402-.911l-1.447-.617-1.767-.804-2.384-1.044-7.661-3.427zm11.652-8.278c-3.41 0-6.295 1.206-8.652 3.616-.59.59-1.143 1.26-1.66 2.01l5.732 2.571a3.513 3.513 0 011.42-1.888c.695-.473 1.508-.737 2.437-.79V5.893h1.741v2.304c1.376.071 2.625.535 3.75 1.392L17.84 11.6c-.84-.59-1.697-.884-2.572-.884-.464 0-.88.09-1.245.267-.366.179-.55.483-.55.911 0 .125.045.25.134.375l1.902.858 1.313.59 2.41 1.07 7.687 3.429c.25-1.054.375-2.125.375-3.214 0-3.447-1.196-6.349-3.588-8.707-2.375-2.41-5.27-3.616-8.68-3.616z"/>+ </g>+</svg>diff --git a/src/static/static/img/cc-nd_icon.svg b/src/static/static/img/cc-nd_icon.svgnew file mode 100644index 000000000..3cba96009--- /dev/null+++ b/src/static/static/img/cc-nd_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M14.973 0c4.196 0 7.75 1.455 10.66 4.366C28.544 7.26 30 10.804 30 15c0 4.197-1.43 7.714-4.287 10.553C22.696 28.518 19.115 30 14.973 30c-4.054 0-7.571-1.473-10.553-4.42C1.474 22.634 0 19.108 0 15c0-4.088 1.474-7.633 4.42-10.633C7.33 1.455 10.848 0 14.973 0zm.054 2.706c-3.41 0-6.295 1.205-8.652 3.616-2.447 2.483-3.67 5.375-3.67 8.678 0 3.34 1.214 6.214 3.642 8.625 2.429 2.43 5.322 3.643 8.679 3.643 3.339 0 6.25-1.223 8.732-3.67 2.358-2.285 3.536-5.15 3.536-8.598 0-3.428-1.197-6.321-3.589-8.678-2.375-2.412-5.268-3.616-8.678-3.616zm5.652 8.758v2.571H9.777v-2.571H20.68zm0 4.822v2.57H9.777v-2.57H20.68z"/>+ </g>+</svg>diff --git a/src/static/static/img/cc-pdm_icon.svg b/src/static/static/img/cc-pdm_icon.svgnew file mode 100644index 000000000..0712e5d1b--- /dev/null+++ b/src/static/static/img/cc-pdm_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M15 0C6.716 0 0 6.716 0 15c0 8.283 6.716 15 15 15 8.284 0 15-6.717 15-15 0-8.284-6.716-15-15-15zm0 27.187C8.28 27.187 2.812 21.72 2.812 15c0-1.407.243-2.758.683-4.015l4.767 2.122a10.081 10.081 0 00-.198 1.991c0 5.988 4.47 7.675 7.282 7.675a7.314 7.314 0 004.217-1.32c.214-.153.407-.307.585-.464l-2.187-2.657a2.496 2.496 0 01-.2.206c-.85.806-1.785.806-1.994.806-2.288 0-3.246-2.414-3.258-4.348l13.137 5.85c.015.002.028.002.041.005-2.073 3.774-6.086 6.336-10.687 6.336zm11.745-9.073l-13.55-6.048c.489-.885 1.267-1.55 2.431-1.55.675 0 1.21.223 1.632.506.175.126.327.252.456.38l2.442-2.514c-1.64-1.41-3.505-1.663-4.725-1.663-2.866 0-4.895 1.24-6.09 3.121L4.81 8.326C6.99 5.007 10.743 2.811 15 2.811c6.72 0 12.188 5.467 12.188 12.188 0 1.088-.145 2.14-.414 3.145-.011-.01-.018-.02-.03-.03z" />+ </g>+</svg>diff --git a/src/static/static/img/cc-sa_icon.svg b/src/static/static/img/cc-sa_icon.svgnew file mode 100644index 000000000..1ed4512b3--- /dev/null+++ b/src/static/static/img/cc-sa_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M14.973 0c4.196 0 7.75 1.455 10.66 4.366C28.544 7.26 30 10.804 30 15c0 4.197-1.43 7.714-4.287 10.553C22.696 28.518 19.115 30 14.973 30c-4.054 0-7.571-1.473-10.553-4.42C1.474 22.634 0 19.108 0 15c0-4.088 1.474-7.633 4.42-10.633C7.33 1.455 10.848 0 14.973 0zm.054 2.706c-3.41 0-6.295 1.205-8.652 3.616-2.447 2.483-3.67 5.375-3.67 8.678 0 3.34 1.214 6.214 3.642 8.625 2.429 2.43 5.322 3.643 8.679 3.643 3.339 0 6.25-1.223 8.732-3.67 2.358-2.285 3.536-5.151 3.536-8.598 0-3.428-1.197-6.321-3.589-8.678-2.375-2.412-5.268-3.616-8.678-3.616zM8.33 12.884c.286-1.84 1.026-3.264 2.223-4.273 1.196-1.008 2.651-1.513 4.366-1.513 2.356 0 4.232.76 5.625 2.277 1.393 1.517 2.09 3.464 2.09 5.839 0 2.304-.724 4.219-2.17 5.745-1.447 1.526-3.321 2.29-5.626 2.29-1.696 0-3.16-.508-4.392-1.527-1.233-1.018-1.973-2.464-2.224-4.339H12c.09 1.822 1.187 2.733 3.295 2.733 1.053 0 1.902-.456 2.544-1.366.644-.91.965-2.126.965-3.643 0-1.59-.294-2.799-.883-3.63-.59-.83-1.437-1.245-2.545-1.245-2.001 0-3.126.884-3.375 2.651h1.098l-2.973 2.973-2.973-2.973H8.33z"/>+ </g>+</svg>diff --git a/src/static/static/img/cc_icon.svg b/src/static/static/img/cc_icon.svgnew file mode 100644index 000000000..78649c72e--- /dev/null+++ b/src/static/static/img/cc_icon.svg@@ -0,0 +1,5 @@+<svg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">+ <g id="icon" fill="currentColor">+ <path d="M14.972 0c4.196 0 7.769 1.465 10.715 4.393A14.426 14.426 0 0128.9 9.228C29.633 11.04 30 12.964 30 15c0 2.054-.363 3.978-1.085 5.772a13.77 13.77 0 01-3.2 4.754 15.417 15.417 0 01-4.983 3.322A14.932 14.932 0 0114.973 30c-1.982 0-3.88-.38-5.692-1.14a15.087 15.087 0 01-4.875-3.293c-1.437-1.437-2.531-3.058-3.281-4.862A14.71 14.71 0 010 15c0-1.982.38-3.888 1.138-5.719a15.062 15.062 0 013.308-4.915C7.303 1.456 10.812 0 14.972 0zm.055 2.706c-3.429 0-6.313 1.196-8.652 3.589a12.896 12.896 0 00-2.72 4.031 11.814 11.814 0 00-.95 4.675c0 1.607.316 3.156.95 4.646a12.428 12.428 0 002.72 3.992 12.362 12.362 0 003.99 2.679c1.483.616 3.037.924 4.662.924 1.607 0 3.164-.312 4.675-.937a12.954 12.954 0 004.084-2.705c2.339-2.286 3.508-5.152 3.508-8.6 0-1.66-.304-3.231-.91-4.713a11.994 11.994 0 00-2.651-3.965c-2.412-2.41-5.314-3.616-8.706-3.616zm-.188 9.803l-2.01 1.045c-.215-.445-.477-.758-.79-.937-.312-.178-.602-.268-.87-.268-1.34 0-2.01.884-2.01 2.652 0 .803.17 1.446.509 1.928.34.482.84.724 1.5.724.876 0 1.492-.43 1.85-1.286l1.847.937a4.407 4.407 0 01-1.634 1.728c-.696.42-1.464.63-2.303.63-1.34 0-2.42-.41-3.242-1.233-.821-.82-1.232-1.964-1.232-3.428 0-1.428.416-2.562 1.246-3.401.83-.84 1.879-1.26 3.147-1.26 1.858 0 3.188.723 3.992 2.17zm8.652 0l-1.983 1.045c-.214-.445-.478-.758-.79-.937-.313-.178-.613-.268-.897-.268-1.34 0-2.01.884-2.01 2.652 0 .803.17 1.446.51 1.928.338.482.838.724 1.5.724.874 0 1.49-.43 1.847-1.286l1.875.937a4.606 4.606 0 01-1.66 1.728c-.696.42-1.455.63-2.277.63-1.357 0-2.441-.41-3.253-1.233-.814-.82-1.22-1.964-1.22-3.428 0-1.428.415-2.562 1.246-3.401.83-.84 1.879-1.26 3.147-1.26 1.857 0 3.18.723 3.965 2.17z"/>+ </g>+</svg>diff --git a/src/utils/attribution-html.js b/src/utils/attribution-html.jsindex d00cd12f8..da2c93eab 100644--- a/src/utils/attribution-html.js+++ b/src/utils/attribution-html.js@@ -3,7 +3,7 @@ function getAttributionHtml(media, licenseUrl, fullLicenseName) {if (!media) {return ''}- const baseAssetsPath = 'https://search.creativecommons.org/static/img'+ const baseAssetsPath = 'https://search.openverse.engineering/static/img'const imgLink = `<a href="${media.foreign_landing_url}" ${linkProperties}>"${media.title}"</a>`let creator = ''let mediaTag = ''