From 06b9568a8291961d176843249ed32417ba8eb37b Mon Sep 17 00:00:00 2001 From: rbbeeston <121198190+rbbeeston@users.noreply.github.com> Date: Mon, 8 Jul 2024 08:02:46 -0700 Subject: [PATCH] Replace "03", "11", etc. icons with "C++03", "C++11", etc. (#1133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1111 adding C++ to lozenges and #1130 fix image tags Screenshot 2024-07-02 at 4 42 54 PM Screenshot 2024-07-02 at 4 43 40 PM Screenshot 2024-07-01 at 11 53 58 AM Screenshot 2024-07-01 at 12 25 45 PM --------- Co-authored-by: rbbeeston Co-authored-by: Kenneth Reitz --- frontend/styles.css | 5 +++- .../_library_category_list_item.html | 4 ++- .../libraries/_library_flat_list_item.html | 4 ++- templates/libraries/_library_list_item.html | 6 +++-- templates/libraries/detail.html | 25 +++++++++++++++++++ 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/frontend/styles.css b/frontend/styles.css index 3e2e6b3a..ad6f6553 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -150,6 +150,10 @@ @apply text-sky-600; } + #libraryReadMe a img { + @apply inline; + } + code, kbd, samp, @@ -159,5 +163,4 @@ @apply text-sm bg-gray-200 dark:bg-black overflow-x-scroll; /* 2 */ } - } diff --git a/templates/libraries/_library_category_list_item.html b/templates/libraries/_library_category_list_item.html index d2fd0135..4e1bc26d 100644 --- a/templates/libraries/_library_category_list_item.html +++ b/templates/libraries/_library_category_list_item.html @@ -3,9 +3,11 @@ {{ library.name }} + - + C++ {% if library.cpp_standard_minimum and library.cpp_standard_minimum != 'None' %}{{ library.cpp_standard_minimum }}{% else %}03{% endif %} diff --git a/templates/libraries/_library_flat_list_item.html b/templates/libraries/_library_flat_list_item.html index d2fd0135..4e1bc26d 100644 --- a/templates/libraries/_library_flat_list_item.html +++ b/templates/libraries/_library_flat_list_item.html @@ -3,9 +3,11 @@ {{ library.name }} + - + C++ {% if library.cpp_standard_minimum and library.cpp_standard_minimum != 'None' %}{{ library.cpp_standard_minimum }}{% else %}03{% endif %} diff --git a/templates/libraries/_library_list_item.html b/templates/libraries/_library_list_item.html index 7888705f..5f7dac28 100644 --- a/templates/libraries/_library_list_item.html +++ b/templates/libraries/_library_list_item.html @@ -17,14 +17,16 @@ {% endif %} {% endfor %} +

{{ library.description }}

-
- + + C++ {% if library.cpp_standard_minimum and library.cpp_standard_minimum != 'None' %}{{ library.cpp_standard_minimum }}{% else %}03{% endif %}
diff --git a/templates/libraries/detail.html b/templates/libraries/detail.html index 73d5f189..47891dd2 100644 --- a/templates/libraries/detail.html +++ b/templates/libraries/detail.html @@ -52,6 +52,7 @@ {% if library.cpp_standard_minimum and library.cpp_standard_minimum != 'None' %}{{ library.cpp_standard_minimum }}{% else %}03{% endif %} or Later"> {% if library.cpp_standard_minimum and library.cpp_standard_minimum != 'None' %} + C++ {{ library.cpp_standard_minimum }}{% else %}03{% endif %} {% if object.first_boost_version %}Added in Boost @@ -113,6 +114,7 @@
+ {% if maintainers %} @@ -229,5 +231,28 @@ // SS: putting this in the window object, a bit hacky, to be able to access it in the light/dark switcher - probably a better way window.chart = new ApexCharts(document.querySelector("#chart1"), options); window.chart.render(); + + const ValidateGitImages = () => { + var all = document.getElementsByTagName("img"); + for (var i = 0; i < all.length; i++) { + (function(index) { + var img = new Image(); + img.src = all[index].getAttribute('src'); + + img.onerror = function() { + var alt = all[index].getAttribute('alt'); + if (alt) { + all[index].parentElement.insertAdjacentText('afterbegin', alt); + all[index].parentElement.classList.add('text-xs'); + } + all[index].remove(); + }; + })(i); + } + } + + window.addEventListener('load', function() { + ValidateGitImages(); + }); {% endblock %}