aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general/blog.rhtml
blob: c9387c24fe1278e66414e2cc160f097ce739b614 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<% @title = "#{site_name} blog and tweets" %>

<h1><%=@title %></h1>
   <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a>&nbsp;
   <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>">Subscribe to blog</a>
<% if !@twitter_user.empty? %>
<div id="twitter">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 15,
  interval: 6000,
  width: 'auto',
  height: 500,
  theme: {
    shell: {
      background: '#eaeaea',
      color: '#000000'
    },
    tweets: {
      background: '#ffffff',
      color: '#000000',
      links: '#0b004a'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: true,
    behavior: 'all'
  }
}).render().setUser('<%=@twitter_user %>').start();
</script>

</div>
<% end %>

<div id="blog">
  <% for item in @blog_items: %>
    <div class="blog_post">
        <h2><a href="<%=item['link']%>"><%=h item['title'] %></a></h2>
        <p class="subtitle">Posted on <%= simple_date(Time.parse(item['pubDate'][0])) %> by <%=h item['creator'] %></p>
        <div><%= item['encoded'] %></div>
        <p><em>
            <a href="<%=item['comments'][0]%>"><%=item['comments'][1]%> comments</a>
        </em>
        </p>
    </div>
  <% end   %>
</div>