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. 58
      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,6 +9,10 @@
<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>
@ -43,7 +47,7 @@
<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> </div>
<p style="text-align: justify" align="justify">&nbsp;</p> <p style="text-align: justify" align="justify">&nbsp;</p>
@ -51,26 +55,26 @@
<div class="article_image"> <div class="article_image">
<img src="{% thumbnail object.logo '935' %}" alt="{{ object.main_title }}"> <img src="{% thumbnail object.logo '935' %}" alt="{{ object.main_title }}">
</div> </div>
<div class="content-text"> <div class="content-text new_article">
<ul class="orange"> {# <ul class="orange">#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
</ul> {# </ul>#}
{##}
<ul class="checked"> {# <ul class="checked">#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
</ul> {# </ul>#}
{##}
<ol class="numeric"> {# <ol class="numeric">#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
<li>fgreger</li> {# <li>fgreger</li>#}
</ol> {# </ol>#}
{{ object.description|safe }} {{ object.description|safe }}
</div> </div>
@ -147,7 +151,7 @@
{{ comment.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ comment.created }}</time> {{ comment.user.get_full_name }} <time><i class="fa fa-calendar"></i> {{ comment.created }}</time>
</div> </div>
<div class="comment_text">{{ comment.text }}</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> <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 %} {% for answer in comment.childs %}
<div class="comment"> <div class="comment">
@ -164,9 +168,11 @@
<div class="сomment_form"> <div class="сomment_form">
<form action="." method="post" id="comment_form"> <form action="." method="post" id="comment_form">
{% csrf_token %} {% csrf_token %}
{# {{ commentform.as_p }}#} <p>
<p><label for="id_text">Сообщение:</label><textarea cols="40" id="id_text" name="text" rows="10"></textarea></p> <textarea cols="40" id="id_text" name="text" rows="10"></textarea>
<button type="submit">Отправить</button>
<button type="submit" class="button">Отправить</button>
</p>
</form> </form>
</div> </div>
{% else %} {% else %}
@ -196,6 +202,6 @@
</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