chore: reorganize para current/, rails 8.1, testes e readme
- move app para current/ (estrutura capistrano) - rails 7.2 → 8.1, ruby 3.2, sqlite3 2.x - adiciona primary_key Idinformativo no model - schema.rb completo com todas as tabelas - testes minitest: models (Tag, Informativo, Tema) e controllers - readme atualizado em pt-br com stack e instruções de desenvolvimento - gitignore exclui dump.sql, *.duckdb e sqlite3
This commit is contained in:
28
current/app/admin/admin_users.rb
Normal file
28
current/app/admin/admin_users.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
33
current/app/admin/dashboard.rb
Normal file
33
current/app/admin/dashboard.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
ActiveAdmin.register_page "Dashboard" do
|
||||
menu false
|
||||
# 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 # content
|
||||
end
|
||||
37
current/app/admin/informativos.rb
Normal file
37
current/app/admin/informativos.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
ActiveAdmin.register Informativo do
|
||||
permit_params :Idinformativo, :titulo, :Descricao, :Idtipo, :Abrangencia, :Datainc, :tema1, :subtema1, :tema2, :subtema2, :tema3, :subtema3, :tema4, :subtema4, :operador_inc, :operador_alt, :markdown, tag_ids: []
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
column :Idinformativo
|
||||
column :titulo
|
||||
column :Abrangencia
|
||||
column :Datainc
|
||||
column :operador_inc
|
||||
actions
|
||||
end
|
||||
|
||||
filter :titulo
|
||||
filter :operador_inc
|
||||
|
||||
form do |f|
|
||||
f.inputs 'Informativo' do
|
||||
f.input :Datainc, as: :date_time_picker
|
||||
f.input :titulo
|
||||
f.input :operador_inc
|
||||
f.input :tag_ids, as: :tags, collection: Tag.all, display_name: :nome
|
||||
f.trix_editor :Descricao
|
||||
end
|
||||
actions
|
||||
end
|
||||
|
||||
show do
|
||||
attributes_table do
|
||||
row :titulo
|
||||
# row :image do |ad|
|
||||
# image_tag ad.image.url
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
18
current/app/admin/tags.rb
Normal file
18
current/app/admin/tags.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
ActiveAdmin.register Tag do
|
||||
|
||||
# See permitted parameters documentation:
|
||||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
||||
#
|
||||
# Uncomment all parameters which should be permitted for assignment
|
||||
#
|
||||
# permit_params :nome, :param, :count
|
||||
#
|
||||
# or
|
||||
#
|
||||
# permit_params do
|
||||
# permitted = [:nome, :param, :count]
|
||||
# permitted << :other if params[:action] == 'create' && current_user.admin?
|
||||
# permitted
|
||||
# end
|
||||
|
||||
end
|
||||
18
current/app/admin/temas.rb
Normal file
18
current/app/admin/temas.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
ActiveAdmin.register Tema do
|
||||
|
||||
# See permitted parameters documentation:
|
||||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
||||
#
|
||||
# Uncomment all parameters which should be permitted for assignment
|
||||
#
|
||||
# permit_params :reg, :cod_tema, :cod_tema_sub, :tema, :ativo, :padrao, :count, :param
|
||||
#
|
||||
# or
|
||||
#
|
||||
# permit_params do
|
||||
# permitted = [:reg, :cod_tema, :cod_tema_sub, :tema, :ativo, :padrao, :count, :param]
|
||||
# permitted << :other if params[:action] == 'create' && current_user.admin?
|
||||
# permitted
|
||||
# end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user