This commit is contained in:
Anna Sudnitsina 2017-11-21 16:14:40 +03:00
parent 925e62be0c
commit 446ac8e697
3 changed files with 113 additions and 119 deletions

View File

@ -1,4 +1,3 @@
a { a {
color: #4a809a; color: #4a809a;
} }
@ -10,17 +9,16 @@
.block { .block {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
//display: block;
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding: 15px; padding: 15px;
} }
.close { .close {
color: #FFFFFF; color: #FFFFFF;
font-size: 30px;
position: absolute; position: absolute;
right: -25px; right: -25px;
text-decoration: none; text-decoration: none;
top: -25px; top: -25px;
font-size: 30px;
} }
#content { #content {
margin: 10px 0 0 0; margin: 10px 0 0 0;
@ -38,18 +36,18 @@
margin-right: 10px; margin-right: 10px;
} }
.dialog { .dialog {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.8);
z-index: 99999;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in; -moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in; -webkit-transition: opacity 400ms ease-in;
background: rgba(0,0,0,0.8);
bottom: 0;
display: none; display: none;
left: 0;
pointer-events: none; pointer-events: none;
position: fixed;
right: 0;
top: 0;
transition: opacity 400ms ease-in;
z-index: 99999;
} }
.dialog:target { .dialog:target {
@ -58,18 +56,18 @@
} }
.dialog1 { .dialog1 {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.8);
z-index: 99999;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in; -moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in; -webkit-transition: opacity 400ms ease-in;
background: rgba(0,0,0,0.8);
bottom: 0;
display: none; display: none;
left: 0;
pointer-events: none; pointer-events: none;
position: fixed;
right: 0;
top: 0;
transition: opacity 400ms ease-in;
z-index: 99999;
} }
.dialog1:target { .dialog1:target {
@ -78,24 +76,19 @@
} }
.dialog > div { .dialog > div {
width: 17em; background: #fff;
position: relative;
margin: 15% auto; margin: 15% auto;
padding: 10px; padding: 10px;
position: relative;
text-align: center; text-align: center;
//border-radius: 10px; width: 17em;
background: #fff;
} }
.dialog span {line-height: 50px} .dialog span {
.dialog input {width: 100px; margin: 5px} line-height: 50px
input#button-search { }
background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center; .dialog input {
border: none; margin: 5px
width: 100px;
cursor: pointer;
//margin-top: 10px;
width: 32px;
height: 32px;
} }
h2 { h2 {
font-size: 26.25px; font-size: 26.25px;
@ -110,14 +103,21 @@
height: 50px; height: 50px;
} }
input[name="search"] { input[name="search"] {
border: 1px solid #CCCCCC;
border-radius: 4px; border-radius: 4px;
border: 1px solid #CCCCCC;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
padding: 6px 12px; padding: 6px 12px;
width: 200px;
vertical-align: top; vertical-align: top;
width: 200px;
}
input#button-search {
background: url('https://touchit.com.ua/static/images/icons/search-25.png') no-repeat center center;
border: none;
cursor: pointer;
height: 32px;
width: 32px;
} }
#logo { #logo {
color: #FFFFFF; color: #FFFFFF;
@ -137,23 +137,26 @@
margin-right: 10px; margin-right: 10px;
} }
#pagination { #pagination {
font-size: 16px; font-size: 16px;
list-style: none; list-style: none;
//text-align: center;
} }
#pagination a { #pagination a {
display: inline-block; display: inline-block;
padding: 2 1; text-decoration:none; padding: 2 1; text-decoration:none;
//text-align: center; }
#plus {
display: none;
}
div.post {
font-size: 16px;
} }
div.post { font-size: 16px;}
.post { .post {
background: #FFFFFF;
box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 0.005em 0.01em 0 rgba(0, 0, 0, 0.12), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box; box-sizing: border-box;
background: #FFFFFF;
color: #1a1a1a; color: #1a1a1a;
display: block; display: block;
font-family: 'Open Sans' font-family: 'Open Sans';
font-weight: 300; font-weight: 300;
line-height: 26px; line-height: 26px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
@ -165,15 +168,13 @@
margin: 5px 0 10px 0; margin: 5px 0 10px 0;
} }
.post-header a { .post-header a {
text-decoration: none;
color: #000; color: #000;
text-decoration: none;
} }
.post-header a:hover { .post-header a:hover {
color: #4a809a; color: #4a809a;
} }
.right {
float: right;
}
#posts { #posts {
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
@ -181,16 +182,17 @@
padding-right: 250px; padding-right: 250px;
width: 100%; width: 100%;
} }
.right {
float: right;
}
#search { #search {
display: block;
float: right; float: right;
font-size: 100%; font-size: 100%;
display: block;
height: 50px; height: 50px;
} }
#search-form { #search-form {
margin: 10px 10px 0 10px; margin: 10px 10px 0 10px;
//vertical-align: top;
} }
.sidemenu { .sidemenu {
box-sizing: border-box; box-sizing: border-box;
@ -199,8 +201,8 @@
width: 240px; width: 240px;
} }
.sidemenu h2 { .sidemenu h2 {
font-size: 16px;
color: #666666; color: #666666;
font-size: 16px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
} }
.sidemenu ul { .sidemenu ul {
@ -211,8 +213,8 @@
margin: 5px 0 10px; margin: 5px 0 10px;
} }
textarea{ textarea{
width: 90%;
margin:5px 10px; margin:5px 10px;
width: 90%;
} }
//button[name="action"] {display: block; float: right; margin: 1px;} //button[name="action"] {display: block; float: right; margin: 1px;}
//table { //table {
@ -220,19 +222,17 @@
//border-collapse: collapse;} //border-collapse: collapse;}
//td {padding: 2 10;} //td {padding: 2 10;}
tr:hover td { tr:hover td {
background-color: rgba(41, 128, 185, 0.1); background-color: rgba(41, 128, 185, 0.1);
} }
@media screen and (max-width: 900px) {
#plus {display: none;} #posts {padding: 0}
@media screen and (max-width: 900px) { #header {width: 100%;}
#posts {padding: 0} #search, .sidemenu {display: none}
#header {width: 100%;} #plus {
//.sidemenu {background: #F7F7F8;} color: #FFF;
#search, .sidemenu {display: none} float: right;
#plus {color: #FFF; float: right; font-size: 25px;
font-size: 25px; display: block;
display: block; margin: 12px;
//height: 30px;
margin: 12px;
} }
} }

