Explorar el Código

Add media page

main
Adrian Short hace 6 años
padre
commit
408f0aa90e
Se han modificado 4 ficheros con 33 adiciones y 0 borrados
  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 fichero

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

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

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


+ 19
- 0
views/media.haml Ver fichero

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

Cargando…
Cancelar
Guardar