diff options
author | Jayaram Pai | 2013-12-08 20:43:40 +0530 |
---|---|---|
committer | Jayaram Pai | 2013-12-08 20:43:40 +0530 |
commit | b596364cf3f871887cce519291b684341cc5c014 (patch) | |
tree | 48dcb9366be1f1110f2fda27afa6485b6c3bdb64 /static/website/templates | |
parent | 41e5496301cd02bff34dad877d20b2dd30349866 (diff) | |
download | FOSSEE-Forum-b596364cf3f871887cce519291b684341cc5c014.tar.gz FOSSEE-Forum-b596364cf3f871887cce519291b684341cc5c014.tar.bz2 FOSSEE-Forum-b596364cf3f871887cce519291b684341cc5c014.zip |
added nicEdit / on-the-fly question edit
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/base.html | 16 | ||||
-rw-r--r-- | static/website/templates/get-question.html | 48 | ||||
-rw-r--r-- | static/website/templates/index.html | 7 | ||||
-rw-r--r-- | static/website/templates/new-question.html | 11 |
4 files changed, 64 insertions, 18 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html index 8d95162..f7e2ac5 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -24,7 +24,6 @@ <!-- 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:home' %}">Home</a></li> <li><a href="{% url 'website:new_question' %}">Ask Question</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> @@ -35,7 +34,7 @@ <li class="divider"></li> <li><a href="#">Separated link</a></li> </ul> - </li> + </li> <!-- /li.dropdown --> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> @@ -45,18 +44,10 @@ <div id="content-wrapper"> <div id="content-inner" class="container"> - <div id="content" class="col-lg-10 col-md-10 col-sm-10"> + <div id="content" class="col-lg-12 col-md-12 col-sm-12"> {% block content %} {% endblock %} </div> <!-- /#content --> - - <div id="sidebar" class="col-lg-2 col-md-2 col-sm-2"> - {% block sidebar %} - <h4>Recent Posts</h4> - {% load sidebar_tags %} - {% recent_questions %} - {% endblock %} - </div> <!-- /#sidebar --> </div> <!-- /#content-inner --> </div> <!-- /#content-wrapper --> @@ -72,5 +63,8 @@ <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 %} </body> </html> diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index b05704f..f6280cf 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -1,4 +1,5 @@ {% extends 'website/templates/base.html' %} +{% load static %} {% load widget_tweaks %} {% block content %} <div class="question"> @@ -6,12 +7,14 @@ <a href=""> {{ question.title }} </a> </div> - <div class="body"> - {{ question.body }} + <div id="questionNicPanel"></div> + <div id="questionInstance" class="body"> + {{ question.body|safe }} </div> <br> + <span class="category"> - <small> + <small> <a href="{% url 'website:filter' question.category %}"> {{ question.category }} </a> @@ -42,12 +45,24 @@ </small> </span> -</div> + <span class="modify"> + {% ifequal question.uid|stringformat:'s' user.id|stringformat:'s' %} + <a class="edit btn btn-xs btn-info" href="#">Edit</a> + <a id="save-{{ question.id }}" class="save btn btn-xs btn-success" href="#">Save</a> + {% endifequal %} + </span> + <span class="user"> + <img id="ajax-loader" src="/static/website/images/ajax-loader.gif" style="display:none;"> + {{ question.user }} + </span> +</div> <!-- /.question --> + +<h4><u>Answers:</u></h4> {% for reply in replies %} <div class="reply"> <span class="body"> - {{ reply.body }} + {{ reply.body|safe }} </span> <span class="user"> @@ -71,4 +86,27 @@ <input class="btn btn-info" type="submit" value="Submit Reply"> </form> +<script src="{% static 'website/js/nicEdit.js' %}" type="text/javascript"></script> +<script type="text/javascript"> + bkLib.onDomLoaded(function() { + new nicEditor({ + iconsPath: "{% static 'website/js/nicEditorIcons.gif' %}", + buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image'] + }).panelInstance('id_body'); + }); +</script> +{% endblock %} + +{% block javascript %} + {% if user.is_authenticated %} + {% ifequal question.user|stringformat:"s" user|stringformat:"s" %} + <script src="{% static 'website/js/thread-user.js' %}"></script> + {% else %} + <script type="text/javascript"> + $(document).ready(function() { + $(".question .body").removeAttr("id"); + }); + </script> + {% endifequal %} + {% endif %} {% endblock %} diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 5fcfec8..43d98f0 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -1,7 +1,6 @@ {% extends 'website/templates/base.html' %} {% block content %} -<h4>Recent Questions</h4> -{{ user.name }} +<h4><u>Recent Questions</u></h4> {% for question in questions %} <div class="question"> <div class="title"> @@ -39,6 +38,10 @@ </a> </small> </span> + + <span class="user"> + {{ question.user }} + </span> </div> <!-- /.question --> {% endfor %} {% endblock %} diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html index 81da5cf..70d8349 100644 --- a/static/website/templates/new-question.html +++ b/static/website/templates/new-question.html @@ -5,6 +5,7 @@ <h4> <span class="glyphicon glyphicon-pencil"> </span> Create a new question . . . + user is {{ user }} </h4> <hr> <form role="form" action="" method="POST">{% csrf_token %} @@ -46,4 +47,14 @@ <input class="btn btn-success" type="submit" value="Submit Question"> {% endwith %} </form> + +<script src="{% static 'website/js/nicEdit.js' %}" type="text/javascript"></script> +<script type="text/javascript"> +bkLib.onDomLoaded(function() { + new nicEditor({ + iconsPath: "{% static 'website/js/nicEditorIcons.gif' %}", + buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image'] + }).panelInstance('id_body'); +}); +</script> {% endblock %} |