informativo basico

This commit is contained in:
lontra
2019-05-29 21:06:15 +03:00
parent 102301019b
commit 7eb4842141
16 changed files with 68 additions and 82 deletions

View File

@@ -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 .

View File

@@ -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;
}

View 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

View File

@@ -0,0 +1,4 @@
class Informativo < ApplicationRecord
self.table_name = "informativo"
paginates_per 10
end

View 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

View File

@@ -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>

View File

@@ -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>

View File

@@ -1 +0,0 @@
<%= yield %>

5
app/views/page/home.haml Normal file
View 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

View File

@@ -0,0 +1,3 @@
!= @informativo.Descricao
%hr
!= ap @informativo