Commit f90776b1 by tasawernawaz

Fix js issue on comment page

ECOM-6579
parent 82d7c4f9
$(document).ready(function() {
var box = $('#id_comment');
$("#id_submit").click(function(event){
if( !box.val() ) {
box.addClass('has-error');
box.focus();
}
else{
$("#frm_comment").submit();
}
});
});
{% load i18n %} {% load i18n %}
{% load staticfiles %}
{% load comments %} {% load comments %}
{% if user.is_authenticated and comment_object %} {% if user.is_authenticated and comment_object %}
<div class="comments-container"> <div class="comments-container">
<p>{% trans 'Add new comment' %}</p> <p>{% trans 'Add new comment' %}</p>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{{ form.object_pk }} {{ form.object_pk }}
{{ form.timestamp }} {{ form.timestamp }}
{{ form.security_hash }} {{ form.security_hash }}
<input type="hidden" name="next" value="{{ comment_object.post_back_url }}"/> <input type="hidden" name="next" value="{% url 'publisher:publisher_course_run_detail' object.id %}"/>
<div> <div>
<input type="button" value="Add comment" id="id_submit" class="btn-brand btn-base" /> <input type="button" value="Add comment" id="id_submit" class="btn-brand btn-base" />
</div> </div>
...@@ -21,21 +21,3 @@ ...@@ -21,21 +21,3 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
var box = $('#id_comment');
$("#id_submit").click(function(event){
if( !box.val() ) {
box.addClass('has-error');
box.focus();
}
else{
$("#frm_comment").submit();
}
});
});
</script>
{% endblock %}
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
{% block extra_js %} {% block extra_js %}
<script src="{% static 'bower_components/clipboard/dist/clipboard.min.js' %}"></script> <script src="{% static 'bower_components/clipboard/dist/clipboard.min.js' %}"></script>
<script src="{% static 'js/publisher/publisher.js' %}"></script> <script src="{% static 'js/publisher/publisher.js' %}"></script>
<script src="{% static 'js/publisher/comments.js' %}"></script>
<script> <script>
new Clipboard(".btn-copy", { new Clipboard(".btn-copy", {
text: function(trigger) { text: function(trigger) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment