From: Aidan Cornelius-Bell Date: Sat, 2 Nov 2024 03:25:13 +0000 (+1030) Subject: Dev env now defines SQL socket in .env, upgraded bundle, minor tweak to import function X-Git-Url: https://gitweb.mndrdr.org/?a=commitdiff_plain;h=035c5661e6a3e1fb562cbff8bc4a40800114ea06;p=arelpe.git Dev env now defines SQL socket in .env, upgraded bundle, minor tweak to import function --- diff --git a/.ruby-version b/.ruby-version index a0891f5..fa7adc7 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.5 diff --git a/Gemfile.lock b/Gemfile.lock index c5c14e7..0865f18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,29 +1,29 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.2.1.1) - actionpack (= 7.2.1.1) - activesupport (= 7.2.1.1) + actioncable (7.2.2) + actionpack (= 7.2.2) + activesupport (= 7.2.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.1.1) - actionpack (= 7.2.1.1) - activejob (= 7.2.1.1) - activerecord (= 7.2.1.1) - activestorage (= 7.2.1.1) - activesupport (= 7.2.1.1) + actionmailbox (7.2.2) + actionpack (= 7.2.2) + activejob (= 7.2.2) + activerecord (= 7.2.2) + activestorage (= 7.2.2) + activesupport (= 7.2.2) mail (>= 2.8.0) - actionmailer (7.2.1.1) - actionpack (= 7.2.1.1) - actionview (= 7.2.1.1) - activejob (= 7.2.1.1) - activesupport (= 7.2.1.1) + actionmailer (7.2.2) + actionpack (= 7.2.2) + actionview (= 7.2.2) + activejob (= 7.2.2) + activesupport (= 7.2.2) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.1.1) - actionview (= 7.2.1.1) - activesupport (= 7.2.1.1) + actionpack (7.2.2) + actionview (= 7.2.2) + activesupport (= 7.2.2) nokogiri (>= 1.8.5) racc rack (>= 2.2.4, < 3.2) @@ -32,36 +32,37 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.1.1) - actionpack (= 7.2.1.1) - activerecord (= 7.2.1.1) - activestorage (= 7.2.1.1) - activesupport (= 7.2.1.1) + actiontext (7.2.2) + actionpack (= 7.2.2) + activerecord (= 7.2.2) + activestorage (= 7.2.2) + activesupport (= 7.2.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.1.1) - activesupport (= 7.2.1.1) + actionview (7.2.2) + activesupport (= 7.2.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.1.1) - activesupport (= 7.2.1.1) + activejob (7.2.2) + activesupport (= 7.2.2) globalid (>= 0.3.6) - activemodel (7.2.1.1) - activesupport (= 7.2.1.1) - activerecord (7.2.1.1) - activemodel (= 7.2.1.1) - activesupport (= 7.2.1.1) + activemodel (7.2.2) + activesupport (= 7.2.2) + activerecord (7.2.2) + activemodel (= 7.2.2) + activesupport (= 7.2.2) timeout (>= 0.4.0) - activestorage (7.2.1.1) - actionpack (= 7.2.1.1) - activejob (= 7.2.1.1) - activerecord (= 7.2.1.1) - activesupport (= 7.2.1.1) + activestorage (7.2.2) + actionpack (= 7.2.2) + activejob (= 7.2.2) + activerecord (= 7.2.2) + activesupport (= 7.2.2) marcel (~> 1.0) - activesupport (7.2.1.1) + activesupport (7.2.2) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) @@ -76,6 +77,7 @@ GEM ast (2.4.2) base64 (0.2.0) bcrypt (3.1.20) + benchmark (0.3.0) bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.4) @@ -100,7 +102,7 @@ GEM connection_pool (2.4.1) crass (1.0.6) csv (3.3.0) - date (3.3.4) + date (3.4.0) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) @@ -132,7 +134,7 @@ GEM irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.2) + json (2.7.5) jsonapi-serializer (2.2.0) activesupport (>= 4.2) kaminari (1.2.2) @@ -154,7 +156,7 @@ GEM letter_opener (1.10.0) launchy (>= 2.2, < 4) logger (1.6.1) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -179,7 +181,7 @@ GEM timeout net-smtp (0.5.0) net-protocol - nio4r (2.7.3) + nio4r (2.7.4) nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) nokogiri (1.16.7-arm-linux) @@ -194,7 +196,7 @@ GEM racc (~> 1.4) orm_adapter (0.5.0) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.5.1) ast (~> 2.4.1) racc psych (5.1.2) @@ -211,20 +213,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.2.1.1) - actioncable (= 7.2.1.1) - actionmailbox (= 7.2.1.1) - actionmailer (= 7.2.1.1) - actionpack (= 7.2.1.1) - actiontext (= 7.2.1.1) - actionview (= 7.2.1.1) - activejob (= 7.2.1.1) - activemodel (= 7.2.1.1) - activerecord (= 7.2.1.1) - activestorage (= 7.2.1.1) - activesupport (= 7.2.1.1) + rails (7.2.2) + actioncable (= 7.2.2) + actionmailbox (= 7.2.2) + actionmailer (= 7.2.2) + actionpack (= 7.2.2) + actiontext (= 7.2.2) + actionview (= 7.2.2) + activejob (= 7.2.2) + activemodel (= 7.2.2) + activerecord (= 7.2.2) + activestorage (= 7.2.2) + activesupport (= 7.2.2) bundler (>= 1.15.0) - railties (= 7.2.1.1) + railties (= 7.2.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -232,9 +234,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.2.1.1) - actionpack (= 7.2.1.1) - activesupport (= 7.2.1.1) + railties (7.2.2) + actionpack (= 7.2.2) + activesupport (= 7.2.2) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -251,14 +253,14 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.8) + rexml (3.3.9) rotp (6.3.0) rouge (4.4.0) rqrcode (2.2.0) chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rubocop (1.67.0) + rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -268,7 +270,7 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + rubocop-ast (1.33.0) parser (>= 3.3.1.0) rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) @@ -276,7 +278,7 @@ GEM rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.26.2) + rubocop-rails (2.27.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) @@ -289,7 +291,7 @@ GEM ruby-progressbar (1.13.0) rubyzip (2.3.2) securerandom (0.3.1) - selenium-webdriver (4.25.0) + selenium-webdriver (4.26.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -303,7 +305,7 @@ GEM activesupport (>= 6.1) sprockets (>= 3.0.0) stringio (3.1.1) - stripe (13.0.2) + stripe (13.1.0) thor (1.3.2) timeout (0.4.1) tzinfo (2.0.6) @@ -317,7 +319,7 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webrick (1.8.2) + webrick (1.9.0) websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) @@ -364,4 +366,4 @@ DEPENDENCIES whenever BUNDLED WITH - 2.5.11 + 2.5.22 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 7989027..2039e97 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -5,114 +5,115 @@ /* Font face declarations */ @font-face { - font-family: 'Meta Correspondence Pro'; - src: url('/fonts/Meta_Correspondence_Pro_Regular.otf') format('opentype'); - font-weight: normal; - font-style: normal; + font-family: "Meta Correspondence Pro"; + src: url("/fonts/Meta_Correspondence_Pro_Regular.otf") format("opentype"); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'Meta Correspondence Pro'; - src: url('/fonts/Meta_Correspondence_Pro_Bold.otf') format('opentype'); - font-weight: bold; - font-style: normal; + font-family: "Meta Correspondence Pro"; + src: url("/fonts/Meta_Correspondence_Pro_Bold.otf") format("opentype"); + font-weight: bold; + font-style: normal; } @font-face { - font-family: 'Meta Correspondence Pro'; - src: url('/fonts/Meta_Correspondence_Pro_Italic.otf') format('opentype'); - font-weight: normal; - font-style: italic; + font-family: "Meta Correspondence Pro"; + src: url("/fonts/Meta_Correspondence_Pro_Italic.otf") format("opentype"); + font-weight: normal; + font-style: italic; } @font-face { - font-family: 'Meta Correspondence Pro'; - src: url('/fonts/Meta_Correspondence_Pro_Bold_Italic.otf') format('opentype'); - font-weight: bold; - font-style: italic; + font-family: "Meta Correspondence Pro"; + src: url("/fonts/Meta_Correspondence_Pro_Bold_Italic.otf") + format("opentype"); + font-weight: bold; + font-style: italic; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-Regular.ttf') format('truetype'); - font-weight: 400; - font-style: normal; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-Regular.ttf") format("truetype"); + font-weight: 400; + font-style: normal; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-Bold.ttf') format('truetype'); - font-weight: 700; - font-style: normal; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-Bold.ttf") format("truetype"); + font-weight: 700; + font-style: normal; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-Italic.ttf') format('truetype'); - font-weight: 400; - font-style: italic; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-Italic.ttf") format("truetype"); + font-weight: 400; + font-style: italic; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-BoldItalic.ttf') format('truetype'); - font-weight: 700; - font-style: italic; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-BoldItalic.ttf") format("truetype"); + font-weight: 700; + font-style: italic; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-Light.ttf') format('truetype'); - font-weight: 300; - font-style: normal; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-Light.ttf") format("truetype"); + font-weight: 300; + font-style: normal; } @font-face { - font-family: 'Inria Sans'; - src: url('/fonts/InriaSans-LightItalic.ttf') format('truetype'); - font-weight: 300; - font-style: italic; + font-family: "Inria Sans"; + src: url("/fonts/InriaSans-LightItalic.ttf") format("truetype"); + font-weight: 300; + font-style: italic; } /* Root variables (Dark mode) */ :root { - --post-bg: #2c1e1a; - --body-bg: #3d2a24; - --quote-bg: #5a3d33; - --link-color: #e8c396; - --accent-a: #f2a76c; - --accent-b: #8ca5b0; - --accent-c: #b68e7d; - --body-text: #e8d1c0; - --dark-text: #faf0e6; - --light-text: #c9ae9c; - --code-text: #f2a76c; + --post-bg: #2c1e1a; + --body-bg: #3d2a24; + --quote-bg: #5a3d33; + --link-color: #e8c396; + --accent-a: #f2a76c; + --accent-b: #8ca5b0; + --accent-c: #b68e7d; + --body-text: #e8d1c0; + --dark-text: #faf0e6; + --light-text: #c9ae9c; + --code-text: #f2a76c; } /* Light mode */ @media (prefers-color-scheme: light) { - :root { - --post-bg: #fdf6f0; - --body-bg: #f5e6db; - --quote-bg: #e8d1c0; - --link-color: #b3461c; - --accent-a: #f2a76c; - --accent-b: #6a8693; - --accent-c: #9e6b57; - --body-text: #4a332c; - --dark-text: #2c1e1a; - --light-text: #7d5b4e; - --code-text: #b3461c; - } + :root { + --post-bg: #fdf6f0; + --body-bg: #f5e6db; + --quote-bg: #e8d1c0; + --link-color: #b3461c; + --accent-a: #f2a76c; + --accent-b: #6a8693; + --accent-c: #9e6b57; + --body-text: #4a332c; + --dark-text: #2c1e1a; + --light-text: #7d5b4e; + --code-text: #b3461c; + } } /* Basic styles */ body { - font-family: 'Meta Correspondence Pro', sans-serif; - background-color: var(--body-bg); - color: var(--body-text); - line-height: 1.6; - margin: 0; - padding: 0; + font-family: "Meta Correspondence Pro", sans-serif; + background-color: var(--body-bg); + color: var(--body-text); + line-height: 1.6; + margin: 0; + padding: 0; } h1, @@ -121,53 +122,53 @@ h3, h4, h5, h6 { - color: var(--dark-text); - font-weight: 700; - font-family: 'Inria Sans', 'Meta Correspondence Pro', sans-serif; + color: var(--dark-text); + font-weight: 700; + font-family: "Inria Sans", "Meta Correspondence Pro", sans-serif; } a, a:visited { - color: var(--link-color); - text-decoration: none; + color: var(--link-color); + text-decoration: none; } a:hover { - text-decoration: underline; + text-decoration: underline; } form { - display:inline; + display: inline; } blockquote { - border-left: 4px solid var(--quote-bg); - margin: 1em 0; - padding: 0.5em 1em; - color: var(--dark-text); + border-left: 4px solid var(--quote-bg); + margin: 1em 0; + padding: 0.5em 1em; + color: var(--dark-text); } .full-content p { - text-indent: 0em; - color: var(--light-text); + text-indent: 0em; + color: var(--light-text); } code { - font-family: monospace; - background-color: var(--post-bg); - color: var(--code-text); - padding: 2px 0px; - border-radius: 3px; + font-family: monospace; + background-color: var(--post-bg); + color: var(--code-text); + padding: 2px 0px; + border-radius: 3px; } pre { - background-color: var(--post-bg); - padding: 1em; - overflow-x: auto; + background-color: var(--post-bg); + padding: 1em; + overflow-x: auto; } abbr { - font-variant-emoji: unicode; + font-variant-emoji: unicode; } /* Style for all form inputs */ @@ -214,296 +215,309 @@ label { } .subheading { - margin-top: -25px; + margin-top: -25px; } .post { - background-color: var(--post-bg); - padding: 2em; - margin: 1em 0; - word-break: break-word; + background-color: var(--post-bg); + padding: 2em; + margin: 1em 0; + word-break: break-word; } .container, footer { - margin: 0 auto; - width: 97.5%; - max-width: 945px; + margin: 0 auto; + width: 97.5%; + max-width: 945px; } .callout { - color: var(--accent-b); + color: var(--accent-b); } -button, input[type="submit"], input[type="reset"] { - padding: 0; - border: none; - outline: none; - font: inherit; - color: inherit; +button, +input[type="submit"], +input[type="reset"] { + padding: 0; + border: none; + outline: none; + font: inherit; + color: inherit; } hr { - border: 1px solid var(--accent-a); - height: 1px; - border-right: none; - border-bottom: none; - border-left: none; + border: 1px solid var(--accent-a); + height: 1px; + border-right: none; + border-bottom: none; + border-left: none; } .devise-links { - padding-top: 1rem; - border-top: 1px solid var(--accent-a); + padding-top: 1rem; + border-top: 1px solid var(--accent-a); } footer { - margin-top: 3rem; - border-top: 1px solid var(--accent-a); + margin-top: 3rem; + border-top: 1px solid var(--accent-a); } footer p { - font-size: .8rem; + font-size: 0.8rem; } .porter { - max-width: 170px; - float: right; - padding: 20px; + max-width: 170px; + float: right; + padding: 20px; } .aidans_arrow { - max-width: 70px; - float: right; - padding: 20px; + max-width: 70px; + float: right; + padding: 20px; } .aidan_about_u { - max-width: 360px; + max-width: 360px; } .post .container p img { - max-width: 170px; - float: right; - padding: 20px; - padding-top: 0; + max-width: 170px; + float: right; + padding: 20px; + padding-top: 0; } .post .container p br:first-of-type { - display: none; + display: none; } .logo { - max-width: 48px; - float: right; + max-width: 48px; + float: right; } .pagination { - margin: 3em 0; - margin: 40px auto; - text-align: center; + margin: 3em 0; + margin: 40px auto; + text-align: center; } -.pagination a, .pagination .current, .pagination .gap { - border: 1px solid var(--link-color); - padding: 4px 8px; - text-decoration: none; - border-radius: 2px; +.pagination a, +.pagination .current, +.pagination .gap { + border: 1px solid var(--link-color); + padding: 4px 8px; + text-decoration: none; + border-radius: 2px; } .pagination a:hover, .pagination a:active, .pagination .active { - color: var(--accent-b); - border: 1px solid var(--accent-b); + color: var(--accent-b); + border: 1px solid var(--accent-b); } .pagination .active:hover { - border: 1px solid var(--link-color); - color: var(--link-color); + border: 1px solid var(--link-color); + color: var(--link-color); } -.pagination .current, .pagination .gap { - margin-right: 1px; +.pagination .current, +.pagination .gap { + margin-right: 1px; } ul li { - list-style: none; - margin-left: 2em; - text-indent: -2em; + list-style: none; + margin-left: 2em; + text-indent: -2em; } ul .dispatch-item::before { - content: "✳\FE0E"; - font-variant-emoji: text; + content: "✳\FE0E"; + font-variant-emoji: text; } ul .bookmark-item::before { - content: "❥\FE0E"; - font-variant-emoji: text; + content: "❥\FE0E"; + font-variant-emoji: text; } ul .thought-item::before { - content: "☭\FE0E"; - font-variant-emoji: text; + content: "☭\FE0E"; + font-variant-emoji: text; } ul .pinned::before { - content: "✯\FE0E"; - font-variant-emoji: text; + content: "✯\FE0E"; + font-variant-emoji: text; } .post-item p { - margin-left: 2em; - white-space: nowrap; + margin-left: 2em; + white-space: nowrap; } .notice { - background: var(--post-bg); - border-radius: 4px; - padding: 1px 1.5em; - margin: 10px auto; - max-width: 290px; - color: var(--accent-c); + background: var(--post-bg); + border-radius: 4px; + padding: 1px 1.5em; + margin: 10px auto; + max-width: 290px; + color: var(--accent-c); } .notice h3 { - color: var(--accent-a); + color: var(--accent-a); } .filter-buttons { - margin: 20px 0; - text-align: center; + margin: 20px 0; + text-align: center; } .filter-buttons .button { - display: inline-block; - padding: 10px 20px; - margin: 0 5px; - margin-bottom: 15px; - background-color: var(--accent-a); - color: var(--body-text); - text-decoration: none; - border-radius: 5px; + display: inline-block; + padding: 10px 20px; + margin: 0 5px; + margin-bottom: 15px; + background-color: var(--accent-a); + color: var(--body-text); + text-decoration: none; + border-radius: 5px; } .filter-buttons .button.active { - background-color: var(--body-text); - color: var(--accent-a); + background-color: var(--body-text); + color: var(--accent-c); } .filter-buttons .button:hover { - background-color: var(--body-text); - color: var(--accent-a); + background-color: var(--body-text); + color: var(--accent-b); } .excerpt { - margin-top: 10px; - text-indent: 0; - font-style: italic; - color: var(--light-text); + margin-top: 10px; + text-indent: 0; + font-style: italic; + color: var(--light-text); } .bookmark-comment { - font-style: italic; - color: var(--accent-b); - font-size: 0.9em; + font-style: italic; + color: var(--accent-b); + font-size: 0.9em; } .bookmark-item { - padding-bottom: 10px; + padding-bottom: 10px; } table { - width: 100%; - border-collapse: collapse; - margin-bottom: 1rem; + width: 100%; + border-collapse: collapse; + margin-bottom: 1rem; } -th, td { - padding: 0.5rem; - text-align: left; - border-bottom: 1px solid #ddd; +th, +td { + padding: 0.5rem; + text-align: left; + border-bottom: 1px solid #ddd; } th { - background-color: #f2f2f2; - font-weight: bold; + background-color: var(--accent-c); + font-weight: bold; } -button, input[type="submit"], .button { - display: inline-block; - padding: 0.5rem 1rem; - text-decoration: none; - background-color: var(--quote-bg); - color: var(--link-color); - border-radius: 0.25rem; - margin-right: 0.5rem; - cursor: pointer; +button, +input[type="submit"], +.button { + display: inline-block; + padding: 0.5rem 1rem; + text-decoration: none; + background-color: var(--quote-bg); + color: var(--link-color); + border-radius: 0.25rem; + margin-right: 0.5rem; + cursor: pointer; } .button.small { - padding: 0.25rem 0.5rem; - font-size: 0.875rem; + padding: 0.25rem 0.5rem; + font-size: 0.875rem; } .button.danger { - background-color: #dc3545; - color: var(--body-text); + background-color: #dc3545; + color: var(--body-text); } -button:hover, input[type="submit"]:hover, .button:hover { - opacity: 0.8; - text-decoration: none; +button:hover, +input[type="submit"]:hover, +.button:hover { + opacity: 0.8; + text-decoration: none; } @media (max-width: 1010px) { - ul { - padding-left: 0; - } + ul { + padding-left: 0; + } } ul .post-item a, ul .post-item a:visited { - color: var(--accent-c); + color: var(--accent-c); } .marquee { - position: relative; - width: 100vw; - max-width: 100%; - height: 18px; - overflow-x: hidden; + position: relative; + width: 100vw; + max-width: 100%; + height: 18px; + overflow-x: hidden; } .track { - position: absolute; - white-space: nowrap; - will-change: transform; - animation: marquee 32s linear infinite; + position: absolute; + white-space: nowrap; + will-change: transform; + animation: marquee 32s linear infinite; } @keyframes marquee { - from { transform: translateX(0); } - to { transform: translateX(-50%); } + from { + transform: translateX(0); + } + to { + transform: translateX(-50%); + } } @media (max-width: 480px) { - - .container, - footer { - margin: 5px 10px -10px 5px; - overflow: hidden; - } - - footer { - margin-top: 3rem; - } - - .post { - overflow: hidden; - } - - .logo { - margin-top: 20px; - } + .container, + footer { + margin: 5px 10px -10px 5px; + overflow: hidden; + } + + footer { + margin-top: 3rem; + } + + .post { + overflow: hidden; + } + + .logo { + margin-top: 20px; + } } diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index e9e295e..1b8b569 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -24,12 +24,12 @@ class PostsController < ApplicationController def create @post = Post.new(post_params) @post.slug = @post.title.parameterize if @post.title.present? - + puts "Raw params: #{params.inspect}" puts "Post params: #{post_params.inspect}" puts "Post content: #{@post.content.inspect}" puts "Post type: #{@post.post_type}" - + if @post.save redirect_to @post, notice: "Post was successfully created." else @@ -53,12 +53,12 @@ class PostsController < ApplicationController @post.destroy! redirect_to posts_url, notice: "Post was successfully destroyed.", status: :see_other end - + def export @posts = Post.order(published_at: :desc) send_data @posts.to_json, filename: "posts_export.json", type: "application/json" end - + def importer end @@ -69,12 +69,12 @@ class PostsController < ApplicationController begin data = JSON.parse(file.read) import_results = { success: 0, failed: 0, errors: [] } - + ActiveRecord::Base.transaction do - import_posts(data['posts'], import_results) if data['posts'] - import_bookmarks(data['bookmarks'], import_results) if data['bookmarks'] + import_posts(data['posts'], import_results) if data['posts'].is_a?(Array) + import_bookmarks(data['bookmarks'], import_results) if data['bookmarks'].is_a?(Array) end - + if import_results[:failed] > 0 flash[:warning] = "Import partially succeeded. Successful: #{import_results[:success]}, Failed: #{import_results[:failed]}. Check the logs for detailed errors." else @@ -95,6 +95,7 @@ class PostsController < ApplicationController redirect_to posts_path end + private # Use callbacks to share common setup or constraints between actions. def set_post @@ -105,10 +106,10 @@ class PostsController < ApplicationController def post_params params.require(:post).permit(:post_type, :title, :slug, :published_at, :excerpt, :tags, :content, :url, :file) end - + def import_posts(posts_data, results) return unless posts_data.is_a?(Array) - + posts_data.each do |post_data| begin post = Post.new( @@ -119,7 +120,7 @@ class PostsController < ApplicationController content: post_data['content'], tags: post_data['tags'] ) - + if post.save results[:success] += 1 else @@ -133,10 +134,10 @@ class PostsController < ApplicationController end end end - + def import_bookmarks(bookmarks_data, results) return unless bookmarks_data.is_a?(Array) - + bookmarks_data.each do |bookmark_data| begin comment = bookmark_data['comment'] @@ -145,7 +146,7 @@ class PostsController < ApplicationController else [comment, nil] end - + post = Post.new( post_type: 'bookmark', title: title, @@ -155,7 +156,7 @@ class PostsController < ApplicationController tags: bookmark_data['starred'] == 1 ? 'starred' : '', url: bookmark_data['url'] ) - + if post.save results[:success] += 1 else diff --git a/config/database.yml b/config/database.yml index f1b91f6..0fe2e44 100644 --- a/config/database.yml +++ b/config/database.yml @@ -15,7 +15,7 @@ default: &default pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: <%= ENV.fetch("MYSQL_PASSWORD") %> - socket: /tmp/mysql.sock + socket: <%= ENV['MYSQL_SOCKET'] %> development: <<: *default @@ -31,4 +31,4 @@ production: password: <%= ENV.fetch("MYSQL_PASSWORD") %> host: <%= ENV.fetch("MYSQL_HOST") %> username: <%= ENV.fetch("MYSQL_USERNAME") %> - socket: /run/mysqld/mysqld.sock \ No newline at end of file + socket: /run/mysqld/mysqld.sock