]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes OSQA 282, Error in related_questions.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 26 May 2010 18:43:06 +0000 (18:43 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 26 May 2010 18:43:06 +0000 (18:43 +0000)
Show wiki checkbox in answer edit form.
Don't answer default to wiki when question is wiki.
Add type to badges without type.
Make first user staff as well.

git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@335 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/answer_edit.html
forum/views/auth.py
forum_modules/default_badges/badges.py
forum_modules/pgfulltext/handlers.py

index 64142005ce85dc2f7ace484b2bd2259d0c67bc1b..137b68413c7ca6ade8f3a9587cb93f426d90f0c4 100644 (file)
                 {{ form.text }}
                 <span class="form-error"></span>
                 <div class="preview-toggle"><span id="pre-collapse" 
-                                       title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span></div>
+                                       title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
+                               {% if settings.WIKI_ON %}
+                    <div style="float:right;">
+                        {{ form.wiki }} <span style="color:#000;cursor:help" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
+                    </div>
+                    {% endif %}
+                </div>
                 <div id="previewer" class="wmd-preview"></div>
             </div>
             
index 477f16d1bcf9efb4234f26162725feb5594de28e..26ce783161ccae5c422424d06037600ec30f0e63 100644 (file)
@@ -147,6 +147,7 @@ def external_register(request):
 
             if User.objects.all().count() == 0:
                 user_.is_superuser = True
+                user_.is_staff = True
             
             user_.save()
             UserJoinsAction(user=user_, ip=request.META['REMOTE_ADDR']).save()
index a04177632a78c7ba826e6002b74e9cb5e7b2b814..279f778f8785276aeb267086b9f2d313e7b19f2b 100644 (file)
@@ -108,6 +108,7 @@ class FavoriteQuestion(FavoriteQuestionBadge):
     expected_count = settings.FAVORITE_QUESTION_FAVS
 
 class StellarQuestion(FavoriteQuestionBadge):
+    type = Badge.GOLD
     name = _("Stellar Question")
     expected_count = settings.STELLAR_QUESTION_FAVS
 
@@ -237,6 +238,7 @@ class SelfLearner(AbstractBadge):
 
 
 class StrunkAndWhite(AbstractBadge):
+    type = Badge.SILVER
     award_once = True
     listen_to = (ReviseAction,)
     name = _("Strunk & White")
index fc64bac73216841f37e3e9cf6940bbb918db7f85..e46c5719ba8a3cf4fddd92971e660ece1ee1d2fe 100644 (file)
@@ -4,7 +4,7 @@ from forum.modules.decorators import decorate
 
 @decorate(QuestionManager.search, needs_origin=False)
 def question_search(self, keywords):
-    tsquery = " | ".join(keywords.split(' '))
+    tsquery = " | ".join([k for k in keywords.split(' ') if k])
     
     return self.extra(
                     tables = ['forum_rootnode_doc'],