diff options
author | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-05-31 15:04:45 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-05-31 15:04:45 +0300 |
commit | 5a7466204b4030873405b1a0fcb8b208762453ee (patch) | |
tree | bc73cccb953b6ba25afdb7dffbee505a296e94ac /weblog/templates | |
parent | be41310b3dc4aec12d3a950cf9fe737811436499 (diff) | |
download | w3blog-5a7466204b4030873405b1a0fcb8b208762453ee.tar.gz w3blog-5a7466204b4030873405b1a0fcb8b208762453ee.zip |
Ability to pin posts, updated to bootstrap 4, fixes
Diffstat (limited to 'weblog/templates')
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog/index.html | 30 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog/post.html | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog/sidebar_archive.html | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog/sidebar_categories.html | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog/weblog.html | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog_base.html | 19 | ||||
-rwxr-xr-x[-rw-r--r--] | weblog/templates/weblog_base_old.html | 0 |
7 files changed, 44 insertions, 19 deletions
diff --git a/weblog/templates/weblog/index.html b/weblog/templates/weblog/index.html index c46da38..7231cf7 100644..100755 --- a/weblog/templates/weblog/index.html +++ b/weblog/templates/weblog/index.html @@ -8,7 +8,7 @@ {{ category.name }}
{% endif %}
{% else %}
-{{ blog_title }}
+{% trans "Home" context "Home page" %}
{% endif %}
{% endblock %}
{% block blog_content_block %}
@@ -18,9 +18,32 @@ {% else %}
<h1>{% blocktrans with category_name=category.name context 'Posts in category' %}Posts in {{ category_name }}{% endblocktrans %}</h1>
{% endif %}
+{% elif year %}
+{% if month %}
+<h1>{% blocktrans with category_name=category.name context 'Posts from archive (year/month,year)' %}Posts from {{ month }}, {{ year }}{% endblocktrans %}</h1>
{% else %}
-<h1>{{ blog_title }}</h1>
+<h1>{% blocktrans with category_name=category.name context 'Posts from archive (year/month,year)' %}Posts from {{ year }}{% endblocktrans %}</h1>
{% endif %}
+{% else %}
+<h1>{{ blog_title }} - {% trans "Home" context "Home page" %}</h1>
+{% endif %}
+ {% if posts or pinned_posts %}
+ {% if pinned_posts %}
+ {% for post in pinned_posts %}
+ <div class="container-fluid blogpost">
+ <p><span class="fas fa-thumbtack"></span> <i>{% trans 'Important post' %}</i></p>
+ <h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
+ <p class="publish-info">{% blocktrans with publish_date=post.publish_date %}Published on {{ publish_date }}{% endblocktrans %}{% if post.author %}{% blocktrans with author=post.author context 'Written by (Author)' %}, by {{ author }}{% endblocktrans %}{% endif %}</p>
+ <hr>
+ {% if post.preview_image %}<img class="img-responsive preview-img" src="{{ post.preview_image.url }}">{% endif %}
+ {{ post.preview_text|safe }}
+ <hr>
+ <div class="text-right">
+ <a href="{{ post.url }}">{% trans 'Read more...' %}</a>
+ </div>
+ </div>
+ {% endfor %}
+ {% endif %}
{% if posts %}
{% for post in posts %}
<div class="container-fluid blogpost">
@@ -72,7 +95,8 @@ {% endif %}
</ul>
{% endif %}
+ {% endif %}
{% else %}
<div class="text-center"><h2>{% trans 'Nothing has been posted yet.' %}</h2></div>
{% endif %}
-{% endblock %}
\ No newline at end of file +{% endblock %}
diff --git a/weblog/templates/weblog/post.html b/weblog/templates/weblog/post.html index 364e17c..364e17c 100644..100755 --- a/weblog/templates/weblog/post.html +++ b/weblog/templates/weblog/post.html diff --git a/weblog/templates/weblog/sidebar_archive.html b/weblog/templates/weblog/sidebar_archive.html index 5953bfe..5953bfe 100644..100755 --- a/weblog/templates/weblog/sidebar_archive.html +++ b/weblog/templates/weblog/sidebar_archive.html diff --git a/weblog/templates/weblog/sidebar_categories.html b/weblog/templates/weblog/sidebar_categories.html index 7e7fa5c..7e7fa5c 100644..100755 --- a/weblog/templates/weblog/sidebar_categories.html +++ b/weblog/templates/weblog/sidebar_categories.html diff --git a/weblog/templates/weblog/weblog.html b/weblog/templates/weblog/weblog.html index 9980b54..e24c918 100644..100755 --- a/weblog/templates/weblog/weblog.html +++ b/weblog/templates/weblog/weblog.html @@ -3,18 +3,18 @@ {% load weblog_extras %} {% block title_block %}{% endblock %} {% block blog_block %} -<ol class="breadcrumb"> +<ul class="breadcrumb"> {% if breadcrumbs %} - <li><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li> + <li class="breadcrumb-item"><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li> {% for crumb in breadcrumbs %} {% if forloop.last %} - <li class="active">{{ crumb.name }}</li> - {% else %}<li><a href="{{ crumb.url }}">{{ crumb.name }}</a></li>{% endif %} + <li class="breadcrumb-item active">{{ crumb.name }}</li> + {% else %}<li class="breadcrumb-item"><a href="{{ crumb.url }}">{{ crumb.name }}</a></li>{% endif %} {% endfor %} {% else %} - <li class="active"><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li> + <li class="breadcrumb-item active"><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li> {% endif %} -</ol> +</ul> <div class="row"> <div class="{% if show_sidebar %}col-sm-9{% else %}container-fluid{% endif %}"> {% block blog_content_block %} @@ -39,4 +39,4 @@ </div> {% endif %} </div> -{% endblock %}
\ No newline at end of file +{% endblock %} diff --git a/weblog/templates/weblog_base.html b/weblog/templates/weblog_base.html index 536e736..9a739cb 100644..100755 --- a/weblog/templates/weblog_base.html +++ b/weblog/templates/weblog_base.html @@ -3,19 +3,20 @@ <html>
<head>
<meta charset="utf-8">
- <title>Simple blog - {% block title_block %} Home {% endblock %}</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
+ <meta content="width=device-width, initial-scale=1" name="viewport">
+ <title>{{ blog_title }} - {% block title_block %} Home {% endblock %}</title>
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link rel="stylesheet" href="{% static '/weblog/css/weblog.css' %}">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" defer></script>
+ <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="{% static '/weblog/js/weblog.js' %}" defer></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
</head>
<body>
- <nav class="navbar navbar-inverse">
+ <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<div class="container nav-container">
- <div class="navbar-header">
- <a class="navbar-brand" href="{% url 'weblog:Index' %}">{{ blog_title }}</a>
- </div>
+ <a class="navbar-brand" href="{% url 'weblog:Index' %}">{{ blog_title }}</a>
</div>
</nav>
<div class="container">
@@ -25,4 +26,4 @@ {% endblock %}
</div>
</body>
-</html>
\ No newline at end of file +</html>
diff --git a/weblog/templates/weblog_base_old.html b/weblog/templates/weblog_base_old.html index a4dbd30..a4dbd30 100644..100755 --- a/weblog/templates/weblog_base_old.html +++ b/weblog/templates/weblog_base_old.html |