Skip to content

Commit

Permalink
Themes templates enhanced with updated code
Browse files Browse the repository at this point in the history
Themes templates enhanced with updated code
  • Loading branch information
vidyasagar-r authored and ashwin31 committed Jul 24, 2016
1 parent 1cfd7e7 commit 5118112
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 100 deletions.
38 changes: 28 additions & 10 deletions themes/theme1/templates/new_base.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{% load staticfiles %}
{% load blog_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Blog - {% block title %}Home{% endblock %}</title>
<title{% blog_title as blogtitle %}{{ blogtitle }} - {% block title %}Home{% endblock %}</title>
<link rel="shortcut icon" href="{% static 'images/favicon.png' %}">
{% block description %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Home - micro-blog - simple blog package - MicroPyramid." />
<meta property="og:description" content="micro-blog - simple blog package - MicroPyramid." />
<meta name="description" content="micro-blog - simple blog package - MicroPyramid." />
<meta name="keywords" content="simple" />
<link rel="canonical" href="{{ request.build_absolute_uri }}"/>
<meta property="og:url" content="{{ request.build_absolute_uri }}" />
<meta property="og:image" content="{{ og_image }}" />
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ description|truncatechars:160 }}" />

<meta name="title" content="{{ title }}" />
<meta name="description" content="{{ description|truncatechars:160 }}" />
<meta name="keywords" content="{{ keywords }}" />
<meta name="author" content="{{ author }}" />
<meta name="robots" content="index, follow">
{% endblock %}

{% load staticfiles %}
{% load blog_tags %}
<!-- Latest compiled and minified CSS -->
<link href='https://fonts.googleapis.com/css?family=Poppins:400,300,500,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{% static 'css/style.css' %}" type="text/css">
Expand Down Expand Up @@ -103,7 +109,19 @@
}

</script>

{% google_analytics_id as GOOGLE_ANALYTICS_ID %}
{% if GOOGLE_ANALYTICS_ID %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{GOOGLE_ANALYTICS_ID}}', 'auto');
ga('send', 'pageview');