View File

@ -37,28 +37,29 @@
</div> </div>
<div class="block"> <div class="block">
<h2>Последние</h2> <h2>Последние</h2>
<ul> <ul>
{% for i in latest %} {% for i in latest %}
<li><a href="{% url 'post_detail' pk=i.pk %}"> {{ i.title }} </a> <br> <li><a href="{% url 'post_detail' pk=i.pk %}"> {{ i.title }} </a> <br>
<div class="date"> {{ i.published_date }} </div> <div class="date"> {{ i.published_date }} </div>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
<div class="block" style="text-align: center"> <div class="block" style="text-align: center">
<h2> Теги </h2> <h2> Теги </h2>
{% for tag in cloud %} {% for tag in cloud %}
<a href="{% url 'post_list' tag=tag %}" style="font-size: {{tag.f}}px; margin: 2px ">{{ tag.name }}</a> <a href="{% url 'post_list' tag=tag %}" style="font-size: {{tag.f}}px; margin: 2px ">{{ tag.name }}</a>
{% endfor %} {% endfor %}
</div>
</div>
</div> </div>
</div> </div>
<div id="pagination"> <div id="pagination">
<p> <p>
{% if posts.has_previous %} <a href="?page={{ posts.previous_page_number }}{% if search_query != '' %}&search={{ search_query }} {% endif %}"><-предыдущая</a>{% endif %} {% if posts.has_previous %}
{% if posts.has_next %}<a href="?page={{ posts.next_page_number }}{% if search_query != '' %}&search={{ search_query }} {% endif %}">следующая-></a> {% endif %} <a href="?page={{ posts.previous_page_number }}{% if search_query != '' %}&search={{ search_query }} {% endif %}"><-предыдущая</a>
{% endif %}
{% if posts.has_next %}
<a href="?page={{ posts.next_page_number }}{% if search_query != '' %}&search={{ search_query }} {% endif %}">следующая-></a>
{% endif %}
</p> </p>
{% if posts.has_other_pages %} {% if posts.has_other_pages %}
<a href="?page=1{% if search_query != '' %}&search={{ search_query }} {% endif %}">|<<</a> <a href="?page=1{% if search_query != '' %}&search={{ search_query }} {% endif %}">|<<</a>
@ -66,26 +67,21 @@
{% if page == posts.number %} {{page}} {% if page == posts.number %} {{page}}
{% else %} <a href="?page={{page}}{% if search_query != '' %}&search={{ search_query }} {% endif %}">{{page}}</a> {% endif %} {% endfor %} {% else %} <a href="?page={{page}}{% if search_query != '' %}&search={{ search_query }} {% endif %}">{{page}}</a> {% endif %} {% endfor %}
<a href="?page={{ posts.paginator.num_pages }}{% if search_query != '' %}&search={{ search_query }} {% endif %}"> >>| </a> <a href="?page={{ posts.paginator.num_pages }}{% if search_query != '' %}&search={{ search_query }} {% endif %}"> >>| </a>
{% endif %} {% endif %}
{% comment %} {% comment %}
<ul class="menu_top paginator"> <ul class="menu_top paginator">
{% if posts.has_previous %} {% if posts.has_previous %}
<li> <a href="?page=1"><<</a> </li> <li> <a href="?page=1"><<</a> </li>
<li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li> <li> <a href="?page={{ posts.previous_page_number }}">{{ posts.previous_page_number }}</a> </li>
{% endif %} {% endif %}
{% if posts.has_other_pages %}<li> <a style="color: #000000" href="">{{ posts.number }}</a></li> {% endif %} {% if posts.has_other_pages %}<li> <a style="color: #000000" href="">{{ posts.number }}</a></li> {% endif %}
{% if posts.has_next %} {% 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 }}"> {{ 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.next_page_number|add:1 }}">{{ posts.next_page_number|add:1 }}</a></li-->
<li> <a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %} <li> <a href="?page={{ posts.paginator.num_pages }}"> >> </a></li> {% endif %}
{% endcomment %} {% endcomment %}
{% comment %} </ul>
<!--li> {% for i in posts.paginator.page_range %} </li--> </div>
{% endcomment %} </body>
</ul>
</div>
</body>
</html> </html>

