From: hernani Date: Tue, 25 May 2010 21:28:23 +0000 (+0000) Subject: Visual indication of community wiki, and made the markddown_help use base_content... X-Git-Tag: live~802 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/1cbbc10ec680da017745add73b98986197988bd3?ds=sidebyside Visual indication of community wiki, and made the markddown_help use base_content so it can use the entire width of the page. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@329 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/images/wiki.png b/forum/skins/default/media/images/wiki.png new file mode 100644 index 0000000..a6be558 Binary files /dev/null and b/forum/skins/default/media/images/wiki.png differ diff --git a/forum/skins/default/media/style/style.css b/forum/skins/default/media/style/style.css index a9d2072..133d8ec 100644 --- a/forum/skins/default/media/style/style.css +++ b/forum/skins/default/media/style/style.css @@ -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; diff --git a/forum/skins/default/templates/markdown_help.html b/forum/skins/default/templates/markdown_help.html index a54334b..bb646cb 100644 --- a/forum/skins/default/templates/markdown_help.html +++ b/forum/skins/default/templates/markdown_help.html @@ -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 index 0000000..3146a97 --- /dev/null +++ b/forum/skins/default/templates/node/wiki_symbol.html @@ -0,0 +1,11 @@ +{% load i18n extra_tags %} +{% spaceless %} +{% if is_wiki %} +
+ {% blocktrans %}This {{ post_type }} is marked "community wiki".{% endblocktrans %} + {% if can_edit %} +
{% blocktrans %}Feel free to edit it.{% endblocktrans %} + {% endif %} +
+{% endif %} +{% endspaceless %} \ No newline at end of file diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 7fb9d9d..9a33846 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -76,14 +76,15 @@
{{ question.html|safe }}
-
-
- {% for tag in question.tagname_list %} - - {% endfor %} -
+
+ {% for tag in question.tagname_list %} + + {% endfor %} +
+
{% post_controls question request.user %} + {% wiki_symbol request.user question %}
{% contributors_info question %} diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index 7ade554..f124761 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -26,6 +26,22 @@ def accept_button(answer, user): 'user': user } +@register.inclusion_tag('node/wiki_symbol.html') +def wiki_symbol(user, post): + context = { + 'is_wiki': post.nis.wiki, + 'post_type': post.friendly_name + } + + if post.nis.wiki: + if user.can_edit_post(post): + context['can_edit'] = True + context['edit_url'] = reverse('edit_' + post.node_type, kwargs={'id': post.id}) + context['by'] = post.nstate.wiki.by.username + context['at'] = post.nstate.wiki.at + + return context + @register.inclusion_tag('node/favorite_mark.html') def favorite_mark(question, user): try: @@ -46,7 +62,7 @@ def post_controls(post, user): menu = [] if user.is_authenticated(): - post_type = (post.__class__ is Question) and 'question' or 'answer' + post_type = post.node_type if post_type == "answer": controls.append(post_control(_('permanent link'), '#%d' % post.id, title=_("answer permanent link")))