forked from eagerworks/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
278841a
commit 45657b0
Showing
33 changed files
with
1,127 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ActiveAdmin.register AdminUser do | ||
permit_params :email, :password, :password_confirmation | ||
index do | ||
selectable_column | ||
id_column | ||
column :email | ||
column :current_sign_in_at | ||
column :sign_in_count | ||
column :created_at | ||
actions | ||
end | ||
|
||
filter :email | ||
filter :current_sign_in_at | ||
filter :sign_in_count | ||
filter :created_at | ||
|
||
form do |f| | ||
f.inputs do | ||
f.input :email | ||
f.input :password | ||
f.input :password_confirmation | ||
end | ||
f.actions | ||
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ActiveAdmin.register Category do | ||
menu label: 'Categorías' | ||
remove_filter :gift_categorizations | ||
filter :name, label: 'Nombre' | ||
filter :created_at, label: 'Fecha de creación' | ||
filter :updated_at, label: 'Última actualización' | ||
permit_params :name | ||
|
||
show do | ||
attributes_table do | ||
row 'Nombre', &:name | ||
row 'Fecha de creación', &:created_at | ||
row 'Última actualización', &:updated_at | ||
end | ||
active_admin_comments | ||
end | ||
|
||
index do | ||
selectable_column | ||
id_column | ||
column 'Nombre', :name | ||
column 'Fecha de creación', :created_at | ||
column 'Última actualización', :updated_at | ||
|
||
actions | ||
end | ||
|
||
form do |f| | ||
f.inputs 'Detalles' do | ||
f.input :name, label: 'Nombre' | ||
end | ||
f.actions | ||
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ActiveAdmin.register Customization do | ||
permit_params :name, :price | ||
menu label: 'Personalizaciones' | ||
filter :name, label: 'Nombre' | ||
filter :price, label: 'Precio' | ||
|
||
index do | ||
selectable_column | ||
id_column | ||
column 'Nombre', :name | ||
column 'Precio', :price | ||
column 'Fecha de creación', :created_at | ||
column 'Última actualización', :updated_at | ||
actions | ||
end | ||
|
||
show do | ||
attributes_table do | ||
row 'Nombre', &:name | ||
row 'Precio', &:price | ||
row 'Fecha de creación', &:created_at | ||
row 'Última actualización', &:updated_at | ||
end | ||
active_admin_comments | ||
end | ||
|
||
form do |f| | ||
f.inputs 'Detalles' do | ||
f.input :name, label: 'Nombre' | ||
f.input :price, label: 'Precio' | ||
end | ||
f.actions | ||
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
ActiveAdmin.register_page 'Dashboard' do | ||
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') } | ||
|
||
content title: proc { I18n.t('active_admin.dashboard') } do | ||
div class: 'blank_slate_container', id: 'dashboard_default_message' do | ||
span class: 'blank_slate' do | ||
span I18n.t('active_admin.dashboard_welcome.welcome') | ||
small I18n.t('active_admin.dashboard_welcome.call_to_action') | ||
end | ||
end | ||
|
||
# Here is an example of a simple dashboard with columns and panels. | ||
# | ||
# columns do | ||
# column do | ||
# panel "Recent Posts" do | ||
# ul do | ||
# Post.recent(5).map do |post| | ||
# li link_to(post.title, admin_post_path(post)) | ||
# end | ||
# end | ||
# end | ||
# end | ||
|
||
# column do | ||
# panel "Info" do | ||
# para "Welcome to ActiveAdmin." | ||
# end | ||
# end | ||
# 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
ActiveAdmin.register Gift do | ||
permit_params :name, :price, :valoration, :supplier_id, :image, :content, category_ids: [], | ||
customization_ids: [] | ||
|
||
menu label: 'Regalos' | ||
remove_filter :gift_customizations, :gift_categorizations, :purchases, | ||
:image_attachment, :image_blob, :rich_text_content | ||
|
||
filter :name, label: 'Nombre' | ||
filter :price, label: 'Precio' | ||
filter :valoration, label: 'Valoración' | ||
filter :supplier, label: 'Proveedor' | ||
filter :categories, label: 'Categorías', multiple: true | ||
filter :customizations, label: 'Personalizaciones', multiple: true | ||
filter :created_at, label: 'Fecha de creación' | ||
filter :updated_at, label: 'Última actualización' | ||
|
||
controller do | ||
def scoped_collection | ||
super.includes(:supplier) | ||
end | ||
end | ||
|
||
index do | ||
selectable_column | ||
id_column | ||
column 'Nombre', :name | ||
column 'Precio', :price | ||
column 'Valoración', :valoration | ||
column 'Proveedor', :supplier | ||
column 'Fecha de creación', :created_at | ||
column 'Última actualización', :updated_at | ||
actions | ||
end | ||
|
||
show do | ||
attributes_table do | ||
row 'Nombre', &:name | ||
row 'Precio', &:price | ||
row 'Valoración', &:valoration | ||
row 'Proveedor', &:supplier | ||
row 'Imagen' do |gift| | ||
image_tag gift.image_resized_for_purchase | ||
end | ||
row 'Contenido' do |gift| | ||
gift.content.to_s | ||
end | ||
row 'Categorías' do |gift| | ||
dropdown_menu '' do | ||
gift.categories.each do |category| | ||
item category.name | ||
end | ||
end | ||
end | ||
row 'Personalizaciones' do |gift| | ||
dropdown_menu '' do | ||
gift.customizations.each do |customization| | ||
item customization.name, admin_customization_path(customization) | ||
end | ||
end | ||
end | ||
row 'Fecha de creación', &:created_at | ||
row 'Última actualización', &:updated_at | ||
end | ||
active_admin_comments | ||
end | ||
|
||
form do |f| | ||
f.inputs 'Detalles' do | ||
f.input :name, label: 'Nombre' | ||
f.input :price, label: 'Precio' | ||
f.input :valoration, label: 'Valoración' | ||
f.input :supplier, label: 'Proveedor' | ||
f.input :image, label: 'Imagen', as: :file | ||
f.input :content, label: 'Contenido' | ||
f.input :categories, label: 'Categorías' | ||
f.input :customizations, label: 'Personalizaciones' | ||
end | ||
f.actions | ||
end | ||
end |
Oops, something went wrong.