From 75a7713f1ca36aee4bfd5755d4b2c5a5685b76fc Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 28 Oct 2010 17:03:08 -0400 Subject: refactored the pages with wmd editor --- askbot/forms.py | 9 +- askbot/skins/default/media/style/default.css | 1754 -------------------- askbot/skins/default/templates/answer_edit.html | 9 +- askbot/skins/default/templates/ask_form.html | 21 +- askbot/skins/default/templates/macros.html | 30 + askbot/skins/default/templates/question.html | 28 +- askbot/skins/default/templates/question_edit.html | 90 +- askbot/skins/default/templates/question_retag.html | 3 - 8 files changed, 79 insertions(+), 1865 deletions(-) delete mode 100755 askbot/skins/default/media/style/default.css diff --git a/askbot/forms.py b/askbot/forms.py index 6136d968..86c96696 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -126,6 +126,7 @@ class WikiField(forms.BooleanField): def __init__(self, *args, **kwargs): super(WikiField, self).__init__(*args, **kwargs) self.required = False + self.initial = False self.label = _('community wiki') self.help_text = _('if you choose community wiki option, the question and answer do not generate points and name of author will not be shown') def clean(self, value): @@ -421,24 +422,26 @@ class EditQuestionForm(forms.Form): text = EditorField() tags = TagNamesField() summary = SummaryField() + wiki = WikiField() #todo: this is odd that this form takes question as an argument def __init__(self, question, revision, *args, **kwargs): + """populate EditQuestionForm with initial data""" super(EditQuestionForm, self).__init__(*args, **kwargs) self.fields['title'].initial = revision.title self.fields['text'].initial = revision.text self.fields['tags'].initial = revision.tagnames - # Once wiki mode is enabled, it can't be disabled - if not question.wiki: - self.fields['wiki'] = WikiField() + self.fields['wiki'].initial = question.wiki class EditAnswerForm(forms.Form): text = EditorField() summary = SummaryField() + wiki = WikiField() def __init__(self, answer, revision, *args, **kwargs): super(EditAnswerForm, self).__init__(*args, **kwargs) self.fields['text'].initial = revision.text + self.fields['wiki'].initial = answer.wiki class EditUserForm(forms.Form): email = forms.EmailField( diff --git a/askbot/skins/default/media/style/default.css b/askbot/skins/default/media/style/default.css deleted file mode 100755 index 27da1dab..00000000 --- a/askbot/skins/default/media/style/default.css +++ /dev/null @@ -1,1754 +0,0 @@ -/* -Document : default -Created on : Dec 9, 2008, 8:48:40 PM -Author : Mike -Description: -Style sheet for cnprog.com -All rights reserved. 2008 CNPROG.COM -*/ - -@import url(media/style/jquery.autocomplete.css); -@import url(media/style/openid.css); -@import url(media/style/prettify.css); - -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, form, label, table, caption, tbody, tfoot, thead, tr, th, td -{ - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; -} -body{ - font-family: "segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif; - font-size: 80%; - - margin:0; - padding:0; - text-align:center; - line-height: 1; -} -blockquote, q -{ - quotes: none; -} -blockquote:before, blockquote:after, q:before, q:after -{ - content: ''; - content: none; -} -table -{ - border-collapse: collapse; - border-spacing: 0; -} - -input, select, button, textarea -{ - border: 1px solid #999; - font-size:100%; - font-family:"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif; -} - -input -{ - /* - margin: 5px 0px 5px 0px;*/ - padding:3px; - -} - -pre -{ - font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace; - font-size:100%; - margin-bottom: 10px; - overflow: auto; - width: 580px; - background-color: #F5F5F5; - padding-left:5px; - padding-top:5px; - padding-bottom: 20px !ie7; -} - -code{ - font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace; - font-size:100%; - -} - -blockquote -{ - margin-bottom: 10px; - margin-right: 15px; - padding: 10px 0px 1px 10px; - background-color: #F5F5F5; -} - -b, strong -{ - font-weight: bold; -} - -i, em -{ - font-style: italic; -} - -ul -{ - list-style: disc; - margin-left: 30px; - margin-bottom: 1em; -} - -p -{ - clear: both; - margin-bottom: 1em; -} - -ol -{ - list-style: decimal; - margin-left: 30px; - margin-bottom: 1em; -} - -a {color:#07c;text-decoration: none;} -a:visited{color:#3E6D8E;text-decoration: none;} -a:hover{text-decoration: underline;} -a:active{text-decoration: none;} - -h1 { - font-family:Trebuchet MS,Helvetica,sans-serif; - font-size: 160%; -} -h2 { - font-family:Trebuchet MS,Helvetica,sans-serif; - font-size:140%; - font-weight:bold; - margin-bottom:7px; -} -h3 {display:block;font-size:120%;font-family:Trebuchet MS,"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif;font-weight:bold;} -h3 a:visited{ - color:#86B0E1; -} -h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;} - -#top{ - width:100%; - border-bottom:solid 3px #ccc; - background-color:#eee; - margin:0px; -} - -#container{ - margin: 0px auto; - width:950px; - display:block; - text-align: left; -} - -#header{ - width:100%; - padding:3px 0 10px 0; -} - -#header-links{ - -} - -#header-links a{ - color:darkred; - font-weight:400; - font-size:100%; - /*letter-spacing:1px;*/ - -} - -#header-links a:hover{ - text-decoration:none; -} - - -#content{ - margin-top:5px; -} - -#main{ - float:left; - width:670px; -} - -#container{ - width:950px; -} - -#main-bar{ - border-bottom: 1px solid #666; - height: 34px; - width: 100%; - clear:both; - margin-bottom:5px; -} - -#main-bar h3{ - float: left; - font-size: 140%; - font-weight:700; - /*letter-spacing:3px;*/ - margin-top:8px; - padding:5px 0 0 3px ; - height:20px; - width:200px; - color:#333; -} - -#question-title{ - float:left; - border-bottom: 1px solid #666; - width: 98%; - clear:both; - padding:13px 0px 5px 0; - margin-bottom:5px; - -} - -#question-title h3{ - font-size: 130%; - font-weight:bold; - line-height:25px; -} - -#question-title a{ - color:#333; -} - -#main-body{ - float:left; - width:100%; -} - -#main-bar .golden{ - background:url(../../images/bg_title_golden.gif) no-repeat; -} - -#main-bar .pink{ - background:url(../../images/bg_title_red.gif) no-repeat; -} - -#main-bar .orange{ - background:url(../../images/bg_title_orange.gif) no-repeat; -} - -#main-bar .green{ - background:url(../../images/bg_title_green.gif) no-repeat; -} - -#tab{ - float:right; - position:relative; - display:block; - font-weight:bold; -} - -#tab a -{ - background: #eee; - border: 1px solid #eee; - color: #777; - display: block; - float: left; - font-size: 90%; - height: 24px; - line-height: 22px; - margin: 8px 4px 0 0; - padding: 0 11px 0 11px; - text-decoration: none; -} - -#tab a:hover -{ - background: #fff; - border: 1px solid #777; - border-bottom-color: #fff; - line-height: 20px; - margin-top: 9px; -} - -#tab a.youarehere -{ - background: #fff; - color:#333; - border: 1px solid #777; - border-bottom-color: #fff; - font-size: 100%; - height: 30px; - line-height: 28px; - margin-top: 3px; - padding: 0px 11px 0px 11px; -} - -#sidebar{ - float:right; - width:260px; -} - -#footer{ - background:#777777 none repeat scroll 0 0; - border-top:7px solid #000000; - clear:both; - margin-top:30px; - overflow:hidden; - padding:15px; - text-align:center; -} - -#footer a -{ - color: White; -} - -#askform{ - padding:5px; - line-height:20px; -} -#askform .title-desc{ - color:#999; - font-size:90%; -} - -#askform #description{ - padding:20px 0 20px 0; -} - -#askform .submit{ - padding:5px 10px 5px 10px; - font-size:120%; - font-weight:bold; - width:120px; - /*letter-spacing:1px;*/ - background-color:#D4D0C8; -} -.notify -{ - position: fixed; - top: 0px; - left: 0px; - width: 100%; - z-index: 100; - padding: 7px 0 5px 0; - text-align: center; - font-size: 130%; - font-weight: Bold; - color: #444; - background-color: #F4A83D; -} - -.notify span -{ - float: left; - width: 95%; - text-align: center; -} - -.close-notify -{ - float: right; - margin-right: 20px; - color: #735005; - text-decoration: none; - background-color: #FAD163; - border: 2px #735005 solid; - padding-left: 3px; - padding-right: 3px; - cursor:pointer; -} -.small{ - font-size:90%; - color:#777; -} -.big{ - font-size:120%; - font-weight:600; - -} - -.paragraph{ - line-height:20px; - margin-bottom:10px; -} - -.paragraph-extra{ - line-height:30px; - margin-bottom:10px; -} - -.darkred{ - color:darkred; -} - -.yellowbg{ - background-color:yellow; -} - -.header-table{ - width:100%; - /*solve template header space problem*/ - margin-top:-12px; -} - -.header-table a{ - font-weight:bold; -} - -.link-separator{ - color:#ccc; - padding:3px; -} - -.action-link-separator{ - color:#ccc; -} - -.nav -{ - font-size: 120%; -} - -.nav ul -{ - margin: 0; -} - -.nav li -{ - background: #777; - display: block; - float: left; - margin-right: 7px; -} - -.nav li.youarehere -{ - background: #f90; -} - -.nav a -{ - color: #fff; - display: block; - font-weight: bold; - padding: 6px 15px 6px 15px; - text-decoration: none; -} - -.nav li.youarehere a -{ - color: white; -} - -.nav li:hover -{ - background-color:#ff9900; -} - -.header-notification{ - font-size:85%; - color:red; -} - -.highlight-box{ - /*letter-spacing:1px;*/ - color:#735005; -} - -.highlight-box p{ - margin:5px 0 0px 0; -} - -.highlight-box a{ - color:#735005; - font-size:90%; - font-weight:bold; -} - -.yellow-box{ - background-color:#FFFFCC; - border:1px dotted #D8D2A9; - margin-bottom:20px; - line-height:20px; - padding:10px 10px 5px; - -} - -.yellow-box ul{ - margin-left:0px; -} - -.yellow-box h3{ - font-size:120%; - padding-bottom:5px; - margin-bottom:10px; - border-bottom:1px dotted #D8D2A9; -} - -.gray-box{ - background-color:#eee; - border:1px dotted #D8D2A9; - margin-bottom:20px; - line-height:20px; - padding:10px 10px 5px; - overflow:hidden; -} - -.gray-box ul{ - margin-left:0px; -} - -.gray-box h3{ - font-size:120%; - padding-bottom:5px; - margin-bottom:10px; - border-bottom:1px dotted #D8D2A9; -} - -.question-item{ - width:100%; - float:left; - margin:5px 0 10px 0; - border-bottom:1px dotted #D8D2A9; -} - -.boxes{ - float:left; - text-align:center; - color:#666; -} - -.boxes-cell{ - padding-right:5px; - vertical-align:top; -} - -.questions-summary-container{ - float:left; - width:580px; - -} -.questions-boxes-container{ - float:left; -} -.questions-boxes{ - float:left; - width: 70px; - text-align:center; - color:#666; - -} -.questions-vote-number{ - font-size:200%; - font-weight:bold; - font-family:Arial; -} -.questions-answer-number{ - font-size:140%; - font-weight:bold; - font-family:Arial; -} -.questions-answerbox{ - padding:5px; -} - -.questions-votebox{ - padding:5px; -} -.questions-viewbox{ - padding:5px; -} -.qustions-summary{ - line-height:20px; - margin-bottom:5px; -} -.question-body{ - min-height:100px; -} -.question-body IMG{ - max-width:600px; -} -.questions-mark{ - float:right; - text-align:left; - font-size:90%; - - line-height:20px; - width:160px; -} - -.questions-boxicon{ - width:15px; - vertical-align:top; -} -.questions-count{ - font-family:arial; - font-size:350%; - font-weight:bolder; - margin:15px 0 15px 0; - color:#777; -} -#questions-answerbox-cell{ - padding:5px; - -} - -.vote{ - background-color:#eee; -} - -.box-number{ - font-size:160%; - font-weight:bold; - font-family:Arial; -} - -.box-unit{ - padding:3px; - font-size:90%; -} - -.answer{ - border-bottom:1px dotted #666666; - padding-bottom:20px; - padding-top:20px; - width: 100%; - margin-bottom:10px; -} -.answer-body{ - min-height:80px; -} - -.answer-body IMG{ - max-width:600px; -} - -.accepted-answer{ - background-color:#E2FCE2; - border-bottom-color:#9BD59B; -} - -.accepted-answer .comments-link{ - background-color:#D9F5D9; -} - -.accepted-answer .comments-container{ - background-color:#D9F5D9; -} - -.answered -{ - background: #75845C; - color: white; -} - -.answered-accepted -{ - background: #75845C; - color: #E1E818; -} - -.answered-by-owner -{ - background: #E0EAF1; -} - -.answered-by-owner .comments-link -{ - background-color:#D6E4EE; -} - -.answered-by-owner .comments-container -{ - background-color:#D6E4EE; -} - -.answered-accepted strong -{ - color: #E1E818; -} - -.unanswered -{ - background: #9A4444; - color: white; -} - -.view{ - -} - -.subtitle{ - padding:15px 0 10px 0; -} - -.qustion-title{ - font-size:100%; - padding:0px; - line-height:20px; - margin-bottom:5px; -} - -.question-tag{ - float:left; - padding-bottom:3px; - width:250px; -} - -.post-tag -{ - color: #3E6D8E; - background-color: #E0EAF1; - border-bottom: 1px solid #3E6D8E; - border-right: 1px solid #7F9FB6; - margin: 2px 3px 2px 0; - padding: 2px 4px 2px 4px; - text-decoration: none; - height:20px; - font-family:Microsoft Yahei,宋体,Tahoma; - font-size: 90%; - line-height: 2.2; - white-space:nowrap; - vertical-align:baseline; -} - -.post-tag:hover -{ - background-color: #3E6D8E; - color: #E0EAF1; - border-bottom: 1px solid #37607D; - border-right: 1px solid #37607D; - text-decoration: none; -} - -.highlight-tag{ - background-color: #3E6D8E; - color: #fff; - font-weight:bold; - border-bottom: 1px solid #3E6D8E; - border-right: 1px solid #7F9FB6; - margin: 2px 6px 2px 0; - padding: 3px 4px 3px 4px; - text-decoration: none; - font-size: 90%; -} - -.question-started{ - font-size:90%; - padding-top:10px; - float:right; - padding-bottom:3px; - -} - -.updatedtime{ - font-weight:bold; - color:#999; -} - -.badge -{ - color: #fff; - background-color: #333; - border: 1px solid #333; - margin: 0 3px 3px 0; - padding: 4px 8px 4px 3px; - color: white !important; - text-decoration: none; - line-height: 1.9; -} - -.badge:hover -{ - border: 1px solid #555; - background-color: #555; - text-decoration: none; -} - -.badge-item{ - margin-bottom:10px; -} - -.badge1 -{ - margin-left:3px; - padding-right:2px; - font-size: 120%; - color: #FFCC00; -} - -.badge2 -{ - margin-left:3px; - padding-right:2px; - font-size: 120%; - color: #C0C0C0; -} - -.badge3 -{ - margin-left:3px; - padding-right:2px; - font-size: 120%; - color: #CC9966; -} - -.badgecount -{ - color: #808185; -} - -.reputation-score{ - font-family:arial; - font-weight: bold; - color: #333; - font-size: 120%; - margin-right:2px; -} - -#recent-tags .post-tag -{ - background-color: #eee; - border: none; - margin: 0; - font-size: 100%; - color: black !important; -} - -#recent-tags .post-tag:hover -{ - background-color: #777; - color: White !important; - border: none; - margin: 0; - text-decoration: none; -} - -#related-tags{ - line-height:30px; -} - -.list-item{ - list-style:inside square - -} -.list-item li{ - margin-bottom:5px; -} - -.list-item dt{ - line-height:20px; -} - -.list-item dd{ - line-height:20px; - margin-bottom:10px; -} - -#editor{ - font-size:100%; - min-height:200px; - line-height: 18px; - width:595px; -} - -.wmd-preview{ - margin-top:10px; - padding:6px; - width:590px; - background-color:#F5F5F5; - min-height:20px; -} - -/*adjustment for editor preview*/ -.wmd-preview pre{ - background-color:#E7F1F8; - -} - -.wmd-preview blockquote -{ - background-color: #eee; -} - -.wmd-preview IMG{ - max-width:600px; -} -.preview-toggle{ - font-size:90%; - font-weight:600; - margin-bottom:-10px; - width:600px; - color:#aaa; - /*letter-spacing:1px;*/ - -} - -.preview-toggle span:hover{ - cursor:pointer; -} - -.edit-content-html{ - border-top:1px dotted #D8D2A9; - border-bottom:1px dotted #D8D2A9; - margin:5px 0 5px 0; -} - -/* 2 textarea resizer styles */ -div.grippie { - background:#EEEEEE url(../../images/grippie.png) no-repeat scroll center 2px; - border-color:#DDDDDD; - border-style:solid; - border-width:0pt 1px 1px; - cursor:s-resize; - height:9px; - overflow:hidden; - width:600px; -} -.resizable-textarea textarea { - display:block; - margin-bottom:0pt; - width:95%; - height: 20%; -} - -.openid-input{ - background:url(../../images/openid.gif) no-repeat; - padding-left:15px; - cursor:pointer; -} - -.openid-login-input{ - background-position:center left; - background:url(../../images/openid.gif) no-repeat 0% 50%; - padding:5px 5px 5px 15px; - cursor:pointer; - font-family:Trebuchet MS; - font-weight:300; - font-size:150%; - width:500px; -} - -.openid-login-submit{ - padding:6px; - /*padding:4px;*/ - cursor:pointer; - font-weight:bold; - font-size:120%; - background-color:#D4D0C8; -} - -.openid-samples{ - -} - -.openid-samples .list, .list li{ - font-family:Trebuchet MS,"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif; - list-style:none !important; - margin-left:-30px !important; - line-height:20px !important; -} - -.darkred{ - color:darkred; -} - -.gray{ - color:gray; -} - -.message{ - padding:5px; - font-weight:bold; - background-color:#eee; - margin:10px 0 10px 0; -} - -.warning{ - color:red; -} - -.vote-buttons{ - float:left; - text-align:center; - border:solid 0px #ccc; -} - -.vote-buttons img{ - cursor:pointer; -} - -.item-right{ - float:left; -} - -.vote-number{ - font-family:Arial; - padding:0px 0 3px 0; - font-size:220%; - font-weight:bold; - color:#777; -} -.favorite-number{ - font-size:100%; - font-family:Arial; - margin-top:-8px; - font-weight:bold; - color:#808185 -} - -.my-favorite-number{ - color:#D4A849; -} - -.tag-number{ - font-size:120%; - font-family:Arial; - font-weight:bold; -} - -#question-tags{ - margin:5px 0 5px 0; -} - -.question-tag-extra{ - float:left; - padding-bottom:3px; - width:100%; -} - -.question-mark{ - background-color:#E0EAF1; - text-align:left; - font-size:90%; - padding:5px; - overflow:hidden; -} - -.question-edit{ - text-align:left; - font-size:90%; - - overflow:hidden; -} - -.question-status{ - margin-top:10px; - padding: 20px; - background-color:#eee; - text-align:center; -} - -.answer-mark{ - text-align:left; - font-size:90%; - padding:5px; -} - -.wiki-category{ - margin-left:5px; - color:#999; - font-size:90%; -} - -.offensive-flag a{ - color:#777; - font-size:90%; - padding:3px; - cursor:pointer; -} - -.offensive-flag a:hover{ - background-color:#777; - text-decoration:none; - color:#fff; -} - -.linksopt a{ - color:#777; - font-size:90%; - padding:3px; - cursor:pointer; -} - -.linksopt a:hover{ - background-color:#777; - text-decoration:none; - color:#fff; -} - -.action-link a{ - color:#777; - font-size:90%; - padding:3px; - cursor:pointer; -} - -.action-link a:hover{ - background-color:#777; - text-decoration:none; - color:#fff; -} - -.dot-line{ - border-bottom:1px dotted #D8D2A9; - width:670px; /*IE*/ - /* - width:100% !important; - */ - margin-bottom:20px; -} - -.line{ - border-bottom:1px solid #777; - width:650px; /*IE*/ - /* - width:100% !important; - */ - margin-bottom:20px -} - -.taglist-td{ - width:190px; - line-height:26px; -} - -.list-table{ - margin-left:15px; -} - -.list-td{ - width:185px; - -} - -.submit{ - cursor:pointer; - #padding-bottom:0px; - #padding-top:0px - background-color:#D4D0C8; -} - -form .error{ - color:darkred; -} - -form .errorlist li{ - color: red; -} - -.vote-notification -{ - z-index: 1; - cursor: pointer; - display: none; - position: absolute; - padding: 15px; - color: White; - background-color: #AE0000; -} - -.vote-notification a -{ - color: White; - text-decoration:underline; -} - -.center-container{ - width:950px; -} - -#revisions{ - width:950px; -} - -.revision{ - margin:10px 0 10px 0; - width:100%; -} - -.revision .header{ - background-color:#eee; - padding:5px; - cursor:pointer; -} - -.revision .author{ - background-color:#E0EAF1; -} - -.revision .summary{ - padding: 5px 0 10px 0; -} - -.revision .summary span{ - background-color:yellow; - display:inline; -} -.revision h1{ - font-size:130%; - font-weight:600; - padding:15px 0 15px 0; -} - -.revision-mark{ - width:200px; - text-align:left; - font-size:90%; - overflow:hidden; -} - -.revision-number{ - font-size:300%; - font-weight:bold; - font-family:arial; -} - -.revision .body{ - padding-left:10px; - margin-bottom:50px; -} -.revision .answerbody{ - padding:10px 0 5px 10px; -} - -/* Revision pages */ -del { color: #FF5F5F; } -del .post-tag{ -color: #FF5F5F; -}; -ins { background-color: #97ff97;} -ins .post-tag{ -background-color: #97ff97; -}; - -/** PAGINATOR **/ -.paginator { - padding:5px 0 10px 0; - font:normal .8em arial; -} - -.paginator .prev-na, -.paginator .next-na { - padding:.3em; - font:bold .875em arial; -} - -.paginator .prev-na, -.paginator .next-na { - border:1px solid #ccc; - background-color:#f9f9f9; - color:#aaa; - font-weight:normal; -} - -.paginator .prev a, .paginator .prev a:visited, -.paginator .next a, .paginator .next a:visited { - border:1px solid #fff; - background-color:#fff; - color:#777; - padding:.3em; - font:bold 100% arial; -} - -.paginator .prev, .paginator .prev-na { margin-right:.5em; } -.paginator .next, .paginator .next-na { margin-left:.5em; } - -.paginator .page a, .paginator .page a:visited, .paginator .curr { - padding:.25em; - font:normal .875em verdana; - border:1px solid #ccc; - background-color:#fff; - margin:0em .25em; - color:#777; -} - -.paginator .curr { - background-color:#777; - color:#fff; - border:1px solid #777; - font-weight:bold; - font-size:1em; -} - -.paginator .page a:hover, -.paginator .curr a:hover, -.paginator .prev a:hover, -.paginator .next a:hover { - color:#fff; - background-color:#777; - border:1px solid #777; - text-decoration:none; -} - -.paginator .text{ - color:#777; - padding:.3em; - font:bold 100% arial; -} - -.paginator-container{ - float:right; - padding:10px 0 10px 0; -} - -.paginator-container-left{ - padding:5px 0 10px 0; -} - -.user-info { - clear:both; - height:45px; -} - -.user-info .user-action-time { - margin-bottom:4px; - margin-top:2px; -} - -.user-info .user-details { - float:left; - margin-left:5px; - overflow:hidden; - white-space:nowrap; - width:138px; -} -.user-details { - color:#888888; - line-height:17px; -} - -table.user-details td { - color:Black; - padding:4px 0; -} - -.user-info .user-gravatar32 { - float:left; - width:32px; -} - -#mainbar-full { - width:950px; -} - -#subheader { - border-bottom:1px solid #666666; - clear:both; - height:34px; - width:100%; -} - -#tabs { - float:right; - font-weight:bold; - position:relative; -} - -.summaryinfo { - color:#808185; - text-align:center; -} - -.summarycount { - font-family:arial; - color:#808185; - font-size:350%; - font-weight:bold; - text-align:center; -} -.summarysubcount { - font-family:arial; - color:#808185; - font-size:250%; - font-weight:bold; - text-align:center; -} - - -#user-about-me { - background-color:#EEEEEE; - height:200px; - line-height:20px; - margin:10px; - overflow:auto; - padding:10px; - width:90%; -} - -.favorites-count-off { - color:#919191; - float:left; - margin-top:13px; - text-align:center; -} - -.favorites-count { - color:#D4A849; - float:left; - margin-top:13px; - text-align:center; -} - -.question-summary { - border-bottom:1px dotted #999999; - float:left; - overflow:hidden; - padding:11px 0; - width:670px; -} - -.user-stats-table .question-summary { - width:800px; -} - -.narrow .stats { - background:transparent none repeat scroll 0 0; - float:left; - height:48px; - margin:0 0 0 7px; - padding:0; - width:auto; -} - -.narrow .votes { - background:#EEEEEE none repeat scroll 0 0; - float:left; - height:38px; - margin:0 3px 0 0; - padding:5px; - width:38px; -} - -.narrow .views { - float:left; - height:38px; - margin:0 7px 0 0; - padding:5px 0 5px 4px; - width:40px; -} - -.narrow .status { - float:left; - height:38px; - margin:0 3px 0 0; - padding:5px; - width:48px; -} - -.narrow .vote-count-post { - font-size:100%; - margin:0; -} - -div.votebox { - text-align:center; - vertical-align:middle; -} - -div.votebox span { - color:#808185; - display:block; - font-weight:bold; -} -.vote-count-post { - display:block; - font-size:240%; -} - -.answered-accepted { - background:#75845C none repeat scroll 0 0; - color:#E1E818; -} - -.status { - margin-top:-3px; - padding:4px 0; - text-align:center; -} - -.views { - color:#999999; - padding-top:4px; - text-align:center; -} - -.user-stats-table .summary { - width:600px; - line-height:22px; -} - -.user-stats-table .summary h3{ - margin:0px; - padding:0px; -} - -div.tags { - float:left; - line-height:18px; -} - -div.started { - color:#999999; - float:right; - line-height:18px; - width:185px; -} - -.narrow div.started { - line-height:inherit; - padding-top:4px; - white-space:nowrap; - width:auto; -} - -.relativetime { - font-weight:bold; - text-decoration:none; -} - -div.started a { - font-weight:bold; -} - -div.started .reputation-score { - margin-left:1px; -} - -.answer-summary { - clear:both; - padding:3px; -} - -.answer-votes { - background-color:#EEEEEE; - color:#555555; - float:left; - font-size:110%; - font-weight:bold; - height:15px; - padding:4px 4px 5px; - text-align:center; - text-decoration:none; - width:20px; -} - -.answered-accepted { - background:#75845C none repeat scroll 0 0; - color:#E1E818; -} - -.answer-link { - color:#555555; - float:left; - margin-top:5px; - padding-left:10px; - width:700px; -} - -.answer-link a { - font-weight:bold; -} - -.deleted{ - background:#F4E7E7 none repeat scroll 0 0; -} - -#mainbar-footer { - clear:both; - width:100%; -} - -#feed-link { - float:right; - text-align:right; -} - -#feed-link-image { - float:left; - margin-left:12px; - margin-right:5px; -} - -#feed-link-text { - float:left; -} - -.revision-comment { - background-color:#FFFE9B; - color:#333333; - line-height:1.4; - padding:3px; -} - -.accept-answer-link { - color:#508850 !important; - font-weight:bold; -} - -.accept-answer-link:hover { - background-color:#508850 !important; - color:#E1E818 !important; - text-decoration:none; -} - -div.comments { - line-height:150%; - padding:10px 0; -} - -div.post-comments{ - width:585px; - clear:both; - float:left; -} - -form.post-comments textarea { - height:6em; - margin-bottom:4px; -} - -form.post-comments input { - margin-left:10px; - margin-top:1px; - vertical-align:top; - width:100px; -} - -span.text-counter { - margin-right:20px; -} - -span.form-error { - color:#990000; - font-size:90%; - font-weight:normal; - margin-left:5px; -} - -div.comments-container, div.comments-container-accepted, div.comments-container-owner, div.comments-container-deleted { - display:none; - margin-top:-1px; - padding:0 5px 5px; -} - -div.comments-container, a.comments-link { - background-color:#EEEEEE; -} - -.post-comments a { - color:#888888; - padding:0 3px 2px; - font-size:90%; -} - -a.comments-link, a.comments-link-accepted, a.comments-link-owner, a.comments-link-deleted { - color:black; - padding:2px; - cursor:pointer; -} - -.post-comments a:hover { - background-color:#777777; - color:white; - text-decoration:none; -} - -a.comment-user, a.comment-user:hover { - background-color:inherit; - color:#0077CC; - padding:0; -} - -a.comment-user:hover { - text-decoration:underline; -} - -.user-action{ - -} -.user-action-1{ - font-weight:bold; - color:#333; -} -.user-action-2{ - font-weight:bold; - color:#75845C; -} -.user-action-3{ - color:#333; -} -.user-action-4{ - color:#333; -} -.user-action-5{ - color:darkred; -} -.user-action-6{ - color:darkred; -} -.user-action-7{ - color:#333; -} -.user-action-8{ - padding:3px; - font-weight:bold; - background-color:#75845C; - color:#E1E818; -} - -.revision-summary{ - background-color:#FFFE9B; - padding:2px; -} -.question-title-link a{ - font-weight:bold; - color:#0077CC; -} -.answer-title-link a{ - color:#333; -} - -.post-type-1 a { - font-weight:bold; - color:#0077CC; -} -.post-type-3 a { - font-weight:bold; - color:#0077CC; -} -.post-type-5 a { - font-weight:bold; - color:#0077CC; -} -.post-type-2 a{ - color:#333; -} -.post-type-4 a{ - color:#333; -} -.post-type-6 a{ - color:#333; -} -.post-type-8 a{ - color:#333; -} - -/* openid styles */ -.form-row{line-height:25px;} -.submit-row{line-height:30px;padding-top:10px;} -.errors{line-height:20px;color:red;} -.error{color:red;} -.error-list li{padding:5px;} -.login{margin-bottom:10px;} -.fieldset{border:solid 1px #777;margin-top:10px;padding:10px;} diff --git a/askbot/skins/default/templates/answer_edit.html b/askbot/skins/default/templates/answer_edit.html index a7fc4aca..4b485d28 100644 --- a/askbot/skins/default/templates/answer_edit.html +++ b/askbot/skins/default/templates/answer_edit.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "macros.html" as macros %} {% block title %}{% spaceless %}{% trans %}Edit answer{% endtrans %}{% endspaceless %}{% endblock %} {% block forejs %} @@ -61,14 +62,8 @@ {{ revision_form.revision }}
-
- {{ form.text }} - -
{% trans %}toggle preview{% endtrans %}
-
+ {{macros.wmd_editor(form, settings.WIKI_ON and answer.wiki == False)}}
- {{ form.summary.label_tag() }}
{{ form.summary }} {{ form.summary.errors }}
diff --git a/askbot/skins/default/templates/ask_form.html b/askbot/skins/default/templates/ask_form.html index 2a841a76..b13b7da4 100644 --- a/askbot/skins/default/templates/ask_form.html +++ b/askbot/skins/default/templates/ask_form.html @@ -1,3 +1,4 @@ +{% import "macros.html" as macros %}
@@ -23,25 +24,7 @@
-
- {{ form.text }} -
- - - - {% if settings.WIKI_ON %} - - {% endif %} - - -
- {% trans %}toggle preview{% endtrans %} - - {{ form.wiki }} {{ form.wiki.label_tag() }} -
-
-
- + {{macros.wmd_editor(form, settings.WIKI_ON)}}
{{ form.tags.label_tag() }}: {% trans %}(required){% endtrans %}
diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index f983de78..c3a69684 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -334,3 +334,33 @@ poor design of the data or methods on data objects #} }; {%- endmacro %} + +{%- macro wmd_editor(post_form, wiki_on) -%} +
+ {{ post_form.text.errors }} + {{ post_form.text }} +
+ + + + {% if wiki_on %} + + {% endif %} + +
+ + {% trans %}toggle preview{% endtrans %} + + + {{ post_form.wiki }} + + {{ post_form.wiki.label_tag() }} + +
+
+
+{%- endmacro -%} diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index f5a1c6b5..febe1489 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -394,33 +394,7 @@

