alexislefebvre/AsyncTweetsBundle

View on GitHub
src/Resources/views/Default/tweet_inc.html.twig

Summary

Maintainability
Test Coverage
{# see http://getbootstrap.com/components/#media #}
<div class="media">
    <div class="media-left media-middle">
        <img src="{{ tweet.user.profileImageUrlHttpOrHttps }}" width="48" height="48"
            class="media-object" alt="{{ tweet.user.name }}"
            title="{{ tweet.user.name }}" />
    </div>
    <blockquote class="media-body">
        <p>{{ tweet.textLinkified|raw }}</p>
        {% for media in tweet.medias %}
            {% if loop.first %}<p>{% endif %}
                <a href="{{ media.expandedUrl }}" title="{{ media.displayUrl }}">
                    <img src="{{ media.mediaUrlHttps }}"
                    alt="{{ media.url }}" /></a>
            {% if loop.last %}</p>{% endif %}
        {% endfor %}
        <small>
            <a href="{{
                'https://twitter.com/%user_name%'|replace({
                    '%user_name%': tweet.user.screenName
                })
            }}">{{ tweet.user.name }}</a>,
            <a href="{{
                'https://twitter.com/%user_name%/status/%tweet_id%'|replace({
                    '%user_name%': tweet.user.screenName,
                    '%tweet_id%': tweet.id
                })
            }}">{{ tweet.createdAt|date('c') }}</a>
            
            <span class="badge">
                <span class="glyphicon glyphicon-retweet"></span>
                {{ tweet.retweetCount }}
            </span>
            
            <span class="badge">
                <span class="glyphicon glyphicon-heart"></span>
                {{ tweet.favoriteCount }}
            </span>
            
            {% if (mark_as_read_link is not defined) %}
                <a href="{{ path('asynctweets_tweets_sinceTweetId',
                    {'firstTweetId': tweet.id}) }}" class="pull-right">
                    <span class="glyphicon glyphicon-check"></span>
                    Mark as read
                </a>
            {% endif %}
        </small>
    </blockquote>
</div>