]> git.openstreetmap.org Git - osqa.git/commitdiff
Visual indication of community wiki, and made the markddown_help use base_content...
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 21:28:23 +0000 (21:28 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 21:28:23 +0000 (21:28 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@329 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/images/wiki.png [new file with mode: 0644]
forum/skins/default/media/style/style.css
forum/skins/default/templates/markdown_help.html
forum/skins/default/templates/node/wiki_symbol.html [new file with mode: 0644]
forum/skins/default/templates/question.html
forum/templatetags/node_tags.py

diff --git a/forum/skins/default/media/images/wiki.png b/forum/skins/default/media/images/wiki.png
new file mode 100644 (file)
index 0000000..a6be558
Binary files /dev/null and b/forum/skins/default/media/images/wiki.png differ
index a9d2072874c7973a0cfd3307732186b5e5cc5ac1..133d8ece5146502b6b75e07f5e05b20b6c1c55cf 100644 (file)
@@ -638,22 +638,6 @@ a.medal:hover {
        text-align: center;
 }
 
-.vote-notification {
-       background-color: darkred;
-       color: White;
-       cursor: pointer;
-       display: none;
-       padding: 15px;
-       position: absolute;
-       text-align: center;
-       z-index: 1;
-}
-
-.vote-notification a {
-       color: White;
-       text-decoration: underline;
-}
-
 span.form-error {
        color: #990000;
        font-weight: normal;
@@ -1115,13 +1099,21 @@ ul.form-horizontal-rows li input {
        padding-bottom: 10px;
 }
 
-.post-controls {
+.post-controls, .tags-container {
        font-size: 11px;
        line-height: 12px;
        margin-bottom: 5px;
        min-width: 200px;
 }
 
+.tags-container {
+    margin: 0 0 16px 0;    
+}
+
+.post-controls {
+    float: left;
+}
+
 #question-controls .tags { margin: 0 0 3px; }
 
 .post-update-info {
@@ -1176,6 +1168,16 @@ a.post-vote.down.on,a.post-vote.down:hover { background: url("../images/vote-arr
 a.accept-answer { background: url("../images/vote-accepted.png") no-repeat scroll center center transparent; }
 a.accept-answer.on,a.accept-answer:hover { background: url("../images/vote-accepted-on.png") no-repeat scroll center center transparent; }
 
+.community-wiki {
+    font-size: 11px;
+    color: #333;
+    background: url("../images/wiki.png") no-repeat left center;
+    padding-left: 46px;
+    margin: 12px 0 32px 0;
+    min-height: 32px;
+    line-height: 14px;
+}
+
 .post-score, .comments-char-left-count {
        color: #777777;
        font-family: Arial;
index a54334b84cab50ae104bac6f3ee26ed45f6d956b..bb646cbe2ea92d6ba5b289c747c5253375268de4 100644 (file)
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "base_content.html" %}
 {% load extra_tags %}
 {% load humanize %}
 {% load i18n %}
diff --git a/forum/skins/default/templates/node/wiki_symbol.html b/forum/skins/default/templates/node/wiki_symbol.html
new file mode 100644 (file)
index 0000000..3146a97
--- /dev/null
@@ -0,0 +1,11 @@
+{% load i18n extra_tags %}
+{% spaceless %}
+{% if is_wiki %}
+    <div class="community-wiki">
+        {% blocktrans %}This {{ post_type }} is marked "community wiki".{% endblocktrans %}
+        {% if can_edit %}
+            <br />{% blocktrans %}Feel free to <a href="{{ edit_url }}">edit it</a>.{% endblocktrans %}
+        {% endif %}
+    </div>
+{% endif %}
+{% endspaceless %}
\ No newline at end of file
index 7fb9d9de3bc8a41cf48254ab015617f4cf248e93..9a3384621d281d72f5f9f001a8737f3f507646f6 100644 (file)
                             <div class="question-body">\r
                                 {{ question.html|safe }}\r
                             </div>\r
-                            <div id="question-controls" class="post-controls">\r
-                                <div id="question-tags" class="tags">\r
-                                    {% for tag in question.tagname_list %}\r
-                                        <a href="{% url tag_questions tag|urlencode %}" class="post-tag"\r
-                                            title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>\r
-                                    {% endfor %}\r
-                                </div>\r
+                            <div id="question-tags" class="tags-container tags">\r
+                                {% for tag in question.tagname_list %}\r
+                                    <a href="{% url tag_questions tag|urlencode %}" class="post-tag"\r
+                                        title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>\r
+                                {% endfor %}\r
+                            </div>\r
+                            <div id="question-controls" class="post-controls">                            \r
                                 {% post_controls question request.user %}\r
+                                {% wiki_symbol request.user question %}\r
                             </div>\r
                             <div class="post-update-info-container">\r
                                     {% contributors_info question %}\r
index 7ade554eafacbcd92280907bc4d57ddd8b1b71f1..f12476162022c0e7011b6d66759e68f95c827e29 100644 (file)
@@ -26,6 +26,22 @@ def accept_button(answer, user):
         'user': user\r
     }\r
 \r
+@register.inclusion_tag('node/wiki_symbol.html')\r
+def wiki_symbol(user, post):\r
+    context = {\r
+        'is_wiki': post.nis.wiki,\r
+        'post_type': post.friendly_name\r
+    }\r
+\r
+    if post.nis.wiki:\r
+        if user.can_edit_post(post):\r
+            context['can_edit'] = True\r
+            context['edit_url'] = reverse('edit_' + post.node_type, kwargs={'id': post.id})\r
+        context['by'] = post.nstate.wiki.by.username\r
+        context['at'] = post.nstate.wiki.at\r
+\r
+    return context\r
+\r
 @register.inclusion_tag('node/favorite_mark.html')\r
 def favorite_mark(question, user):\r
     try:\r
@@ -46,7 +62,7 @@ def post_controls(post, user):
     menu = []\r
 \r
     if user.is_authenticated():\r
-        post_type = (post.__class__ is Question) and 'question' or 'answer'\r
+        post_type = post.node_type\r
 \r
         if post_type == "answer":\r
             controls.append(post_control(_('permanent link'), '#%d' % post.id, title=_("answer permanent link")))\r