From dffa556eede4d633879e55b60bf95e4469c530c0 Mon Sep 17 00:00:00 2001 From: Jayaram Pai Date: Wed, 19 Mar 2014 13:22:23 +0530 Subject: added commenting feature on the answers replies are now renamed to answers --- static/website/css/main.css | 73 +- static/website/js/nicEdit.js | 1717 ++++++++++++++++++++- static/website/js/nicEditorIcons.gif | Bin 3351 -> 3716 bytes static/website/js/thread-user.js | 147 +- static/website/templates/ajax-keyword-search.html | 4 +- static/website/templates/ajax-time-search.html | 4 +- static/website/templates/base.html | 9 +- static/website/templates/filter.html | 4 +- static/website/templates/get-question.html | 278 ++-- static/website/templates/index.html | 6 +- static/website/templates/notify.html | 4 +- static/website/templates/recent_questions.html | 5 - static/website/templates/user-answers.html | 36 + static/website/templates/user-replies.html | 36 - 14 files changed, 2114 insertions(+), 209 deletions(-) mode change 100644 => 100755 static/website/js/nicEdit.js mode change 100644 => 100755 static/website/js/nicEditorIcons.gif delete mode 100644 static/website/templates/recent_questions.html create mode 100644 static/website/templates/user-answers.html delete mode 100644 static/website/templates/user-replies.html (limited to 'static/website') diff --git a/static/website/css/main.css b/static/website/css/main.css index 4f1f495..ac93f8f 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -1,5 +1,8 @@ @import url(http://fonts.googleapis.com/css?family=Varela+Round); /* override bootstrap */ +hr { + border-top: 1px solid #424242; +} .container>.navbar-header { height: 45px; } @@ -33,7 +36,6 @@ body { background: #ffffff; } #header-inner { - } #logo { width: 25px; @@ -51,6 +53,31 @@ body { } #content{ } +.question-critic, .answer-critic { + padding-left: 0; + padding-top: 15px; + text-align: center; +} +.question-critic { + font-size: 1.3em; +} +.answer-critic { + font-size: 1em; +} +.vote { + text-decoration: none; + color: #cccccc; +} +.vote:hover { + text-decoration: none; + cursor: pointer; +} +.voted { + color: orange; +} +.question-wrapper { + padding-left: 0; +} #content .question { position: relative; padding: 15px 0 15px 0; @@ -170,22 +197,56 @@ table .title a { .saved { background: lightgreen; } -#content .reply { +.answer-wrapper { + padding-left: 0px; +} +#content .answer { position: relative; border-bottom: 1px solid #f5f5f5; padding-top: 20px; padding-bottom: 20px; margin: 10px 0px; } -#content .reply .body { +#content .answer .body { } -#content .reply .user { +#content .answer .user { position: absolute; right: 0px; bottom: 0px; padding: 2px 7px; background: #f5f5f5; } +.comments { + border-left: 1px solid #cccccc; +} +.comments .comment { + position: relative; + padding: 5px 5px; + border-bottom: 1px dotted #cccccc; +} +.comments .new-comment { + display: none; +} +.comments .add-comment { + margin: 2px; + padding: 1px 2px; + color: #000000; + background: #f5f5f5; +} +.comments .cancel-comment { + display: none; + margin: 2px; + padding: 1px 2px; + color: #ffffff; + background: #d34836; +} +.comments .post-comment { + display: none; + margin: 2px; + padding: 1px 2px; + color: #ffffff; + background: #42B449; +} #footer-wrapper { max-width: 970px; margin:0 auto; @@ -215,7 +276,7 @@ table .title a { top: 15px; } .my-question, -.my-reply { +.my-answer { position: relative; margin: 10px auto; padding: 15px; @@ -223,7 +284,7 @@ table .title a { background: #f7f7f7; } .my-question .date, -.my-reply .date { +.my-answer .date { position: absolute; right: 5px; bottom: 5px; diff --git a/static/website/js/nicEdit.js b/static/website/js/nicEdit.js old mode 100644 new mode 100755 index c890433..f915847 --- a/static/website/js/nicEdit.js +++ b/static/website/js/nicEdit.js @@ -4,10 +4,250 @@ * NicEdit is distributed under the terms of the MIT license * For more information visit http://nicedit.com/ * Do not remove this copyright message - */ -var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A.nicEdit-main p { margin: 0; } {% block javascript %} {% endblock %} + {% endcompress %} diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html index 64eeb5c..dada403 100644 --- a/static/website/templates/filter.html +++ b/static/website/templates/filter.html @@ -80,7 +80,7 @@ Question Date Views - Replies + Answers User {% for question in questions %} @@ -137,7 +137,7 @@ - {{ question.reply_set.count }} + {{ question.answer_set.count }} diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index c1ae565..2ef71b1 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -8,123 +8,189 @@ saving . . . saved -
-
- {{ question.title }} -
- -
-
Title
- -
Question
-
- -
-
- {{ question.body|safe }} -
-
- - - - - {{ question.category }} - - - - - - - - {{ question.tutorial}} - - - - - - - - {{ question.minute_range }} min - - - - - - - - {{ question.second_range }} sec - - - - - - - - - - {% if user|can_edit:question %} - Edit - Save - {% endif %} - - - - - - {{ question.date_created|date:"y-d-m" }}, {{ question.date_created|time }} - - +
+
+ + + +
34
+ + + +
- - {{ question.user }} +
+
+
+ {{ question.title }} +
+ +
+
Title
+ +
Question
+
+ +
+
+ {{ question.body|safe }} +
+
+ + + + + {{ question.category }} + + + + + + + + {{ question.tutorial}} + + + + + + + + {{ question.minute_range }} min + + + + + + + + {{ question.second_range }} sec + + + + + + + + + + {% if user|can_edit:question %} + Edit + Save + {% endif %} + + + + + + {{ question.date_created|date:"y-d-m" }}, {{ question.date_created|time }} + + + + + {{ question.user }} + -
+
+

Answers:

- -
@@ -243,4 +308,29 @@ {% block javascript %} + {% endblock %} diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 8cb69e4..af97707 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -10,7 +10,7 @@ Question Date Views - Replies + Answers User {% for question in questions %} @@ -67,7 +67,7 @@ - {{ question.reply_set.count }} + {{ question.answer_set.count }} @@ -79,7 +79,7 @@ {% endfor %} - {% if total > 20 %} + {% if total > 25 %}