</script>
{% endif %}
<script type="text/javascript">
$(document).ready(function() {
setTimeout(function() {
Expand Down
179 changes: 96 additions & 83 deletions themes/theme1/templates/posts/index.html
Original file line number Diff line number Diff line change
@@ -1,91 +1,104 @@
{% extends 'posts/new_base.html' %}
{% extends 'posts/base.html' %}
{% block title %} {{ title }} {% endblock %}
{% load paginate %}
{% load blog_tags %}
{% block blog_content %}
<!-- breadcrumbs-schema -->
{% if tag or date or category %}
<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb">
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="name">Home</span></a>
<meta itemprop="position" content="1" />
</li>
{% if tag %}
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="name">Tag</span></a>
<meta itemprop="position" content="2" />
</li>
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="tag">{{ tag }}</span></a>
<meta itemprop="position" content="3" />
</li>
{% endif %}
{% if date %}
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="name">Archive</span></a>
<meta itemprop="position" content="2" />
</li>
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="month">{{ date|date:"F Y"}}</span></a>
<meta itemprop="position" content="3" />
</li>
{% endif %}
{% if category %}
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="/">
<span itemprop="name">Category</span></a>
<meta itemprop="position" content="2" />
</li>
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="">
<span itemprop="name"> {{ category }}</span></a>
<meta itemprop="position" content="3" />
</li>
{% endif %}
</ol>
{% endif %}
<!-- end -->
<div class="row col-sm-12 col-md-9 blog-container-left">
<div class="blogs">
<ul class="blog-list">
{% if blog_posts %}
{% paginate 5 blog_posts %}
{% for blog in blog_posts %}
<li class="list-item" itemtype="http://schema.org/BlogPosting">
<div class="blog-left">
<h3 class="title" itemprop="name headline"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">{{ blog }}</a></h3>
</div>
<div class="desc">
<span>
<span itemprop="author" itemtype="http://schema.org/Person">{{ blog.user|title }} |</span>
<span itemprop="datePublished" itemtype="https://schema.org/datePublished"> {{ blog.updated_on|date:"d F Y" }}
</span>
</span>
<div class="content" itemprop="articleBody">
{{ blog.content|safe|truncatewords_html:50 }}
</div>
{% for tag in blog.tags.all %}
<span class="tags">
<a href="{% url 'selected_tag' tag_slug=tag.slug %}" ><i class="fa fa-tags"></i> {{ tag }}</a>
</span>
{% endfor %}
<p class="continue-read"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">Continue reading ....</a></p>
</div>
</li>
<hr />
{% endfor %}
<!-- pagination -->
<div class="pagination_wrap">
{% show_pages %}
</div>
<!--/ pagination -->
{% else %}
<h2 align="center">There are no Blog-posts are here !</h2>
{% endif %}

<!--
<div class="row col-sm-12 col-md-9 blog-container-left">
<div class="blogs">
<ul class="blog-list">
{% if blog_posts %}
{% paginate 5 blog_posts %}
{% for blog in blog_posts %}
<li class="list-item">
<div class="blog-left">
<h3 class="title" itemprop="headline"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">{{ blog }}</a></h3>
</div>
<div class="desc">
<span> {{ blog.user|title }} | {{ blog.updated_on|date:"d F Y" }}</span>
{{ blog.content|safe|truncatewords_html:50 }}
{% for tag in blog.tags.all %}
<span class="tags">
<a href="{% url 'selected_tag' tag_slug=tag.slug %}" ><i class="fa fa-tags"></i> {{ tag }}</a>
</span>
{% endfor %}
<p class="continue-read"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">Continue reading ....</a></p>
</div>
</li>
<hr />
{% endfor %}
{% endif %}
</ul>
</div>
</div>
-->
<!-- blog_list_container starts here -->
<div class="blog_list_container">
{% if blog_posts %}
{% paginate 5 blog_posts %}
{% for blog in blog_posts %}
<!-- blog_container starts here -->
<div class="blog_container">
<!--
<div class="blog_img">
<img src="https://d13yacurqjgara.cloudfront.net/users/566817/screenshots/2387531/nycgifathon08.gif" />
</div>
-->
<div class="blog_content_container">
<div class="author_category">
<a href="#" class="author">By {{ blog.user }}</a>
<a href="{% url 'selected_category' category_slug=blog.category.slug %}" class="category">{{ blog.category }}</a>
</div>
<div class="blog_title">
<a href="{% url 'blog_post_view' blog_slug=blog.slug %}">{{ blog }}</a>
</div>
<div class="blog_desc">
{{ blog.content|safe|truncatewords_html:50 }}
</div>
<div class="blog_detail_options">
<span class="activity">Posted on {{ blog.updated_on|date:"F d, Y" }}</span>
<span class="reply"><a href="#"><i class="fa fa-reply"></i>Replies 123 </a></span>
<span class="views"><a href="#"><i class="fa fa-eye"></i> Views 123 </a></span>
<span class="likes"><a href="#"><i class="fa fa-thumbs-up" aria-hidden="true"></i> Likes 23 </a></span>
</div>
<div class="share_more">
<!-- <span class="share">
<ul class="list-inline">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-google-plus"></i></a></li>
</ul>
</span> -->
<span class="more"><a href="{% url 'blog_post_view' blog_slug=blog.slug %}">Continue Reading</a></span>
</div>
</div>
</div>
<!-- blog_container ends here -->
{% endfor %}
<!-- pagination -->
<div class="pagination_wrap">
{% show_pages %}
</ul>
</div>
<!--/ pagination -->
{% else %}
<h2 align="center">There are no Blog-posts are here !</h2>
{% endif %}
</div>
<!-- blog_list_container ends here -->
</div>


{% endblock %}

Expand Down
65 changes: 65 additions & 0 deletions themes/theme1/templates/posts/nav_menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% load recurse %}

<nav id="main-nav" role="navigation">

{% recurse menu.menu_set.all|dictsort:"lvl" with menu as menu %}
<ul {% if menu.count %}id="main-menu" class="sm sm-blue"{% endif %}>
{% loop %}
<li {% if not menu.status %}style="display:none;"{% endif %}><a href="{% if menu.has_children %}#{% else %}{{ menu.url }}{% endif %}"> <span>{{menu.title}}</span></a>
{% child %}
</li>
{% endloop %}
</ul>
{% endrecurse %}

</nav>
<!--
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
{% recurse menu.menu_set.all|dictsort:"lvl" with menu as menu %}
<ul class="nav navbar-nav">
{% loop %}
<li class="dropdown" {% if not menu.status %}style="display:none;"{% endif %}><a href="{% if menu.has_children %}#{% else %}{{ menu.url }}{% endif %}"> <span>{{menu.title}}</span></a>
{% child %}
</li>
{% endloop %}
</ul>
{% endrecurse %}
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>-->
<!--
<div class="row" id="top_menu">
<div class="container">
<div class="row menu_items">
{% recurse menu.menu_set.all|dictsort:"lvl" with menu as menu %}
<ul class="nav nav-pills pull-left">
{% loop %}
<li {% if not menu.status %}style="display:none;"{% endif %}><a href="{% if menu.has_children %}#{% else %}{{ menu.url }}{% endif %}"> <span>{{menu.title}}</span></a>
{% child %}
</li>
{% endloop %}
</ul>
{% endrecurse %}
</div>
</div>
</div>-->
12 changes: 6 additions & 6 deletions themes/theme1/templates/posts/new_blog_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,27 @@
<div class="social_block">
<ul class="social_connections">
<li class="text-center">
<a href="#" class="facebook">
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u={{short_url}}&t={{blog_name.title}}" class="facebook">
<i class="fa fa-facebook"></i>
Facebook
</a>
</li>
<li class="text-center">
<a href="#" class="twitter">
<a target="_blank" href="https://twitter.com/intent/tweet?text={{blog_name.title}}&url={{short_url}}&via={{blog_title}}" class="twitter">
<i class="fa fa-twitter"></i>
Twitter
</a>
</li>
<li class="text-center">
<a href="#" class="google">
<a target="_blank" href="https://plus.google.com/share?hl=en-US&url={{short_url}}" class="google">
<i class="fa fa-google"></i>
Google Plus
</a>
</li>
<li class="text-center">
<a href="#" class="youtube">
<i class="fa fa-youtube-play"></i>
Youtube
<a target="_blank" href="https://www.linkedin.com/cws/share?url={{ short_url }}&token=&isFramed=true" class="youtube">
<i class="fa fa-linkedin"></i>
Linkedin
</a>
</li>
<br clear="all">
Expand Down
2 changes: 1 addition & 1 deletion themes/theme1/templates/posts/new_nav_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">DjangoBlogIt</a>
<a class="navbar-brand" href="/">DjangoBlogIt</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
Expand Down

0 comments on commit 5118112

Please sign in to comment.