Created
December 7, 2012 16:19
-
-
Save kcoss/4234384 to your computer and use it in GitHub Desktop.
Media Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if widget.media %} | |
<div class="widget widget-{{ widget.type }} widget-{{ widget.width }}" id="widget-{{ widget.wid }}"> | |
<div class="inner"> | |
<h3>{{ widget.name }}</h3> | |
<ul class="list widget-list"> | |
{% for media in widget.media %} | |
<li class="item"> | |
<div class="information-fluid"> | |
{% if media.covers.first %} | |
{% case widget.width %} | |
{% when "small" %} | |
<div class="cover"> | |
<a href="{{ media.url }}"><img width="75" height="75" src="{{ media.covers.first | asset_url : 'C75x75' }}" alt="{{ media.title }}"/></a> | |
</div> | |
{% when "full" %} | |
<div class="cover"> | |
<a href="{{ media.url }}"><img width="160" height="120" src="{{ media.covers.first | asset_url : 'C160x120' }}" alt="{{ media.title }}"/></a> | |
</div> | |
{% else %} | |
<div class="cover"> | |
<a href="{{ media.url }}"><img width="143" height="96" src="{{ media.covers.first | asset_url : 'C143x96' }}" alt="{{ media.title }}"/></a> | |
</div> | |
{% endcase %} | |
{% endif %} | |
<div class="information-detail"> | |
<h4>{{ media.title | link_to : media.url }}</h4> | |
<small> | |
{{ media.created_at | time_ago_in_words }} | |
</small> | |
<div class="description"> | |
{{ media.description | strip_tags | truncate : 150 }} | |
</div> | |
{% if media.comments_enabled %} | |
<div class="counters"> | |
<span class="comments-count"> | |
<i class="icon-comment"></i> {{ media.comments_count }} | |
</span> | |
</div> | |
{% endif %} | |
</div> | |
</div> | |
</li> | |
{% endfor %} | |
</ul> | |
<div class="view-more"> | |
{{ 'site.commons.view_more' | translate | button_to : widget.view_more_url }} | |
</div> | |
</div> | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment