Template source: home.html

{% extends 'base.html' %} {% load staticfiles publication_tags cache i18n %} {% block title %}{% trans "Home" %} | {{ block.super }}{% endblock %} {% block content %} <main> {% if request.user.is_authenticated %} <section id="full-hero" class="container-fluid"> <div class="row"> {% with article=articles.0 %} <a href="{{ article.get_absolute_url }}" class="item-card hero-card-large col-md-6"> {% if article.featured_image %} <div class="hero-card-image" style="background-image:url({{ article.featured_image.get_article_small_url }})"></div> {% else %} <div class="hero-card-image hero-placeholder"></div> {% endif %} <div class="item-card-content"> <span id="feed-summary-link" href="{% if request.user.is_author %}{{ request.user.author.get_absolute_url }}{% elif request.user.is_member %}{{ request.user.member.get_absolute_url }}{% else %}{% url 'admin:index' %}{% endif %}"> <h2 class="hero-title">{% trans "Feed Summary" %}</h2> </span> <h4 class="item-card-title">{{ article.title }}</h4> <div class="item-card-author-group"> {% if article.author.avatar %} <img class="avatar" src="{{ article.author.avatar.get_author_small_url }}" alt="{{ article.author }}"/> {% elif article.author %} <img class="avatar" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ article.author }}"/> {% endif %} <span class="item-card-author">{{ article.author.full_name }}</span> </div> <div class="item-card-category"> <h3 class="cat-bubble {{ article.master_category.color_class }}-bg">{{ article.master_category }}</h3> </div> <p>{{ article.description }}</p> </div> </a> {% endwith %} {% for article in articles|slice:"1:" %} <a href="{{ article.get_absolute_url }}" class="item-card hero-card col-md-3 col-xs-6"> {% if article.featured_image %} <div class="hero-card-image" style="background-image:url({{ article.featured_image.get_article_small_url }})"></div> {% else %} <div class="hero-card-image hero-placeholder"></div> {% endif %} <div class="item-card-content"> <div class="item-card-category"> <h3 class="cat-bubble {{ article.master_category.color_class }}-bg">{{ article.master_category }}</h3> <div class="pull-right"> <span class="item-card-author">{{ article.author.full_name }}</span> {% if article.author.avatar %} <img class="avatar" src="{{ article.author.avatar.get_author_small_url }}" alt="{{ article.author }}"/> {% else %} <img class="avatar" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ article.author }}"/> {% endif %} </div> </div> <h4 class="item-card-title">{{ article.title }}</h4> </div> </a> {% endfor %} </div> </section> {% else %} <section id="full-hero" class="container-fluid"> <div class="row"> {% with article=articles_today_stories.0 %} <a href="{{ article.get_absolute_url }}" class="item-card hero-card-large col-md-6"> {% if article.featured_image %} <div class="hero-card-image" style="background-image:url({{ article.featured_image.get_article_small_url }})"></div> {% else %} <div class="hero-card-image hero-placeholder"></div> {% endif %} <div class="item-card-content"> <span class="redirect-link" href="{% url 'category_single' %}"> <h2 class="hero-title">{% trans "Today's stories" %}</h2> </span> <h4 class="item-card-title">{{ article.title }}</h4> <div class="item-card-author-group"> {% if article.author.avatar %} <img class="avatar" src="{{ article.author.avatar.get_author_small_url }}" alt="{{ article.author }}"/> {% elif article.author %} <img class="avatar" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ article.author }}"/> {% endif %} <span class="item-card-author">{{ article.author.full_name }}</span> </div> <div class="item-card-category"> <h3 class="cat-bubble {{ article.master_category.color_class }}-bg">{{ article.master_category }}</h3> </div> <p>{{ article.description }}</p> </div> </a> {% endwith %} {% for article in articles_today_stories|slice:"1:" %} <a href="{{ article.get_absolute_url }}" class="item-card hero-card col-md-3 col-xs-6"> {% if article.featured_image %} <div class="hero-card-image" style="background-image:url({{ article.featured_image.get_article_small_url }})"></div> {% else %} <div class="hero-card-image hero-placeholder"></div> {% endif %} <div class="item-card-content"> <div class="item-card-category"> <h3 class="cat-bubble {{ article.master_category.color_class }}-bg">{{ article.master_category }}</h3> <div class="pull-right"> <span class="item-card-author">{{ article.author.full_name }}</span> {% if article.author.avatar %} <img class="avatar" src="{{ article.author.avatar.get_author_small_url }}" alt="{{ article.author }}"/> {% else %} <img class="avatar" src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ article.author }}"/> {% endif %} </div> </div> <h4 class="item-card-title">{{ article.title }}</h4> </div> </a> {% endfor %} </div> </section> {% endif %} <section id="follower-suggestions" class="lightgreybg text-left"> <div class="suggestions-title"> {% trans "You might also like :" %} </div> <div class="suggestions-container"> <ul class="avatar-list list-unstyled text-center" data-list-authors="{{ suggested_authors.pks|escapejs }}"> {% for author in suggested_authors.authors %} <li class="avatar-single"> <a href="{% url 'author_single' author.slug %}"> {% if author.avatar %} <img src="{{ author.avatar.get_author_small_url }}" alt="{{ author.full_name }}"/> {% else %} <img src="{% static 'dist/images/avatar-default.jpg' %}" alt="{{ author.full_name }}"/> {% endif %} </a> {% include '_tooltip_follow.html' with author=author %} </li> {% endfor %} </ul> <div class="clearfix"></div> </div> {% if not request.user.is_authenticated %} <a class="suggestions-feed-btn all-feed-btn btn btn-primary text-right" href="{% url 'category_single' %}"> {% trans "View all<br>today's stories" %} </a> {% else %} {% if request.user.is_author %} <a class="suggestions-feed-btn btn btn-primary text-right" href=" {{ request.user.author.get_absolute_url }}"> {% trans "View my feed" %} <i class="fa fa-newspaper-o" aria-hidden="true"></i> </a> {% elif request.user.is_member %} <a class="suggestions-feed-btn btn btn-primary text-right" href=" {{ request.user.member.get_absolute_url }}"> {% trans "View my feed" %} <i class="fa fa-newspaper-o" aria-hidden="true"></i> </a> {% else %} <a class="suggestions-feed-btn btn btn-primary text-right" href="{% url 'admin:index' %}"> {% trans "View admin" %} <i class="fa fa-lock" aria-hidden="true"></i> </a> {% endif %} {% endif %} </section> {% if request.user.is_authenticated %} <section id="stories" class="cat-box line-bottom"> <div class="container-fluid"> <div class="cat-box-title"> <h2 class="all-cat no-padding no-margin"> <a href="{% url 'category_single' %}"> {% trans "Today's stories" %} </a> </h2> <span class="all-cat pull-right"> <a href="{% url 'category_single' %}"> {% trans "Show more Stories" %}<i class="fa fa-angle-right"></i> </a> </span> </div> <div class="cat-box-gallery"> <div class="row article-row"> {% if articles_today_stories.0 %} {% with article=articles_today_stories.0 %} <div class="col col-sm-40"> {% if article.get_city_category %} {% include '_article_card_square.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card_square.html' %} {% endif %} </div> {% endwith %} {% else %} <div class="col col-sm-40 article-placeholder"> {% include '_article_card_square.html' %} </div> {% endif %} {% if articles_today_stories.1 %} {% with article=articles_today_stories.1 %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endwith %} {% else %} <div class="col col-sm-15 article-placeholder"> {% include '_article_card.html' %} </div> {% endif %} {% if articles_today_stories.2 %} {% with article=articles_today_stories.2 %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endwith %} {% else %} <div class="col col-sm-15 article-placeholder"> {% include '_article_card.html' %} </div> {% endif %} {% if articles_today_stories.3 %} {% with article=articles_today_stories.3 %} <div class="col col-sm-15"> {% if article.get_city_category %} {% include '_article_card.html' with city_category=article.get_city_category %} {% else %} {% include '_article_card.html' %} {% endif %} </div> {% endwith %} {% else %} <div class="col col-sm-15 article-placeholder"> {% include '_article_card.html' %} </div> {% endif %} </div> </div> </div> </section> {% endif %} {# <section class="banners sectionpadding text-center">#} {# <script type="text/javascript">#} {# clicksor_mobile_redirect = false;#} {# //default banner house ad url#} {# clicksor_default_url = '';#} {# clicksor_banner_border = '#A0D000';#} {# clicksor_banner_ad_bg = '#FFFFFF';#} {# clicksor_banner_link_color = '#000000';#} {# clicksor_banner_text_color = '#666666';#} {# clicksor_banner_image_banner = true;#} {# clicksor_banner_text_banner = true;#} {# clicksor_layer_border_color = '#A0D000';#} {# clicksor_layer_ad_bg = '#FFFFFF';#} {# clicksor_layer_ad_link_color = '#000000';#} {# clicksor_layer_ad_text_color = '#666666';#} {# clicksor_text_link_bg = '';#} {# clicksor_text_link_color = '';#} {# clicksor_enable_text_link = false;#} {# clicksor_layer_banner = false;#} {# </script>#} {# <script type="text/javascript"#} {# src="//b.yu0123456.com/show.php?nid=1&amp;pid=373596&amp;adtype=1&amp;sid=629867"></script>#} {# </section>#} {% for dict in master_categories %} {% if dict.articles %} {% include '_home_category_box.html' with category=dict.object random=dict.random articles=dict.articles %} {% endif %} {# {% if forloop.counter == video_index_position %} #} {# {% include '_home_video_box.html' %} #} {# {% endif %} #} {% endfor %} {# {% include '_home_video_box.html' %}#} <div class="clearfix"></div> </main> {% endblock %}