This commit is contained in:
Anna Sudnitsina 2017-11-08 12:43:13 +03:00
parent dfe6c2ad56
commit 64eaab9d6b
6 changed files with 88 additions and 92 deletions

View File

@ -23,6 +23,14 @@ a {
letter-spacing: 1px; letter-spacing: 1px;
margin-right: 10px; margin-right: 10px;
} }
.delete {
right: 80px;
}
.edit {
position: absolute;
right: 10px;
bottom: 10px;
}
input#button-search { input#button-search {
background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center; background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center;
border: none; border: none;

View File

@ -5,10 +5,9 @@
<title>BLOG</title> <title>BLOG</title>
<link rel="stylesheet" href="{% static 'css/blog.css' %}"> <link rel="stylesheet" href="{% static 'css/blog.css' %}">
<link rel="stylesheet" href="{% static 'css/new.css' %}"> <link rel="stylesheet" href="{% static 'css/new.css' %}">
<meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<!--script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script-->
<!--Let browser know website is optimized for mobile--> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
@ -21,43 +20,39 @@
</div> </div>
</div> </div>
<div id="content"> <div id="content">
{% block content %} {% block content %}
{% endblock %} {% endblock %}
<div class="sidemenu"> <div class="sidemenu">
Hop hey</div> <div class="block">
<div class="sidemenu"> <h2>Меню</h2>
<div class="block"> <ul>
<h2>Меню</h2> <li><li><a href="{% url 'post_new' %}">new post</a></li>
<ul> <li><a href="/blog/1">all notes</a></li>
<li><li><a href="{% url 'post_new' %}">new post</a></li> </ul>
<li><a href="/blog/1">all notes</a></li> </div>
</ul> <div class="block">
<h2>Последние</h2>
<ul>
<li><a href="/">ToDo List</a><div class="date">2017-11-04</div></li>
<li><a href="/">Йа сцылко</a><div class="date">2017-11-03</div></li>
<li><a href="/">Йа сцылко №2</a><div class="date">2017-11-03</div></li>
</ul>
</div>
</div>
</div> </div>
<div class="block"> <ul class="menu_top paginator">
<h2>Последние</h2> {% if posts.has_previous %}
<ul> <li> <a href="?page=1"><<</a> </li>
<li><a href="/">ToDo List</a><div class="date">2017-11-04</div></li> <li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li>
<li><a href="/">Йа сцылко</a><div class="date">2017-11-03</div></li> {% endif %}
<li><a href="/">Йа сцылко №2</a><div class="date">2017-11-03</div></li> <li> <a style="color: #000000" href="">{{ posts.number }}<a></li>
</ul> {% if posts.has_next %}
</div> <li> <a href="?page={{ posts.next_page_number }}"> {{ posts.next_page_number }}</a> </li>
</div> <li> <a href="?page={{ posts.next_page_number|add:1 }}">{{ posts.next_page_number|add:1 }}</a></li>
</div> <li><a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %}
</body>
{% comment %}
<ul class="menu_top paginator"> <!--li> {% for i in posts.paginator.page_range %} </li-->
{% if posts.has_previous %} {% endcomment %}
<li> <a href="?page=1"><<</a> </li> </ul>
<li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li>
{% endif %}
<li> <a style="color: #000000" href="">{{ posts.number }}<a></li>
{% if posts.has_next %}
<li> <a href="?page={{ posts.next_page_number }}"> {{ posts.next_page_number }}</a> </li>
<li> <a href="?page={{ posts.next_page_number|add:1 }}">{{ posts.next_page_number|add:1 }}</a></li>
<li><a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %}
</body>
{% comment %}
<!--li> {% for i in posts.paginator.page_range %} </li-->
{% endcomment %}
</ul>
</html> </html>

View File

