From 4fda215f209c408b7fb80bd04e8aa8936ca1ab84 Mon Sep 17 00:00:00 2001 From: niyas301 Date: Mon, 3 Nov 2025 10:05:34 +0530 Subject: [PATCH 1/2] added cart --- vendor/plugins/shop_now/.rubocop.yml | 8 + vendor/plugins/shop_now/Gemfile | 16 ++ vendor/plugins/shop_now/Gemfile.lock | 254 ++++++++++++++++++ vendor/plugins/shop_now/README.md | 28 ++ vendor/plugins/shop_now/Rakefile | 8 + .../shop_now/app/assets/images/shop_now/.keep | 0 .../app/assets/stylesheets/shop_now/.keep | 0 vendor/plugins/shop_now/app/controllers/.keep | 0 .../shop_now/app/controllers/concerns/.keep | 0 .../shop_now/products_controller.rb | 68 +++++ vendor/plugins/shop_now/app/helpers/.keep | 0 .../shop_now/app/helpers/products_helper.rb | 2 + vendor/plugins/shop_now/app/jobs/.keep | 0 vendor/plugins/shop_now/app/mailers/.keep | 0 vendor/plugins/shop_now/app/models/.keep | 0 .../shop_now/app/models/concerns/.keep | 0 .../shop_now/app/models/shop_now/product.rb | 14 + vendor/plugins/shop_now/app/views/.keep | 0 .../layouts/shop_now/application.html.erb | 125 +++++++++ .../views/shop_now/products/_form.html.erb | 39 +++ .../views/shop_now/products/_product.html.erb | 29 ++ .../views/shop_now/products/contact.html.erb | 10 + .../app/views/shop_now/products/edit.html.erb | 12 + .../views/shop_now/products/index.html.erb | 183 +++++++++++++ .../app/views/shop_now/products/new.html.erb | 11 + .../app/views/shop_now/products/show.html.erb | 10 + vendor/plugins/shop_now/bin/rails | 14 + vendor/plugins/shop_now/bin/rubocop | 8 + vendor/plugins/shop_now/config/routes.rb | 7 + .../migrate/20251102092955_create_products.rb | 11 + vendor/plugins/shop_now/lib/shop_now.rb | 6 + .../plugins/shop_now/lib/shop_now/engine.rb | 5 + .../plugins/shop_now/lib/shop_now/version.rb | 3 + .../shop_now/lib/tasks/shop_now_tasks.rake | 4 + vendor/plugins/shop_now/shop_now.gemspec | 26 ++ .../plugins/shop_now/test/controllers/.keep | 0 .../controllers/products_controller_test.rb | 48 ++++ vendor/plugins/shop_now/test/dummy/Rakefile | 6 + .../test/dummy/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 ++ .../app/controllers/application_controller.rb | 4 + .../test/dummy/app/controllers/concerns/.keep | 0 .../dummy/app/helpers/application_helper.rb | 2 + .../test/dummy/app/jobs/application_job.rb | 7 + .../dummy/app/mailers/application_mailer.rb | 4 + .../dummy/app/models/application_record.rb | 3 + .../test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 27 ++ .../dummy/app/views/layouts/mailer.html.erb | 13 + .../dummy/app/views/layouts/mailer.text.erb | 1 + .../dummy/app/views/pwa/manifest.json.erb | 22 ++ .../dummy/app/views/pwa/service-worker.js | 26 ++ vendor/plugins/shop_now/test/dummy/bin/dev | 2 + vendor/plugins/shop_now/test/dummy/bin/rails | 4 + vendor/plugins/shop_now/test/dummy/bin/rake | 4 + vendor/plugins/shop_now/test/dummy/bin/setup | 34 +++ vendor/plugins/shop_now/test/dummy/config.ru | 6 + .../shop_now/test/dummy/config/application.rb | 29 ++ .../shop_now/test/dummy/config/boot.rb | 5 + .../shop_now/test/dummy/config/cable.yml | 10 + .../shop_now/test/dummy/config/database.yml | 32 +++ .../shop_now/test/dummy/config/environment.rb | 5 + .../dummy/config/environments/development.rb | 69 +++++ .../dummy/config/environments/production.rb | 89 ++++++ .../test/dummy/config/environments/test.rb | 53 ++++ .../test/dummy/config/initializers/assets.rb | 7 + .../initializers/content_security_policy.rb | 25 ++ .../initializers/filter_parameter_logging.rb | 8 + .../dummy/config/initializers/inflections.rb | 16 ++ .../shop_now/test/dummy/config/locales/en.yml | 31 +++ .../shop_now/test/dummy/config/puma.rb | 38 +++ .../shop_now/test/dummy/config/routes.rb | 14 + .../shop_now/test/dummy/config/storage.yml | 34 +++ .../plugins/shop_now/test/dummy/db/schema.rb | 21 ++ vendor/plugins/shop_now/test/dummy/log/.keep | 0 .../shop_now/test/dummy/log/development.log | 31 +++ .../shop_now/test/dummy/public/400.html | 114 ++++++++ .../shop_now/test/dummy/public/404.html | 114 ++++++++ .../dummy/public/406-unsupported-browser.html | 114 ++++++++ .../shop_now/test/dummy/public/422.html | 114 ++++++++ .../shop_now/test/dummy/public/500.html | 114 ++++++++ .../shop_now/test/dummy/public/icon.png | Bin 0 -> 4166 bytes .../shop_now/test/dummy/public/icon.svg | 3 + .../plugins/shop_now/test/dummy/storage/.keep | 0 .../test/dummy/storage/development.sqlite3 | Bin 0 -> 28672 bytes vendor/plugins/shop_now/test/dummy/tmp/.keep | 0 .../shop_now/test/dummy/tmp/local_secret.txt | 1 + .../shop_now/test/dummy/tmp/pids/.keep | 0 .../shop_now/test/dummy/tmp/restart.txt | 0 .../shop_now/test/dummy/tmp/storage/.keep | 0 .../shop_now/test/fixtures/files/.keep | 0 .../shop_now/test/fixtures/products.yml | 9 + vendor/plugins/shop_now/test/helpers/.keep | 0 .../plugins/shop_now/test/integration/.keep | 0 .../test/integration/navigation_test.rb | 7 + vendor/plugins/shop_now/test/mailers/.keep | 0 vendor/plugins/shop_now/test/models/.keep | 0 .../shop_now/test/models/product_test.rb | 7 + vendor/plugins/shop_now/test/shop_now_test.rb | 7 + .../shop_now/test/system/products_test.rb | 43 +++ vendor/plugins/shop_now/test/test_helper.rb | 14 + 101 files changed, 2307 insertions(+) create mode 100644 vendor/plugins/shop_now/.rubocop.yml create mode 100644 vendor/plugins/shop_now/Gemfile create mode 100644 vendor/plugins/shop_now/Gemfile.lock create mode 100644 vendor/plugins/shop_now/README.md create mode 100644 vendor/plugins/shop_now/Rakefile create mode 100644 vendor/plugins/shop_now/app/assets/images/shop_now/.keep create mode 100644 vendor/plugins/shop_now/app/assets/stylesheets/shop_now/.keep create mode 100644 vendor/plugins/shop_now/app/controllers/.keep create mode 100644 vendor/plugins/shop_now/app/controllers/concerns/.keep create mode 100644 vendor/plugins/shop_now/app/controllers/shop_now/products_controller.rb create mode 100644 vendor/plugins/shop_now/app/helpers/.keep create mode 100644 vendor/plugins/shop_now/app/helpers/products_helper.rb create mode 100644 vendor/plugins/shop_now/app/jobs/.keep create mode 100644 vendor/plugins/shop_now/app/mailers/.keep create mode 100644 vendor/plugins/shop_now/app/models/.keep create mode 100644 vendor/plugins/shop_now/app/models/concerns/.keep create mode 100644 vendor/plugins/shop_now/app/models/shop_now/product.rb create mode 100644 vendor/plugins/shop_now/app/views/.keep create mode 100644 vendor/plugins/shop_now/app/views/layouts/shop_now/application.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/_form.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/_product.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/contact.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/edit.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/index.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/new.html.erb create mode 100644 vendor/plugins/shop_now/app/views/shop_now/products/show.html.erb create mode 100755 vendor/plugins/shop_now/bin/rails create mode 100755 vendor/plugins/shop_now/bin/rubocop create mode 100644 vendor/plugins/shop_now/config/routes.rb create mode 100644 vendor/plugins/shop_now/db/migrate/20251102092955_create_products.rb create mode 100644 vendor/plugins/shop_now/lib/shop_now.rb create mode 100644 vendor/plugins/shop_now/lib/shop_now/engine.rb create mode 100644 vendor/plugins/shop_now/lib/shop_now/version.rb create mode 100644 vendor/plugins/shop_now/lib/tasks/shop_now_tasks.rake create mode 100644 vendor/plugins/shop_now/shop_now.gemspec create mode 100644 vendor/plugins/shop_now/test/controllers/.keep create mode 100644 vendor/plugins/shop_now/test/controllers/products_controller_test.rb create mode 100644 vendor/plugins/shop_now/test/dummy/Rakefile create mode 100644 vendor/plugins/shop_now/test/dummy/app/assets/images/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/app/assets/stylesheets/application.css create mode 100644 vendor/plugins/shop_now/test/dummy/app/controllers/application_controller.rb create mode 100644 vendor/plugins/shop_now/test/dummy/app/controllers/concerns/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/app/helpers/application_helper.rb create mode 100644 vendor/plugins/shop_now/test/dummy/app/jobs/application_job.rb create mode 100644 vendor/plugins/shop_now/test/dummy/app/mailers/application_mailer.rb create mode 100644 vendor/plugins/shop_now/test/dummy/app/models/application_record.rb create mode 100644 vendor/plugins/shop_now/test/dummy/app/models/concerns/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/app/views/layouts/application.html.erb create mode 100644 vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.html.erb create mode 100644 vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.text.erb create mode 100644 vendor/plugins/shop_now/test/dummy/app/views/pwa/manifest.json.erb create mode 100644 vendor/plugins/shop_now/test/dummy/app/views/pwa/service-worker.js create mode 100755 vendor/plugins/shop_now/test/dummy/bin/dev create mode 100755 vendor/plugins/shop_now/test/dummy/bin/rails create mode 100755 vendor/plugins/shop_now/test/dummy/bin/rake create mode 100755 vendor/plugins/shop_now/test/dummy/bin/setup create mode 100644 vendor/plugins/shop_now/test/dummy/config.ru create mode 100644 vendor/plugins/shop_now/test/dummy/config/application.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/boot.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/cable.yml create mode 100644 vendor/plugins/shop_now/test/dummy/config/database.yml create mode 100644 vendor/plugins/shop_now/test/dummy/config/environment.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/environments/development.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/environments/production.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/environments/test.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/initializers/assets.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/initializers/content_security_policy.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/initializers/filter_parameter_logging.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/initializers/inflections.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/locales/en.yml create mode 100644 vendor/plugins/shop_now/test/dummy/config/puma.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/routes.rb create mode 100644 vendor/plugins/shop_now/test/dummy/config/storage.yml create mode 100644 vendor/plugins/shop_now/test/dummy/db/schema.rb create mode 100644 vendor/plugins/shop_now/test/dummy/log/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/log/development.log create mode 100644 vendor/plugins/shop_now/test/dummy/public/400.html create mode 100644 vendor/plugins/shop_now/test/dummy/public/404.html create mode 100644 vendor/plugins/shop_now/test/dummy/public/406-unsupported-browser.html create mode 100644 vendor/plugins/shop_now/test/dummy/public/422.html create mode 100644 vendor/plugins/shop_now/test/dummy/public/500.html create mode 100644 vendor/plugins/shop_now/test/dummy/public/icon.png create mode 100644 vendor/plugins/shop_now/test/dummy/public/icon.svg create mode 100644 vendor/plugins/shop_now/test/dummy/storage/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/storage/development.sqlite3 create mode 100644 vendor/plugins/shop_now/test/dummy/tmp/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/tmp/local_secret.txt create mode 100644 vendor/plugins/shop_now/test/dummy/tmp/pids/.keep create mode 100644 vendor/plugins/shop_now/test/dummy/tmp/restart.txt create mode 100644 vendor/plugins/shop_now/test/dummy/tmp/storage/.keep create mode 100644 vendor/plugins/shop_now/test/fixtures/files/.keep create mode 100644 vendor/plugins/shop_now/test/fixtures/products.yml create mode 100644 vendor/plugins/shop_now/test/helpers/.keep create mode 100644 vendor/plugins/shop_now/test/integration/.keep create mode 100644 vendor/plugins/shop_now/test/integration/navigation_test.rb create mode 100644 vendor/plugins/shop_now/test/mailers/.keep create mode 100644 vendor/plugins/shop_now/test/models/.keep create mode 100644 vendor/plugins/shop_now/test/models/product_test.rb create mode 100644 vendor/plugins/shop_now/test/shop_now_test.rb create mode 100644 vendor/plugins/shop_now/test/system/products_test.rb create mode 100644 vendor/plugins/shop_now/test/test_helper.rb diff --git a/vendor/plugins/shop_now/.rubocop.yml b/vendor/plugins/shop_now/.rubocop.yml new file mode 100644 index 0000000..f9d86d4 --- /dev/null +++ b/vendor/plugins/shop_now/.rubocop.yml @@ -0,0 +1,8 @@ +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false diff --git a/vendor/plugins/shop_now/Gemfile b/vendor/plugins/shop_now/Gemfile new file mode 100644 index 0000000..dd5b26a --- /dev/null +++ b/vendor/plugins/shop_now/Gemfile @@ -0,0 +1,16 @@ +source "https://rubygems.org" + +# Specify your gem's dependencies in shop_now.gemspec. +gemspec + +gem "puma" + +gem "sqlite3" + +gem "propshaft" + +# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] +gem "rubocop-rails-omakase", require: false + +# Start debugger with binding.b [https://github.com/ruby/debug] +# gem "debug", ">= 1.0.0" diff --git a/vendor/plugins/shop_now/Gemfile.lock b/vendor/plugins/shop_now/Gemfile.lock new file mode 100644 index 0000000..67e26ae --- /dev/null +++ b/vendor/plugins/shop_now/Gemfile.lock @@ -0,0 +1,254 @@ +PATH + remote: . + specs: + shop_now (0.1.0) + rails (>= 8.0.3) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + mail (>= 2.8.0) + actionmailer (8.0.3) + actionpack (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activesupport (= 8.0.3) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.3) + actionview (= 8.0.3) + activesupport (= 8.0.3) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.3) + actionpack (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.3) + activesupport (= 8.0.3) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.3) + activesupport (= 8.0.3) + globalid (>= 0.3.6) + activemodel (8.0.3) + activesupport (= 8.0.3) + activerecord (8.0.3) + activemodel (= 8.0.3) + activesupport (= 8.0.3) + timeout (>= 0.4.0) + activestorage (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activesupport (= 8.0.3) + marcel (~> 1.0) + activesupport (8.0.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + ast (2.4.3) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + crass (1.0.6) + date (3.4.1) + drb (2.2.3) + erb (5.1.1) + erubi (1.13.1) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.15.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + mini_mime (1.1.5) + minitest (5.26.0) + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.10-x86_64-linux-gnu) + racc (~> 1.4) + parallel (1.27.0) + parser (3.3.10.0) + ast (~> 2.4.1) + racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.6.0) + propshaft (1.3.1) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + psych (5.2.6) + date + stringio + puma (7.1.0) + nio4r (~> 2.0) + racc (1.8.1) + rack (3.2.3) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (8.0.3) + actioncable (= 8.0.3) + actionmailbox (= 8.0.3) + actionmailer (= 8.0.3) + actionpack (= 8.0.3) + actiontext (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activemodel (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) + bundler (>= 1.15.0) + railties (= 8.0.3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.3.0) + rdoc (6.15.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.11.3) + reline (0.6.2) + io-console (~> 0.5) + rubocop (1.81.6) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.47.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) + rubocop-rails (2.33.4) + activesupport (>= 4.2.0) + lint_roller (~> 1.1) + rack (>= 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rails-omakase (1.1.0) + rubocop (>= 1.72) + rubocop-performance (>= 1.24) + rubocop-rails (>= 2.30) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + sqlite3 (2.7.4-x86_64-linux-gnu) + stringio (3.1.7) + thor (1.4.0) + timeout (0.4.3) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.0) + useragent (0.16.11) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.7.3) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + propshaft + puma + rubocop-rails-omakase + shop_now! + sqlite3 + +BUNDLED WITH + 2.4.20 diff --git a/vendor/plugins/shop_now/README.md b/vendor/plugins/shop_now/README.md new file mode 100644 index 0000000..1bfc947 --- /dev/null +++ b/vendor/plugins/shop_now/README.md @@ -0,0 +1,28 @@ +# ShopNow +Short description and motivation. + +## Usage +How to use my plugin. + +## Installation +Add this line to your application's Gemfile: + +```ruby +gem "shop_now" +``` + +And then execute: +```bash +$ bundle +``` + +Or install it yourself as: +```bash +$ gem install shop_now +``` + +## Contributing +Contribution directions go here. + +## License +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/vendor/plugins/shop_now/Rakefile b/vendor/plugins/shop_now/Rakefile new file mode 100644 index 0000000..e7793b5 --- /dev/null +++ b/vendor/plugins/shop_now/Rakefile @@ -0,0 +1,8 @@ +require "bundler/setup" + +APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) +load "rails/tasks/engine.rake" + +load "rails/tasks/statistics.rake" + +require "bundler/gem_tasks" diff --git a/vendor/plugins/shop_now/app/assets/images/shop_now/.keep b/vendor/plugins/shop_now/app/assets/images/shop_now/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/assets/stylesheets/shop_now/.keep b/vendor/plugins/shop_now/app/assets/stylesheets/shop_now/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/controllers/.keep b/vendor/plugins/shop_now/app/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/controllers/concerns/.keep b/vendor/plugins/shop_now/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/controllers/shop_now/products_controller.rb b/vendor/plugins/shop_now/app/controllers/shop_now/products_controller.rb new file mode 100644 index 0000000..babe2ad --- /dev/null +++ b/vendor/plugins/shop_now/app/controllers/shop_now/products_controller.rb @@ -0,0 +1,68 @@ +module ShopNow + + class ProductsController < ApplicationController + before_action :set_product, only: %i[ show edit update destroy ] + layout "shop_now/application" + + + # GET /products + def index + @products = Product.all + end + + # GET /products/1 + def show + @product = Product.find(params[:id]) + end + + # GET /products/new + def new + @product = Product.new + end + + # GET /products/1/edit + def edit + end + + # GET /products/1/contact + def contact + end + + # POST /products + def create + @product = Product.new(product_params) + + if @product.save + redirect_to shop_now.product_path(@product), notice: "Product was successfully created." + else + render :new, status: :unprocessable_content + end + end + + # PATCH/PUT /products/1 + def update + if @product.update(product_params) + redirect_to shop_now.product_path(@product), notice: "Product was successfully updated.", status: :see_other + else + render :edit, status: :unprocessable_entity + end + end + + # DELETE /products/1 + def destroy + @product.destroy! + redirect_to shop_now.products_path, notice: "Product was successfully destroyed.", status: :see_other + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_product + @product = Product.find(params[:id]) + end + + # Only allow a list of trusted parameters through. + def product_params + params.require(:product).permit(:name, :description, :price, images: []) + end + end +end \ No newline at end of file diff --git a/vendor/plugins/shop_now/app/helpers/.keep b/vendor/plugins/shop_now/app/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/helpers/products_helper.rb b/vendor/plugins/shop_now/app/helpers/products_helper.rb new file mode 100644 index 0000000..ab5c42b --- /dev/null +++ b/vendor/plugins/shop_now/app/helpers/products_helper.rb @@ -0,0 +1,2 @@ +module ProductsHelper +end diff --git a/vendor/plugins/shop_now/app/jobs/.keep b/vendor/plugins/shop_now/app/jobs/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/mailers/.keep b/vendor/plugins/shop_now/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/models/.keep b/vendor/plugins/shop_now/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/models/concerns/.keep b/vendor/plugins/shop_now/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/models/shop_now/product.rb b/vendor/plugins/shop_now/app/models/shop_now/product.rb new file mode 100644 index 0000000..f1f3181 --- /dev/null +++ b/vendor/plugins/shop_now/app/models/shop_now/product.rb @@ -0,0 +1,14 @@ +module ShopNow + class Product < ApplicationRecord + self.table_name = 'shop_now_products' + has_rich_text :description + has_many_attached :images + has_one_attached :image + end +end + + + +# class ShopNow::Product < ApplicationRecord + +# end diff --git a/vendor/plugins/shop_now/app/views/.keep b/vendor/plugins/shop_now/app/views/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/app/views/layouts/shop_now/application.html.erb b/vendor/plugins/shop_now/app/views/layouts/shop_now/application.html.erb new file mode 100644 index 0000000..7d6cb32 --- /dev/null +++ b/vendor/plugins/shop_now/app/views/layouts/shop_now/application.html.erb @@ -0,0 +1,125 @@ + + + + ShopNow + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> + + + + + + + + + + + + + + + + +
+ <%= yield %> +
+ + + + + diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/_form.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/_form.html.erb new file mode 100644 index 0000000..dcb9c4d --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/_form.html.erb @@ -0,0 +1,39 @@ +<%# Use explicit engine route helpers to avoid polymorphic helper resolution issues inside isolated engine views %> +<% form_url = product.persisted? ? shop_now.product_path(product) : shop_now.products_path %> +<% form_method = product.persisted? ? :patch : :post %> +<%= form_with(model: product, url: form_url, method: form_method, local: true) do |form| %> + <% if product.errors.any? %> +
+

