article + conference comments and article fixes

remotes/origin/stage6
ya_dim4ik 9 years ago
parent 746ee9e780
commit 3d6724090b
  1. 29
      static/ckeditor/ckeditor/styles.js
  2. 60
      static/client/css/main.css
  3. 2
      static/client/css_min/main.min.css
  4. 60
      static/client/js/comments.js
  5. 326
      templates/client/article/article.html
  6. 60
      templates/client/includes/conference/conference_partner.html

@ -43,6 +43,17 @@ CKEDITOR.stylesSet.add( 'default', [
} }
}, },
{
name: 'White Container',
element: 'div',
attributes: {'class': 'white_block'}
// styles: {
// padding: '5px 10px',
// background: '#eee',
// border: '1px solid #ccc'
// }
},
/* Inline Styles */ /* Inline Styles */
// These are core styles available as toolbar buttons. You may opt enabling // These are core styles available as toolbar buttons. You may opt enabling
@ -86,6 +97,24 @@ CKEDITOR.stylesSet.add( 'default', [
attributes: { 'class': 'left' } attributes: { 'class': 'left' }
}, },
{
name: 'Marker: Orange',
element: 'ul',
attributes: {'class': 'orange'}
},
{
name: 'Marker: Checkbox',
element: 'ul',
attributes: {'class': 'checked'}
},
{
name: 'Marker: Grey numbers',
element: 'ol',
attributes: {'class': 'numeric'}
},
{ {
name: 'Styled image (right)', name: 'Styled image (right)',
element: 'img', element: 'img',

@ -13129,6 +13129,7 @@ button.gray:hover {
border-bottom: 1px dashed #cccccc; border-bottom: 1px dashed #cccccc;
margin: 15px -20px 0; margin: 15px -20px 0;
padding: 10px 20px; padding: 10px 20px;
background-color: #fff;
} }
.article_sharing .sharing_block{ .article_sharing .sharing_block{
@ -13136,6 +13137,20 @@ button.gray:hover {
vertical-align: middle; vertical-align: middle;
} }
.article_sharing .sharing_block .social-likes{
padding: 0;
}
.article_sharing h5{
display: inline-block;
vertical-align: middle;
margin: 0;
font-size: 14px;
font-weight: 500;
color: #999999;
margin-right: 10px;
}
.filter_form{ .filter_form{
background-color: #fff; background-color: #fff;
border-radius: 3px; border-radius: 3px;
@ -13351,10 +13366,6 @@ ul.checked{
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB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+7fAAABq0lEQVR42qzUO0ibURjG8URihSraC0gFpSCuCrVegnaoF8Sl4FCRiuBmRaSQENDNRekggnXwMlQFxcFBEVsRrHERoRoXRdtBvICDUMwidJBC+j/yBE4ODaaQAz++c97vyxPek/PFG4lEPGkYPvh9aQh6gWnE4mHPUI0j1OMWYTTrftiqz6rmRRBDuECjCXuNZSzh2hTxGweam3Gs+Y3CsnV9ixM04NLLnh0ymcB4im0VYgXl+IUaBd5t3Ccs/sf+fEWBWm6JB5mRgW481LoDT5MEVWFTQWb0YMd+wIS91B7MYw77qHCCXmEDj7WewWfUumH96v1KtefYxnutS/EFuVr/QK+Cn7hhXchBCCOqZ2ESC1hDnup/0Klfu03HJeHkFuvqUaD5goDW75x2h7Gn+SPku2GmnahVC+oacILOMGit17Hrttln7YcdOOrUQmovPvx444bZbSYL/K63xB4ptRkfMQWad3BLa899bbajKMlBjWnvVv9xrw6VbtgpplCGBzo/poVMa+6z5uaZVgzogCeEfcBPjOlfwLR8jibNo069BB/1uW922F8BBgAx/1yfsUyMnAAAAABJRU5ErkJggg==');
} }
ul.checked li{
line-height: 19px;
}
ol.numeric{ ol.numeric{
counter-reset: myCounter; counter-reset: myCounter;
padding-left: 25px; padding-left: 25px;
@ -13362,7 +13373,7 @@ ol.numeric{
ol.numeric li{ ol.numeric li{
list-style: none; list-style: none;
line-height: 18px; /*line-height: 18px;*/
} }
ol.numeric li:before { ol.numeric li:before {
@ -13470,6 +13481,10 @@ blockquote{
margin-bottom: 30px; margin-bottom: 30px;
} }
.article_comments form button{
margin-top: 15px;
}
.comment{ .comment{
padding: 20px; padding: 20px;
} }
@ -13926,6 +13941,15 @@ blockquote{
padding: 4px; padding: 4px;
} }
.conf_comments{
padding-top: 30px;
font-family: dindisplay_pro, sans-serif;
}
.conf_comments h2{
font: 500 28px dindisplay_pro;
}
.conf_comments .сomment_form{ .conf_comments .сomment_form{
border-top: 1px dotted #cccccc; border-top: 1px dotted #cccccc;
border-bottom: 1px dotted #cccccc; border-bottom: 1px dotted #cccccc;
@ -13980,4 +14004,30 @@ blockquote{
color: #FF6600; color: #FF6600;
} }
.conf_sharing{
text-align: center;
padding-top: 20px;
}
.conf_sharing .social-likes__button{
border-radius: 3px;
font-weight: 500;
}
.new_article{
font-size: 16px;
line-height: 28px;
}
.white_block{
background-color: #fff;
border-top: 1px dashed #cccccc;
border-bottom: 1px dashed #cccccc;
}
.new_article .white_block{
margin-left: -20px;
margin-right: -20px;
padding: 0 20px;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,60 @@
$(function () {
var $comment_form = $('#comment_form');
$('.reply_comment').on('click', function (e) {
e.preventDefault();
$('#parent_comment_id').remove();
$('#delete_parent').remove();
var $parent = $('<input type="hidden" name="parent" id="parent_comment_id" value="' + $(this).data('parent') + '">'),
$delete_parent = $('<a href="#" id="delete_parent" class="delete_parent"> &times; <i>' + $(this).data('user') + '</i></a>');
$comment_form.prepend($parent);
$comment_form.find('button').after($delete_parent);
$('html, body').animate({
scrollTop: $comment_form.offset().top - 20
});
$comment_form.find('textarea').trigger('focus');
});
$comment_form.on('click', '#delete_parent', function (e) {
e.preventDefault();
$('#parent_comment_id').remove();
$(this).remove();
});
$comment_form.on('submit', function (e) {
e.preventDefault();
$comment_form.find('.error').removeClass('error');
$.ajax({
url: $comment_form.attr('action'),
type: $comment_form.attr('method'),
data: $comment_form.serializeArray(),
beforeSend: function () {
$comment_form.find('button').attr('disabled', true);
},
success: function (response) {
console.log(response);
if (response.success) {
$comment_form.find('[name="parent"]').remove();
$comment_form[0].reset();
window.location.reload();
}
if (response.errors) {
$.each(response.errors, function (i, err) {
$comment_form.find('#id_' + i).addClass('error');
});
}
},
complete: function () {
$comment_form.find('button').attr('disabled', false);
}
});
});
});

@ -9,193 +9,199 @@
<meta property="og:url" content="{{ request.build_absolute_uri }}"> <meta property="og:url" content="{{ request.build_absolute_uri }}">
{% endblock %} {% endblock %}
{% block head_scripts %}
<script src="{% static 'client/js/comments.js' %}"></script>
{% endblock %}
{% block bread_scrumbs %} {% block bread_scrumbs %}
<div class="bread-crumbs"> <div class="bread-crumbs">
<a href="/">{% trans 'Главная страница' %}</a> <a href="/">{% trans 'Главная страница' %}</a>
<a href="/blogs/">{% trans 'Статьи' %}</a> <a href="/blogs/">{% trans 'Статьи' %}</a>
<strong>{{ object.main_title }}</strong> <strong>{{ object.main_title }}</strong>
</div> </div>
{% endblock %} {% endblock %}
{% block page_title %} {% block page_title %}
{% endblock %} {% endblock %}
{% block content_list %} {% block content_list %}
<div class="m-article cl-news blog_block"> <div class="m-article cl-news blog_block">
<div class="blog_block_headline full_width"> <div class="blog_block_headline full_width">
<!--{% include 'client/includes/article/article_logo.html' with obj=object %}--> <!--{% include 'client/includes/article/article_logo.html' with obj=object %}-->
<h1>{{ object.main_title }}</h1> <h1>{{ object.main_title }}</h1>
<ul class="article_info"> <ul class="article_info">
<li><i class="fa fa-user"></i> Мануковская</li> <li><i class="fa fa-user"></i> Мануковская</li>
<li><i class="fa fa-calendar"></i> {{ object.publish_date|date:"d E Y" }}</li> <li><i class="fa fa-calendar"></i> {{ object.publish_date|date:"d E Y" }}</li>
<li>Раздел: <a href="#">Event-индустрия</a></li> <li>Раздел: <a href="#">Event-индустрия</a></li>
</ul> </ul>
<!--<strong><span>{{ object.publish_date|date:"d E Y" }}</span></strong>--> <!--<strong><span>{{ object.publish_date|date:"d E Y" }}</span></strong>-->
{% if object.theme.all.exists %} {% if object.theme.all.exists %}
<div class="article_tags"> <div class="article_tags">
Теги: {% include 'client/includes/article_theme.html' with obj=object %} Теги: {% include 'client/includes/article_theme.html' with obj=object %}
</div> </div>
{% endif %} {% endif %}
{% if request.user.is_admin %} {% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a> <a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %} {% endif %}
<div class="article_sharing"> <div class="article_sharing">
{% trans 'Поделитесь статьей с коллегами:' %} <h5>{% trans 'Поделитесь статьей с коллегами:' %}</h5>
{% include "client/includes/sharing_block.html" %} {% include "client/includes/sharing_block.html" %}
</div>
<p style="text-align: justify" align="justify">&nbsp;</p>
</div> </div>
<p style="text-align: justify" align="justify">&nbsp;</p> <div class="article_image">
</div> <img src="{% thumbnail object.logo '935' %}" alt="{{ object.main_title }}">
<div class="article_image"> </div>
<img src="{% thumbnail object.logo '935' %}" alt="{{ object.main_title }}"> <div class="content-text new_article">
</div> {# <ul class="orange">#}
<div class="content-text"> {# <li>fgreger</li>#}
<ul class="orange"> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# </ul>#}
<li>fgreger</li> {##}
</ul> {# <ul class="checked">#}
{# <li>fgreger</li>#}
<ul class="checked"> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# </ul>#}
<li>fgreger</li> {##}
</ul> {# <ol class="numeric">#}
{# <li>fgreger</li>#}
<ol class="numeric"> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# </ol>#}
<li>fgreger</li>
</ol> {{ object.description|safe }}
{{ object.description|safe }}
</div>
<div class="full_sharing">
{% include 'client/includes/sharing_block_full.html' %}
</div>
<div class="blog_avtor">
{# <i>{% trans 'Источник' %}: {{ object.author }}</i> #}
{% if object.tag.all.exists %}
<div class="blog_avtor_right">
{% include 'includes/article_tags.html' with obj=object %}
</div> </div>
{% endif %}
<div class="clear"></div> <div class="full_sharing">
</div> {% include 'client/includes/sharing_block_full.html' %}
</div>
<div class="blog_avtor">
{# <i>{% trans 'Источник' %}: {{ object.author }}</i> #}
{% if object.tag.all.exists %}
<div class="blog_avtor_right">
{% include 'includes/article_tags.html' with obj=object %}
</div>
{% endif %}
<div class="article_author"> <div class="clear"></div>
<div class="author">
{# для thumbnail '148x148' crop="center" #}
{% thumbnail object.author_s.photo '148x148' crop="center" as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
<h4>{{ object.author_s.fullname }}</h4>
<i>{{ object.author_s.position|default:'' }}</i>
<ul>
{% if object.author_s.email %}
<li><i class="fa fa-envelope"></i> <a href="mailto:{{ object.author_s.email }}">{{ object.author_s.email }}</a></li>
{% endif %}
<li>
{# <a href="#"><i class="fa fa-rss-square"></i></a>#}
{% if object.author_s.fb %}
<a href="{{ object.author_s.fb }}"><i class="fa fa-facebook-square"></i></a>
{% endif %}
{% if object.author_s.linkedin %}
<a href="{{ object.author_s.linkedin }}"><i class="fa fa-linkedin-square"></i></a>
{% endif %}
</li>
</ul>
</div>
<div class="author_about">
{{ object.author_s.about|safe }}
</div> </div>
</div>
{% if object.get_similar %} <div class="article_author">
<div class="recommended_articles"> <div class="author">
<h2>{% trans 'Рекомендуемые статьи' %}</h2> {# для thumbnail '148x148' crop="center" #}
<div class="articles"> {% thumbnail object.author_s.photo '148x148' crop="center" as im %}
{% for sim in object.get_similar %} <img src="{{ im.url }}" alt="">
<div class="article"> {% endthumbnail %}
{# thumbnail '217x148' crop="center" #} <h4>{{ object.author_s.fullname }}</h4>
{% thumbnail sim.logo '217x148' crop="center" as im %} <i>{{ object.author_s.position|default:'' }}</i>
<img src="{{ im.url }}" alt=""> <ul>
{% endthumbnail %} {% if object.author_s.email %}
<a href="{{ sim.get_permanent_url }}">{{ sim.main_title }}</a> <li><i class="fa fa-envelope"></i> <a href="mailto:{{ object.author_s.email }}">{{ object.author_s.email }}</a></li>
<time><i class="fa fa-calendar"></i> {{ sim.publish_date|date:"d E Y" }}</time> {% endif %}
<p>{{ sim.preview }}</p> <li>
</div> {# <a href="#"><i class="fa fa-rss-square"></i></a>#}
{% endfor %} {% if object.author_s.fb %}
<a href="{{ object.author_s.fb }}"><i class="fa fa-facebook-square"></i></a>
{% endif %}
{% if object.author_s.linkedin %}
<a href="{{ object.author_s.linkedin }}"><i class="fa fa-linkedin-square"></i></a>
{% endif %}
</li>
</ul>
</div>
<div class="author_about">
{{ object.author_s.about|safe }}
</div> </div>
</div> </div>
{% endif %}
<div class="article_comments">
<h2>{% trans 'Комментарии' %}</h2>
{% for comment in comments %}
<div class="comment">
<div class="comment_author">
{{ comment.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ comment.created }}</time>
</div>
<div class="comment_text">{{ comment.text }}</div>
<a href="#" data-parent="{{ comment.pk }}" class="reply_comment"><i class="fa fa-comment"></i> <span>{% trans "Ответить на комментарий" %}</span></a>
{% for answer in comment.childs %}
<div class="comment"> {% if object.get_similar %}
<div class="comment_author"> <div class="recommended_articles">
{{ answer.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ answer.created }}</time> <h2>{% trans 'Рекомендуемые статьи' %}</h2>
<div class="articles">
{% for sim in object.get_similar %}
<div class="article">
{# thumbnail '217x148' crop="center" #}
{% thumbnail sim.logo '217x148' crop="center" as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
<a href="{{ sim.get_permanent_url }}">{{ sim.main_title }}</a>
<time><i class="fa fa-calendar"></i> {{ sim.publish_date|date:"d E Y" }}</time>
<p>{{ sim.preview }}</p>
</div> </div>
<div class="comment_text">{{ answer.text }}</div> {% endfor %}
</div> </div>
{% endfor %}
</div>
{% endfor %}
{% if user.is_authenticated %}
<div class="сomment_form">
<form action="." method="post" id="comment_form">
{% csrf_token %}
{# {{ commentform.as_p }}#}
<p><label for="id_text">Сообщение:</label><textarea cols="40" id="id_text" name="text" rows="10"></textarea></p>
<button type="submit">Отправить</button>
</form>
</div> </div>
{% else %}
<p>{% trans 'Для отправки комментариев авторизуйтесь.' %}</p>
{% endif %} {% endif %}
<div class="article_comments">
<h2>{% trans 'Комментарии' %}</h2>
{% for comment in comments %}
<div class="comment">
<div class="comment_author">
{{ comment.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ comment.created }}</time>
</div>
<div class="comment_text">{{ comment.text }}</div>
<a href="#" data-parent="{{ comment.pk }}" data-user="{{ comment.user.get_full_name }}" class="reply_comment"><i class="fa fa-comment"></i> <span>{% trans "Ответить на комментарий" %}</span></a>
{% for answer in comment.childs %}
<div class="comment">
<div class="comment_author">
{{ answer.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ answer.created }}</time>
</div>
<div class="comment_text">{{ answer.text }}</div>
</div>
{% endfor %}
</div>
{% endfor %}
{% if user.is_authenticated %}
<div class="сomment_form">
<form action="." method="post" id="comment_form">
{% csrf_token %}
<p>
<textarea cols="40" id="id_text" name="text" rows="10"></textarea>
<button type="submit" class="button">Отправить</button>
</p>
</form>
</div>
{% else %}
<p>{% trans 'Для отправки комментариев авторизуйтесь.' %}</p>
{% endif %}
</div>
</div> </div>
</div>
{% with blogs=object.similars %}
{% with blogs=object.similars %} {% if blogs %}
{% if blogs %} <div class="rq-to-hide">
<div class="rq-to-hide"> <div class="s-comments">
<div class="s-comments"> <div class="sect-title blog_link">{% trans 'Похожие статьи' %}<a class="button more" href="/blogs/">{% trans 'Все статьи' %}</a></div>
<div class="sect-title blog_link">{% trans 'Похожие статьи' %}<a class="button more" href="/blogs/">{% trans 'Все статьи' %}</a></div> <div class="cat-list sc-comments">
<div class="cat-list sc-comments"> {% for blog in blogs %}
{% for blog in blogs %} <div class="cl-item">
<div class="cl-item"> <div class="acticle_list">
<div class="acticle_list"> <a href="{{ blog.get_permanent_url }}" title="">{% include 'includes/show_logo.html' with obj=blog %}</a>
<a href="{{ blog.get_permanent_url }}" title="">{% include 'includes/show_logo.html' with obj=blog %}</a> <h3><a href="{{ blog.get_permanent_url }}" title="">{{ blog.main_title }}</a></h3>
<h3><a href="{{ blog.get_permanent_url }}" title="">{{ blog.main_title }}</a></h3> <p>{{ blog.preview }}</p>
<p>{{ blog.preview }}</p> <strong><span>{{ blog.publish_date|date:"d E Y" }}</span><a href="{{ blog.author.get_permanent_url }}" title=""><i>{% trans "Евгения Булавина" %}</i></a></strong>
<strong><span>{{ blog.publish_date|date:"d E Y" }}</span><a href="{{ blog.author.get_permanent_url }}" title=""><i>{% trans "Евгения Булавина" %}</i></a></strong> </div>
</div> </div>
{% endfor %}
</div> </div>
{% endfor %}
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %} {% endwith %}
{% endwith %} {% endblock %}
{% endblock %}

@ -429,6 +429,10 @@
<p>{% trans 'Для отправки комментариев авторизуйтесь.' %}</p> <p>{% trans 'Для отправки комментариев авторизуйтесь.' %}</p>
{% endif %} {% endif %}
</div> </div>
<div class="conf_sharing">
{% include 'client/includes/sharing_block_full.html' %}
</div>
</div> </div>
{% include 'client/includes/booking_block.html' with city=event.city place=event.place event=event %} {% include 'client/includes/booking_block.html' with city=event.city place=event.place event=event %}
@ -552,6 +556,7 @@
</script> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js"></script>
<script src="{% static 'client/js/comments.js' %}"></script>
<script> <script>
$(window).load(function(){ $(window).load(function(){
$('.speakers_slider').slick({ $('.speakers_slider').slick({
@ -578,60 +583,5 @@
focusOnSelect: true focusOnSelect: true
}); });
}); });
var $comment_form = $('#comment_form');
$('.reply_comment').on('click', function (e) {
e.preventDefault();
var $parent = $('<input type="hidden" name="parent" id="parent_comment_id" value="' + $(this).data('parent') + '">'),
$delete_parent = $('<a href="#" class="delete_parent"> &times; <i>' + $(this).data('user') + '</i></a>');
$comment_form.prepend($parent);
$comment_form.find('button').after($delete_parent);
$('html, body').animate({
scrollTop: $comment_form.offset().top - 20
});
$comment_form.find('textarea').trigger('focus');
});
$comment_form.on('click', '.delete_parent', function (e) {
e.preventDefault();
$('#parent_comment_id').remove();
$(this).remove();
});
$comment_form.on('submit', function (e) {
e.preventDefault();
$comment_form.find('.error').removeClass('error');
$.ajax({
url: $comment_form.attr('action'),
type: $comment_form.attr('method'),
data: $comment_form.serializeArray(),
beforeSend: function () {
$comment_form.find('button').attr('disabled', true);
},
success: function (response) {
console.log(response);
if (response.success){
$comment_form.find('[name="parent"]').remove();
$comment_form[0].reset();
}
if (response.errors){
$.each(response.errors, function (i, err) {
$comment_form.find('#id_' + i).addClass('error');
});
}
},
complete: function () {
$comment_form.find('button').attr('disabled', false);
}
});
});
</script> </script>
{% endblock %} {% endblock %}

Loading…
Cancel
Save