Source

py4u-opensource / templates / news.html

Full commit
{% extends "base.html" %}
{% block content %}
<style type="text/css">
#posts li {
margin: 10px 0;
padding-bottom: 40px;
}
.span0{
margin: 10px -5px 0 25px;
}
#news_toolbar{
    margin-left:50px;
}
</style>


{%include 'static_news_toolbar.html'%}
<ul id="posts" class='unstyled'>
    {%for post in posts%}
        <li>
        <span class ='span0'><a href='javascript:void(0);' onclick='vote_for_post({{post.id}})'><i class="icon-thumbs-up"></i></a></span>
        {%if not post.des %}

        <div class = 'span11'>
            <div><a href="{{post.link}}" class="public">{{post.title}}</a>
                {%if post.domain !="" %}
                    <span class="domain muted" >{{post.domain}}</span>
                {%endif%}
            </div>

        {%else%}
                <div><a href="/showpost?id={{post.id}}" class="public">{{post.title}}</a></div>
        {%endif%}
            
            <small><span class="post-info muted">
            <a href="/showpost?id={{post.id}}" class='muted'>Comments ({{post.comments_number}})</a> |
            Score <span id="score-1">{{post.score}}</span> |
            Posted {{post.post_date|timesince}} by
            <a href="/user?id={{post.poster.id}}" class='muted'>{{post.poster.nickname}}</a>
            </span></small>
        </div>
        </li>
    {%endfor%}
</ul>

<ul class="pager">
{%if posts.__len__() == POSTNUMBER_PER_PAGE %}
  <li class="previous">
    <a href="{{crrent_url}}?page={{nextpage}}" style="width:100%;">&larr; Older</a>
  </li>
{%else%}
    <li>
          <a style="width:100%;">No More Posts</a>
    </li>
{%endif%}
</ul>

{% endblock %}

{% block script %}
$(document).ready(function(){
     $("#nav_news").addClass("active");
     $("#{{news_type}}").addClass("active");
});

{% endblock %}