<%= pluralize(product.errors.count, "error") %> prohibited this product from being saved:

+ +
+ <% end %> + +
+ <%= form.label :name, class: "form-label" %> + <%= form.text_field :name, class: "form-control" %> +
+ +
+ <%= form.label :price, class: "form-label" %> + <%= form.number_field :price, class: "form-control", step: :any %> +
+ +
+ <%= form.label :description, class: "form-label" %> + <%= form.text_field :description, class: "form-control" %> +
+ +
+ <%= form.label :images, class: "form-label" %> + <%= form.file_field :images, multiple: true, class: "form-control" %> +
+ +
+ <%= form.submit class: "btn btn-primary" %> +
+<% end %> diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/_product.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/_product.html.erb new file mode 100644 index 0000000..4567030 --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/_product.html.erb @@ -0,0 +1,29 @@ +
+

+ Name: + <%= product.name %> +

+ +

+ Description: + <%= product.description %> +

+ +

+ Images: + <% if product.images.attached? %> +

+ <% product.images.each do |image| %> +
+ <%= image_tag main_app.rails_blob_path(image, only_path: true), class: "img-thumbnail rounded shadow-sm", style: "max-width: 200px; height: auto;" %> +
+ <% end %> +
+ <% end %> +

+ +

+ Price: + <%= product.price %> +

+
diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/contact.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/contact.html.erb new file mode 100644 index 0000000..ce0e8ce --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/contact.html.erb @@ -0,0 +1,10 @@ +

Contact Us

+

If you have any questions or need assistance, please feel free to reach out to us:

+ \ No newline at end of file diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/edit.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/edit.html.erb new file mode 100644 index 0000000..f2b1d02 --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/edit.html.erb @@ -0,0 +1,12 @@ +<% content_for :title, "Editing product" %> + +

Editing product

+ +<%= render "form", product: @product %> + +
+ +
+ <%= link_to "Show this product", @product %> | + <%= link_to "Back to products", products_path %> +
diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/index.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/index.html.erb new file mode 100644 index 0000000..2520385 --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/index.html.erb @@ -0,0 +1,183 @@ +<% content_for :title, "Products" %> + + + + + +
+ <% @products.each do |product| %> +
+ + +

<%= product.name %>

+

<%= product.price %>

+ <%= link_to "View Product", product_path(product), class: "product-link" %> +
+ <% end %> +
+ + +<%= link_to "Add New Product", new_product_path, class: 'new-product-button' %> + + + + + diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/new.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/new.html.erb new file mode 100644 index 0000000..ed0f5e0 --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/new.html.erb @@ -0,0 +1,11 @@ +<% content_for :title, "New product" %> + +

New product

+ +<%= render "form", product: @product %> + +
+ +
+ <%= link_to "Back to products", products_path %> +
diff --git a/vendor/plugins/shop_now/app/views/shop_now/products/show.html.erb b/vendor/plugins/shop_now/app/views/shop_now/products/show.html.erb new file mode 100644 index 0000000..c0c58be --- /dev/null +++ b/vendor/plugins/shop_now/app/views/shop_now/products/show.html.erb @@ -0,0 +1,10 @@ +

<%= notice %>

