Merge pull request #32 from LQDJudge/new_actionBar
add function share , comment button and write comments
This commit is contained in:
commit
a5c045986b
3 changed files with 54 additions and 34 deletions
|
@ -17,7 +17,7 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{% if not hide_actionbar_comment %}
|
{% if not hide_actionbar_comment %}
|
||||||
<span class="actionbar-block">
|
<span class="actionbar-block" id="comment-button">
|
||||||
<span class="actionbar-button">
|
<span class="actionbar-button">
|
||||||
<i class="fa fa-comment-o" style="font-size: large;"></i>
|
<i class="fa fa-comment-o" style="font-size: large;"></i>
|
||||||
<span class="actionbar-text">{{_("Comment")}}</span>
|
<span class="actionbar-text">{{_("Comment")}}</span>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<span class="actionbar-text">{{_("Bookmark")}}</span>
|
<span class="actionbar-text">{{_("Bookmark")}}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="actionbar-block">
|
<span class="actionbar-block" id="share-button" >
|
||||||
<span class="actionbar-button">
|
<span class="actionbar-button">
|
||||||
<i class="fa fa-share" style="font-size: large;"></i>
|
<i class="fa fa-share" style="font-size: large;"></i>
|
||||||
<span class="actionbar-text">{{_("Share")}}</span>
|
<span class="actionbar-text">{{_("Share")}}</span>
|
||||||
|
|
|
@ -1,5 +1,36 @@
|
||||||
<div id="comments" class="comment-area">
|
<div id="comments" class="comment-area">
|
||||||
<h2 id="comment-header"><i style="padding-right: 0.3em" class="fa fa-comments"></i>{{ _('Comments') }}</h2>
|
<h2 id="comment-header"><i style="padding-right: 0.3em" class="fa fa-comments"></i>{{ _('Comments') }}</h2>
|
||||||
|
<p> <a href="" id="write-comments" > Write comments </a> </p>
|
||||||
|
{% if request.user.is_authenticated and comment_form and not comment_lock %}
|
||||||
|
<div id="new-comment" class="form-area comment-submit" style="display: none;" >
|
||||||
|
{% block comment_submit_title %}
|
||||||
|
<h3>{{ _('New comment') }}</h3>
|
||||||
|
<hr>
|
||||||
|
{% endblock %}
|
||||||
|
{% if is_new_user %}
|
||||||
|
<div style="margin-bottom: 0" class="alert alert-info">
|
||||||
|
{{ _('You need to have solved at least one problem before your voice can be heard.') }}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<form class="comment-submit-form" action="" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{% if comment_form.errors %}
|
||||||
|
<div id="form-errors">
|
||||||
|
{{ comment_form.non_field_errors() }}
|
||||||
|
{{ comment_form.parent.errors }}
|
||||||
|
{% if comment_form.body.errors %}{{ _('Invalid comment body.') }}{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{{ comment_form.parent }}
|
||||||
|
<div class="comment-post-wrapper">
|
||||||
|
<div id="comment-form-body">{{ comment_form.body }}</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<input style="float:right" type="submit" value="{{ _('Post!') }}" class="button">
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if has_comments %}
|
{% if has_comments %}
|
||||||
<ul class="comments top-level-comments new-comments">
|
<ul class="comments top-level-comments new-comments">
|
||||||
{% set logged_in = request.user.is_authenticated %}
|
{% set logged_in = request.user.is_authenticated %}
|
||||||
|
@ -121,37 +152,6 @@
|
||||||
<p class="no-comments-message">{{ _('There are no comments at the moment.') }}</p>
|
<p class="no-comments-message">{{ _('There are no comments at the moment.') }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.user.is_authenticated and comment_form and not comment_lock %}
|
|
||||||
<div id="new-comment" class="form-area comment-submit">
|
|
||||||
{% block comment_submit_title %}
|
|
||||||
<h3>{{ _('New comment') }}</h3>
|
|
||||||
<hr>
|
|
||||||
{% endblock %}
|
|
||||||
{% if is_new_user %}
|
|
||||||
<div style="margin-bottom: 0" class="alert alert-info">
|
|
||||||
{{ _('You need to have solved at least one problem before your voice can be heard.') }}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<form class="comment-submit-form" action="" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
{% if comment_form.errors %}
|
|
||||||
<div id="form-errors">
|
|
||||||
{{ comment_form.non_field_errors() }}
|
|
||||||
{{ comment_form.parent.errors }}
|
|
||||||
{% if comment_form.body.errors %}{{ _('Invalid comment body.') }}{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{{ comment_form.parent }}
|
|
||||||
<div class="comment-post-wrapper">
|
|
||||||
<div id="comment-form-body">{{ comment_form.body }}</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<input style="float:right" type="submit" value="{{ _('Post!') }}" class="button">
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if comment_lock %}
|
{% if comment_lock %}
|
||||||
<div class="alert alert-warning comment-lock">
|
<div class="alert alert-warning comment-lock">
|
||||||
{{ _('Comments are disabled on this page.') }}
|
{{ _('Comments are disabled on this page.') }}
|
||||||
|
|
|
@ -211,6 +211,26 @@
|
||||||
$comment.find('.comment-body').show();
|
$comment.find('.comment-body').show();
|
||||||
$comment.find('.bad-comment-body').hide();
|
$comment.find('.bad-comment-body').hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$("#share-button").click( function() {
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(window.location.href)
|
||||||
|
.then( () => {
|
||||||
|
alert("Copied link to this post");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#write-comments").click( function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#new-comment").show("slow");
|
||||||
|
$("#write-comments").hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#comment-button').click( function() {
|
||||||
|
$('#comment-section').show();
|
||||||
|
$('#comment-announcement').hide();
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endcompress %}
|
{% endcompress %}
|
||||||
|
|
Loading…
Reference in a new issue