Ver código fonte

Add media page

main
Adrian Short 6 anos atrás
pai
commit
408f0aa90e
4 arquivos alterados com 33 adições e 0 exclusões
  1. +5
    -0
      lib/site.rb
  2. +5
    -0
      public/style.css
  3. +4
    -0
      views/layout.haml
  4. +19
    -0
      views/media.haml

+ 5
- 0
lib/site.rb Ver arquivo

@@ -1,5 +1,6 @@
require 'scraperwiki'
require 'petrify'
require 'csv'

class Site
def self.generate
@@ -69,4 +70,8 @@ class Site
Petrify.csv(path, slug(auth['authority_name']), apps)
end
end
# Media page
media_items = CSV.read('media.csv', :headers => true )
Petrify.page('media', 'media', { media_items: media_items })
end

+ 5
- 0
public/style.css Ver arquivo

@@ -188,6 +188,11 @@ nav
padding: 0 10px 0 0;
}

.tags {
font-size: 0.7rem;
text-transform: uppercase;
}

@media print {
.noprint, footer, .nav, nav
{


+ 4
- 0
views/layout.haml Ver arquivo

@@ -21,6 +21,10 @@
%li
%a{ :href => '/appeals/' }<
Appeals
%li
%a{ :href => '/media/' }<
Media
= yield
%footer


+ 19
- 0
views/media.haml Ver arquivo

@@ -0,0 +1,19 @@
%h1 Media

%p
%a.button{ :href => 'https://github.com/adrianshort/kiosks/blob/master/media.csv' }
Add more media here

%table
- media_items.each do |item|
%tr
%td.nowrap= short_date(item['publish_date'])
%td.nowrap= item['publication']
%td
%a{ :href => item['url'] }<
= item['title']
-#
%div.tags
- item['authorities'].split('|').each do |authority|
%a{ :href => authority_url(authority) }<
= authority

Carregando…
Cancelar
Salvar