+ +<%= render @product %> + +
+ <%= link_to "Edit this product", shop_now.edit_product_path(@product) %> | + <%= link_to "Back to products", shop_now.products_path %> + + <%= button_to "Destroy this product", shop_now.product_path(@product), method: :delete %> +
diff --git a/vendor/plugins/shop_now/bin/rails b/vendor/plugins/shop_now/bin/rails new file mode 100755 index 0000000..2e4a1b7 --- /dev/null +++ b/vendor/plugins/shop_now/bin/rails @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails gems +# installed from the root of your application. + +ENGINE_ROOT = File.expand_path("..", __dir__) +ENGINE_PATH = File.expand_path("../lib/shop_now/engine", __dir__) +APP_PATH = File.expand_path("../test/dummy/config/application", __dir__) + +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) + +require "rails/all" +require "rails/engine/commands" diff --git a/vendor/plugins/shop_now/bin/rubocop b/vendor/plugins/shop_now/bin/rubocop new file mode 100755 index 0000000..40330c0 --- /dev/null +++ b/vendor/plugins/shop_now/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/vendor/plugins/shop_now/config/routes.rb b/vendor/plugins/shop_now/config/routes.rb new file mode 100644 index 0000000..b5560e5 --- /dev/null +++ b/vendor/plugins/shop_now/config/routes.rb @@ -0,0 +1,7 @@ + +ShopNow::Engine.routes.draw do + resources :products + # Within the engine, controllers are namespaced automatically (ShopNow::ProductsController) + root to: "shop_now/products#index" + get "contact", to: "products#contact" +end diff --git a/vendor/plugins/shop_now/db/migrate/20251102092955_create_products.rb b/vendor/plugins/shop_now/db/migrate/20251102092955_create_products.rb new file mode 100644 index 0000000..305a029 --- /dev/null +++ b/vendor/plugins/shop_now/db/migrate/20251102092955_create_products.rb @@ -0,0 +1,11 @@ +class CreateProducts < ActiveRecord::Migration[8.0] + def change + create_table :products do |t| + t.string :name + t.text :description + t.decimal :price + + t.timestamps + end + end +end diff --git a/vendor/plugins/shop_now/lib/shop_now.rb b/vendor/plugins/shop_now/lib/shop_now.rb new file mode 100644 index 0000000..c28b501 --- /dev/null +++ b/vendor/plugins/shop_now/lib/shop_now.rb @@ -0,0 +1,6 @@ +require "shop_now/version" +require "shop_now/engine" + +module ShopNow + # Your code goes here... +end diff --git a/vendor/plugins/shop_now/lib/shop_now/engine.rb b/vendor/plugins/shop_now/lib/shop_now/engine.rb new file mode 100644 index 0000000..6714745 --- /dev/null +++ b/vendor/plugins/shop_now/lib/shop_now/engine.rb @@ -0,0 +1,5 @@ +module ShopNow + class Engine < ::Rails::Engine + isolate_namespace ShopNow + end +end diff --git a/vendor/plugins/shop_now/lib/shop_now/version.rb b/vendor/plugins/shop_now/lib/shop_now/version.rb new file mode 100644 index 0000000..9ea7c90 --- /dev/null +++ b/vendor/plugins/shop_now/lib/shop_now/version.rb @@ -0,0 +1,3 @@ +module ShopNow + VERSION = "0.1.0" +end diff --git a/vendor/plugins/shop_now/lib/tasks/shop_now_tasks.rake b/vendor/plugins/shop_now/lib/tasks/shop_now_tasks.rake new file mode 100644 index 0000000..0994a4f --- /dev/null +++ b/vendor/plugins/shop_now/lib/tasks/shop_now_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :shop_now do +# # Task goes here +# end diff --git a/vendor/plugins/shop_now/shop_now.gemspec b/vendor/plugins/shop_now/shop_now.gemspec new file mode 100644 index 0000000..af04c65 --- /dev/null +++ b/vendor/plugins/shop_now/shop_now.gemspec @@ -0,0 +1,26 @@ +require_relative "lib/shop_now/version" + +Gem::Specification.new do |spec| + spec.name = "shop_now" + spec.version = ShopNow::VERSION + spec.authors = [ "niyas301" ] + spec.email = [ "niyumon301@gmail.com" ] + spec.homepage = "https://example.com/shop_now" + spec.summary = "ShopNow plugin for Badar Madeena (local)" + spec.description = "Local ShopNow plugin used by the application. Replace with your project's description." + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host" + # to allow pushing to a single host or delete this section to allow pushing to any host. + # If you publish this gem, set allowed_push_host appropriately. Left unset for local use. + # spec.metadata["allowed_push_host"] = "http://mygemserver.com" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "https://example.com/shop_now/source" + spec.metadata["changelog_uri"] = "https://example.com/shop_now/CHANGELOG.md" + + spec.files = Dir.chdir(File.expand_path(__dir__)) do + Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] + end + + spec.add_dependency "rails", ">= 8.0.3" +end diff --git a/vendor/plugins/shop_now/test/controllers/.keep b/vendor/plugins/shop_now/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/controllers/products_controller_test.rb b/vendor/plugins/shop_now/test/controllers/products_controller_test.rb new file mode 100644 index 0000000..97174d1 --- /dev/null +++ b/vendor/plugins/shop_now/test/controllers/products_controller_test.rb @@ -0,0 +1,48 @@ +require "test_helper" + +class ProductsControllerTest < ActionDispatch::IntegrationTest + setup do + @product = products(:one) + end + + test "should get index" do + get products_url + assert_response :success + end + + test "should get new" do + get new_product_url + assert_response :success + end + + test "should create product" do + assert_difference("Product.count") do + post products_url, params: { product: { name: @product.name, price: @product.price } } + end + + assert_redirected_to product_url(Product.last) + end + + test "should show product" do + get product_url(@product) + assert_response :success + end + + test "should get edit" do + get edit_product_url(@product) + assert_response :success + end + + test "should update product" do + patch product_url(@product), params: { product: { name: @product.name, price: @product.price } } + assert_redirected_to product_url(@product) + end + + test "should destroy product" do + assert_difference("Product.count", -1) do + delete product_url(@product) + end + + assert_redirected_to products_url + end +end diff --git a/vendor/plugins/shop_now/test/dummy/Rakefile b/vendor/plugins/shop_now/test/dummy/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/vendor/plugins/shop_now/test/dummy/app/assets/images/.keep b/vendor/plugins/shop_now/test/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/app/assets/stylesheets/application.css b/vendor/plugins/shop_now/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..0ebd7fe --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/vendor/plugins/shop_now/test/dummy/app/controllers/application_controller.rb b/vendor/plugins/shop_now/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..0d95db2 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,4 @@ +class ApplicationController < ActionController::Base + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + allow_browser versions: :modern +end diff --git a/vendor/plugins/shop_now/test/dummy/app/controllers/concerns/.keep b/vendor/plugins/shop_now/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/app/helpers/application_helper.rb b/vendor/plugins/shop_now/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/vendor/plugins/shop_now/test/dummy/app/jobs/application_job.rb b/vendor/plugins/shop_now/test/dummy/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/vendor/plugins/shop_now/test/dummy/app/mailers/application_mailer.rb b/vendor/plugins/shop_now/test/dummy/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/vendor/plugins/shop_now/test/dummy/app/models/application_record.rb b/vendor/plugins/shop_now/test/dummy/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/vendor/plugins/shop_now/test/dummy/app/models/concerns/.keep b/vendor/plugins/shop_now/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/app/views/layouts/application.html.erb b/vendor/plugins/shop_now/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..f25ae92 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,27 @@ + + + + <%= content_for(:title) || "Dummy" %> + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= yield :head %> + + <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> + <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> + + + + + + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app %> + + + + <%= yield %> + + diff --git a/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.html.erb b/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.text.erb b/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/vendor/plugins/shop_now/test/dummy/app/views/pwa/manifest.json.erb b/vendor/plugins/shop_now/test/dummy/app/views/pwa/manifest.json.erb new file mode 100644 index 0000000..a3c046e --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/views/pwa/manifest.json.erb @@ -0,0 +1,22 @@ +{ + "name": "Dummy", + "icons": [ + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "Dummy.", + "theme_color": "red", + "background_color": "red" +} diff --git a/vendor/plugins/shop_now/test/dummy/app/views/pwa/service-worker.js b/vendor/plugins/shop_now/test/dummy/app/views/pwa/service-worker.js new file mode 100644 index 0000000..b3a13fb --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/app/views/pwa/service-worker.js @@ -0,0 +1,26 @@ +// Add a service worker for processing Web Push notifications: +// +// self.addEventListener("push", async (event) => { +// const { title, options } = await event.data.json() +// event.waitUntil(self.registration.showNotification(title, options)) +// }) +// +// self.addEventListener("notificationclick", function(event) { +// event.notification.close() +// event.waitUntil( +// clients.matchAll({ type: "window" }).then((clientList) => { +// for (let i = 0; i < clientList.length; i++) { +// let client = clientList[i] +// let clientPath = (new URL(client.url)).pathname +// +// if (clientPath == event.notification.data.path && "focus" in client) { +// return client.focus() +// } +// } +// +// if (clients.openWindow) { +// return clients.openWindow(event.notification.data.path) +// } +// }) +// ) +// }) diff --git a/vendor/plugins/shop_now/test/dummy/bin/dev b/vendor/plugins/shop_now/test/dummy/bin/dev new file mode 100755 index 0000000..5f91c20 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/vendor/plugins/shop_now/test/dummy/bin/rails b/vendor/plugins/shop_now/test/dummy/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/vendor/plugins/shop_now/test/dummy/bin/rake b/vendor/plugins/shop_now/test/dummy/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/vendor/plugins/shop_now/test/dummy/bin/setup b/vendor/plugins/shop_now/test/dummy/bin/setup new file mode 100755 index 0000000..be3db3c --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/bin/setup @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require "fileutils" + +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end +end diff --git a/vendor/plugins/shop_now/test/dummy/config.ru b/vendor/plugins/shop_now/test/dummy/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/vendor/plugins/shop_now/test/dummy/config/application.rb b/vendor/plugins/shop_now/test/dummy/config/application.rb new file mode 100644 index 0000000..6e61f6b --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/application.rb @@ -0,0 +1,29 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Dummy + class Application < Rails::Application + config.load_defaults Rails::VERSION::STRING.to_f + + # For compatibility with applications that use this config + config.action_controller.include_all_helpers = false + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/vendor/plugins/shop_now/test/dummy/config/boot.rb b/vendor/plugins/shop_now/test/dummy/config/boot.rb new file mode 100644 index 0000000..116591a --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) + +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) +$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) diff --git a/vendor/plugins/shop_now/test/dummy/config/cable.yml b/vendor/plugins/shop_now/test/dummy/config/cable.yml new file mode 100644 index 0000000..98367f8 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: dummy_production diff --git a/vendor/plugins/shop_now/test/dummy/config/database.yml b/vendor/plugins/shop_now/test/dummy/config/database.yml new file mode 100644 index 0000000..01bebb5 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/database.yml @@ -0,0 +1,32 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: storage/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: storage/test.sqlite3 + + +# SQLite3 write its data on the local filesystem, as such it requires +# persistent disks. If you are deploying to a managed service, you should +# make sure it provides disk persistence, as many don't. +# +# Similarly, if you deploy your application as a Docker container, you must +# ensure the database is located in a persisted volume. +production: + <<: *default + # database: path/to/persistent/storage/production.sqlite3 diff --git a/vendor/plugins/shop_now/test/dummy/config/environment.rb b/vendor/plugins/shop_now/test/dummy/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/vendor/plugins/shop_now/test/dummy/config/environments/development.rb b/vendor/plugins/shop_now/test/dummy/config/environments/development.rb new file mode 100644 index 0000000..263e0c4 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/environments/development.rb @@ -0,0 +1,69 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Make code changes take effect immediately without server restart. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing. + config.server_timing = true + + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + else + config.action_controller.perform_caching = false + end + + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. + config.action_mailer.perform_caching = false + + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/vendor/plugins/shop_now/test/dummy/config/environments/production.rb b/vendor/plugins/shop_now/test/dummy/config/environments/production.rb new file mode 100644 index 0000000..1749607 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/environments/production.rb @@ -0,0 +1,89 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). + config.eager_load = true + + # Full error reports are disabled. + config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true + + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + + # Change to "debug" to log everything (including potentially personally-identifiable information!) + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. + # config.cache_store = :mem_cache_store + + # Replace the default in-process and non-durable queuing backend for Active Job. + # config.active_job.queue_adapter = :resque + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/vendor/plugins/shop_now/test/dummy/config/environments/test.rb b/vendor/plugins/shop_now/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..c2095b1 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/environments/test.rb @@ -0,0 +1,53 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? + + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + + # Show full error reports. + config.consider_all_requests_local = true + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/vendor/plugins/shop_now/test/dummy/config/initializers/assets.rb b/vendor/plugins/shop_now/test/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..4873244 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/initializers/assets.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path diff --git a/vendor/plugins/shop_now/test/dummy/config/initializers/content_security_policy.rb b/vendor/plugins/shop_now/test/dummy/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/vendor/plugins/shop_now/test/dummy/config/initializers/filter_parameter_logging.rb b/vendor/plugins/shop_now/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c0b717f --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc +] diff --git a/vendor/plugins/shop_now/test/dummy/config/initializers/inflections.rb b/vendor/plugins/shop_now/test/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/vendor/plugins/shop_now/test/dummy/config/locales/en.yml b/vendor/plugins/shop_now/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/vendor/plugins/shop_now/test/dummy/config/puma.rb b/vendor/plugins/shop_now/test/dummy/config/puma.rb new file mode 100644 index 0000000..787e4ce --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/puma.rb @@ -0,0 +1,38 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. +# +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. +# +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/vendor/plugins/shop_now/test/dummy/config/routes.rb b/vendor/plugins/shop_now/test/dummy/config/routes.rb new file mode 100644 index 0000000..48254e8 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/routes.rb @@ -0,0 +1,14 @@ +Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb) + # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest + # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker + + # Defines the root path route ("/") + # root "posts#index" +end diff --git a/vendor/plugins/shop_now/test/dummy/config/storage.yml b/vendor/plugins/shop_now/test/dummy/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/vendor/plugins/shop_now/test/dummy/db/schema.rb b/vendor/plugins/shop_now/test/dummy/db/schema.rb new file mode 100644 index 0000000..c5fc249 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/db/schema.rb @@ -0,0 +1,21 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 2025_11_02_092955) do + create_table "products", force: :cascade do |t| + t.string "name" + t.text "description" + t.decimal "price" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end +end diff --git a/vendor/plugins/shop_now/test/dummy/log/.keep b/vendor/plugins/shop_now/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/log/development.log b/vendor/plugins/shop_now/test/dummy/log/development.log new file mode 100644 index 0000000..a1e4192 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/log/development.log @@ -0,0 +1,31 @@ +Started GET "/shop_now/products" for 127.0.0.1 at 2025-11-02 15:11:37 +0530 +  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) /*application='Dummy'*/ +  (0.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) /*application='Dummy'*/ + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application='Dummy'*/ + +ActionController::RoutingError (No route matches [GET] "/shop_now/products"): + +Started GET "/shop_now/products" for 127.0.0.1 at 2025-11-02 15:11:42 +0530 + +ActionController::RoutingError (No route matches [GET] "/shop_now/products"): + +Started GET "/shop_now/products" for 127.0.0.1 at 2025-11-02 15:13:06 +0530 + +ActionController::RoutingError (No route matches [GET] "/shop_now/products"): + +Started GET "/shop_now/products" for 127.0.0.1 at 2025-11-02 15:13:08 +0530 + +ActionController::RoutingError (No route matches [GET] "/shop_now/products"): + + ActiveRecord::InternalMetadata Load (0.7ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 /*application='Dummy'*/ + ActiveRecord::InternalMetadata Create (2.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2025-11-02 11:06:31.387892', '2025-11-02 11:06:31.387898') RETURNING "key" /*application='Dummy'*/ + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application='Dummy'*/ +Migrating to CreateProducts (20251102092955) + TRANSACTION (0.1ms) BEGIN immediate TRANSACTION /*application='Dummy'*/ +  (6.9ms) CREATE TABLE "products" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "description" text, "price" decimal, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL) /*application='Dummy'*/ + ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20251102092955') RETURNING "version" /*application='Dummy'*/ + TRANSACTION (0.5ms) COMMIT TRANSACTION /*application='Dummy'*/ + ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application='Dummy'*/ + ActiveRecord::InternalMetadata Load (0.2ms) SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1 /*application='Dummy'*/ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application='Dummy'*/ + ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application='Dummy'*/ diff --git a/vendor/plugins/shop_now/test/dummy/public/400.html b/vendor/plugins/shop_now/test/dummy/public/400.html new file mode 100644 index 0000000..282dbc8 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/vendor/plugins/shop_now/test/dummy/public/404.html b/vendor/plugins/shop_now/test/dummy/public/404.html new file mode 100644 index 0000000..c0670bc --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/404.html @@ -0,0 +1,114 @@ + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/vendor/plugins/shop_now/test/dummy/public/406-unsupported-browser.html b/vendor/plugins/shop_now/test/dummy/public/406-unsupported-browser.html new file mode 100644 index 0000000..9532a9c --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/406-unsupported-browser.html @@ -0,0 +1,114 @@ + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + + diff --git a/vendor/plugins/shop_now/test/dummy/public/422.html b/vendor/plugins/shop_now/test/dummy/public/422.html new file mode 100644 index 0000000..8bcf060 --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/422.html @@ -0,0 +1,114 @@ + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/vendor/plugins/shop_now/test/dummy/public/500.html b/vendor/plugins/shop_now/test/dummy/public/500.html new file mode 100644 index 0000000..d77718c --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/500.html @@ -0,0 +1,114 @@ + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/vendor/plugins/shop_now/test/dummy/public/icon.png b/vendor/plugins/shop_now/test/dummy/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c9dbfbbd2f7c1421ffd5727188146213abbcef GIT binary patch literal 4166 zcmd6qU;WFw?|v@m)Sk^&NvB8tcujdV-r1b=i(NJxn&7{KTb zX$3(M+3TP2o^#KAo{#tIjl&t~(8D-k004kqPglzn0HFG(Q~(I*AKsD#M*g7!XK0T7 zN6P7j>HcT8rZgKl$v!xr806dyN19Bd4C0x_R*I-a?#zsTvb_89cyhuC&T**i|Rc zq5b8M;+{8KvoJ~uj9`u~d_f6`V&3+&ZX9x5pc8s)d175;@pjm(?dapmBcm0&vl9+W zx1ZD2o^nuyUHWj|^A8r>lUorO`wFF;>9XL-Jy!P}UXC{(z!FO%SH~8k`#|9;Q|eue zqWL0^Bp(fg_+Pkm!fDKRSY;+^@BF?AJE zCUWpXPst~hi_~u)SzYBDZroR+Z4xeHIlm_3Yc_9nZ(o_gg!jDgVa=E}Y8uDgem9`b zf=mfJ_@(BXSkW53B)F2s!&?_R4ptb1fYXlF++@vPhd=marQgEGRZS@B4g1Mu?euknL= z67P~tZ?*>-Hmi7GwlisNHHJDku-dSm7g@!=a}9cSL6Pa^w^2?&?$Oi8ibrr>w)xqx zOH_EMU@m05)9kuNR>>4@H%|){U$^yvVQ(YgOlh;5oU_-vivG-p4=LrN-k7D?*?u1u zsWly%tfAzKd6Fb=`eU2un_uaTXmcT#tlOL+aRS=kZZf}A7qT8lvcTx~7j` z*b>=z)mwg7%B2_!D0!1IZ?Nq{^Y$uI4Qx*6T!E2Col&2{k?ImCO=dD~A&9f9diXy^$x{6CwkBimn|1E09 zAMSezYtiL?O6hS37KpvDM?22&d{l)7h-!F)C-d3j8Z`c@($?mfd{R82)H>Qe`h{~G z!I}(2j(|49{LR?w4Jspl_i!(4T{31|dqCOpI52r5NhxYV+cDAu(xp*4iqZ2e-$YP= zoFOPmm|u*7C?S{Fp43y+V;>~@FFR76bCl@pTtyB93vNWy5yf;HKr8^0d7&GVIslYm zo3Tgt@M!`8B6IW&lK{Xk>%zp41G%`(DR&^u z5^pwD4>E6-w<8Kl2DzJ%a@~QDE$(e87lNhy?-Qgep!$b?5f7+&EM7$e>|WrX+=zCb z=!f5P>MxFyy;mIRxjc(H*}mceXw5a*IpC0PEYJ8Y3{JdoIW)@t97{wcUB@u+$FCCO z;s2Qe(d~oJC^`m$7DE-dsha`glrtu&v&93IZadvl_yjp!c89>zo;Krk+d&DEG4?x$ zufC1n+c1XD7dolX1q|7}uelR$`pT0Z)1jun<39$Sn2V5g&|(j~Z!wOddfYiZo7)A< z!dK`aBHOOk+-E_xbWCA3VR-+o$i5eO9`rMI#p_0xQ}rjEpGW;U!&&PKnivOcG(|m9 z!C8?WC6nCXw25WVa*eew)zQ=h45k8jSIPbq&?VE{oG%?4>9rwEeB4&qe#?-y_es4c|7ufw%+H5EY#oCgv!Lzv291#-oNlX~X+Jl5(riC~r z=0M|wMOP)Tt8@hNg&%V@Z9@J|Q#K*hE>sr6@oguas9&6^-=~$*2Gs%h#GF@h)i=Im z^iKk~ipWJg1VrvKS;_2lgs3n1zvNvxb27nGM=NXE!D4C!U`f*K2B@^^&ij9y}DTLB*FI zEnBL6y{jc?JqXWbkIZd7I16hA>(f9T!iwbIxJj~bKPfrO;>%*5nk&Lf?G@c2wvGrY&41$W{7HM9+b@&XY@>NZM5s|EK_Dp zQX60CBuantx>|d#DsaZ*8MW(we|#KTYZ=vNa#d*DJQe6hr~J6{_rI#?wi@s|&O}FR zG$kfPxheXh1?IZ{bDT-CWB4FTvO-k5scW^mi8?iY5Q`f8JcnnCxiy@m@D-%lO;y0pTLhh6i6l@x52j=#^$5_U^os}OFg zzdHbo(QI`%9#o*r8GCW~T3UdV`szO#~)^&X_(VW>o~umY9-ns9-V4lf~j z`QBD~pJ4a#b`*6bJ^3RS5y?RAgF7K5$ll97Y8#WZduZ`j?IEY~H(s^doZg>7-tk*t z4_QE1%%bb^p~4F5SB$t2i1>DBG1cIo;2(xTaj*Y~hlM{tSDHojL-QPg%Mo%6^7FrpB*{ z4G0@T{-77Por4DCMF zB_5Y~Phv%EQ64W8^GS6h?x6xh;w2{z3$rhC;m+;uD&pR74j+i22P5DS-tE8ABvH(U~indEbBUTAAAXfHZg5QpB@TgV9eI<)JrAkOI z8!TSOgfAJiWAXeM&vR4Glh;VxH}WG&V$bVb`a`g}GSpwggti*&)taV1@Ak|{WrV|5 zmNYx)Ans=S{c52qv@+jmGQ&vd6>6yX6IKq9O$3r&0xUTdZ!m1!irzn`SY+F23Rl6# zFRxws&gV-kM1NX(3(gnKpGi0Q)Dxi~#?nyzOR9!en;Ij>YJZVFAL*=R%7y%Mz9hU% zs>+ZB?qRmZ)nISx7wxY)y#cd$iaC~{k0avD>BjyF1q^mNQ1QcwsxiTySe<6C&cC6P zE`vwO9^k-d`9hZ!+r@Jnr+MF*2;2l8WjZ}DrwDUHzSF{WoG zucbSWguA!3KgB3MU%HH`R;XqVv0CcaGq?+;v_A5A2kpmk5V%qZE3yzQ7R5XWhq=eR zyUezH=@V)y>L9T-M-?tW(PQYTRBKZSVb_!$^H-Pn%ea;!vS_?M<~Tm>_rWIW43sPW z=!lY&fWc1g7+r?R)0p8(%zp&vl+FK4HRkns%BW+Up&wK8!lQ2~bja|9bD12WrKn#M zK)Yl9*8$SI7MAwSK$%)dMd>o+1UD<2&aQMhyjS5R{-vV+M;Q4bzl~Z~=4HFj_#2V9 zB)Gfzx3ncy@uzx?yzi}6>d%-?WE}h7v*w)Jr_gBl!2P&F3DX>j_1#--yjpL%<;JMR z*b70Gr)MMIBWDo~#<5F^Q0$VKI;SBIRneuR7)yVsN~A9I@gZTXe)E?iVII+X5h0~H zx^c(fP&4>!*q>fb6dAOC?MI>Cz3kld#J*;uik+Ps49cwm1B4 zZc1|ZxYyTv;{Z!?qS=D)sgRKx^1AYf%;y_V&VgZglfU>d+Ufk5&LV$sKv}Hoj+s; xK3FZRYdhbXT_@RW*ff3@`D1#ps#~H)p+y&j#(J|vk^lW{fF9OJt5(B-_&*Xgn9~3N literal 0 HcmV?d00001 diff --git a/vendor/plugins/shop_now/test/dummy/public/icon.svg b/vendor/plugins/shop_now/test/dummy/public/icon.svg new file mode 100644 index 0000000..04b34bf --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/vendor/plugins/shop_now/test/dummy/storage/.keep b/vendor/plugins/shop_now/test/dummy/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/storage/development.sqlite3 b/vendor/plugins/shop_now/test/dummy/storage/development.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..f6bdd340ba1371913c893af9e3ab9222188548d7 GIT binary patch literal 28672 zcmeI)O>f#T7zc0%T3Dx1I%yM!shSlopuRw;Xra3-o6uC1LdW1x?GSm1*G40OItF#e zZnu4zp7xP;oz$InoI{}k3a4#Sh5iv%>?e-#^D`VwB;LKPx{}k69pN!acgPxvM951@ z2_aEc;;M{}u)Q>DsIxX!pI42N?Qc&K$=@XQ=m$x@NPb^^w)!ivry4jQ009U<00Izz z00bZa0SNpLf#X;#wXva{NcN%4gY&l9@mK*r?{VLrZpL3XDrU1no93%(g--R&_{`&* z>dx#XTaKsJ*R`)t2V-_c$LZNJ7@cDiqv)fsPBXge=+yNkKjnfRHx7=>#tA*FoKUmX ztRK|WeMgmAlh*30w5rujs)z5X(>@dS8564Q@W2*sSGpZvr;=Yt73&JuR-GJfyB=$+ zfGs$a+_9KcQB{+!$1}Ux@o{_I@WT8q*~?}$o+=i#FNcF1nXtln3!k+uk4vWRX0u{T zley385;}b1pKr6eoz}RB%A(KOy@}laMOtr`VyX8My>LJP0uX=z1Rwwb2tWV=5P$##Ag~YuYg!~*$QO!+kuT)S zg>td@Q00aF|3WM-l7IjNAOHafKmY;|fB*y_009UL1s+GUE0g>Go9F*mBzXlS2tWV= z5P$##AOHafKmY;|fB*#Ui9lUjPNz+i`+Zk*e2@Fm;eFojbi-=6v)?j|t$cwR#(sWx zf5+I~DeaZYg}GNsH_!jCN%H!hWQb`%00Izz00bZa0SG_<0uX=z1R(JD0;|#V%Gl2b z;q!m>r++vg009U<00Izz00bZa0SG_<0uWeW0qp-5cyW;$1Rwwb2tWV=5P$##AOHaf IKwv2F2OMKOUjP6A literal 0 HcmV?d00001 diff --git a/vendor/plugins/shop_now/test/dummy/tmp/.keep b/vendor/plugins/shop_now/test/dummy/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/tmp/local_secret.txt b/vendor/plugins/shop_now/test/dummy/tmp/local_secret.txt new file mode 100644 index 0000000..becbf8e --- /dev/null +++ b/vendor/plugins/shop_now/test/dummy/tmp/local_secret.txt @@ -0,0 +1 @@ +109d3b806956385271f85d1c984a81f275079a1cb3e00b8dac0b1b134c2b963211c999cdf043945b679c54d48ff434daa02b4fad5dd44e7227481f33596c9c3f \ No newline at end of file diff --git a/vendor/plugins/shop_now/test/dummy/tmp/pids/.keep b/vendor/plugins/shop_now/test/dummy/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/tmp/restart.txt b/vendor/plugins/shop_now/test/dummy/tmp/restart.txt new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/dummy/tmp/storage/.keep b/vendor/plugins/shop_now/test/dummy/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/fixtures/files/.keep b/vendor/plugins/shop_now/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/fixtures/products.yml b/vendor/plugins/shop_now/test/fixtures/products.yml new file mode 100644 index 0000000..60c836e --- /dev/null +++ b/vendor/plugins/shop_now/test/fixtures/products.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + price: 9.99 + +two: + name: MyString + price: 9.99 diff --git a/vendor/plugins/shop_now/test/helpers/.keep b/vendor/plugins/shop_now/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/integration/.keep b/vendor/plugins/shop_now/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/integration/navigation_test.rb b/vendor/plugins/shop_now/test/integration/navigation_test.rb new file mode 100644 index 0000000..ebbc098 --- /dev/null +++ b/vendor/plugins/shop_now/test/integration/navigation_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class NavigationTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/vendor/plugins/shop_now/test/mailers/.keep b/vendor/plugins/shop_now/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/models/.keep b/vendor/plugins/shop_now/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/plugins/shop_now/test/models/product_test.rb b/vendor/plugins/shop_now/test/models/product_test.rb new file mode 100644 index 0000000..3560151 --- /dev/null +++ b/vendor/plugins/shop_now/test/models/product_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ProductTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/vendor/plugins/shop_now/test/shop_now_test.rb b/vendor/plugins/shop_now/test/shop_now_test.rb new file mode 100644 index 0000000..83650dd --- /dev/null +++ b/vendor/plugins/shop_now/test/shop_now_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ShopNowTest < ActiveSupport::TestCase + test "it has a version number" do + assert ShopNow::VERSION + end +end diff --git a/vendor/plugins/shop_now/test/system/products_test.rb b/vendor/plugins/shop_now/test/system/products_test.rb new file mode 100644 index 0000000..a30fb27 --- /dev/null +++ b/vendor/plugins/shop_now/test/system/products_test.rb @@ -0,0 +1,43 @@ +require "application_system_test_case" + +class ProductsTest < ApplicationSystemTestCase + setup do + @product = products(:one) + end + + test "visiting the index" do + visit products_url + assert_selector "h1", text: "Products" + end + + test "should create product" do + visit products_url + click_on "New product" + + fill_in "Name", with: @product.name + fill_in "Price", with: @product.price + click_on "Create Product" + + assert_text "Product was successfully created" + click_on "Back" + end + + test "should update Product" do + visit product_url(@product) + click_on "Edit this product", match: :first + + fill_in "Name", with: @product.name + fill_in "Price", with: @product.price + click_on "Update Product" + + assert_text "Product was successfully updated" + click_on "Back" + end + + test "should destroy Product" do + visit product_url(@product) + click_on "Destroy this product", match: :first + + assert_text "Product was successfully destroyed" + end +end diff --git a/vendor/plugins/shop_now/test/test_helper.rb b/vendor/plugins/shop_now/test/test_helper.rb new file mode 100644 index 0000000..25a5782 --- /dev/null +++ b/vendor/plugins/shop_now/test/test_helper.rb @@ -0,0 +1,14 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require_relative "../test/dummy/config/environment" +ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ] +require "rails/test_help" + +# Load fixtures from the engine +if ActiveSupport::TestCase.respond_to?(:fixture_paths=) + ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ] + ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths + ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files" + ActiveSupport::TestCase.fixtures :all +end From 6c044844d414347275d7463299121fb73711615d Mon Sep 17 00:00:00 2001 From: niyas301 Date: Mon, 3 Nov 2025 10:09:12 +0530 Subject: [PATCH 2/2] added cart --- Gemfile | 11 + Gemfile.lock | 45 +- app/assets/config/manifest.js | 2 + app/assets/javascripts/application.js | 11 + app/assets/stylesheets/actiontext.css | 440 +++++++++++++++ .../{application.css => application.css.scss} | 10 + app/assets/stylesheets/flash.css.scss | 25 + app/assets/stylesheets/flash_messages.css | 31 ++ app/controllers/application_controller.rb | 2 + app/controllers/expenses_controller.rb | 8 +- app/controllers/institutions_controller.rb | 12 +- app/controllers/layouts_controller.rb | 4 + app/controllers/students_controller.rb | 4 +- app/helpers/cart_items_helper.rb | 2 + app/helpers/carts_helper.rb | 2 + app/helpers/products_helper.rb | 2 + app/javascript/application.js | 5 + app/javascript/controllers/application.js | 9 + .../controllers/dropdown_controller.js | 12 + .../controllers/flash_controller.js | 14 + app/javascript/dropdown.js | 7 + app/javascript/flash_messages.js | 21 + app/javascript/rails_admin.js | 1 + app/models/admin.rb | 6 + app/models/admin_user.rb | 18 + app/models/finance.rb | 6 + app/models/student.rb | 2 + app/models/user.rb | 6 + app/views/active_storage/blobs/_blob.html.erb | 14 + app/views/devise/confirmations/new.html.erb | 16 + .../mailer/confirmation_instructions.html.erb | 5 + .../devise/mailer/email_changed.html.erb | 7 + .../devise/mailer/password_change.html.erb | 3 + .../reset_password_instructions.html.erb | 8 + .../mailer/unlock_instructions.html.erb | 7 + app/views/devise/passwords/edit.html.erb | 25 + app/views/devise/passwords/new.html.erb | 16 + app/views/devise/registrations/edit.html.erb | 43 ++ app/views/devise/registrations/new.html.erb | 29 + app/views/devise/sessions/new.html.erb | 26 + .../devise/shared/_error_messages.html.erb | 15 + app/views/devise/shared/_links.html.erb | 25 + app/views/devise/unlocks/new.html.erb | 16 + .../_exclusive_traditional_record.html.erb | 1 + app/views/expenses/report.html.erb | 6 +- app/views/incomes/report.html.erb | 6 +- app/views/institutions/_form.html.erb | 4 +- app/views/institutions/index.html.erb | 502 +++++++----------- app/views/institutions/show.html.erb | 133 ++++- .../action_text/contents/_content.html.erb | 3 + app/views/layouts/application.html.erb | 82 ++- app/views/programs/_form.html.erb | 138 ++++- app/views/programs/index.html.erb | 42 +- config/application.rb | 7 + config/environments/development.rb | 16 +- config/importmap.rb | 12 +- config/initializers/active_storage.rb | 11 + config/initializers/devise.rb | 313 +++++++++++ config/locales/devise.en.yml | 65 +++ config/routes.rb | 12 +- config/storage.yml | 5 + .../20251026182832_add_pricing_to_products.rb | 7 + ...251026184419_remove_price_from_products.rb | 5 + ...0251028033118_devise_create_admin_users.rb | 44 ++ ...1028033120_create_active_admin_comments.rb | 16 + ...0251102044402_add_devise_to_admin_users.rb | 17 + .../20251102065934_devise_create_users.rb | 44 ++ db/migrate/20251102091554_create_products.rb | 10 + ...2_create_action_text_tables.action_text.rb | 26 + ...20251102124707_create_shop_now_products.rb | 11 + db/schema.rb | 94 +++- db/seeds.rb | 1 + test/controllers/products_controller_test.rb | 48 ++ test/fixtures/action_text/rich_texts.yml | 4 + test/fixtures/admin_users.yml | 11 + test/fixtures/admins.yml | 11 + test/fixtures/cart_items.yml | 11 + test/fixtures/carts.yml | 11 + test/fixtures/products.yml | 9 + test/fixtures/users.yml | 11 + test/models/admin_test.rb | 7 + test/models/admin_user_test.rb | 7 + test/models/cart_item_test.rb | 7 + test/models/cart_test.rb | 7 + test/models/product_test.rb | 7 + test/models/user_test.rb | 7 + test/system/cart_items_test.rb | 45 ++ test/system/carts_test.rb | 39 ++ test/system/products_test.rb | 43 ++ 89 files changed, 2478 insertions(+), 413 deletions(-) create mode 100644 app/assets/config/manifest.js create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/actiontext.css rename app/assets/stylesheets/{application.css => application.css.scss} (76%) create mode 100644 app/assets/stylesheets/flash.css.scss create mode 100644 app/assets/stylesheets/flash_messages.css create mode 100644 app/controllers/layouts_controller.rb create mode 100644 app/helpers/cart_items_helper.rb create mode 100644 app/helpers/carts_helper.rb create mode 100644 app/helpers/products_helper.rb create mode 100644 app/javascript/controllers/dropdown_controller.js create mode 100644 app/javascript/controllers/flash_controller.js create mode 100644 app/javascript/dropdown.js create mode 100644 app/javascript/flash_messages.js create mode 100644 app/javascript/rails_admin.js create mode 100644 app/models/admin.rb create mode 100644 app/models/admin_user.rb create mode 100644 app/models/finance.rb create mode 100644 app/models/user.rb create mode 100644 app/views/active_storage/blobs/_blob.html.erb create mode 100644 app/views/devise/confirmations/new.html.erb create mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb create mode 100644 app/views/devise/mailer/email_changed.html.erb create mode 100644 app/views/devise/mailer/password_change.html.erb create mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb create mode 100644 app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 app/views/devise/passwords/edit.html.erb create mode 100644 app/views/devise/passwords/new.html.erb create mode 100644 app/views/devise/registrations/edit.html.erb create mode 100644 app/views/devise/registrations/new.html.erb create mode 100644 app/views/devise/sessions/new.html.erb create mode 100644 app/views/devise/shared/_error_messages.html.erb create mode 100644 app/views/devise/shared/_links.html.erb create mode 100644 app/views/devise/unlocks/new.html.erb create mode 100644 app/views/layouts/action_text/contents/_content.html.erb create mode 100644 config/initializers/active_storage.rb create mode 100644 config/initializers/devise.rb create mode 100644 config/locales/devise.en.yml create mode 100644 db/migrate/20251026182832_add_pricing_to_products.rb create mode 100644 db/migrate/20251026184419_remove_price_from_products.rb create mode 100644 db/migrate/20251028033118_devise_create_admin_users.rb create mode 100644 db/migrate/20251028033120_create_active_admin_comments.rb create mode 100644 db/migrate/20251102044402_add_devise_to_admin_users.rb create mode 100644 db/migrate/20251102065934_devise_create_users.rb create mode 100644 db/migrate/20251102091554_create_products.rb create mode 100644 db/migrate/20251102093952_create_action_text_tables.action_text.rb create mode 100644 db/migrate/20251102124707_create_shop_now_products.rb create mode 100644 test/controllers/products_controller_test.rb create mode 100644 test/fixtures/action_text/rich_texts.yml create mode 100644 test/fixtures/admin_users.yml create mode 100644 test/fixtures/admins.yml create mode 100644 test/fixtures/cart_items.yml create mode 100644 test/fixtures/carts.yml create mode 100644 test/fixtures/products.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/models/admin_test.rb create mode 100644 test/models/admin_user_test.rb create mode 100644 test/models/cart_item_test.rb create mode 100644 test/models/cart_test.rb create mode 100644 test/models/product_test.rb create mode 100644 test/models/user_test.rb create mode 100644 test/system/cart_items_test.rb create mode 100644 test/system/carts_test.rb create mode 100644 test/system/products_test.rb diff --git a/Gemfile b/Gemfile index 7bc3434..e8c0ccb 100644 --- a/Gemfile +++ b/Gemfile @@ -61,3 +61,14 @@ group :test do gem "capybara" gem "selenium-webdriver" end +# admin +gem 'devise' + +gem "sprockets-rails" +gem "sassc-rails" +gem "font-awesome-sass", '~> 5.15.1' + + + + +gem "shop_now", path: "vendor/plugins/shop_now" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index c9bf4d8..8f61946 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,9 @@ +PATH + remote: vendor/plugins/shop_now + specs: + shop_now (0.1.0) + rails (>= 8.0.3) + GEM remote: https://rubygems.org/ specs: @@ -76,6 +82,7 @@ GEM public_suffix (>= 2.0.2, < 7.0) ast (2.4.3) base64 (0.3.0) + bcrypt (3.1.20) bcrypt_pbkdf (1.1.1) benchmark (0.4.1) bigdecimal (3.2.3) @@ -101,6 +108,12 @@ GEM debug (1.11.0) irb (~> 1.10) reline (>= 0.3.8) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) dotenv (3.1.8) drb (2.2.3) ed25519 (1.4.0) @@ -109,6 +122,8 @@ GEM et-orbi (1.4.0) tzinfo ffi (1.17.2-x86_64-linux-gnu) + font-awesome-sass (5.15.1) + sassc (>= 1.11) fugit (1.11.2) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) @@ -178,6 +193,7 @@ GEM nio4r (2.7.4) nokogiri (1.18.10-x86_64-linux-gnu) racc (~> 1.4) + orm_adapter (0.5.0) ostruct (0.6.3) parallel (1.27.0) parser (3.3.9.0) @@ -245,6 +261,9 @@ GEM regexp_parser (2.11.3) reline (0.6.2) io-console (~> 0.5) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) rexml (3.4.4) rubocop (1.81.1) json (~> 2.3) @@ -279,6 +298,14 @@ GEM ffi (~> 1.12) logger rubyzip (3.1.1) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt securerandom (0.4.1) selenium-webdriver (4.35.0) base64 (~> 0.2) @@ -302,6 +329,14 @@ GEM fugit (~> 1.11.0) railties (>= 7.1) thor (>= 1.3.1) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) sqlite3 (2.7.4-x86_64-linux-gnu) sshkit (1.24.0) base64 @@ -315,6 +350,7 @@ GEM stringio (3.1.7) thor (1.4.0) thruster (0.1.15-x86_64-linux) + tilt (2.6.1) timeout (0.4.3) tsort (0.2.0) turbo-rails (2.0.17) @@ -325,8 +361,10 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.1.0) - uri (1.0.3) + uri (1.1.0) useragent (0.16.11) + warden (1.2.9) + rack (>= 2.0.9) web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -349,6 +387,8 @@ DEPENDENCIES brakeman capybara debug + devise + font-awesome-sass (~> 5.15.1) image_processing (~> 1.12) importmap-rails jbuilder @@ -357,10 +397,13 @@ DEPENDENCIES puma (>= 5.0) rails (~> 8.0.3) rubocop-rails-omakase + sassc-rails selenium-webdriver + shop_now! solid_cable solid_cache solid_queue + sprockets-rails sqlite3 (>= 2.1) stimulus-rails thruster diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..7b8888f --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,11 @@ +// app/javascript/application.js or app/assets/javascripts/application.js +document.addEventListener("DOMContentLoaded", () => { + const flash = document.getElementById("flash-message"); + if (flash) { + setTimeout(() => { + flash.style.transition = "opacity 0.5s ease"; + flash.style.opacity = "0"; + setTimeout(() => flash.remove(), 500); // remove from DOM after fade + }, 3000); // 3 seconds + } +}); diff --git a/app/assets/stylesheets/actiontext.css b/app/assets/stylesheets/actiontext.css new file mode 100644 index 0000000..9b6bcb0 --- /dev/null +++ b/app/assets/stylesheets/actiontext.css @@ -0,0 +1,440 @@ +/* + * Default Trix editor styles. See Action Text overwrites below. +*/ + +trix-editor { + border: 1px solid #bbb; + border-radius: 3px; + margin: 0; + padding: 0.4em 0.6em; + min-height: 5em; + outline: none; } + +trix-toolbar * { + box-sizing: border-box; } + +trix-toolbar .trix-button-row { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + overflow-x: auto; } + +trix-toolbar .trix-button-group { + display: flex; + margin-bottom: 10px; + border: 1px solid #bbb; + border-top-color: #ccc; + border-bottom-color: #888; + border-radius: 3px; } + trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 1.5vw; } + @media (max-width: 768px) { + trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 0; } } + +trix-toolbar .trix-button-group-spacer { + flex-grow: 1; } + @media (max-width: 768px) { + trix-toolbar .trix-button-group-spacer { + display: none; } } + +trix-toolbar .trix-button { + position: relative; + float: left; + color: rgba(0, 0, 0, 0.6); + font-size: 0.75em; + font-weight: 600; + white-space: nowrap; + padding: 0 0.5em; + margin: 0; + outline: none; + border: none; + border-bottom: 1px solid #ddd; + border-radius: 0; + background: transparent; } + trix-toolbar .trix-button:not(:first-child) { + border-left: 1px solid #ccc; } + trix-toolbar .trix-button.trix-active { + background: #cbeefa; + color: black; } + trix-toolbar .trix-button:not(:disabled) { + cursor: pointer; } + trix-toolbar .trix-button:disabled { + color: rgba(0, 0, 0, 0.125); } + @media (max-width: 768px) { + trix-toolbar .trix-button { + letter-spacing: -0.01em; + padding: 0 0.3em; } } + +trix-toolbar .trix-button--icon { + font-size: inherit; + width: 2.6em; + height: 1.6em; + max-width: calc(0.8em + 4vw); + text-indent: -9999px; } + @media (max-width: 768px) { + trix-toolbar .trix-button--icon { + height: 2em; + max-width: calc(0.8em + 3.5vw); } } + trix-toolbar .trix-button--icon::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.6; + content: ""; + background-position: center; + background-repeat: no-repeat; + background-size: contain; } + @media (max-width: 768px) { + trix-toolbar .trix-button--icon::before { + right: 6%; + left: 6%; } } + trix-toolbar .trix-button--icon.trix-active::before { + opacity: 1; } + trix-toolbar .trix-button--icon:disabled::before { + opacity: 0.125; } + +trix-toolbar .trix-button--icon-attach::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); + top: 8%; + bottom: 4%; } + +trix-toolbar .trix-button--icon-bold::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-italic::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-link::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-strike::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-quote::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-heading-1::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-code::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-bullet-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-number-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-undo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-redo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-decrease-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-button--icon-increase-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); } + +trix-toolbar .trix-dialogs { + position: relative; } + +trix-toolbar .trix-dialog { + position: absolute; + top: 0; + left: 0; + right: 0; + font-size: 0.75em; + padding: 15px 10px; + background: #fff; + box-shadow: 0 0.3em 1em #ccc; + border-top: 2px solid #888; + border-radius: 5px; + z-index: 5; } + +trix-toolbar .trix-input--dialog { + font-size: inherit; + font-weight: normal; + padding: 0.5em 0.8em; + margin: 0 10px 0 0; + border-radius: 3px; + border: 1px solid #bbb; + background-color: #fff; + box-shadow: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; } + trix-toolbar .trix-input--dialog.validate:invalid { + box-shadow: #F00 0px 0px 1.5px 1px; } + +trix-toolbar .trix-button--dialog { + font-size: inherit; + padding: 0.5em; + border-bottom: none; } + +trix-toolbar .trix-dialog--link { + max-width: 600px; } + +trix-toolbar .trix-dialog__link-fields { + display: flex; + align-items: baseline; } + trix-toolbar .trix-dialog__link-fields .trix-input { + flex: 1; } + trix-toolbar .trix-dialog__link-fields .trix-button-group { + flex: 0 0 content; + margin: 0; } + +trix-editor [data-trix-mutable]:not(.attachment__caption-editor) { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + +trix-editor [data-trix-mutable]::-moz-selection, +trix-editor [data-trix-cursor-target]::-moz-selection, trix-editor [data-trix-mutable] ::-moz-selection { + background: none; } + +trix-editor [data-trix-mutable]::selection, +trix-editor [data-trix-cursor-target]::selection, trix-editor [data-trix-mutable] ::selection { + background: none; } + +trix-editor .attachment__caption-editor:focus[data-trix-mutable]::-moz-selection { + background: highlight; } + +trix-editor .attachment__caption-editor:focus[data-trix-mutable]::selection { + background: highlight; } + +trix-editor [data-trix-mutable].attachment.attachment--file { + box-shadow: 0 0 0 2px highlight; + border-color: transparent; } + +trix-editor [data-trix-mutable].attachment img { + box-shadow: 0 0 0 2px highlight; } + +trix-editor .attachment { + position: relative; } + trix-editor .attachment:hover { + cursor: default; } + +trix-editor .attachment--preview .attachment__caption:hover { + cursor: text; } + +trix-editor .attachment__progress { + position: absolute; + z-index: 1; + height: 20px; + top: calc(50% - 10px); + left: 5%; + width: 90%; + opacity: 0.9; + transition: opacity 200ms ease-in; } + trix-editor .attachment__progress[value="100"] { + opacity: 0; } + +trix-editor .attachment__caption-editor { + display: inline-block; + width: 100%; + margin: 0; + padding: 0; + font-size: inherit; + font-family: inherit; + line-height: inherit; + color: inherit; + text-align: center; + vertical-align: top; + border: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; } + +trix-editor .attachment__toolbar { + position: absolute; + z-index: 1; + top: -0.9em; + left: 0; + width: 100%; + text-align: center; } + +trix-editor .trix-button-group { + display: inline-flex; } + +trix-editor .trix-button { + position: relative; + float: left; + color: #666; + white-space: nowrap; + font-size: 80%; + padding: 0 0.8em; + margin: 0; + outline: none; + border: none; + border-radius: 0; + background: transparent; } + trix-editor .trix-button:not(:first-child) { + border-left: 1px solid #ccc; } + trix-editor .trix-button.trix-active { + background: #cbeefa; } + trix-editor .trix-button:not(:disabled) { + cursor: pointer; } + +trix-editor .trix-button--remove { + text-indent: -9999px; + display: inline-block; + padding: 0; + outline: none; + width: 1.8em; + height: 1.8em; + line-height: 1.8em; + border-radius: 50%; + background-color: #fff; + border: 2px solid highlight; + box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25); } + trix-editor .trix-button--remove::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.7; + content: ""; + background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E"); + background-position: center; + background-repeat: no-repeat; + background-size: 90%; } + trix-editor .trix-button--remove:hover { + border-color: #333; } + trix-editor .trix-button--remove:hover::before { + opacity: 1; } + +trix-editor .attachment__metadata-container { + position: relative; } + +trix-editor .attachment__metadata { + position: absolute; + left: 50%; + top: 2em; + transform: translate(-50%, 0); + max-width: 90%; + padding: 0.1em 0.6em; + font-size: 0.8em; + color: #fff; + background-color: rgba(0, 0, 0, 0.7); + border-radius: 3px; } + trix-editor .attachment__metadata .attachment__name { + display: inline-block; + max-width: 100%; + vertical-align: bottom; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + trix-editor .attachment__metadata .attachment__size { + margin-left: 0.2em; + white-space: nowrap; } + +.trix-content { + line-height: 1.5; + overflow-wrap: break-word; + word-break: break-word; } + .trix-content * { + box-sizing: border-box; + margin: 0; + padding: 0; } + .trix-content h1 { + font-size: 1.2em; + line-height: 1.2; } + .trix-content blockquote { + border: 0 solid #ccc; + border-left-width: 0.3em; + margin-left: 0.3em; + padding-left: 0.6em; } + .trix-content [dir=rtl] blockquote, + .trix-content blockquote[dir=rtl] { + border-width: 0; + border-right-width: 0.3em; + margin-right: 0.3em; + padding-right: 0.6em; } + .trix-content li { + margin-left: 1em; } + .trix-content [dir=rtl] li { + margin-right: 1em; } + .trix-content pre { + display: inline-block; + width: 100%; + vertical-align: top; + font-family: monospace; + font-size: 0.9em; + padding: 0.5em; + white-space: pre; + background-color: #eee; + overflow-x: auto; } + .trix-content img { + max-width: 100%; + height: auto; } + .trix-content .attachment { + display: inline-block; + position: relative; + max-width: 100%; } + .trix-content .attachment a { + color: inherit; + text-decoration: none; } + .trix-content .attachment a:hover, .trix-content .attachment a:visited:hover { + color: inherit; } + .trix-content .attachment__caption { + text-align: center; } + .trix-content .attachment__caption .attachment__name + .attachment__size::before { + content: ' \2022 '; } + .trix-content .attachment--preview { + width: 100%; + text-align: center; } + .trix-content .attachment--preview .attachment__caption { + color: #666; + font-size: 0.9em; + line-height: 1.2; } + .trix-content .attachment--file { + color: #333; + line-height: 1; + margin: 0 2px 2px 2px; + padding: 0.4em 1em; + border: 1px solid #bbb; + border-radius: 5px; } + .trix-content .attachment-gallery { + display: flex; + flex-wrap: wrap; + position: relative; } + .trix-content .attachment-gallery .attachment { + flex: 1 0 33%; + padding: 0 0.5em; + max-width: 33%; } + .trix-content .attachment-gallery.attachment-gallery--2 .attachment, .trix-content .attachment-gallery.attachment-gallery--4 .attachment { + flex-basis: 50%; + max-width: 50%; } + +/* + * We need to override trix.css’s image gallery styles to accommodate the + * element we wrap around attachments. Otherwise, + * images in galleries will be squished by the max-width: 33%; rule. +*/ +.trix-content .attachment-gallery > action-text-attachment, +.trix-content .attachment-gallery > .attachment { + flex: 1 0 33%; + padding: 0 0.5em; + max-width: 33%; +} + +.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment, +.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment, +.trix-content .attachment-gallery.attachment-gallery--4 > .attachment { + flex-basis: 50%; + max-width: 50%; +} + +.trix-content action-text-attachment .attachment { + padding: 0 !important; + max-width: 100% !important; +} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css.scss similarity index 76% rename from app/assets/stylesheets/application.css rename to app/assets/stylesheets/application.css.scss index fe93333..d23eb91 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css.scss @@ -8,3 +8,13 @@ * * Consider organizing styles into separate files for maintainability. */ +@import "font-awesome"; + +#flash-message { + position: fixed; + top: 20px; + right: 20px; + padding: 12px 20px; + border-radius: 8px; + z-index: 1000; +} diff --git a/app/assets/stylesheets/flash.css.scss b/app/assets/stylesheets/flash.css.scss new file mode 100644 index 0000000..bc7dc45 --- /dev/null +++ b/app/assets/stylesheets/flash.css.scss @@ -0,0 +1,25 @@ +.alert { + position: fixed; + top: 20px; + right: 20px; + z-index: 1050; + min-width: 300px; + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + transition: opacity 0.3s ease-in-out; + + &.alert-success { + background: rgba(40, 167, 69, 0.95); + border-color: #28a745; + color: white; + } + + &.alert-danger { + background: rgba(220, 53, 69, 0.95); + border-color: #dc3545; + color: white; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/flash_messages.css b/app/assets/stylesheets/flash_messages.css new file mode 100644 index 0000000..b8f4af6 --- /dev/null +++ b/app/assets/stylesheets/flash_messages.css @@ -0,0 +1,31 @@ +.alert { + position: fixed; + top: 20px; + right: 20px; + z-index: 1050; + min-width: 300px; + padding: 15px; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; + cursor: pointer; + opacity: 1; + transform: translateX(0); +} + +.alert.fade-out { + opacity: 0; + transform: translateX(100%); +} + +.alert-success { + background: rgba(40, 167, 69, 0.95); + border: 1px solid #28a745; + color: white; +} + +.alert-danger { + background: rgba(220, 53, 69, 0.95); + border: 1px solid #dc3545; + color: white; +} \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8176851..937f6bd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,7 @@ class ApplicationController < ActionController::Base # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + before_action :authenticate_user! + allow_browser versions: :modern before_action :set_assets_url def set_assets_url diff --git a/app/controllers/expenses_controller.rb b/app/controllers/expenses_controller.rb index 3ecbee2..97a9aa6 100644 --- a/app/controllers/expenses_controller.rb +++ b/app/controllers/expenses_controller.rb @@ -16,7 +16,8 @@ class ExpensesController < ApplicationController # GET /expenses/1 or /expenses/1.json def show - @expense = Expense.find(params[:id]) + @expense = Expense.find_by(id: params[:id]) + redirect_to expenses_path, alert: "Expense not found" unless @expense # Totals @total_expenses = Expense.sum(:amount) @@ -97,7 +98,10 @@ class ExpensesController < ApplicationController private # Use callbacks to share common setup or constraints between actions. def set_expense - @expense = Expense.find(params[:id]) + @expense = Expense.find_by(id: params[:id]) + unless @expense + redirect_to expenses_path, alert: "Expense not found" + end end # Only allow a list of trusted parameters through. diff --git a/app/controllers/institutions_controller.rb b/app/controllers/institutions_controller.rb index 0e0cfbc..97835fe 100644 --- a/app/controllers/institutions_controller.rb +++ b/app/controllers/institutions_controller.rb @@ -34,9 +34,12 @@ class InstitutionsController < ApplicationController @weekly_expense_items = Expense.where(created_at: Time.current.all_week) @monthly_expense_items = Expense.where(created_at: Time.current.all_month) - - # index is a collection action β€” do not attempt to load a single institution here - @students = Student.all + # Financial Summary + @total_income = Income.sum(:amount) + @total_expense = Expense.sum(:amount) + @profit = Finance.profit + # index is a collection action β€” do not attempt to load a single institution here + @students = Student.all end @@ -48,6 +51,8 @@ class InstitutionsController < ApplicationController # GET /institutions/1 or /institutions/1.json def show + @institution = Institution.find(params[:id]) + @students = @institution.students end # GET /institutions/contact @@ -78,6 +83,7 @@ class InstitutionsController < ApplicationController end end + # PATCH/PUT /institutions/1 or /institutions/1.json def update respond_to do |format| diff --git a/app/controllers/layouts_controller.rb b/app/controllers/layouts_controller.rb new file mode 100644 index 0000000..01bc1fa --- /dev/null +++ b/app/controllers/layouts_controller.rb @@ -0,0 +1,4 @@ +class LayoutsController < ApplicationController + def index + end +end diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb index 2929b0f..ac1e47c 100644 --- a/app/controllers/students_controller.rb +++ b/app/controllers/students_controller.rb @@ -3,8 +3,8 @@ class StudentsController < ApplicationController before_action :set_institution # set_student will safely find a student either scoped to @institution or globally before_action :set_student, only: %i[ show edit update destroy ] - # ensure nested behaviour for index/new/create (these expect an institution) - before_action :ensure_institution_for_nested_actions, only: %i[index new create] + # ensure nested behaviour for new/create (these expect an institution). Allow index to show all students. + before_action :ensure_institution_for_nested_actions, only: %i[new create] # GET /students or /students.json def index diff --git a/app/helpers/cart_items_helper.rb b/app/helpers/cart_items_helper.rb new file mode 100644 index 0000000..f30f683 --- /dev/null +++ b/app/helpers/cart_items_helper.rb @@ -0,0 +1,2 @@ +module CartItemsHelper +end diff --git a/app/helpers/carts_helper.rb b/app/helpers/carts_helper.rb new file mode 100644 index 0000000..d99c380 --- /dev/null +++ b/app/helpers/carts_helper.rb @@ -0,0 +1,2 @@ +module CartsHelper +end diff --git a/app/helpers/products_helper.rb b/app/helpers/products_helper.rb new file mode 100644 index 0000000..ab5c42b --- /dev/null +++ b/app/helpers/products_helper.rb @@ -0,0 +1,2 @@ +module ProductsHelper +end diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b494..b847918 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +1,8 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" +import * as bootstrap from "bootstrap" import "controllers" +import "flash_messages" + +import "trix" +import "@rails/actiontext" diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js index 1213e85..5048655 100644 --- a/app/javascript/controllers/application.js +++ b/app/javascript/controllers/application.js @@ -1,6 +1,15 @@ import { Application } from "@hotwired/stimulus" +import DropdownController from "./dropdown_controller" +import HelloController from "./hello_controller" +import { definitionsFromContext } from "@hotwired/stimulus-loading" const application = Application.start() +const context = require.context("./", true, /\.js$/) +application.load(definitionsFromContext(context)) + +// Register custom controllers +application.register("dropdown", DropdownController) +application.register("hello", HelloController) // Configure Stimulus development experience application.debug = false diff --git a/app/javascript/controllers/dropdown_controller.js b/app/javascript/controllers/dropdown_controller.js new file mode 100644 index 0000000..abd56da --- /dev/null +++ b/app/javascript/controllers/dropdown_controller.js @@ -0,0 +1,12 @@ +import { Controller } from "@hotwired/stimulus" +import { Dropdown } from "bootstrap" + +export default class extends Controller { + connect() { + // Initialize all dropdowns on the page + const dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle')) + dropdownElementList.map(function (dropdownToggleEl) { + return new Dropdown(dropdownToggleEl) + }) + } +} \ No newline at end of file diff --git a/app/javascript/controllers/flash_controller.js b/app/javascript/controllers/flash_controller.js new file mode 100644 index 0000000..840589b --- /dev/null +++ b/app/javascript/controllers/flash_controller.js @@ -0,0 +1,14 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + setTimeout(() => { + if (this.element) { + this.element.style.opacity = '0' + setTimeout(() => { + this.element.remove() + }, 300) // Remove after fade animation + } + }, 3000) // Start fading after 3 seconds + } +} \ No newline at end of file diff --git a/app/javascript/dropdown.js b/app/javascript/dropdown.js new file mode 100644 index 0000000..2cde8b8 --- /dev/null +++ b/app/javascript/dropdown.js @@ -0,0 +1,7 @@ +document.addEventListener('turbo:load', function() { + // Initialize all dropdowns + var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle')) + var dropdownList = dropdownElementList.map(function (dropdownToggleEl) { + return new bootstrap.Dropdown(dropdownToggleEl) + }) +}) \ No newline at end of file diff --git a/app/javascript/flash_messages.js b/app/javascript/flash_messages.js new file mode 100644 index 0000000..41f6f83 --- /dev/null +++ b/app/javascript/flash_messages.js @@ -0,0 +1,21 @@ +document.addEventListener('turbo:load', () => { + const flashMessages = document.querySelectorAll('.alert'); + flashMessages.forEach(flash => { + // Add fade-out class after 3 seconds + setTimeout(() => { + flash.classList.add('fade-out'); + // Remove element after animation completes + setTimeout(() => { + flash.remove(); + }, 500); // matches the CSS transition duration + }, 3000); + + // Optional: Allow clicking to dismiss + flash.addEventListener('click', () => { + flash.classList.add('fade-out'); + setTimeout(() => { + flash.remove(); + }, 500); + }); + }); +}); \ No newline at end of file diff --git a/app/javascript/rails_admin.js b/app/javascript/rails_admin.js new file mode 100644 index 0000000..d0c3bed --- /dev/null +++ b/app/javascript/rails_admin.js @@ -0,0 +1 @@ +import "rails_admin/src/rails_admin/base"; diff --git a/app/models/admin.rb b/app/models/admin.rb new file mode 100644 index 0000000..7a7be2f --- /dev/null +++ b/app/models/admin.rb @@ -0,0 +1,6 @@ +class Admin < ApplicationRecord + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :validatable +end diff --git a/app/models/admin_user.rb b/app/models/admin_user.rb new file mode 100644 index 0000000..9b798db --- /dev/null +++ b/app/models/admin_user.rb @@ -0,0 +1,18 @@ +class AdminUser < ApplicationRecord + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, + :recoverable, :rememberable, :validatable + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, + :recoverable, :rememberable, :validatable + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, + :recoverable, :rememberable, :validatable + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, + :recoverable, :rememberable, :validatable +end diff --git a/app/models/finance.rb b/app/models/finance.rb new file mode 100644 index 0000000..e3c580d --- /dev/null +++ b/app/models/finance.rb @@ -0,0 +1,6 @@ + +class Finance + def self.profit + Income.sum(:amount) - Expense.sum(:amount) + end +end diff --git a/app/models/student.rb b/app/models/student.rb index dd27047..8e94d68 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -1,4 +1,6 @@ class Student < ApplicationRecord belongs_to :institution has_one_attached :photo + + end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..4756799 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,6 @@ +class User < ApplicationRecord + # Include default devise modules. Others available are: + # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :validatable +end diff --git a/app/views/active_storage/blobs/_blob.html.erb b/app/views/active_storage/blobs/_blob.html.erb new file mode 100644 index 0000000..49ba357 --- /dev/null +++ b/app/views/active_storage/blobs/_blob.html.erb @@ -0,0 +1,14 @@ +
attachment--<%= blob.filename.extension %>"> + <% if blob.representable? %> + <%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %> + <% end %> + +
+ <% if caption = blob.try(:caption) %> + <%= caption %> + <% else %> + <%= blob.filename %> + <%= number_to_human_size blob.byte_size %> + <% end %> +
+
diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 0000000..b12dd0c --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,16 @@ +