View File

@ -4,31 +4,29 @@
<div class="post"> <div class="post">
<span class="delete"><a href='#deletionDialog';"><i class="fa fa-trash"></i></a></span> <span class="delete"><a href='#deletionDialog';"><i class="fa fa-trash"></i></a></span>
<span class="edit"><a href="{% url 'post_edit' pk=post.pk %}"><i class="fa fa-pencil"></i></a></span> <span class="edit"><a href="{% url 'post_edit' pk=post.pk %}"><i class="fa fa-pencil"></i></a></span>
<h1>{{ post.title }}</h1> <h1>{{ post.title }}</h1>
{% if post.published_date %}
{% if post.published_date %} <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> {% endif %}
{% endif %} {% 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 'post_list' tag=tag%}">{{ tag }}</a> <a href="{% url 'post_list' tag=tag%}">{{ tag }}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<p>{{ post.text|safe|linebreaksbr }}</p> <p>{{ post.text|safe|linebreaksbr }}</p>
<div id="deletionDialog" class="dialog">
<div id="deletionDialog" class="dialog"> <div>
<div> <a class="close" href="">x</a>
<a class="close" href="">x</a> <span style="margin: auto">Удалить пост "{{ post.title }}"? </span>
<span style="margin: auto">Удалить пост "{{ post.title }}"? </span> <form method="POST" >{% csrf_token %}
<form method="POST" >{% csrf_token %} <input type=hidden name="id" value="{{ post.pk }}">
<input type=hidden name="id" value="{{ post.pk }}"> <input type="submit" name="action" value="delete" onclick="location.href = '#'">
<input type="submit" name="action" value="delete" onclick="location.href = '#'"> <input type="button" value="cancel" onclick="location.href='#'">
<input type="button" value="cancel" onclick="location.href='#'"> </form>
</form> </div>
</div> </div>
</div>
</div> </div>
{% endblock %} {% endblock %}