@ -4,22 +4,21 @@
<div class="block" style="position: relative; "> <div class="block" style="position: relative; ">
<h1>{{ post.title }}</h1> <h1>{{ post.title }}</h1>
<h3> Теги: <h3> Теги:
{% if tags %} {% if tags %}
{% for tag in tags %} {% for tag in tags %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a> <a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</h3> </h3>
<p>{{ post.text|safe|linebreaksbr }}</p> <p>{{ post.text|safe|linebreaksbr }}</p>
<span> <span>
{% if post.published_date %} {% if post.published_date %}
{{ post.published_date }} {{ post.published_date }}
{% endif %} {% endif %}
</span> </span>
<span class="edit" style="position: absolute; right: 10px; bottom: 10px;"><a href="{% url 'post_edit' pk=post.pk %}">edit post</a></span> <span class="edit"><a href="{% url 'post_edit' pk=post.pk %}">edit post</a></span>
<span class="edit" style="position: absolute; right: 80px; bottom: 10px;"><a href='#deletionDialog';">delete</a></span> <span class="edit delete"><a href='#deletionDialog';">delete</a></span>
<div id="deletionDialog" class="dialog"> <div id="deletionDialog" class="dialog">
<div> <div>
<p align="right"><a href=""><img src="http://py.difrex.ru/media/images/x.PNG"></a></p> <p align="right"><a href=""><img src="http://py.difrex.ru/media/images/x.PNG"></a></p>

View File

@ -1,11 +1,11 @@
{% extends 'blog/base.html' %} {% extends 'blog/base.html' %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<form method="POST" class="post-form">{% csrf_token %} <form method="POST" class="post-form">{% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<button type="submit" class="save btn btn-default">Save</button> <button type="submit" class="save btn btn-default">Save</button>
</form> </form>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,25 +1,24 @@
{% extends 'blog/base.html' %} {% extends 'blog/base.html' %}
{% load pagination_tags %} {% load pagination_tags %}
{% block content %}
{% block content %}
<div id="posts"> <div id="posts">
{% for post in posts %} {% for post in posts %}
<div class="post"> <div class="post">
<div class="post-header"> <div class="post-header">
<h2><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h2> <h2><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h2>
<div class="date"><i class="fa fa-calendar"></i> {{ post.published_date}}</div> <div class="date"><i class="fa fa-calendar"></i> {{ post.published_date}}</div>
{% if post.tags.names %} {% if post.tags.names %}
<div class="tag"> <div class="tag">
<i class="fa fa-tags"></i> <i class="fa fa-tags"></i>
{% for tag in post.tags.names %} {% for tag in post.tags.names %}
<a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a> <a href="{% url 'search_by_tag' tag=tag%}">{{ tag }}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
</div> </div>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br> {{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
</div> </div>
{% endfor %}
{% endfor %} </div>
</div>
{% endblock content %} {% endblock content %}

View File

@ -1,24 +1,19 @@
{% extends 'blog/base.html' %} {% extends 'blog/base.html' %}
{% load pagination_tags %} {% load pagination_tags %}
{% block content %} {% block content %}
{% for post in tagged_posts %} {% for post in tagged_posts %}
<div class="block post"> <div class="block post">
<h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1> <h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--><br>
{{ post.text|safe|linebreaksbr|truncatewords:80 }} <!--|linebreaksbr|truncatewords:80 }}</p--> <p style="float: left; color: #1abc9c; font-style: italic;"> Tags:
{% for tag in post.tags.names %}
<br> <a href="{% url 'search_by_tag' tag=tag%}" style="color: #1abc9c; ">{{ tag }}</a>
<p style="float: left; color: #1abc9c; font-style: italic;"> Tags: {% endfor %}
{% for tag in post.tags.names %} </p>
<a href="{% url 'search_by_tag' tag=tag%}" style="color: #1abc9c; ">{{ tag }}</a> <p align="right">
{% endfor %} {{ post.published_date}}
</p> </p>
</div>
<p align="right">
{{ post.published_date}}
</p>
</div>
{% endfor %} {% endfor %}
{% endblock content %} {% endblock content %}