diff --git a/Gemfile b/Gemfile index 01b976d..5a31f96 100644 --- a/Gemfile +++ b/Gemfile @@ -10,10 +10,12 @@ gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.2' gem 'bootsnap', '>= 1.1.0', require: false -gem 'haml-rails' +gem 'haml' gem 'mysql2' gem 'activeadmin' gem 'devise' +gem 'will_paginate' +gem "awesome_print" group :development, :test do gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index c74effb..648d6d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,7 @@ GEM arbre (1.2.1) activesupport (>= 3.0.0) arel (9.0.0) + awesome_print (1.8.0) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -83,7 +84,6 @@ GEM responders warden (~> 1.2.3) erubi (1.8.0) - erubis (2.7.0) execjs (2.7.0) ffi (1.11.1) formtastic (3.1.5) @@ -94,20 +94,9 @@ GEM haml (5.1.1) temple (>= 0.8.0) tilt - haml-rails (2.0.1) - actionpack (>= 5.1) - activesupport (>= 5.1) - haml (>= 4.0.6, < 6.0) - html2haml (>= 1.0.1) - railties (>= 5.1) has_scope (0.7.2) actionpack (>= 4.1) activesupport (>= 4.1) - html2haml (2.2.0) - erubis (~> 2.7.0) - haml (>= 4.0, < 6) - nokogiri (>= 1.6.0) - ruby_parser (~> 3.5) i18n (1.6.0) concurrent-ruby (~> 1.0) inherited_resources (1.10.0) @@ -194,8 +183,6 @@ GEM actionpack (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0) ruby_dep (1.5.0) - ruby_parser (3.13.1) - sexp_processor (~> 4.9) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -207,7 +194,6 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sexp_processor (4.12.0) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -242,17 +228,19 @@ GEM websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) + will_paginate (3.1.7) PLATFORMS ruby DEPENDENCIES activeadmin + awesome_print bootsnap (>= 1.1.0) byebug coffee-rails (~> 4.2) devise - haml-rails + haml listen (>= 3.0.5, < 3.2) mysql2 puma (~> 3.11) @@ -262,6 +250,7 @@ DEPENDENCIES spring-watcher-listen (~> 2.0.0) uglifier (>= 1.3.0) web-console (>= 3.3.0) + will_paginate RUBY VERSION ruby 2.5.5p157 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 82e6f0f..0a37005 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,7 +10,4 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // -//= require rails-ujs -//= require activestorage -//= require turbolinks //= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d05ea0f..f33f48b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,15 +1,14 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's - * vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS - * files in this directory. Styles in this file should be added after the last require_* statement. - * It is generally better to create a new file per style scope. - * - *= require_tree . - *= require_self - */ +body { + padding: 20px; + font-family: 'Inconsolata', monospace; + background-color: #f5fff1; +} + +a { + color:black; +} + +a:hover{ + background-color: black; + color: white; +} diff --git a/app/controllers/page_controller.rb b/app/controllers/page_controller.rb new file mode 100644 index 0000000..f36c8d0 --- /dev/null +++ b/app/controllers/page_controller.rb @@ -0,0 +1,11 @@ +class PageController < ApplicationController + +def home + @informativos = Informativo.order("data_inc desc").page(params[:page] || 1) +end + +def informativo + @informativo = Informativo.find(params[:id]) +end + +end diff --git a/app/models/informativo.rb b/app/models/informativo.rb new file mode 100644 index 0000000..79d2f2d --- /dev/null +++ b/app/models/informativo.rb @@ -0,0 +1,4 @@ +class Informativo < ApplicationRecord + self.table_name = "informativo" + paginates_per 10 +end diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml new file mode 100644 index 0000000..3ffae2a --- /dev/null +++ b/app/views/layouts/application.haml @@ -0,0 +1,13 @@ +!!! +%html + %head + %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ + %title Ambiente Já! + = csrf_meta_tags + = csp_meta_tag + = stylesheet_link_tag "https://fonts.googleapis.com/css?family=Inconsolata&display=swap" + = stylesheet_link_tag 'application', media: 'all' + %body + + %h1= "Ambiente Já!" + = yield diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 737f724..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - -
-