From 8fa792a2b610b513c96ad322d3839a68e366df08 Mon Sep 17 00:00:00 2001 From: pessi-v Date: Thu, 4 Jul 2024 23:49:23 +0200 Subject: [PATCH] change ogpr gem to own fork in order to fix an issue with chinese characters showing up --- Gemfile | 2 +- Gemfile.lock | 18 ++++++++++++------ app/assets/stylesheets/config/_reset.scss | 5 +++++ app/models/source.rb | 4 ---- app/views/articles/list.html.slim | 4 ++-- app/views/sources/_source.html.slim | 9 +++++---- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 94457bb..857967f 100644 --- a/Gemfile +++ b/Gemfile @@ -56,7 +56,7 @@ gem 'faraday_middleware' gem 'feedjira' # a ruby library to fetch and parse meta tags which represent OpenGraph Protocol and TwitterCard. -gem 'ogpr' +gem 'ogpr', git: 'https://github.com/pessi-v/ogpr', branch: 'master' # Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. # It is flexible, offers heuristic parsing, and additionally provides extensive support for IRIs and URI templates. diff --git a/Gemfile.lock b/Gemfile.lock index 897aaae..85aad8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: https://github.com/pessi-v/ogpr + revision: 0cf586b4eee4d655be40f196eae3c82c78aa301b + branch: master + specs: + ogpr (1.1.0) + nokogiri (~> 1.8) + rest-client (~> 2.1.0) + GEM remote: https://rubygems.org/ specs: @@ -155,7 +164,7 @@ GEM rake (>= 13) guess_html_encoding (0.0.11) http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.0.6) domain_name (~> 0.5) httpclient (2.8.3) i18n (1.14.5) @@ -184,7 +193,7 @@ GEM matrix (0.4.2) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0507) + mime-types-data (3.2024.0702) mini_mime (1.1.5) minitest (5.23.1) msgpack (1.7.2) @@ -214,9 +223,6 @@ GEM racc (~> 1.4) nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) - ogpr (1.1.0) - nokogiri (~> 1.8) - rest-client (~> 2.1.0) pg (1.5.6) pg_search (2.3.6) activerecord (>= 5.2) @@ -395,7 +401,7 @@ DEPENDENCIES importmap-rails jbuilder node-runner (~> 1.2) - ogpr + ogpr! pg (~> 1.1) pg_search puma (>= 5.0) diff --git a/app/assets/stylesheets/config/_reset.scss b/app/assets/stylesheets/config/_reset.scss index e38e8f3..225287f 100644 --- a/app/assets/stylesheets/config/_reset.scss +++ b/app/assets/stylesheets/config/_reset.scss @@ -106,4 +106,9 @@ sup { hr { border: var(--border); +} + +.line { + height: 1px; + border-top: var(--border); } \ No newline at end of file diff --git a/app/models/source.rb b/app/models/source.rb index 6243e6e..ec3d3a5 100644 --- a/app/models/source.rb +++ b/app/models/source.rb @@ -44,7 +44,3 @@ def update_articles_source_name articles.update_all(source_name: name) end end - -Source.find_each do |source| - Source.reset_counters(source.id, :articles) -end \ No newline at end of file diff --git a/app/views/articles/list.html.slim b/app/views/articles/list.html.slim index 666316a..8628b3c 100644 --- a/app/views/articles/list.html.slim +++ b/app/views/articles/list.html.slim @@ -14,9 +14,9 @@ .list_view_desktop - @articles.each do |article| = render 'article_small_image_headline_summary_preview', article: article - hr + .line .list_view_mobile - @articles.each do |article| = render 'article_image_headline_summary', article: article - hr \ No newline at end of file + .line \ No newline at end of file diff --git a/app/views/sources/_source.html.slim b/app/views/sources/_source.html.slim index a87bac4..ab4e45b 100644 --- a/app/views/sources/_source.html.slim +++ b/app/views/sources/_source.html.slim @@ -33,10 +33,11 @@ css: p = source.url - p - strong - 'Articles: - = source.articles_count + = link_to(articles_by_source_path(source.name), data: {turbo: false}) + p + strong + 'Articles: + = source.articles_count p strong