{% endif %}
-
- {{ answer.text }} -
- - - - {% if settings.WIKI_ON %} - - {% endif %} - -
- - {% trans %}toggle preview{% endtrans %} - - - {{ answer.wiki }} - - {{ answer.wiki.label_tag() }} - -
-
-
- {{ answer.text.errors }} + {{macros.wmd_editor(answer, settings.WIKI_ON)}}

{% block title %}{% spaceless %}{% trans %}Edit question{% endtrans %}{% endspaceless %}{% endblock %} {% block forejs %} @@ -55,7 +56,11 @@ }); - setupFormValidation("#fmedit", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages()); + setupFormValidation( + "#fmedit", + CPValidator.getQuestionFormRules(), + CPValidator.getQuestionFormMessages() + ); $('#id_revision').unbind().change(function(){ $("#select_revision").click(); @@ -70,59 +75,40 @@ {% trans %}Edit question{% endtrans %} [{% trans %}back{% endtrans %}]
-
- -
- {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul() }}{% endif %} -
- {{ revision_form.revision }} -
-
-
- {{ form.title }} {{ form.title.errors }} -
- {{ form.title.help_text }} -
-
-
-
- {{ form.text }} - -
- - - - {% if settings.WIKI_ON and 'wiki' in form %} - - {% endif %} - -
- {% trans %}toggle preview{% endtrans %} - - {{ form.wiki }} {{ form.wiki.label_tag() }} -
-
-
-
-
- {{ form.tags.label_tag() }}:
- {{ form.tags }} {{ form.tags.errors }} -
- {{ form.tags.help_text }} -
-
- {{ form.summary.label_tag() }}
- {{ form.summary }} {{ form.summary.errors }} + +
+ {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul() }}{% endif %} +
+ {{ revision_form.revision }} +
+
+
+ {{ form.title }} {{ form.title.errors }} +
+ {{ form.title.help_text }} +
+
+
+ {{macros.wmd_editor(form, settings.WIKI_ON and question.wiki == False)}} +
+
+ {{ form.tags.label_tag() }}:
+ {{ form.tags }} {{ form.tags.errors }}
- {{ form.summary.help_text }} + {{ form.tags.help_text }}
-
-   - - -
+
+ {{ form.summary.label_tag() }}
+ {{ form.summary }} {{ form.summary.errors }} +
+ {{ form.summary.help_text }} +
+
+   + +
{% endblock %} diff --git a/askbot/skins/default/templates/question_retag.html b/askbot/skins/default/templates/question_retag.html index df3a1b1f..37573c03 100644 --- a/askbot/skins/default/templates/question_retag.html +++ b/askbot/skins/default/templates/question_retag.html @@ -41,7 +41,6 @@ }); lanai.highlightSyntax(); - }); {% endblock %} @@ -59,8 +58,6 @@
{{ question.html }}
- -
{{ form.tags.label_tag() }}:
{{ form.tags }} {{ form.tags.errors }} -- cgit v1.2.3-1-g7c22