b177bb568da8e92d53b558f9b932ba5a3b3a9a1f
[snf-cloudcms] / cloudcms / templates / content / twitter_feed.html
1
2 <script id="feeds-template-{{ content.pk }}" type="text/x-jquery-tmpl">
3     <li><b>${Name}</b> (${ReleaseYear})</li>
4 </script>
5 <script>
6     $(document).ready(function(){
7         var el = $("#twitter_feeds_section_{{ content.pk }}");
8         $.twitter({{ content.js_conf|safe}}, function(tweets){
9             $.each(tweets.results, function(i,t){
10                 var tweet = $('<li>');
11                 var date = $('<p class="date">');
12                 var text = $('<p class="text">');
13                 
14                 text.html(linkify(t.text));
15                 date.html('<a href="https://twitter.com/#!/' + t.from_user + 
16                 '">' + $.timeago(new Date(t.created_at)) + 
17                 '</a>');
18
19                 tweet.append(date);
20                 tweet.append(text);
21                 el.append(tweet);
22             })
23         })
24
25     })
26 </script>
27 <div class="follow">
28     {% if content.title %}
29         <h3>{{ content.title|safe }}</h3>
30     {% endif %}
31     <ul id="twitter_feeds_section_{{ content.pk }}">
32     </ul>
33 </div>