diff --git a/Gemfile b/Gemfile index 8b4fbd8f..661f3125 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,6 @@ gem "turbo-rails" gem "faraday" gem "jbuilder" gem "tzinfo-data", platforms: %i[ windows jruby ] -gem "madmin", github: "excid3/madmin" gem "redcarpet" group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 532ea56c..1a4f512b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/excid3/madmin.git - revision: cc6cd36ca4a64cb5b75a829fffd41b7948afde6c - specs: - madmin (1.2.10) - pagy (>= 3.5) - rails (>= 6.0.3) - GIT remote: https://github.com/maybe-finance/lucide-rails.git revision: 6170b3a0eceb43a8af6552638e9526673c356d0d @@ -225,7 +217,6 @@ GEM racc (~> 1.4) nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) - pagy (8.3.0) parallel (1.24.0) parser (3.3.0.5) ast (~> 2.4.1) @@ -379,7 +370,6 @@ DEPENDENCIES importmap-rails jbuilder lucide-rails! - madmin! pg (~> 1.5) propshaft puma (>= 5.0) diff --git a/app/controllers/madmin/application_controller.rb b/app/controllers/madmin/application_controller.rb deleted file mode 100644 index 5a8744f1..00000000 --- a/app/controllers/madmin/application_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Madmin - class ApplicationController < Madmin::BaseController - before_action :authenticate_admin_user - - def authenticate_admin_user - # TODO: Add your authentication logic here - - # For example, we could redirect if the user isn't an admin - # redirect_to "/", alert: "Not authorized." unless user_signed_in? && current_user.admin? - end - - # Authenticate with Clearance - # include Clearance::Controller - # before_action :require_login - - # Authenticate with Devise - # before_action :authenticate_user! - - # Authenticate with Basic Auth - # http_basic_authenticate_with(name: Rails.application.credentials.admin_username, password: Rails.application.credentials.admin_password) - if Rails.env.production? - http_basic_authenticate_with( - name: ENV["ADMIN_USERNAME"] || Rails.application.credentials.admin_username, - password: ENV["ADMIN_PASSWORD"] || Rails.application.credentials.admin_password - ) - end - end -end diff --git a/app/controllers/madmin/articles_controller.rb b/app/controllers/madmin/articles_controller.rb deleted file mode 100644 index 13629bd3..00000000 --- a/app/controllers/madmin/articles_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -module Madmin - class ArticlesController < Madmin::ResourceController - end -end diff --git a/app/controllers/madmin/terms_controller.rb b/app/controllers/madmin/terms_controller.rb deleted file mode 100644 index 5c791aec..00000000 --- a/app/controllers/madmin/terms_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -module Madmin - class TermsController < Madmin::ResourceController - end -end diff --git a/app/madmin/resources/article_resource.rb b/app/madmin/resources/article_resource.rb deleted file mode 100644 index e8ec5c52..00000000 --- a/app/madmin/resources/article_resource.rb +++ /dev/null @@ -1,27 +0,0 @@ -class ArticleResource < Madmin::Resource - # Attributes - attribute :id, form: false - attribute :title - attribute :slug - attribute :content - attribute :publish_at - attribute :author_name - attribute :created_at, form: false - attribute :updated_at, form: false - - # Associations - - # Uncomment this to customize the display name of records in the admin area. - # def self.display_name(record) - # record.name - # end - - # Uncomment this to customize the default sort column and direction. - # def self.default_sort_column - # "created_at" - # end - # - # def self.default_sort_direction - # "desc" - # end -end diff --git a/app/madmin/resources/term_resource.rb b/app/madmin/resources/term_resource.rb deleted file mode 100644 index 162502b9..00000000 --- a/app/madmin/resources/term_resource.rb +++ /dev/null @@ -1,36 +0,0 @@ -class TermResource < Madmin::Resource - # Attributes - attribute :id, form: false, index: false - attribute :name - attribute :title - attribute :content - attribute :slug - attribute :created_at, form: false, index: false - attribute :updated_at, form: false, index: false - attribute :video_id - attribute :video_title - attribute :video_description - attribute :video_thumbnail_url - attribute :video_upload_date - attribute :video_duration - - def self.model_find(id) - model.find_by!(slug: id) - end - - # Associations - - # Uncomment this to customize the display name of records in the admin area. - def self.display_name(record) - record.name - end - - # Uncomment this to customize the default sort column and direction. - def self.default_sort_column - "name" - end - # - def self.default_sort_direction - "asc" - end -end diff --git a/config/routes.rb b/config/routes.rb index eaae4156..596495eb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ Rails.application.routes.draw do - draw :madmin # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html resources :signups, only: [ :new, :create ] resources :articles, only: [ :index, :show ] diff --git a/config/routes/madmin.rb b/config/routes/madmin.rb deleted file mode 100644 index 637e29e0..00000000 --- a/config/routes/madmin.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Below are the routes for madmin -namespace :madmin do - resources :terms - resources :articles - root to: "dashboard#show" -end