-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
151 changed files
with
578 additions
and
836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
class Admin::DashboardController < Backstage::Rails::BaseController | ||
class Admin::DashboardController < Backstage::BaseController | ||
def index | ||
readme_path = Rails.root.join('app', 'views', 'admin', 'README.md') | ||
@readme_content = File.exist?(readme_path) ? File.read(readme_path) : "Welcome to the Admin Panel" | ||
render "index" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
require "backstage/config" | ||
|
||
module BackstageConfig | ||
|
||
Backstage::Config.configure do | ||
resource :users do | ||
column :id | ||
column :email | ||
column :username | ||
column :role | ||
column :editor | ||
|
||
scope :all | ||
scope :admins, -> { where(role: 'admin') } | ||
scope :recent, -> { where('created_at > ?', 1.week.ago) } | ||
|
||
filter :email_cont, :string, label: 'Email contains' | ||
filter :username_cont, :string, label: 'Username contains' | ||
filter :role_cont, :select, collection: -> { User.roles.keys } | ||
|
||
filterable_field :username, :string | ||
filterable_field :email, :string | ||
filterable_field :role, :select, collection: -> { [:admin, :artist] } | ||
|
||
form_field :email, :email | ||
form_field :username, :string | ||
form_field :role, :select, collection: -> { User.roles.keys }, include_blank: false | ||
form_field :seller, :boolean | ||
form_field :editor, :check_box | ||
|
||
action :view | ||
action :edit | ||
action :delete | ||
end | ||
|
||
resource :categories do | ||
column :id | ||
column :name | ||
|
||
filter :name, :string, label: 'Name contains' | ||
|
||
form_field :name_cont, :string | ||
|
||
action :view | ||
action :edit | ||
action :delete | ||
end | ||
|
||
resource :posts do | ||
column :id | ||
column :title | ||
column :author do |post, view| | ||
view.link_to post.user.full_name, view.admin_user_path(post.user) | ||
end | ||
|
||
scope :all | ||
scope :published, -> { where(published: true) } | ||
scope :draft, -> { where(published: false) } | ||
scope :recent, -> { where('created_at > ?', 1.week.ago) } | ||
|
||
filter :title, :string, label: 'Name contains' | ||
|
||
form_field :title_cont, :string | ||
|
||
action :view | ||
action :edit | ||
action :delete | ||
end | ||
|
||
resource :terms_and_conditions do | ||
|
||
column :id | ||
column :title | ||
|
||
form_field :title, :string | ||
form_field :category, :string | ||
form_field :content, :custom, ->(view, form) { view.render("shared/simple_editor", form: form, field: :content) } | ||
|
||
action :view | ||
action :edit | ||
action :delete | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<div class="bg-white shadow rounded-lg p-6"> | ||
<h1 class="text-2xl font-semibold mb-6">Admin Dashboard</h1> | ||
|
||
<div class="prose prose-sm sm:prose lg:prose-lg xl:prose-xl mx-auto"> | ||
<%= markdown(@readme_content) %> | ||
</div> | ||
</div> | ||
<h1 class="text-2xl font-semibold mb-6">Admin Dashboard</h1> | ||
|
||
<div class="prose prose-sm sm:prose lg:prose-lg xl:prose-xl mx-auto"> | ||
<%= markdown(@readme_content) %> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.