Merge branch 'master' of git+ssh://maxious.lambdacomplex.org/git/ckanext-datagovau
[ckanext-datagovau.git] / ckanext / datagovau / templates / home / index.html
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
{% ckan_extends %}
{% block home_secondary_content %}
<script type="text/javascript" src="//www.google.com/jsapi">
</script>
<script type="text/javascript">
google.load("feeds", "1") //Load Google Ajax Feed API (version 1)
</script>
 
          <div id="feeddiv"></div>
 
<script type="text/javascript">
 
var feedcontainer=document.getElementById("feeddiv")
var feedurl="http://www.finance.gov.au/taxonomy/term/1274/feed"
var feedlimit=3
var rssoutput="<div  class='module module-shallow module-narrow module-dark info box' style='color:black'><h2>Latest data.gov.au News</h2><i class='ckan-icon ckan-icon-feed'></i><a href='http://www.finance.gov.au/taxonomy/term/1274/feed/'>&nbsp;Subscribe to the blog </a></div>"
 
 
function rssfeedsetup(){
var feedpointer=new google.feeds.Feed(feedurl) //Google Feed API method
feedpointer.setNumEntries(feedlimit) //Google Feed API method
feedpointer.load(displayfeed) //Google Feed API method
}
 
function displayfeed(result){
if (!result.error){
var thefeeds=result.feed.entries
for (var i=0; i<thefeeds.length; i++) {
rssoutput+="<div  class='module module-shallow module-narrow module-dark info box'><h3><a href='" + thefeeds[i].link + "'>" + thefeeds[i].title + "</a></h3>"
rssoutput+= " <font color='black'>Posted on " + new Date(thefeeds[i].publishedDate).toDateString() + "</font></div>"
}
rssoutput+=""
feedcontainer.innerHTML=rssoutput
}
else
alert("Error fetching feeds!")
}
 
window.onload=function(){
rssfeedsetup()
}
 
</script>
 
{{ super() }}
            {% endblock %}