Resend confirmation instructions

+ +<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> +
+ +
+ <%= f.submit "Resend confirmation instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000..dc55f64 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/email_changed.html.erb b/app/views/devise/mailer/email_changed.html.erb new file mode 100644 index 0000000..32f4ba8 --- /dev/null +++ b/app/views/devise/mailer/email_changed.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @email %>!

+ +<% if @resource.try(:unconfirmed_email?) %> +

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

+<% else %> +

We're contacting you to notify you that your email has been changed to <%= @resource.email %>.

+<% end %> diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 0000000..b41daf4 --- /dev/null +++ b/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +

Hello <%= @resource.email %>!

+ +

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..f667dc1 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000..41e148b --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000..5fbb9ff --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,25 @@ +

Change your password

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + <%= f.hidden_field :reset_password_token %> + +
+ <%= f.label :password, "New password" %>
+ <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum)
+ <% end %> + <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %> +
+ +
+ <%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.submit "Change my password" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 0000000..9b486b8 --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,16 @@ +

Forgot your password?

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.submit "Send me reset password instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 0000000..b82e336 --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,43 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
+ <%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "new-password" %> + <% if @minimum_password_length %> +
+ <%= @minimum_password_length %> characters minimum + <% end %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password, autocomplete: "current-password" %> +
+ +
+ <%= f.submit "Update" %> +
+<% end %> + +

