diff options
author | Jayaram Pai | 2013-12-09 12:47:18 +0530 |
---|---|---|
committer | Jayaram Pai | 2013-12-09 12:47:18 +0530 |
commit | 0dd964ec05401809a408ab55d5517d3b2fba3a85 (patch) | |
tree | 805c74ea457c551cea557be39d16fb91d42cea9f /static/website/templates | |
parent | b596364cf3f871887cce519291b684341cc5c014 (diff) | |
download | FOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.tar.gz FOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.tar.bz2 FOSSEE-Forum-0dd964ec05401809a408ab55d5517d3b2fba3a85.zip |
reply edit with no ajax
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/ajax-similar-questions.html | 23 | ||||
-rw-r--r-- | static/website/templates/base.html | 34 | ||||
-rw-r--r-- | static/website/templates/get-question.html | 22 | ||||
-rw-r--r-- | static/website/templates/new-question.html | 33 |
4 files changed, 96 insertions, 16 deletions
diff --git a/static/website/templates/ajax-similar-questions.html b/static/website/templates/ajax-similar-questions.html new file mode 100644 index 0000000..64f194f --- /dev/null +++ b/static/website/templates/ajax-similar-questions.html @@ -0,0 +1,23 @@ +<div> +<div id="similar-count"> + {% if questions.count > 0 %} + {% if questions.count == 1 %} + 1 similar question + {% else %} + {{ questions.count }} similar questions + {% endif %} + {% endif %} +</div> +<br> +<table class="table table-bordered table-hover"> +{% for question in questions %} + <tr> + <td> + <a href="{% url 'website:get_question' question.id %}" target="_blank"> + {{ question.title }} + </a> + </td> + </tr> +{% endfor %} +</table> +</div> <!-- /div for ajax --> diff --git a/static/website/templates/base.html b/static/website/templates/base.html index f7e2ac5..5e397e8 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -18,23 +18,42 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" href="{% url 'website:home' %}">Spoken Tutorial Forums</a> + <a class="navbar-brand" href="{% url 'website:home' %}"> + Spoken Tutorial Forums + </a> </div> <!-- /.navbar-header --> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> - <li><a href="{% url 'website:new_question' %}">Ask Question</a></li> + <li> + <a href="{% url 'website:new_question' %}"> + <span class="glyphicon glyphicon-pencil"></span> + Ask Question + </a> + </li> + {% if user.is_authenticated %} <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> + <span class="glyphicon glyphicon-user"></span> + {{ user }}<b class="caret"></b> + </a> <ul class="dropdown-menu"> - <li><a href="#">Action</a></li> - <li><a href="#">Another action</a></li> - <li><a href="#">Something else here</a></li> + <li><a href="#">My Questions</a></li> + <li><a href="#">My Replies</a></li> + <li><a href="#">Notifications</a></li> <li class="divider"></li> - <li><a href="#">Separated link</a></li> + <li><a href="{% url 'user_logout' %}">Logout</a></li> </ul> </li> <!-- /li.dropdown --> + {% else %} + <li> + <a href="{% url 'user_login' %}"> + <span class="glyphicon glyphicon-user"></span> + Login + </a> + </li> + {% endif %} </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> @@ -62,7 +81,6 @@ <script src="{% static 'website/js/jquery.min.js' %}"></script> <script src="{% static 'website/js/bootstrap.min.js' %}"></script> - <script src="{% static 'website/js/custom.js' %}"></script> {% block javascript %} <!-- overide with custom javascript --> {% endblock %} diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index f6280cf..5e68aed 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -59,16 +59,29 @@ </div> <!-- /.question --> <h4><u>Answers:</u></h4> + +<div id="replyPanelWrapper" style="display:none;"> + <div id="replyNicPanel" style="display:none;"></div> +</div> + {% for reply in replies %} - <div class="reply"> - <span class="body"> + <div class="reply {% ifequal reply.uid|stringformat:'s' user.id|stringformat:'s' %}editable{% endifequal %}"> + + <div class="body" id="body{{ reply.id }}"> {{ reply.body|safe }} - </span> + </div> <span class="user"> {{ reply.user }} </span> - </div> + + {% ifequal reply.uid|stringformat:'s' user.id|stringformat:'s' %} + <span class="modify" style="display:block"> + <a class="edit btn btn-xs btn-info vs" href="#body{{ reply.id}}" data-target="body{{ reply.id }}">Edit</a> + <a id="save-{{ question.id }}" class="save btn btn-xs btn-success vs" href="#" data-target="body{{ reply.id }}">Save</a> + </span> + {% endifequal %} + </div> <!-- /.reply --> {% endfor %} <form action="{% url 'website:question_reply' %}" method="POST"> {% csrf_token %} @@ -102,6 +115,7 @@ {% ifequal question.user|stringformat:"s" user|stringformat:"s" %} <script src="{% static 'website/js/thread-user.js' %}"></script> {% else %} + <script src="{% static 'website/js/thread-user.js' %}"></script> <script type="text/javascript"> $(document).ready(function() { $(".question .body").removeAttr("id"); diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html index 70d8349..d14c956 100644 --- a/static/website/templates/new-question.html +++ b/static/website/templates/new-question.html @@ -5,7 +5,6 @@ <h4> <span class="glyphicon glyphicon-pencil"> </span> Create a new question . . . - user is {{ user }} </h4> <hr> <form role="form" action="" method="POST">{% csrf_token %} @@ -16,10 +15,10 @@ <img id="ajax-loader" src="{% static 'website/images/ajax-loader.gif' %}" style="display:none;"> </p> <div class="row"> - <div class="col-lg-3 col-md-4 col-sm-4"> + <div class="col-lg-3 col-md-3 col-sm-3"> {% render_field form.category class+="form-control"%} </div> - <div class="col-lg-3 col-md-4 col-sm-4"> + <div class="col-lg-3 col-md-3 col-sm-3"> {% render_field form.tutorial class+="form-control" disabled="disabled" %} </div> <div class="col-lg-2 col-md-2 col-sm-2"> @@ -28,12 +27,19 @@ <div class="col-lg-2 col-md-2 col-sm-2"> {% render_field form.second_range class+="form-control" disabled="disabled" %} </div> + <div class="col-lg-2 col-md-2 col-sm-2"> + <small><strong> + <a id="similar-link" data-toggle="modal" data-target="#similarModal" href="#"> + 0 similar questions + </a> + </strong></small> + </div> </div> <hr> <p>Please enter your question details.</p> <div class="row"> - <div class="col-lg-10"> + <div class="col-lg-12"> <div class="form-group"> <label for="id_title">Title:</label> {% render_field form.title class+="form-control" %} @@ -48,6 +54,21 @@ {% endwith %} </form> + <!-- Modal --> + <div class="modal fade" id="similarModal" tabindex="-1" role="dialog" aria-labelledby="similarModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">Similar Questions</h4> + </div> + <div class="modal-body"> + ... + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> + </div><!-- /.modal --> + <script src="{% static 'website/js/nicEdit.js' %}" type="text/javascript"></script> <script type="text/javascript"> bkLib.onDomLoaded(function() { @@ -58,3 +79,7 @@ bkLib.onDomLoaded(function() { }); </script> {% endblock %} + +{% block javascript %} + <script src="{% static 'website/js/custom.js' %}"></script> +{% endblock %} |