diff --git a/Gemfile b/Gemfile index 9a3947f..94457bb 100644 --- a/Gemfile +++ b/Gemfile @@ -62,7 +62,7 @@ gem 'ogpr' # It is flexible, offers heuristic parsing, and additionally provides extensive support for IRIs and URI templates. gem 'addressable' -# gem "ruby-readability" +gem "ruby-readability", :require => 'readability' # gem 'nokogiri' diff --git a/Gemfile.lock b/Gemfile.lock index 80c4cd2..897aaae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -153,6 +153,7 @@ GEM google-protobuf (4.27.0-x86_64-linux) bigdecimal rake (>= 13) + guess_html_encoding (0.0.11) http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) @@ -281,6 +282,9 @@ GEM netrc (~> 0.8) rexml (3.2.8) strscan (>= 3.0.9) + ruby-readability (0.7.1) + guess_html_encoding (>= 0.0.4) + nokogiri (>= 1.6.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) rufus-scheduler (3.9.1) @@ -397,6 +401,7 @@ DEPENDENCIES puma (>= 5.0) rails (~> 7.1.3, >= 7.1.3.3) redis (>= 4.0.1) + ruby-readability rufus-scheduler selenium-webdriver slim-rails diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a4e67e2..d519bac 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -18,6 +18,7 @@ @import "components/item-c"; @import "components/item-d"; @import "components/item-e"; +@import "components/source"; // Layouts @import "layouts/container"; diff --git a/app/assets/stylesheets/components/_source.scss b/app/assets/stylesheets/components/_source.scss new file mode 100644 index 0000000..78540df --- /dev/null +++ b/app/assets/stylesheets/components/_source.scss @@ -0,0 +1,4 @@ +.source_info { + border-top: var(--border); + border-bottom: var(--border); +} \ No newline at end of file diff --git a/app/assets/stylesheets/config/_variables.scss b/app/assets/stylesheets/config/_variables.scss index 2d78b1d..54d5e03 100644 --- a/app/assets/stylesheets/config/_variables.scss +++ b/app/assets/stylesheets/config/_variables.scss @@ -62,7 +62,8 @@ --border-radius: 0.375rem; // Border - --border: solid 2px var(--color-light); + // --border: solid 2px var(--color-light); + --border: 1px dashed var(--color-glint); // Shadows --shadow-large: 2px 4px 10px hsl(0 0% 0% / 0.1); diff --git a/app/assets/stylesheets/layouts/_page_grid.scss b/app/assets/stylesheets/layouts/_page_grid.scss index edbf994..10f3dac 100644 --- a/app/assets/stylesheets/layouts/_page_grid.scss +++ b/app/assets/stylesheets/layouts/_page_grid.scss @@ -27,11 +27,6 @@ grid-row-end: 4; } - .source_info { - grid-column: span 2; - grid-row: span 2; - } - .item-b { // in it's own file } diff --git a/app/views/sources/_source.html.slim b/app/views/sources/_source.html.slim index 9a07b45..7a94fbd 100644 --- a/app/views/sources/_source.html.slim +++ b/app/views/sources/_source.html.slim @@ -4,7 +4,7 @@ css: } -div id=dom_id(source) +.source_info id=dom_id(source) p strong 'Name: diff --git a/app/views/sources/index.html.slim b/app/views/sources/index.html.slim index b97b45a..dd298d1 100644 --- a/app/views/sources/index.html.slim +++ b/app/views/sources/index.html.slim @@ -8,8 +8,8 @@ = button_to('Reload all feeds', fetch_feeds_path) - - = link_to "New source", new_source_path + = turbo_frame_tag 'first_turbo_frame' do # 1) this will intercept the link clicks + = link_to "New source", new_source_path, data: { turbo_frame: 'new_source' } div id="article_counts" table @@ -22,9 +22,10 @@ p = @article_counts_by_day[index] - div id="sources" - .list_view_desktop - - @sources.each do |source| - = link_to(source, class: 'source_info') do - = render source + + .list_view_desktop + = turbo_frame_tag 'new_source' + - @sources.each do |source| + = link_to(source) do + = render source diff --git a/app/views/sources/new.html.slim b/app/views/sources/new.html.slim index 8c51f8b..c1fcb85 100644 --- a/app/views/sources/new.html.slim +++ b/app/views/sources/new.html.slim @@ -9,6 +9,7 @@ h1 br -= render "form", source: @source += turbo_frame_tag 'new_source' + = render "form", source: @source diff --git a/config/initializers/scheduler.rb b/config/initializers/scheduler.rb index 4bbc09f..94f2509 100644 --- a/config/initializers/scheduler.rb +++ b/config/initializers/scheduler.rb @@ -8,7 +8,3 @@ s.every '30m' do Sources::FeedFetcher.new.consume_all end - -s.every '1m' do - puts 'keep alive' -end \ No newline at end of file