Cancel my account

+ +
Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %>
+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000..d655b66 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,29 @@ +

Sign up

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.label :password %> + <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum) + <% end %>
+ <%= f.password_field :password, autocomplete: "new-password" %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.submit "Sign up" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000..5ede964 --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,26 @@ +

Log in

+ +<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.label :password %>
+ <%= f.password_field :password, autocomplete: "current-password" %> +
+ + <% if devise_mapping.rememberable? %> +
+ <%= f.check_box :remember_me %> + <%= f.label :remember_me %> +
+ <% end %> + +
+ <%= f.submit "Log in" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_error_messages.html.erb b/app/views/devise/shared/_error_messages.html.erb new file mode 100644 index 0000000..cabfe30 --- /dev/null +++ b/app/views/devise/shared/_error_messages.html.erb @@ -0,0 +1,15 @@ +<% if resource.errors.any? %> +
+

+ <%= I18n.t("errors.messages.not_saved", + count: resource.errors.count, + resource: resource.class.model_name.human.downcase) + %> +

+
    + <% resource.errors.full_messages.each do |message| %> +
  • <%= message %>
  • + <% end %> +
+
+<% end %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb new file mode 100644 index 0000000..7a75304 --- /dev/null +++ b/app/views/devise/shared/_links.html.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Log in", new_session_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end %> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
+ <% end %> +<% end %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 0000000..ffc34de --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,16 @@ +

