aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/general/blog.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/general/blog.html.erb')
-rw-r--r--app/views/general/blog.html.erb44
1 files changed, 44 insertions, 0 deletions
diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb
new file mode 100644
index 000000000..7146aab5d
--- /dev/null
+++ b/app/views/general/blog.html.erb
@@ -0,0 +1,44 @@
+<% @title = _("{{site_name}} blog and tweets", :site_name => site_name) %>
+
+<% if !@twitter_user.empty? %>
+<div id="right_column">
+ <div class="act_link">
+ <h2><%= _("Stay up to date") %></h2>
+ <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/>
+ <img src="/images/feed-16.png" alt="RSS icon"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
+ </div>
+ <% if AlaveteliConfiguration::twitter_widget_id %>
+ <div id="twitter">
+ <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ </div>
+ <% end %>
+</div>
+<% end %>
+
+<div id="left_column">
+ <h1><%=@title %></h1>
+
+ <div id="blog">
+ <% @blog_items.each do |item| %>
+ <div class="blog_post">
+ <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link'][0]%>"><%=h item['title'][0] %></a></h2>
+ <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=>item['creator'][0]) %></p>
+ <div>
+ <% if item['encoded'] %>
+ <%= raw item['encoded'][0] %>
+ <% elsif item['description'] %>
+ <%= raw item['description'][0] %>
+ <% end %>
+ </div>
+ <p><em>
+ <% if item['comments'] %>
+ <a href="<%=item['comments'][0]%>"><%= _("{{number_of_comments}} comments", :number_of_comments=>item['comments'][1]) %></a>
+ <% end %>
+ </em>
+ </p>
+ </div>
+ <% end %>
+ </div>
+</div>
+