Statistics
| Branch: | Tag: | Revision:

root / cloudcms / templates / content / twitter_feed.html @ f6e90a2b

History | View | Annotate | Download (1 kB)

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 = $('<div class="tweet">');
11
                var date = $('<span class="date">');
12
                var text = $('<span 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="section twitter-feed">
28
    {% if content.title %}
29
        <h2>{{ content.title|safe }}</h2>
30
    {% endif %}
31
    <div id="twitter_feeds_section_{{ content.pk }}">
32
    </div>
33
</div>