Browse Source

Add media page

main
Adrian Short 5 years ago
parent
commit
408f0aa90e
4 changed files with 33 additions and 0 deletions
  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 View File

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

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

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


+ 19
- 0
views/media.haml View File

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

Loading…
Cancel
Save