Resend unlock instructions

+ +<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= render "devise/shared/error_messages", resource: resource %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %> +
+ +
+ <%= f.submit "Resend unlock instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/exclusive_traditional_records/_exclusive_traditional_record.html.erb b/app/views/exclusive_traditional_records/_exclusive_traditional_record.html.erb index 28bdfbe..d4e4530 100644 --- a/app/views/exclusive_traditional_records/_exclusive_traditional_record.html.erb +++ b/app/views/exclusive_traditional_records/_exclusive_traditional_record.html.erb @@ -21,6 +21,7 @@ <% else %> No PDF file uploaded. <% end %> + diff --git a/app/views/expenses/report.html.erb b/app/views/expenses/report.html.erb index 81714e5..5a555f2 100644 --- a/app/views/expenses/report.html.erb +++ b/app/views/expenses/report.html.erb @@ -156,7 +156,7 @@
-

Today's Expenses

+

Today's Expenses

@@ -180,7 +180,7 @@
-

This Week's Expenses

+

This Week's Expenses

AmountDate
@@ -204,7 +204,7 @@
-

This Month's Expenses

+

This Month's Expenses

AmountDate
diff --git a/app/views/incomes/report.html.erb b/app/views/incomes/report.html.erb index 2f1648d..56acba0 100644 --- a/app/views/incomes/report.html.erb +++ b/app/views/incomes/report.html.erb @@ -154,7 +154,7 @@
-

