informativo basico
This commit is contained in:
@@ -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 .
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
11
app/controllers/page_controller.rb
Normal file
11
app/controllers/page_controller.rb
Normal file
@@ -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
|
||||
4
app/models/informativo.rb
Normal file
4
app/models/informativo.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Informativo < ApplicationRecord
|
||||
self.table_name = "informativo"
|
||||
paginates_per 10
|
||||
end
|
||||
13
app/views/layouts/application.haml
Normal file
13
app/views/layouts/application.haml
Normal file
@@ -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
|
||||
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ambienteja</title>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<%= yield %>
|
||||
5
app/views/page/home.haml
Normal file
5
app/views/page/home.haml
Normal file
@@ -0,0 +1,5 @@
|
||||
%h3= "#{@informativos.count} informativos"
|
||||
- @informativos.each do |i|
|
||||
%p= link_to "#{i.data_inc} > #{i.titulo}", "/informativo/#{i.id}"
|
||||
|
||||
= will_paginate @informativos
|
||||
3
app/views/page/informativo.haml
Normal file
3
app/views/page/informativo.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
!= @informativo.Descricao
|
||||
%hr
|
||||
!= ap @informativo
|
||||
Reference in New Issue
Block a user