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:
2026-06-18 18:58:01 +02:00
parent 691ed8e7e5
commit 25832564f9
132 changed files with 2067 additions and 1253 deletions

View File

@@ -0,0 +1,35 @@
!!!
%html
%head
%meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
- title = "Ambiente Já!"
- title = "#{@title} - #{title}" if @title
%title= title
= csrf_meta_tags
= csp_meta_tag
= favicon_link_tag asset_path('favicon.ico')
= stylesheet_link_tag "https://fonts.googleapis.com/css?family=Fira+Sans&display=swap"
= stylesheet_link_tag 'application', media: 'all'
= javascript_include_tag 'application'
%body
#all
#topo
= link_to image_tag("logo.png", class: "logo_img"), "/"
#busca
= form_tag("/search", method: :get) do
= text_field_tag :q, "", class: 'busca-input', placeholder: "+agrofloresta +vida -lixo"
= submit_tag '⌕', class: 'busca-btn'
#temas
- Tema.infos.each do |t|
= link_to "/tema/#{t[0].parameterize}", class: "tema" do
%span.content= t[0]
%span.right= "(#{t[1]})"
= yield :tags
#informativos
= yield
#baixo
%span - AmbienteJá desde 2001 -

View File

@@ -0,0 +1,16 @@
- content_for :tags do
#tags
- Tag.top.each do |t|
%span= link_to "#{t.nome} (#{t.count})", "/tag/#{t.param}", class: "tags", target: "blank"
#informativos
- @informativos.each do |i|
.card
%p= link_to i.titulo.html_safe, CGI.unescapeHTML("/informativo/#{i.id}"), class: "link"
- i.tags.each do |t|
%span= link_to t.nome, "/tag/#{t.param}", class: "tags", target: "blank"
- from = i.operador_inc ? " | #{i.operador_inc.downcase.capitalize}" : ""
.date= "#{i.Datainc} #{from}"
#nav
= will_paginate @informativos

View File

@@ -0,0 +1,25 @@
:javascript
$(document).ready(function(){
$(".texto a").each(function(a){
$(this).attr("target", "_blank");
})
});
#todo
%h2.link= @informativo.titulo.html_safe
#br{style: "padding-top: 4px"}
- @informativo.tags.each do |t|
%span= link_to t.nome, "/tag/#{t.param}", class: "tags", target: "blank"
- from = @informativo.operador_inc ? " | #{@informativo.operador_inc.downcase.capitalize}" : ""
.date= "#{@informativo.Datainc} #{from}"
.texto!= @informativo.Descricao #to_html
-# %hr
-# != ap @informativo
%hr
#tags
- Tag.top.each do |t|
%span= link_to "#{t.nome} (#{t.count})", "/tag/#{t.param}", class: "tags", target: "blank"

View File

@@ -0,0 +1,14 @@
%h2.link= "[ #{@title} ]"
-# .date= "#{@informativos.count} informativos"
#br{style: "padding: 5px 0px 5px"}
- @informativos.each do |i|
.card
%p= link_to i.titulo.html_safe, CGI.unescapeHTML("/informativo/#{i.id}"), class: "link"
- i.tags.each do |t|
%span= link_to t.nome, "/tag/#{t.param}", class: "tags", target: "blank"
- from = i.operador_inc ? " | #{i.operador_inc.downcase.capitalize}" : ""
.date= "#{i.Datainc} #{from}"
#nav
= will_paginate @informativos