Today's Income

+

Today's Income

AmountDate
@@ -178,7 +178,7 @@
-

This Week's Income

+

This Week's Income

AmountDate
@@ -202,7 +202,7 @@
-

This Month's Income

+

This Month's Income

AmountDate
diff --git a/app/views/institutions/_form.html.erb b/app/views/institutions/_form.html.erb index 8301f5e..61ab3ba 100644 --- a/app/views/institutions/_form.html.erb +++ b/app/views/institutions/_form.html.erb @@ -17,8 +17,8 @@
- <%= form.label :institution_type, style: "display: block" %> - <%= form.text_field :institution_type %> + <%= form.label :manager_name, style: "display: block" %> + <%= form.text_field :manager_name %>
diff --git a/app/views/institutions/index.html.erb b/app/views/institutions/index.html.erb index ee92300..edbe97e 100644 --- a/app/views/institutions/index.html.erb +++ b/app/views/institutions/index.html.erb @@ -5,8 +5,7 @@ html, body { margin: 0; padding: 0; font-family: "Poppins", sans-serif; - /* Dark gradient background */ - background: linear-gradient(135deg, #0f1724, #1e293b); /* deep navy/charcoal */ + background: linear-gradient(135deg, #0f1724, #1e293b); color: #e6eef6; } @@ -14,7 +13,6 @@ html, body { min-height: 100vh; display: flex; flex-direction: column; - justify-content: flex-start; } .container { @@ -27,18 +25,17 @@ html, body { /* ---------------- Header ---------------- */ .page-header { text-align: center; - margin-bottom: 15px; + margin-bottom: 30px; } .page-header h1 { font-weight: 700; - font-size: 3rem; - background: linear-gradient(90deg, #1e88e5, #43a047, #1e88e5); + font-size: 2.9rem; + background: linear-gradient(90deg, #1e88e5, #43a047, #fdd835, #fb8c00, #e53935); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: gradient-move 3s linear infinite; - margin-bottom: 5px; } @keyframes gradient-move { @@ -47,156 +44,194 @@ html, body { } .logo-img { - width: 100px; - height: 100px; - object-fit: cover; + width: 120px; + height: 120px; border-radius: 50%; - box-shadow: 0 4px 10px rgba(0,0,0,0.15); - margin-bottom: 10px; + box-shadow: 0 6px 16px rgba(0,0,0,0.3); + margin-bottom: 15px; } .divider { - width: 80px; + width: 100px; height: 4px; background: linear-gradient(to right, #1e88e5, #43a047); margin: 15px auto; border-radius: 3px; } -/* ---------------- Stats Cards ---------------- */ +/* ---------------- Stats Row ---------------- */ .stats-row { display: flex; flex-wrap: wrap; justify-content: center; - gap: 12px; - margin-bottom: 24px; + gap: 15px; + margin-bottom: 35px; } .stat-card { flex: 0 0 auto; - width: 140px; /* compact cards */ - margin: 6px; + width: 140px; padding: 12px 16px; - background: rgba(255,255,255,0.03); - border: 1px solid rgba(255,255,255,0.06); - border-radius: 12px; - box-shadow: 0 6px 18px rgba(2,6,23,0.6); - transition: transform 0.18s ease, box-shadow 0.18s ease; + background: rgba(255,255,255,0.05); + border-radius: 15px; text-align: center; + box-shadow: 0 6px 20px rgba(0,0,0,0.3); + transition: 0.3s ease; } .stat-card:hover { - transform: translateY(-3px); - box-shadow: 0 10px 22px rgba(2,6,23,0.7); + transform: translateY(-4px); + box-shadow: 0 10px 25px rgba(0,0,0,0.5); } .stat-label { font-weight: 600; - color: rgba(230,238,246,0.8); - margin-bottom: 6px; - font-size: 0.8rem; + font-size: 0.85rem; + color: #cfd8dc; } .stat-value { - font-size: 1.4rem; /* smaller count */ + font-size: 1.5rem; font-weight: 700; - color: #7dd3fc; /* soft cyan */ + color: #7dd3fc; } /* ---------------- Glass Cards ---------------- */ .glass-card { - background: rgba(255,255,255,0.9); + background: rgba(255,255,255,0.1); backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); border-radius: 18px; - box-shadow: 0 10px 25px rgba(0,0,0,0.1); padding: 25px; - transition: 0.3s ease; width: 100%; + transition: 0.3s ease; } .glass-card:hover { - transform: translateY(-3px); - box-shadow: 0 12px 30px rgba(0,0,0,0.15); + transform: translateY(-5px); + box-shadow: 0 12px 40px rgba(0,0,0,0.25); } /* ---------------- Section Titles ---------------- */ .section-title { font-weight: 700; - font-size: 1.5rem; + font-size: 1.4rem; margin-bottom: 20px; text-align: center; } /* ---------------- Item Cards ---------------- */ .item-card { - border-radius: 15px; - background: #ffffff; - border: 1px solid #e0e0e0; - padding: 15px; + border-radius: 12px; + background: rgba(255,255,255,0.95); + border: 1px solid rgba(0,0,0,0.1); + padding: 12px 15px; + margin-bottom: 10px; transition: all 0.3s ease; - display: flex; - flex-direction: column; - justify-content: space-between; } .item-card:hover { transform: scale(1.03); - background: #f9f9f9; - box-shadow: 0 8px 20px rgba(0,0,0,0.1); + box-shadow: 0 6px 20px rgba(0,0,0,0.15); } .item-title { - font-size: 1.1rem; + font-size: 1.05rem; font-weight: 600; - color: #0d47a1; + color: #1e88e5; margin-bottom: 5px; } .item-desc { - font-size: 0.95rem; + font-size: 0.9rem; color: #37474f; - margin-bottom: 10px; } .item-footer { text-align: right; + margin-top: 8px; } /* ---------------- Buttons ---------------- */ .btn-custom { - border-radius: 25px; + padding: 10px 18px; + border-radius: 12px; font-weight: 600; - padding: 7px 18px; transition: 0.3s ease; + text-decoration: none; + display: inline-block; } -.btn-primary-custom { background-color: #1e88e5; color: #fff; } -.btn-primary-custom:hover { background-color: #1565c0; } +.btn-primary-custom { background: #1e88e5; color: #fff; } +.btn-primary-custom:hover { background: #1565c0; transform: translateY(-2px); } -.btn-success-custom { background-color: #43a047; color: #fff; } -.btn-success-custom:hover { background-color: #2e7d32; } +.btn-success-custom { background: #43a047; color: #fff; } +.btn-success-custom:hover { background: #2e7d32; transform: translateY(-2px); } -/* ---------------- Ziyara Section ---------------- */ -.ziyara-card { - border-top: 5px solid #fbc02d; - background: rgba(255,255,240,0.95); +/* ---------------- Expense & Income Cards ---------------- */ +.expense-card, .income-card { + background: rgba(255,255,255,0.1); + backdrop-filter: blur(12px); + border-radius: 18px; + padding: 25px; + width: 100%; + text-align: center; + transition: transform 0.3s ease, box-shadow 0.3s ease; } -.ziyara-title { - background: linear-gradient(90deg, #fdd835, #fbc02d, #f57f17); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - animation: gradient-move 4s linear infinite; +.expense-card:hover, .income-card:hover { + transform: translateY(-5px); + box-shadow: 0 12px 40px rgba(0,0,0,0.25); +} + +.expense-card h1, .income-card h1 { + font-size: 1.6rem; + margin-bottom: 15px; + font-weight: 700; + color: #ffffff; +} + +.expense-card .btn, .income-card .btn { + width: 80%; + margin: 0 auto; + padding: 10px 0; } /* ---------------- Responsive ---------------- */ @media (max-width: 992px) { .stats-row { flex-direction: column; align-items: center; } + .row.g-4 { flex-direction: column; } + .col-lg-6, .col-lg-5 { max-width: 95%; margin: 0 auto; } } +.finance-card { + background: rgba(255,255,255,0.08); + backdrop-filter: blur(14px); + -webkit-backdrop-filter: blur(14px); + border-radius: 20px; + border: 1px solid rgba(255,255,255,0.2); + box-shadow: 0 10px 30px rgba(0,0,0,0.2); + padding: 30px; + transition: transform 0.3s ease, box-shadow 0.3s ease; +} + +.finance-card:hover { + transform: translateY(-5px); + box-shadow: 0 15px 40px rgba(0,0,0,0.25); +} + +.stat-value { + font-size: 1.6rem; + font-weight: 700; + color: #facc15; /* golden color for finance numbers */ + margin: 10px 0; + text-align: center; +} +
+
AmountDate