diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-06-20 23:23:53 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-06-20 23:23:53 -0400 |
commit | bb290f37db5c93509cc336595be828343381d9cd (patch) | |
tree | 2046402e816b4731ce90228ec7810f0d4642304b | |
parent | 4303c3d6b44a010b99459723900bbb5577f7ffb4 (diff) | |
download | askbot-bb290f37db5c93509cc336595be828343381d9cd.tar.gz askbot-bb290f37db5c93509cc336595be828343381d9cd.tar.bz2 askbot-bb290f37db5c93509cc336595be828343381d9cd.zip |
ran dos2unix on templates
-rw-r--r-- | askbot/skins/default/media/js/org.askbot.output-words.js | 194 | ||||
-rw-r--r-- | askbot/skins/default/templates/email_base.html | 50 | ||||
-rw-r--r-- | askbot/skins/default/templates/question.html | 1004 | ||||
-rw-r--r-- | askbot/skins/default/templates/question_list.html | 46 | ||||
-rw-r--r-- | askbot/skins/default/templates/questions.html | 546 | ||||
-rw-r--r-- | askbot/skins/default/templates/user_edit.html | 196 |
6 files changed, 1018 insertions, 1018 deletions
diff --git a/askbot/skins/default/media/js/org.askbot.output-words.js b/askbot/skins/default/media/js/org.askbot.output-words.js index 54eebba7..a9ad6981 100644 --- a/askbot/skins/default/media/js/org.askbot.output-words.js +++ b/askbot/skins/default/media/js/org.askbot.output-words.js @@ -1,97 +1,97 @@ -/*
-
- @desc Word checker
- Tests the JavaScript-side i18n translation arrays for completeness
- and generates an empty template containing all the keys
- for new translations.
-
- Is included by org.askbot.output-words.html.
-
- @author Pekka Gaiser <post@pekkagaiser.com>
- @package Part of the ASKBOT project <www.askbot.org>
- @license Published with NO WARRANTY WHATSOEVER
- under the same license as the Askbot project.
- @version First release, May 7th 2010
-
-*/
-
-
-function output()
- {
-
- document.write("<div class='column'><h1>Translation check</h1><table class='languages'>");
-
- var allKeys = new Array();
-
-
- for (var key in i18n)
- {
- if(!i18n.hasOwnProperty(key)) continue;
-
- for (var word in i18n[key])
- {
- if(!i18n[key].hasOwnProperty(word)) continue;
-
- if (jQuery.inArray(word, allKeys) == -1)
- allKeys.push(word);
-
- }
- }
-
-
- // Output all keys
- for (var key in allKeys.sort())
- {
-
- document.write("<tr><td>");
- document.write(allKeys[key]);
- document.write("</td><td>");
-
- // Check word in all languages
- for (var language in i18n)
- {
- if(!i18n.hasOwnProperty(language)) continue;
-
- if ((!i18n[language][allKeys[key]]) || (i18n[language][allKeys[key]] == ""))
- document.write("<td class='language missing'>"+language+"</td>");
- else
- document.write("<td class='language okay' title='"+escape(i18n[language][allKeys[key]])+"'>"+language+"</td>");
-
- escape(i18n[language][key])
-
- }
-
- document.write("</tr>");
-
- }
-
- document.write("</table></div><div class='column'>");
-
- // Translation template
-
- document.write("<h1>Template for new translation</h1>");
- document.write("<textarea style='width: 100%; height: 600px'>");
- document.write("// Note that the words ending with '/' (e.g. 'questions/') are directory names\n");
- document.write("// And need to be identical with the directory names\n");
- document.write("// in the basic server-side translation\n\n");
-
-
- document.write("var i18nXY = {\n");
-
- // Output all words
- for (var key in allKeys.sort())
- {
-
- document.write(" '"+allKeys[key]+"': '', \n");
-
- }
-
- document.write(" 'delete_this': ''\n}"); // To prevent trailing comma
- document.write("</textarea>");
-
- document.write("</div>");
-
-
- }
-
-
+/* + + @desc Word checker + Tests the JavaScript-side i18n translation arrays for completeness + and generates an empty template containing all the keys + for new translations. + + Is included by org.askbot.output-words.html. + + @author Pekka Gaiser <post@pekkagaiser.com> + @package Part of the ASKBOT project <www.askbot.org> + @license Published with NO WARRANTY WHATSOEVER + under the same license as the Askbot project. + @version First release, May 7th 2010 + +*/ + + +function output() + { + + document.write("<div class='column'><h1>Translation check</h1><table class='languages'>"); + + var allKeys = new Array(); + + + for (var key in i18n) + { + if(!i18n.hasOwnProperty(key)) continue; + + for (var word in i18n[key]) + { + if(!i18n[key].hasOwnProperty(word)) continue; + + if (jQuery.inArray(word, allKeys) == -1) + allKeys.push(word); + + } + } + + + // Output all keys + for (var key in allKeys.sort()) + { + + document.write("<tr><td>"); + document.write(allKeys[key]); + document.write("</td><td>"); + + // Check word in all languages + for (var language in i18n) + { + if(!i18n.hasOwnProperty(language)) continue; + + if ((!i18n[language][allKeys[key]]) || (i18n[language][allKeys[key]] == "")) + document.write("<td class='language missing'>"+language+"</td>"); + else + document.write("<td class='language okay' title='"+escape(i18n[language][allKeys[key]])+"'>"+language+"</td>"); + + escape(i18n[language][key]) + + } + + document.write("</tr>"); + + } + + document.write("</table></div><div class='column'>"); + + // Translation template + + document.write("<h1>Template for new translation</h1>"); + document.write("<textarea style='width: 100%; height: 600px'>"); + document.write("// Note that the words ending with '/' (e.g. 'questions/') are directory names\n"); + document.write("// And need to be identical with the directory names\n"); + document.write("// in the basic server-side translation\n\n"); + + + document.write("var i18nXY = {\n"); + + // Output all words + for (var key in allKeys.sort()) + { + + document.write(" '"+allKeys[key]+"': '', \n"); + + } + + document.write(" 'delete_this': ''\n}"); // To prevent trailing comma + document.write("</textarea>"); + + document.write("</div>"); + + + } + + diff --git a/askbot/skins/default/templates/email_base.html b/askbot/skins/default/templates/email_base.html index b74741e3..c9340b57 100644 --- a/askbot/skins/default/templates/email_base.html +++ b/askbot/skins/default/templates/email_base.html @@ -1,26 +1,26 @@ -{% load extra_filters %}
-{% load extra_tags %}
-{% load i18n %}
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <link href="{% fullmedia "/media/style/style.css" %}" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <a href="{% fullurl index %}">
- <img src="{% fullmedia "/media/images/logo.png" %}" title="{% trans "home" %}" alt="{{settings.APP_TITLE}} logo"/>
- </a>
- <br />
- <p>{{ settings.APP_TITLE }}</p>
- <br /><br />
- <div id="wrapper">
- <div id="room">
- <div id="CALeft">
- {% block content%}
- {% endblock%}
- </div>
- </div>
- <div class="spacer3"></div>
- </div>
- </body>
+{% load extra_filters %} +{% load extra_tags %} +{% load i18n %} + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <link href="{% fullmedia "/media/style/style.css" %}" rel="stylesheet" type="text/css" /> + </head> + <body> + <a href="{% fullurl index %}"> + <img src="{% fullmedia "/media/images/logo.png" %}" title="{% trans "home" %}" alt="{{settings.APP_TITLE}} logo"/> + </a> + <br /> + <p>{{ settings.APP_TITLE }}</p> + <br /><br /> + <div id="wrapper"> + <div id="room"> + <div id="CALeft"> + {% block content%} + {% endblock%} + </div> + </div> + <div class="spacer3"></div> + </div> + </body> </html>
\ No newline at end of file diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index 566f7762..71c2df01 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -1,502 +1,502 @@ -{% extends "base.html" %}
-<!-- question.html -->
-{% load extra_tags %}
-{% load extra_filters %}
-{% load smart_if %}
-{% load humanize %}
-{% load i18n %}
-{% load cache %}
-{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %}
-{% block meta_description %}
- <meta name="description" content="{{question.summary}}" />
-{% endblock %}
-{% block keywords %}{{question.tagname_meta_generator}}{% endblock %}
-{% block forejs %}
- <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />
- {% if not question.closed %}
- <script type='text/javascript' src='{% media "/media/js/com.cnprog.editor.js" %}'></script>
- <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
- <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
- <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
- {% endif %}
- <script type='text/javascript' src='{% media "/media/js/com.cnprog.post.js" %}'></script>
- <script type='text/javascript' src='{% media "/media/js/jquery.validate.pack.js" %}'></script>
-
- <script type="text/javascript">
- // define reputation needs for comments
- var repNeededForComments = 50;
- $().ready(function(){
- $("#nav_questions").attr('className',"on");
- var answer_sort_tab = "{{ tab_id }}";
- $("#" + answer_sort_tab).attr('className',"on");
-
- Vote.init({{ question.id }}, '{{ question.title|slugify }}', '{{ question.author.id }}','{{ request.user.id }}');
-
- {% if not question.closed and request.user.is_authenticated %}initEditor();{% endif %}
-
- lanai.highlightSyntax();
- $('#btLogin').bind('click', function(){window.location.href='{% url user_signin %}'; } )
- });
-
- function initEditor(){
- $('#editor').TextAreaResizer();
- //highlight code synctax when editor has new text
- $("#editor").typeWatch({highlight: false, wait: 3000,
- captureLength: 5, callback: lanai.highlightSyntax});
-
- var display = true;
- var txt = "[{% trans "hide preview" %}]";
- $('#pre-collapse').text(txt);
- $('#pre-collapse').bind('click', function(){
- txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
- display = !display;
- $('#previewer').toggle();
- $('#pre-collapse').text(txt);
- });
-
- setupFormValidation("#fmanswer", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages());
- }
-
- </script>
-{% endblock %}
-
-{% block content %}
-<div class="headNormal">
- <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>
-</div>
-<div id="main-body" class="">
- <div id="askform">
- <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- {% if question_vote %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- {% if question_vote.is_upvote %}
- src="{% media "/media/images/vote-arrow-up-on.png" %}"
- {% else %}
- src="{% media "/media/images/vote-arrow-up.png" %}"
- {% endif %}
- alt="{% trans "i like this post (click again to cancel)" %}"
- title="{% trans "i like this post (click again to cancel)" %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans "current number of votes" %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- {% if question_vote.is_downvote %}
- src="{% media "/media/images/vote-arrow-down-on.png" %}"
- {% else %}
- src="{% media "/media/images/vote-arrow-down.png" %}"
- {% endif %}
- alt="{% trans "i dont like this post (click again to cancel)" %}"
- title="{% trans "i dont like this post (click again to cancel)" %}" />
-
- {% else %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- alt="{% trans "i like this post (click again to cancel)" %}"
- src="{% media "/media/images/vote-arrow-up.png" %}"
- title="{% trans "i like this post (click again to cancel)" %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans "current number of votes" %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- src="{% media "/media/images/vote-arrow-down.png" %}"
- alt="{% trans "i dont like this post (click again to cancel)" %}"
- title="{% trans "i dont like this post (click again to cancel)" %}" />
- {% endif %}
- {% if favorited %}
- <img class="question-img-favorite" src="{% media "/media/images/vote-favorite-on.png" %}"
- alt="{% trans "mark this question as favorite (click again to cancel)" %}"
- title="{% trans "mark this question as favorite (click again to cancel)" %}" />
- <div id="favorite-number" class="favorite-number my-favorite-number">
- {{ question.favourite_count }}
- </div>
- {% else %}
- <img class="question-img-favorite" src="{% media "/media/images/vote-favorite-off.png" %}"
- alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}"
- title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" />
- <div id="favorite-number" class="favorite-number">
- {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %}
- </div>
- {% endif %}
-
- </div>
- </td>
- <td>
- <div id="item-right">
- <div class="question-body">
- {{ question.html|safe }}
- </div>
- <div id="question-controls" class="post-controls">
- {% comment %}todo: here we have important case to reset search state{% endcomment %}
- <div id="question-tags" class="tags">
- {% for tag in question.tagname_list %}
- <a href="{% url questions %}?tags={{tag|urlencode}}&start_over=true"
- class="post-tag"
- title="{% blocktrans %}see questions tagged '{{tag}}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
- {% endfor %}
- </div>
- {% joinitems using '<span class="action-link-separator">|</span>' %}
- {% if request.user|can_edit_post:question %}
- <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span>
- {% endif %}
- {% separator %}
- {% if question.closed %}
- {% if request.user|can_reopen_question:question %}
- <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span>
- {% endif %}
- {% else %}
- {% if request.user|can_close_question:question %}
- <span class="action-link"><a href="{% url close question.id %}">{% trans "close" %}</a></span>
- {% endif %}
- {% endif %}
- {% separator %}
- {% if request.user|can_flag_offensive %}
- <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag"
- title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">
- <a>{% trans "flag offensive" %}</a>
- {% if request.user|can_view_offensive_flags and question.offensive_flag_count %}
- <span class="darkred">({{ question.offensive_flag_count }})</span>
- {% endif %}
- </span>
- {% endif %}
- {% separator %}
- {% if request.user|can_delete_post:question %}
- <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span>
- {% endif %}
- {% endjoinitems %}
- </div>
- <div class="post-update-info-container">
- {% post_contributor_info question "original_author" %}
- {% post_contributor_info question "last_updater" %}
- </div>
- <div class="comments-container" id="comments-container-question-{{question.id}}">
- {% for comment in question.get_comments|slice:":5" %}
- <p class="comment" id="comment-{{comment.id}}">
- {{comment.html|safe}}
- - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>
- {% spaceless %}
- <span class="comment-age">({% diff_date comment.added_at %})</span>
- {% if request.user|can_delete_comment:comment %}
- <img class="delete-icon"
- src="{% media "/media/images/close-small.png" %}"
- title="{% trans "delete this comment" %}"/>
- {% endif %}
- {% endspaceless %}
- </p>
- {% endfor %}
- </div>
- <div class="post-comments" style="margin-bottom:20px">
- <input id="can-post-comments-question-{{question.id}}" type="hidden" value="{{ request.user|can_add_comments:question }}"/>
- {% if request.user|can_add_comments:question or question.comment_count > 5 %}
- <a id="comments-link-question-{{question.id}}" class="comments-link">
- {% if request.user|can_add_comments:question %}
- {% trans "add comment" %}
- {% endif %}
- {% if question.comment_count > 5 %}
- {% if request.user|can_add_comments:question %}/
- {% blocktrans count question.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more{% plural %}see <strong>{{counter}}</strong> more{% endblocktrans %}
- {% else %}
- {% blocktrans count question.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more comment{% plural %}see <strong>{{counter}}</strong> more comments
- {% endblocktrans %}
- {% endif %}
- {% endif %}</a>
- {% endif %}
- </div>
- </div>
-
- </td>
- </tr>
- </table>
- {% if question.closed %}
- <div class="question-status" style="margin-bottom:15px">
- <h3>{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %}
- <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a>
- {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}</h3>
- </div>
- {% endif %}
- {% if answers %}
- <hr/>
- <div class="tabBar">
- <a name="sort-top"></a>
- <div class="headUsers">
- {% blocktrans count answers|length as counter %}
- {{counter}} Answer:
- {% plural %}
- {{counter}} Answers:
- {% endblocktrans %}
- </div>
- <div class="tabsA">
- <a id="oldest" href="{% url question question.id %}?sort=oldest#sort-top"
- title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>
- <a id="latest" href="{% url question question.id %}?sort=latest#sort-top"
- title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>
- <a id="votes" href="{% url question question.id %}?sort=votes#sort-top"
- title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a>
- </div>
- </div>
- {% cnprog_paginator context %}
-
- {% for answer in answers %}
- <a name="{{ answer.id }}"></a>
- <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}">
- <table style="width:100%;">
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote"
- src="{% blockmedia %}/media/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png{% endblockmedia %}"
- alt="{% trans "i like this answer (click again to cancel)" %}"
- title="{% trans "i like this answer (click again to cancel)" %}"/>
- <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}">
- {{ answer.score }}
- </div>
- <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote"
- src="{% blockmedia %}/media/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png{% endblockmedia %}"
- alt="{% trans "i dont like this answer (click again to cancel)" %}"
- title="{% trans "i dont like this answer (click again to cancel)" %}" />
-
- {% ifequal request.user question.author %}
- <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
- src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}"
- alt="{% trans "mark this answer as favorite (click again to undo)" %}"
- title="{% trans "mark this answer as favorite (click again to undo)" %}" />
- {% else %}
- {% if answer.accepted %}
- <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
- src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}"
- alt="{% trans "the author of the question has selected this answer as correct" %}"
- title="{% trans "the author of the question has selected this answer as correct" %}" />
- {% endif %}
- {% endifequal %}
- </div>
- </td>
- <td>
- <div class="item-right">
- <div class="answer-body">
- {{ answer.html|safe }}
- </div>
- <div class="answer-controls post-controls">
- {% joinitems using '<span class="action-link-separator">|</span>' %}
- <span class="linksopt">
- <a href="#{{ answer.id }}" title="{% trans "answer permanent link" %}">
- {% trans "permanent link" %}
- </a>
- </span>
- {% separator %}
- {% if request.user|can_edit_post:answer %}
- <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span>
- {% endif %}
- {% separator %}
- {% if request.user|can_flag_offensive %}
- <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag"
- title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}">
- <a>{% trans "flag offensive" %}</a>
- {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %}
- <span class="darkred">({{ answer.offensive_flag_count }})</span>
- {% endif %}
- </span>
- {% endif %}
- {% separator %}
- {% if request.user|can_delete_post:answer %}
- {% spaceless %}
- <span class="action-link">
- <a id="answer-delete-link-{{answer.id}}">
- {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a>
- </span>
- {% endspaceless %}
- {% endif %}
- {% endjoinitems %}
- </div>
- <div class="post-update-info-container">
- {% post_contributor_info answer "original_author" %}
- {% post_contributor_info answer "last_updater" %}
- </div>
- <div class="comments-container" id="comments-container-answer-{{answer.id}}">
- {% for comment in answer.get_comments|slice:":5" %}
- <p id="comment-{{comment.id}}" class="comment">
- {{comment.html|safe}}
- - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>
- {% spaceless %}
- <span class="comment-age">({% diff_date comment.added_at %})</span>
- {% if request.user|can_delete_comment:comment %}
- <img class="delete-icon"
- src="{% media "/media/images/close-small.png" %}"
- title="{% trans "delete this comment" %}"/>
- {% endif %}
- {% endspaceless %}
- </p>
- {% endfor %}
- </div>
- <div class="post-comments" style="margin-bottom:20px">
- <input id="can-post-comments-answer-{{answer.id}}" type="hidden" value="{{ request.user|can_add_comments:answer}}"/>
- {% if request.user|can_add_comments:answer or answer.comment_count > 5 %}
- <a id="comments-link-answer-{{answer.id}}" class="comments-link">
- {% if request.user|can_add_comments:answer %}
- {% trans "add comment" %}
- {% endif %}
- {% if answer.comment_count > 5 %}
- {% if request.user|can_add_comments:answer %}/
- {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more{% plural %}see <strong>{{counter}}</strong> more{% endblocktrans %}
- {% else %}
- {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more comment{% plural %} see <strong>{{counter}}</strong> more comments{% endblocktrans %}
- {% endif %}
- {% endif %}</a>
- {% endif %}
- </div>
- </div>
-
- </td>
- </tr>
- </table>
- </div>
- {% endfor %}
- <div class="paginator-container-left">
- {% cnprog_paginator context %}
- </div>
- {% endif %}
- <form id="fmanswer" action="{% url answer question.id %}" method="post">
- {% if request.user.is_authenticated %}
- <p style="padding-left:3px">
- {{ answer.email_notify }}
- <label for="question-subscribe-updates">
- {% ifequal request.user.get_q_sel_email_feed_frequency 'n' %}
- {% trans "Notify me once a day when there are any new answers" %}
- {% else %}
- {% ifequal request.user.get_q_sel_email_feed_frequency 'd' %}
- {% trans "Notify me once a day when there are any new answers" %}
- {% else %}
- {% ifequal request.user.get_q_sel_email_feed_frequency 'w' %}
- {% trans "Notify me weekly when there are any new answers" %}
- {% endifequal %}
- {% endifequal %}
- {% endifequal %}
- </label>
- {% blocktrans with request.user.get_profile_url as profile_url %}You can always adjust frequency of email updates from your {{profile_url}}{% endblocktrans %}
- </p>
- {% else %}
- <p style="padding-left:3px">
- <input class="nomargin" type="checkbox" disabled="disabled" />
- <label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label>
- </p>
- {% endif %}
- <div style="clear:both">
- </div>
-
- {% if not question.closed %}
- <div style="padding:10px 0 0 0;">
- {% spaceless %}
- <div class="headNormal">
- {% if answers %}
- {% trans "Your answer" %}
- {% else %}
- {% trans "Be the first one to answer this question!" %}
- {% endif %}
- </div>
- {% endspaceless %}
- </div>
- {% if not request.user.is_authenticated %}
- <div class="message">{% trans "you can answer anonymously and then login" %}</div>
- {% else %}
- <p class="message">
- {% ifequal request.user question.author %}
- {% trans "answer your own question only to give an answer" %}
- {% else %}
- {% trans "please only give an answer, no discussions" %}
- {% endifequal %}
- </p>
- {% endif %}
-
- <div id="description" class="" >
- <div id="wmd-button-bar" class="wmd-panel"></div>
- {{ answer.text }}
- <div class="preview-toggle">
- <table width="100%">
- <tr>
- <td>
- <span id="pre-collapse"
- title="{% trans "Toggle the real time Markdown editor preview" %}">
- {% trans "toggle preview" %}
- </span>
- </td>
- {% if settings.WIKI_ON %}
- <td style="text-align:right;">
- {{ answer.wiki }}
- <span style="font-weight:normal;cursor:help"
- title="{{answer.wiki.help_text}}">
- {{ answer.wiki.label_tag }}
- </span>
- </td>
- {% endif %}
- </tr>
-
- </table>
- </div>
- <div id="previewer" class="wmd-preview"></div>
- {{ answer.text.errors }}
- </div>
- <p><span class="form-error"></span></p>
- <input type="submit"
- {% if user.is_anonymous %}
- value="{% trans "Login/Signup to Post Your Answer" %}"
- {% else %}
- {% if user == question.author %}
- value="{% trans "Answer Your Own Question" %}"
- {% else %}
- value="{% trans "Answer the question" %}"
- {% endif %}
- {% endif %}
- class="submit" style="float:left"/>
- {% endif %}
- </form>
- </div>
-</div>
-{% endblock %}
-
-{% block sidebar %}
-{% cache 600 questions_tags question.id %}
-<div class="boxC">
- <p>
- {% trans "Question tags" %}:
- </p>
- <p class="tags" >
- {% for tag in tags %}
- <a href="{% url questions %}?tags={{tag.name|urlencode}}&start_over=true"
- title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{tag_name}}'{% endblocktrans %}"
- rel="tag">{{ tag.name }}</a>
- <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
- {% endfor %}
- </p>
- <p>
- {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong>
- </p>
- <p>
- {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong>
- </p>
- <p>
- {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong>
- </p>
-</div>
-{% endcache %}
-{% cache 1800 related_questions question.id %}
-<div class="boxC">
- <h3 class="subtitle">{% trans "Related questions" %}</h3>
- <div class="questions-related">
-
- {% for question in similar_questions.data %}
- <p>
- <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a>
- </p>
- {% endfor %}
-
- </div>
-</div>
-{% endcache %}
-
-{% endblock %}
-
-{% block endjs %}
-{% endblock %}
-<!-- end question.html -->
+{% extends "base.html" %} +<!-- question.html --> +{% load extra_tags %} +{% load extra_filters %} +{% load smart_if %} +{% load humanize %} +{% load i18n %} +{% load cache %} +{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} +{% block meta_description %} + <meta name="description" content="{{question.summary}}" /> +{% endblock %} +{% block keywords %}{{question.tagname_meta_generator}}{% endblock %} +{% block forejs %} + <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" /> + {% if not question.closed %} + <script type='text/javascript' src='{% media "/media/js/com.cnprog.editor.js" %}'></script> + <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script> + <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script> + <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" /> + {% endif %} + <script type='text/javascript' src='{% media "/media/js/com.cnprog.post.js" %}'></script> + <script type='text/javascript' src='{% media "/media/js/jquery.validate.pack.js" %}'></script> + + <script type="text/javascript"> + // define reputation needs for comments + var repNeededForComments = 50; + $().ready(function(){ + $("#nav_questions").attr('className',"on"); + var answer_sort_tab = "{{ tab_id }}"; + $("#" + answer_sort_tab).attr('className',"on"); + + Vote.init({{ question.id }}, '{{ question.title|slugify }}', '{{ question.author.id }}','{{ request.user.id }}'); + + {% if not question.closed and request.user.is_authenticated %}initEditor();{% endif %} + + lanai.highlightSyntax(); + $('#btLogin').bind('click', function(){window.location.href='{% url user_signin %}'; } ) + }); + + function initEditor(){ + $('#editor').TextAreaResizer(); + //highlight code synctax when editor has new text + $("#editor").typeWatch({highlight: false, wait: 3000, + captureLength: 5, callback: lanai.highlightSyntax}); + + var display = true; + var txt = "[{% trans "hide preview" %}]"; + $('#pre-collapse').text(txt); + $('#pre-collapse').bind('click', function(){ + txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]"; + display = !display; + $('#previewer').toggle(); + $('#pre-collapse').text(txt); + }); + + setupFormValidation("#fmanswer", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages()); + } + + </script> +{% endblock %} + +{% block content %} +<div class="headNormal"> + <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> +</div> +<div id="main-body" class=""> + <div id="askform"> + <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}> + <tr> + <td style="width:30px;vertical-align:top"> + <div class="vote-buttons"> + {% if question_vote %} + <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" + {% if question_vote.is_upvote %} + src="{% media "/media/images/vote-arrow-up-on.png" %}" + {% else %} + src="{% media "/media/images/vote-arrow-up.png" %}" + {% endif %} + alt="{% trans "i like this post (click again to cancel)" %}" + title="{% trans "i like this post (click again to cancel)" %}" /> + <div id="question-vote-number-{{ question.id }}" class="vote-number" + title="{% trans "current number of votes" %}"> + {{ question.score }} + </div> + <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" + {% if question_vote.is_downvote %} + src="{% media "/media/images/vote-arrow-down-on.png" %}" + {% else %} + src="{% media "/media/images/vote-arrow-down.png" %}" + {% endif %} + alt="{% trans "i dont like this post (click again to cancel)" %}" + title="{% trans "i dont like this post (click again to cancel)" %}" /> + + {% else %} + <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" + alt="{% trans "i like this post (click again to cancel)" %}" + src="{% media "/media/images/vote-arrow-up.png" %}" + title="{% trans "i like this post (click again to cancel)" %}" /> + <div id="question-vote-number-{{ question.id }}" class="vote-number" + title="{% trans "current number of votes" %}"> + {{ question.score }} + </div> + <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" + src="{% media "/media/images/vote-arrow-down.png" %}" + alt="{% trans "i dont like this post (click again to cancel)" %}" + title="{% trans "i dont like this post (click again to cancel)" %}" /> + {% endif %} + {% if favorited %} + <img class="question-img-favorite" src="{% media "/media/images/vote-favorite-on.png" %}" + alt="{% trans "mark this question as favorite (click again to cancel)" %}" + title="{% trans "mark this question as favorite (click again to cancel)" %}" /> + <div id="favorite-number" class="favorite-number my-favorite-number"> + {{ question.favourite_count }} + </div> + {% else %} + <img class="question-img-favorite" src="{% media "/media/images/vote-favorite-off.png" %}" + alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}" + title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" /> + <div id="favorite-number" class="favorite-number"> + {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %} + </div> + {% endif %} + + </div> + </td> + <td> + <div id="item-right"> + <div class="question-body"> + {{ question.html|safe }} + </div> + <div id="question-controls" class="post-controls"> + {% comment %}todo: here we have important case to reset search state{% endcomment %} + <div id="question-tags" class="tags"> + {% for tag in question.tagname_list %} + <a href="{% url questions %}?tags={{tag|urlencode}}&start_over=true" + class="post-tag" + title="{% blocktrans %}see questions tagged '{{tag}}'{% endblocktrans %}" rel="tag">{{ tag }}</a> + {% endfor %} + </div> + {% joinitems using '<span class="action-link-separator">|</span>' %} + {% if request.user|can_edit_post:question %} + <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span> + {% endif %} + {% separator %} + {% if question.closed %} + {% if request.user|can_reopen_question:question %} + <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span> + {% endif %} + {% else %} + {% if request.user|can_close_question:question %} + <span class="action-link"><a href="{% url close question.id %}">{% trans "close" %}</a></span> + {% endif %} + {% endif %} + {% separator %} + {% if request.user|can_flag_offensive %} + <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag" + title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}"> + <a>{% trans "flag offensive" %}</a> + {% if request.user|can_view_offensive_flags and question.offensive_flag_count %} + <span class="darkred">({{ question.offensive_flag_count }})</span> + {% endif %} + </span> + {% endif %} + {% separator %} + {% if request.user|can_delete_post:question %} + <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span> + {% endif %} + {% endjoinitems %} + </div> + <div class="post-update-info-container"> + {% post_contributor_info question "original_author" %} + {% post_contributor_info question "last_updater" %} + </div> + <div class="comments-container" id="comments-container-question-{{question.id}}"> + {% for comment in question.get_comments|slice:":5" %} + <p class="comment" id="comment-{{comment.id}}"> + {{comment.html|safe}} + - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a> + {% spaceless %} + <span class="comment-age">({% diff_date comment.added_at %})</span> + {% if request.user|can_delete_comment:comment %} + <img class="delete-icon" + src="{% media "/media/images/close-small.png" %}" + title="{% trans "delete this comment" %}"/> + {% endif %} + {% endspaceless %} + </p> + {% endfor %} + </div> + <div class="post-comments" style="margin-bottom:20px"> + <input id="can-post-comments-question-{{question.id}}" type="hidden" value="{{ request.user|can_add_comments:question }}"/> + {% if request.user|can_add_comments:question or question.comment_count > 5 %} + <a id="comments-link-question-{{question.id}}" class="comments-link"> + {% if request.user|can_add_comments:question %} + {% trans "add comment" %} + {% endif %} + {% if question.comment_count > 5 %} + {% if request.user|can_add_comments:question %}/ + {% blocktrans count question.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more{% plural %}see <strong>{{counter}}</strong> more{% endblocktrans %} + {% else %} + {% blocktrans count question.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more comment{% plural %}see <strong>{{counter}}</strong> more comments + {% endblocktrans %} + {% endif %} + {% endif %}</a> + {% endif %} + </div> + </div> + + </td> + </tr> + </table> + {% if question.closed %} + <div class="question-status" style="margin-bottom:15px"> + <h3>{% blocktrans with question.get_close_reason_display as close_reason %}The question has been closed for the following reason "{{ close_reason }}" by{% endblocktrans %} + <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a> + {% blocktrans with question.closed_at as closed_at %}close date {{closed_at}}{% endblocktrans %}</h3> + </div> + {% endif %} + {% if answers %} + <hr/> + <div class="tabBar"> + <a name="sort-top"></a> + <div class="headUsers"> + {% blocktrans count answers|length as counter %} + {{counter}} Answer: + {% plural %} + {{counter}} Answers: + {% endblocktrans %} + </div> + <div class="tabsA"> + <a id="oldest" href="{% url question question.id %}?sort=oldest#sort-top" + title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a> + <a id="latest" href="{% url question question.id %}?sort=latest#sort-top" + title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a> + <a id="votes" href="{% url question question.id %}?sort=votes#sort-top" + title="{% trans "most voted answers will be shown first" %}">{% trans "popular answers" %}</a> + </div> + </div> + {% cnprog_paginator context %} + + {% for answer in answers %} + <a name="{{ answer.id }}"></a> + <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% ifequal answer.author_id question.author_id %} answered-by-owner{% endifequal %} {% if answer.deleted %}deleted{% endif %}"> + <table style="width:100%;"> + <tr> + <td style="width:30px;vertical-align:top"> + <div class="vote-buttons"> + <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" + src="{% blockmedia %}/media/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png{% endblockmedia %}" + alt="{% trans "i like this answer (click again to cancel)" %}" + title="{% trans "i like this answer (click again to cancel)" %}"/> + <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}"> + {{ answer.score }} + </div> + <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" + src="{% blockmedia %}/media/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png{% endblockmedia %}" + alt="{% trans "i dont like this answer (click again to cancel)" %}" + title="{% trans "i dont like this answer (click again to cancel)" %}" /> + + {% ifequal request.user question.author %} + <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" + src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}" + alt="{% trans "mark this answer as favorite (click again to undo)" %}" + title="{% trans "mark this answer as favorite (click again to undo)" %}" /> + {% else %} + {% if answer.accepted %} + <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" + src="{% blockmedia %}/media/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png{% endblockmedia %}" + alt="{% trans "the author of the question has selected this answer as correct" %}" + title="{% trans "the author of the question has selected this answer as correct" %}" /> + {% endif %} + {% endifequal %} + </div> + </td> + <td> + <div class="item-right"> + <div class="answer-body"> + {{ answer.html|safe }} + </div> + <div class="answer-controls post-controls"> + {% joinitems using '<span class="action-link-separator">|</span>' %} + <span class="linksopt"> + <a href="#{{ answer.id }}" title="{% trans "answer permanent link" %}"> + {% trans "permanent link" %} + </a> + </span> + {% separator %} + {% if request.user|can_edit_post:answer %} + <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span> + {% endif %} + {% separator %} + {% if request.user|can_flag_offensive %} + <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" + title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}"> + <a>{% trans "flag offensive" %}</a> + {% if request.user|can_view_offensive_flags and answer.offensive_flag_count %} + <span class="darkred">({{ answer.offensive_flag_count }})</span> + {% endif %} + </span> + {% endif %} + {% separator %} + {% if request.user|can_delete_post:answer %} + {% spaceless %} + <span class="action-link"> + <a id="answer-delete-link-{{answer.id}}"> + {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a> + </span> + {% endspaceless %} + {% endif %} + {% endjoinitems %} + </div> + <div class="post-update-info-container"> + {% post_contributor_info answer "original_author" %} + {% post_contributor_info answer "last_updater" %} + </div> + <div class="comments-container" id="comments-container-answer-{{answer.id}}"> + {% for comment in answer.get_comments|slice:":5" %} + <p id="comment-{{comment.id}}" class="comment"> + {{comment.html|safe}} + - <a class="comment-user" href="{{comment.user.get_profile_url}}">{{comment.user}}</a> + {% spaceless %} + <span class="comment-age">({% diff_date comment.added_at %})</span> + {% if request.user|can_delete_comment:comment %} + <img class="delete-icon" + src="{% media "/media/images/close-small.png" %}" + title="{% trans "delete this comment" %}"/> + {% endif %} + {% endspaceless %} + </p> + {% endfor %} + </div> + <div class="post-comments" style="margin-bottom:20px"> + <input id="can-post-comments-answer-{{answer.id}}" type="hidden" value="{{ request.user|can_add_comments:answer}}"/> + {% if request.user|can_add_comments:answer or answer.comment_count > 5 %} + <a id="comments-link-answer-{{answer.id}}" class="comments-link"> + {% if request.user|can_add_comments:answer %} + {% trans "add comment" %} + {% endif %} + {% if answer.comment_count > 5 %} + {% if request.user|can_add_comments:answer %}/ + {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more{% plural %}see <strong>{{counter}}</strong> more{% endblocktrans %} + {% else %} + {% blocktrans count answer.get_comments|slice:"5:"|length as counter %}see <strong>{{counter}}</strong> more comment{% plural %} see <strong>{{counter}}</strong> more comments{% endblocktrans %} + {% endif %} + {% endif %}</a> + {% endif %} + </div> + </div> + + </td> + </tr> + </table> + </div> + {% endfor %} + <div class="paginator-container-left"> + {% cnprog_paginator context %} + </div> + {% endif %} + <form id="fmanswer" action="{% url answer question.id %}" method="post"> + {% if request.user.is_authenticated %} + <p style="padding-left:3px"> + {{ answer.email_notify }} + <label for="question-subscribe-updates"> + {% ifequal request.user.get_q_sel_email_feed_frequency 'n' %} + {% trans "Notify me once a day when there are any new answers" %} + {% else %} + {% ifequal request.user.get_q_sel_email_feed_frequency 'd' %} + {% trans "Notify me once a day when there are any new answers" %} + {% else %} + {% ifequal request.user.get_q_sel_email_feed_frequency 'w' %} + {% trans "Notify me weekly when there are any new answers" %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + </label> + {% blocktrans with request.user.get_profile_url as profile_url %}You can always adjust frequency of email updates from your {{profile_url}}{% endblocktrans %} + </p> + {% else %} + <p style="padding-left:3px"> + <input class="nomargin" type="checkbox" disabled="disabled" /> + <label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label> + </p> + {% endif %} + <div style="clear:both"> + </div> + + {% if not question.closed %} + <div style="padding:10px 0 0 0;"> + {% spaceless %} + <div class="headNormal"> + {% if answers %} + {% trans "Your answer" %} + {% else %} + {% trans "Be the first one to answer this question!" %} + {% endif %} + </div> + {% endspaceless %} + </div> + {% if not request.user.is_authenticated %} + <div class="message">{% trans "you can answer anonymously and then login" %}</div> + {% else %} + <p class="message"> + {% ifequal request.user question.author %} + {% trans "answer your own question only to give an answer" %} + {% else %} + {% trans "please only give an answer, no discussions" %} + {% endifequal %} + </p> + {% endif %} + + <div id="description" class="" > + <div id="wmd-button-bar" class="wmd-panel"></div> + {{ answer.text }} + <div class="preview-toggle"> + <table width="100%"> + <tr> + <td> + <span id="pre-collapse" + title="{% trans "Toggle the real time Markdown editor preview" %}"> + {% trans "toggle preview" %} + </span> + </td> + {% if settings.WIKI_ON %} + <td style="text-align:right;"> + {{ answer.wiki }} + <span style="font-weight:normal;cursor:help" + title="{{answer.wiki.help_text}}"> + {{ answer.wiki.label_tag }} + </span> + </td> + {% endif %} + </tr> + + </table> + </div> + <div id="previewer" class="wmd-preview"></div> + {{ answer.text.errors }} + </div> + <p><span class="form-error"></span></p> + <input type="submit" + {% if user.is_anonymous %} + value="{% trans "Login/Signup to Post Your Answer" %}" + {% else %} + {% if user == question.author %} + value="{% trans "Answer Your Own Question" %}" + {% else %} + value="{% trans "Answer the question" %}" + {% endif %} + {% endif %} + class="submit" style="float:left"/> + {% endif %} + </form> + </div> +</div> +{% endblock %} + +{% block sidebar %} +{% cache 600 questions_tags question.id %} +<div class="boxC"> + <p> + {% trans "Question tags" %}: + </p> + <p class="tags" > + {% for tag in tags %} + <a href="{% url questions %}?tags={{tag.name|urlencode}}&start_over=true" + title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{tag_name}}'{% endblocktrans %}" + rel="tag">{{ tag.name }}</a> + <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/> + {% endfor %} + </p> + <p> + {% trans "question asked" %}: <strong title="{{ question.added_at }}">{% diff_date question.added_at %}</strong> + </p> + <p> + {% trans "question was seen" %}: <strong>{{ question.view_count|intcomma }} {% trans "times" %}</strong> + </p> + <p> + {% trans "last updated" %}: <strong title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</strong> + </p> +</div> +{% endcache %} +{% cache 1800 related_questions question.id %} +<div class="boxC"> + <h3 class="subtitle">{% trans "Related questions" %}</h3> + <div class="questions-related"> + + {% for question in similar_questions.data %} + <p> + <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> + </p> + {% endfor %} + + </div> +</div> +{% endcache %} + +{% endblock %} + +{% block endjs %} +{% endblock %} +<!-- end question.html --> diff --git a/askbot/skins/default/templates/question_list.html b/askbot/skins/default/templates/question_list.html index c9fc1f96..3410c6ae 100644 --- a/askbot/skins/default/templates/question_list.html +++ b/askbot/skins/default/templates/question_list.html @@ -1,23 +1,23 @@ -{% load cache %}
-{% load i18n %}
-{% load humanize %}
-{% load extra_filters %}
-{% load extra_tags %}
-
-{% for question in questions.object_list %}
-<div class="short-summary">
- {% question_counter_widget question %}
- <h2><a title="{{question.summary}}" href="{% url question id=question.id %}{{question.title|slugify}}">{{question.title}}</a></h2>
- <div class="userinfo">
- <span class="relativetime" title="{{question.last_activity_at}}">{% diff_date question.last_activity_at %}</span>
- {% if question.last_activity_by %}
- <a href="{% url user_profile question.last_activity_by.id question.last_activity_by.username|slugify %}">{{ question.last_activity_by }}</a> {% get_score_badge question.last_activity_by %}
- {% endif %}
- </div>
- <div class="tags">
- {% for tag in question.tagname_list %}
- <a href="{% url questions %}?tags={{tag|urlencode}}" title="{% blocktrans %}see questions tagged '{{ tag }}'{%endblocktrans %}" rel="tag">{{ tag }}</a>
- {% endfor %}
- </div>
-</div>
-{% endfor %}
+{% load cache %} +{% load i18n %} +{% load humanize %} +{% load extra_filters %} +{% load extra_tags %} + +{% for question in questions.object_list %} +<div class="short-summary"> + {% question_counter_widget question %} + <h2><a title="{{question.summary}}" href="{% url question id=question.id %}{{question.title|slugify}}">{{question.title}}</a></h2> + <div class="userinfo"> + <span class="relativetime" title="{{question.last_activity_at}}">{% diff_date question.last_activity_at %}</span> + {% if question.last_activity_by %} + <a href="{% url user_profile question.last_activity_by.id question.last_activity_by.username|slugify %}">{{ question.last_activity_by }}</a> {% get_score_badge question.last_activity_by %} + {% endif %} + </div> + <div class="tags"> + {% for tag in question.tagname_list %} + <a href="{% url questions %}?tags={{tag|urlencode}}" title="{% blocktrans %}see questions tagged '{{ tag }}'{%endblocktrans %}" rel="tag">{{ tag }}</a> + {% endfor %} + </div> +</div> +{% endfor %} diff --git a/askbot/skins/default/templates/questions.html b/askbot/skins/default/templates/questions.html index 58006b77..dca26dc9 100644 --- a/askbot/skins/default/templates/questions.html +++ b/askbot/skins/default/templates/questions.html @@ -1,273 +1,273 @@ -{% extends "base.html" %}
-<!-- questions.html -->
-{% load extra_tags %}
-{% load i18n %}
-{% load humanize %}
-{% load extra_filters %}
-{% load smart_if %}
-{% load cache %}
-{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}
-{% block forejs %}
- <script type="text/javascript">
- var tags = {{ tags_autocomplete|safe }};
- $().ready(function(){
- var sort_tab_id = "{{ sort }}";
- $("#"+sort_tab_id).attr('className',"on");
- var scope_tab_id = "{{ scope }}";
- $("#"+scope_tab_id).attr('className',"on");
- var on_tab = '#nav_questions';
- $(on_tab).attr('className','on');
- Hilite.exact = false;
- Hilite.elementid = "listA";
- Hilite.debug_referrer = location.href;
- });
- </script>
- <script type='text/javascript' src='{% media "/media/js/com.cnprog.editor.js" %}'></script>
- <script type='text/javascript' src='{% media "/media/js/com.cnprog.tag_selector.js" %}'></script>
-{% endblock %}
-{% block content %}
-<div class="tabBar">
- {% comment %}
- <div class="headUsers">
- {% if searchtag %}
- {% trans "Found by tags" %}
- {% else %}
- {% if searchtitle %}
- {% if settings.USE_SPHINX_SEARCH %}
- {% trans "Search results" %}
- {% else %}
- {% trans "Found by title" %}
- {% endif %}
- {% else %}
- {% if is_unanswered %}
- {% trans "Unanswered questions" %}
- {% else %}
- {% trans "All questions" %}
- {% endif %}
- {% endif %}
- {% endif %}
- </div><br/>
- {% endcomment %}
- <div class="tabsC">
- <span class="label">{% trans "In:" %}</span>
- <a id="all" class="off" href="?scope=all" title="{% trans "see all questions" %}">{% trans "all" %}</a>
- <a id="unanswered" class="off" href="?scope=unanswered&sort=coldest" title="{% trans "see unanswered questions" %}">{% trans "unanswered" %}</a>
- {% if request.user.is_authenticated %}
- <a id="favorite" class="off" href="?scope=favorite" title="{% trans "see your favorite questions" %}">{% trans "favorite" %}</a>
- {% endif %}
- </div>
- <div class="tabsA">
- <span class="label">{% trans "Sort by:" %}</span>
- {% if sort == "oldest" %}
- <a id="oldest"
- href="?sort=latest"
- class="off"
- title="{% trans "click to see the newest questions" %}">{% trans "oldest" %}</a>
- {% else %}
- {% if sort == "latest" %}
- <a id="latest"
- href="?sort=oldest"
- class="off"
- title="{% trans "click to see the oldest questions" %}">{% trans "newest" %}</a>
- {% else %}
- <a id="latest"
- href="?sort=latest"
- class="off"
- title="{% trans "click to see the newest questions" %}">{% trans "newest" %}</a>
- {% endif %}
- {% endif %}
-
- {% if sort == "inactive" %}
- <a id="inactive"
- href="?sort=active"
- class="off"
- title="{% trans "click to see the most recently updated questions" %}">{% trans "inactive" %}</a>
- {% else %}
- {% if sort == "active" %}
- <a id="active"
- href="?sort=inactive"
- class="off"
- title="{% trans "click to see the least recently updated questions" %}">{% trans "active" %}</a>
- {% else %}
- <a id="active"
- href="?sort=active"
- class="off"
- title="{% trans "click to see the most recently updated questions" %}">{% trans "active" %}</a>
- {% endif %}
- {% endif %}
-
- {% if sort == "coldest" %}
- <a id="coldest"
- href="?sort=hottest"
- class="off"
- title="{% trans "click to see hottest questions" %}">{% trans "less answers" %}</a>
- {% else %}
- {% if sort == "hottest" %}
- <a id="hottest"
- href="?sort=coldest"
- class="off"
- title="{% trans "click to see coldest questions" %}">{% trans "more answers" %}</a>
- {% else %}
- <a id="hottest"
- href="?sort=hottest"
- class="off"
- title="{% trans "click to see hottest questions" %}">{% trans "more answers" %}</a>
- {% endif %}
- {% endif %}
-
- {% if sort == "leastvoted" %}
- <a id="leastvoted"
- href="?sort=mostvoted"
- class="off"
- title="{% trans "click to see most voted questions" %}">{% trans "unpopular" %}</a>
- {% else %}
- {% if sort == "mostvoted" %}
- <a id="mostvoted"
- href="?sort=leastvoted"
- class="off"
- title="{% trans "click to see least voted questions" %}">{% trans "popular" %}</a>
- {% else %}
- <a id="mostvoted"
- href="?sort=mostvoted"
- class="off"
- title="{% trans "click to see most voted questions" %}">{% trans "popular" %}</a>
- {% endif %}
- {% endif %}
- </div>
-</div>
-{% if questions_count > 0 %}
- <div style="clear:both">
- <p class="search-result-summary">
- {% if author_name or search_tags or query %}
- {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}
- {{q_num}} question found
- {% plural %}
- {{q_num}} questions found
- {% endblocktrans %}
- {% else %}
- {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}{{q_num}} question{% plural %}{{q_num}} questions{% endblocktrans %}
- {% endif %}
- {% joinitems using ', ' %}
- {% if author_name %}
- {% blocktrans %}with {{author_name}}'s contributions{% endblocktrans %}
- {% endif %}
- {% separator %}
- {% if search_tags %}
- {% trans "tagged" %}
- "{{ search_tags|join:"\", \"" }}"
- {% endif %}
- {% endjoinitems %}
- </p>
- {% if author_name or search_tags or query %}
- <p class="search-tips">{% trans "Search tips:" %}
- {% ifmany query search_tags author_name %}
- {% joinitems using ', ' ' or ' %}
- {% if author_name %}
- <a href="{% url questions %}?reset_author=true">{% trans "reset author" %}</a>
- {% endif %}
- {% separator %}
- {% if search_tags %}
- <a href="{% url questions %}?reset_tags=true">{% trans "reset tags" %}</a>
- {% endif %}
- {% separator %}
- {% ifmany query search_tags author_name %}
- <a href="{% url questions %}?start_over=true">{% trans "start over" %}</a>
- {% endifmany %}
- {% endjoinitems %}
- {% else %}
- <a href="{% url questions %}?start_over=true">{% trans "start over" %}</a>
- {% endifmany %}
- {% trans " - to expand, or dig in by adding more tags and revising the query." %}
- </p>
- {% else %}
- <p class="search-tips">{% trans "Search tip:" %} {% trans "add tags and a query to focus your search" %}</p>
- {% endif %}
-
- </div>
-{% endif %}
-<div id="listA">
-{% get_current_language as LANGUAGE_CODE %}
-{% cache 600 questions search_tags scope sort query LANGUAGE_CODE %}
- {% include "question_list.html" %}
-{% endcache %}
- {% comment %}todo: fix css here{% endcomment %}
- {% if questions_count == 0 %}
- {% comment %}todo: add tips to widen selection{% endcomment%}
- <p class="evenMore" style="padding-top:30px;text-align:center;">
- {% if scope == "unanswered" %}
- {% trans "There are no unanswered questions here" %}
- {% endif %}
- {% if scope == "favorite" %}
- {% trans "No favorite questions here. " %}
- {% trans "Please start (bookmark) some questions when you visit them" %}
- {% endif %}
- </p>
- {% if query or search_tags or author_name %}
- <p class="evenMore" style="text-align:center">
- {% trans "You can expand your search by " %}
- {% ifmany query search_tags author_name %}
- {% joinitems using ', ' ' or ' %}
- {% if author_name %}
- <a href="{% url questions %}?reset_author=true">{% trans "resetting author" %}</a>
- {% endif %}
- {% separator %}
- {% if search_tags %}
- <a href="{% url questions %}?reset_tags=true">{% trans "resetting tags" %}</a>
- {% endif %}
- {% separator %}
- {% ifmany query search_tags author_name %}
- <a href="{% url questions %}?start_over=true">{% trans "starting over" %}</a>
- {% endifmany %}
- {% endjoinitems %}
- {% else %}
- <a href="{% url questions %}?start_over=true">{% trans "starting over" %}</a>
- {% endifmany %}
- </p>
- {% endif %}
- <p class="evenMore" style="text-align:center">
- <a href="{% url ask %}">{% trans "Please always feel free to ask your question!" %}</a>
- </p>
- {% else %}
- <p class="evenMore" style="padding-left:9px">
- {% trans "Did not find what you were looking for?" %}
- <a href="{% url ask %}">{% trans "Please, post your question!" %}</a>
- </p>
- {% endif %}
-</div>
-{% endblock %}
-
- {% block tail %}
- {% if questions_count > 10 %}{%comment%}todo: remove magic number{%endcomment%}
- <div class="pager">{% cnprog_paginator context %}</div>
- <div class="pagesize">{% cnprog_pagesize context %}</div>
- {% endif %}
- {% endblock %}
-
-{% block sidebar %}
- {% if contributors %}
- <div class="boxC">
- <h3 class="subtitle">{% trans "Contributors" %}</h3>
- {% for person in contributors %}
- {% gravatar person 48 %}
- {% endfor %}
- </div>
- {% endif %}
-
- {% if request.user.is_authenticated %}
- {% include "tag_selector.html" %}
- {% endif %}
-
- {% if tags %}
- <div class="boxC">
- <h3 class="subtitle">{% trans "Related tags" %}</h3>
- <div class="tags">
- {% for tag in tags %}
- <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url questions %}?tags={{tag.name|urlencode}}">{{ tag.name }}</a>
- <span class="tag-number">× {{ tag.used_count|intcomma }}</span>
- <br />
- {% endfor %}
- </div>
- </div>
- {% endif %}
-{% endblock %}
-<!-- end questions.html -->
+{% extends "base.html" %} +<!-- questions.html --> +{% load extra_tags %} +{% load i18n %} +{% load humanize %} +{% load extra_filters %} +{% load smart_if %} +{% load cache %} +{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %} +{% block forejs %} + <script type="text/javascript"> + var tags = {{ tags_autocomplete|safe }}; + $().ready(function(){ + var sort_tab_id = "{{ sort }}"; + $("#"+sort_tab_id).attr('className',"on"); + var scope_tab_id = "{{ scope }}"; + $("#"+scope_tab_id).attr('className',"on"); + var on_tab = '#nav_questions'; + $(on_tab).attr('className','on'); + Hilite.exact = false; + Hilite.elementid = "listA"; + Hilite.debug_referrer = location.href; + }); + </script> + <script type='text/javascript' src='{% media "/media/js/com.cnprog.editor.js" %}'></script> + <script type='text/javascript' src='{% media "/media/js/com.cnprog.tag_selector.js" %}'></script> +{% endblock %} +{% block content %} +<div class="tabBar"> + {% comment %} + <div class="headUsers"> + {% if searchtag %} + {% trans "Found by tags" %} + {% else %} + {% if searchtitle %} + {% if settings.USE_SPHINX_SEARCH %} + {% trans "Search results" %} + {% else %} + {% trans "Found by title" %} + {% endif %} + {% else %} + {% if is_unanswered %} + {% trans "Unanswered questions" %} + {% else %} + {% trans "All questions" %} + {% endif %} + {% endif %} + {% endif %} + </div><br/> + {% endcomment %} + <div class="tabsC"> + <span class="label">{% trans "In:" %}</span> + <a id="all" class="off" href="?scope=all" title="{% trans "see all questions" %}">{% trans "all" %}</a> + <a id="unanswered" class="off" href="?scope=unanswered&sort=coldest" title="{% trans "see unanswered questions" %}">{% trans "unanswered" %}</a> + {% if request.user.is_authenticated %} + <a id="favorite" class="off" href="?scope=favorite" title="{% trans "see your favorite questions" %}">{% trans "favorite" %}</a> + {% endif %} + </div> + <div class="tabsA"> + <span class="label">{% trans "Sort by:" %}</span> + {% if sort == "oldest" %} + <a id="oldest" + href="?sort=latest" + class="off" + title="{% trans "click to see the newest questions" %}">{% trans "oldest" %}</a> + {% else %} + {% if sort == "latest" %} + <a id="latest" + href="?sort=oldest" + class="off" + title="{% trans "click to see the oldest questions" %}">{% trans "newest" %}</a> + {% else %} + <a id="latest" + href="?sort=latest" + class="off" + title="{% trans "click to see the newest questions" %}">{% trans "newest" %}</a> + {% endif %} + {% endif %} + + {% if sort == "inactive" %} + <a id="inactive" + href="?sort=active" + class="off" + title="{% trans "click to see the most recently updated questions" %}">{% trans "inactive" %}</a> + {% else %} + {% if sort == "active" %} + <a id="active" + href="?sort=inactive" + class="off" + title="{% trans "click to see the least recently updated questions" %}">{% trans "active" %}</a> + {% else %} + <a id="active" + href="?sort=active" + class="off" + title="{% trans "click to see the most recently updated questions" %}">{% trans "active" %}</a> + {% endif %} + {% endif %} + + {% if sort == "coldest" %} + <a id="coldest" + href="?sort=hottest" + class="off" + title="{% trans "click to see hottest questions" %}">{% trans "less answers" %}</a> + {% else %} + {% if sort == "hottest" %} + <a id="hottest" + href="?sort=coldest" + class="off" + title="{% trans "click to see coldest questions" %}">{% trans "more answers" %}</a> + {% else %} + <a id="hottest" + href="?sort=hottest" + class="off" + title="{% trans "click to see hottest questions" %}">{% trans "more answers" %}</a> + {% endif %} + {% endif %} + + {% if sort == "leastvoted" %} + <a id="leastvoted" + href="?sort=mostvoted" + class="off" + title="{% trans "click to see most voted questions" %}">{% trans "unpopular" %}</a> + {% else %} + {% if sort == "mostvoted" %} + <a id="mostvoted" + href="?sort=leastvoted" + class="off" + title="{% trans "click to see least voted questions" %}">{% trans "popular" %}</a> + {% else %} + <a id="mostvoted" + href="?sort=mostvoted" + class="off" + title="{% trans "click to see most voted questions" %}">{% trans "popular" %}</a> + {% endif %} + {% endif %} + </div> +</div> +{% if questions_count > 0 %} + <div style="clear:both"> + <p class="search-result-summary"> + {% if author_name or search_tags or query %} + {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %} + {{q_num}} question found + {% plural %} + {{q_num}} questions found + {% endblocktrans %} + {% else %} + {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}{{q_num}} question{% plural %}{{q_num}} questions{% endblocktrans %} + {% endif %} + {% joinitems using ', ' %} + {% if author_name %} + {% blocktrans %}with {{author_name}}'s contributions{% endblocktrans %} + {% endif %} + {% separator %} + {% if search_tags %} + {% trans "tagged" %} + "{{ search_tags|join:"\", \"" }}" + {% endif %} + {% endjoinitems %} + </p> + {% if author_name or search_tags or query %} + <p class="search-tips">{% trans "Search tips:" %} + {% ifmany query search_tags author_name %} + {% joinitems using ', ' ' or ' %} + {% if author_name %} + <a href="{% url questions %}?reset_author=true">{% trans "reset author" %}</a> + {% endif %} + {% separator %} + {% if search_tags %} + <a href="{% url questions %}?reset_tags=true">{% trans "reset tags" %}</a> + {% endif %} + {% separator %} + {% ifmany query search_tags author_name %} + <a href="{% url questions %}?start_over=true">{% trans "start over" %}</a> + {% endifmany %} + {% endjoinitems %} + {% else %} + <a href="{% url questions %}?start_over=true">{% trans "start over" %}</a> + {% endifmany %} + {% trans " - to expand, or dig in by adding more tags and revising the query." %} + </p> + {% else %} + <p class="search-tips">{% trans "Search tip:" %} {% trans "add tags and a query to focus your search" %}</p> + {% endif %} + + </div> +{% endif %} +<div id="listA"> +{% get_current_language as LANGUAGE_CODE %} +{% cache 600 questions search_tags scope sort query LANGUAGE_CODE %} + {% include "question_list.html" %} +{% endcache %} + {% comment %}todo: fix css here{% endcomment %} + {% if questions_count == 0 %} + {% comment %}todo: add tips to widen selection{% endcomment%} + <p class="evenMore" style="padding-top:30px;text-align:center;"> + {% if scope == "unanswered" %} + {% trans "There are no unanswered questions here" %} + {% endif %} + {% if scope == "favorite" %} + {% trans "No favorite questions here. " %} + {% trans "Please start (bookmark) some questions when you visit them" %} + {% endif %} + </p> + {% if query or search_tags or author_name %} + <p class="evenMore" style="text-align:center"> + {% trans "You can expand your search by " %} + {% ifmany query search_tags author_name %} + {% joinitems using ', ' ' or ' %} + {% if author_name %} + <a href="{% url questions %}?reset_author=true">{% trans "resetting author" %}</a> + {% endif %} + {% separator %} + {% if search_tags %} + <a href="{% url questions %}?reset_tags=true">{% trans "resetting tags" %}</a> + {% endif %} + {% separator %} + {% ifmany query search_tags author_name %} + <a href="{% url questions %}?start_over=true">{% trans "starting over" %}</a> + {% endifmany %} + {% endjoinitems %} + {% else %} + <a href="{% url questions %}?start_over=true">{% trans "starting over" %}</a> + {% endifmany %} + </p> + {% endif %} + <p class="evenMore" style="text-align:center"> + <a href="{% url ask %}">{% trans "Please always feel free to ask your question!" %}</a> + </p> + {% else %} + <p class="evenMore" style="padding-left:9px"> + {% trans "Did not find what you were looking for?" %} + <a href="{% url ask %}">{% trans "Please, post your question!" %}</a> + </p> + {% endif %} +</div> +{% endblock %} + + {% block tail %} + {% if questions_count > 10 %}{%comment%}todo: remove magic number{%endcomment%} + <div class="pager">{% cnprog_paginator context %}</div> + <div class="pagesize">{% cnprog_pagesize context %}</div> + {% endif %} + {% endblock %} + +{% block sidebar %} + {% if contributors %} + <div class="boxC"> + <h3 class="subtitle">{% trans "Contributors" %}</h3> + {% for person in contributors %} + {% gravatar person 48 %} + {% endfor %} + </div> + {% endif %} + + {% if request.user.is_authenticated %} + {% include "tag_selector.html" %} + {% endif %} + + {% if tags %} + <div class="boxC"> + <h3 class="subtitle">{% trans "Related tags" %}</h3> + <div class="tags"> + {% for tag in tags %} + <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url questions %}?tags={{tag.name|urlencode}}">{{ tag.name }}</a> + <span class="tag-number">× {{ tag.used_count|intcomma }}</span> + <br /> + {% endfor %} + </div> + </div> + {% endif %} +{% endblock %} +<!-- end questions.html --> diff --git a/askbot/skins/default/templates/user_edit.html b/askbot/skins/default/templates/user_edit.html index abbce58a..71484714 100644 --- a/askbot/skins/default/templates/user_edit.html +++ b/askbot/skins/default/templates/user_edit.html @@ -1,98 +1,98 @@ -{% extends "base_content.html" %}
-<!-- user_edit.html -->
-{% load extra_tags %}
-{% load humanize %}
-{% load i18n %}
-{% block title %}{% spaceless %}{% trans "Edit user profile" %}{% endspaceless %}{% endblock %}
-{% block forejs %}
- <script type="text/javascript">
- $().ready(function(){
- $("#nav_profile").attr('className',"on");
- $("#cancel").bind('click', function(){history.go(-1);})
- });
- </script>
- {% block userjs %}
- {% endblock %}
-{% endblock %}
-{% block content %}
-<div id="main-bar" class="headNormal">
- {{ request.user.username }} - {% trans "edit profile" %}
-</div>
-<div id="main-body" style="width:100%;padding-top:10px">
- <form name="" action="{% url edit_user request.user.id %}" method="post">
- <div id="left" style="float:left;width:180px">
- {% if request.user.email %}
- {% gravatar request.user 128 %}
- {% else %}
- <img src="{% media "/media/images/nophoto.png" %}">
- {% endif %}
- <h1><a href="{% url faq %}#gravatar">change picture</a><h1>
- </div>
-
- <div id="askform" style="float:right;width:750px;text-align:left;">
- <h2>{% trans "Registered user" %}</h2>
- <table class="user-details">
- <tr>
- <th width="100px"></th>
- <th></th>
- </tr>
- <tr style="height:35px">
- <td>{% trans "Screen Name" %}:</td>
- <td>
- {% if settings.EDITABLE_SCREEN_NAME %}
- {{ form.username }}
- {% else %}
- {{ request.user.username }}
- {% endif %}
- <span class="form-error"></span> {{ form.username.errors }} </td>
- </tr>
-
- <tr style="height:35px">
- <td>{{ form.email.label_tag }}:</td>
- <td>{{ form.email }} <span class="form-error"></span> {{ form.email.errors }} </td>
- </tr>
- <tr style="height:35px">
- <td></td>
- <td class="title-desc">{{ form.email.help_text }}</td>
- </tr>
- <tr style="height:35px">
- <td>{{ form.realname.label_tag }}:</td>
- <td>{{ form.realname }} <span class="form-error"></span> {{ form.realname.errors }} </td>
- </tr>
- <tr style="height:35px">
- <td>{{ form.website.label_tag }}:</td>
- <td>{{ form.website }} <span class="form-error"></span> {{ form.website.errors }} </td>
- </tr>
- <tr style="height:35px">
- <td>{{ form.city.label_tag }}:</td>
- <td>{{ form.city }} <span class="form-error"></span> {{ form.city.errors }} </td>
- </tr>
- <tr style="height:35px">
- <td>{{ form.birthday.label_tag }}:</td>
- <td>{{ form.birthday }} <span class="form-error"></span> {{ form.birthday.errors }} </td>
- </tr>
- <tr style="height:35px">
- <td></td>
- <td class="title-desc">{{ form.birthday.help_text }}</td>
- </tr>
- <tr style="height:10px">
- <td colspan="2">
- </td>
- </tr>
- <tr>
- <td style="vertical-align:top">{{ form.about.label_tag }}:</td>
- <td>{{ form.about }} <span class="form-error"></span> {{ form.about.errors }} </td>
- </tr>
-
- </table>
- <div style="margin:30px 0 60px 0">
- <input type="submit" value="{% trans "Update" %}" class="submit" >
- <input id="cancel" type="button" value="{% trans "Cancel" %}" class="submit" >
-
- </div>
- </div>
- </form>
-
-</div>
-{% endblock %}
-<!-- end user_edit.html -->
+{% extends "base_content.html" %} +<!-- user_edit.html --> +{% load extra_tags %} +{% load humanize %} +{% load i18n %} +{% block title %}{% spaceless %}{% trans "Edit user profile" %}{% endspaceless %}{% endblock %} +{% block forejs %} + <script type="text/javascript"> + $().ready(function(){ + $("#nav_profile").attr('className',"on"); + $("#cancel").bind('click', function(){history.go(-1);}) + }); + </script> + {% block userjs %} + {% endblock %} +{% endblock %} +{% block content %} +<div id="main-bar" class="headNormal"> + {{ request.user.username }} - {% trans "edit profile" %} +</div> +<div id="main-body" style="width:100%;padding-top:10px"> + <form name="" action="{% url edit_user request.user.id %}" method="post"> + <div id="left" style="float:left;width:180px"> + {% if request.user.email %} + {% gravatar request.user 128 %} + {% else %} + <img src="{% media "/media/images/nophoto.png" %}"> + {% endif %} + <h1><a href="{% url faq %}#gravatar">change picture</a><h1> + </div> + + <div id="askform" style="float:right;width:750px;text-align:left;"> + <h2>{% trans "Registered user" %}</h2> + <table class="user-details"> + <tr> + <th width="100px"></th> + <th></th> + </tr> + <tr style="height:35px"> + <td>{% trans "Screen Name" %}:</td> + <td> + {% if settings.EDITABLE_SCREEN_NAME %} + {{ form.username }} + {% else %} + {{ request.user.username }} + {% endif %} + <span class="form-error"></span> {{ form.username.errors }} </td> + </tr> + + <tr style="height:35px"> + <td>{{ form.email.label_tag }}:</td> + <td>{{ form.email }} <span class="form-error"></span> {{ form.email.errors }} </td> + </tr> + <tr style="height:35px"> + <td></td> + <td class="title-desc">{{ form.email.help_text }}</td> + </tr> + <tr style="height:35px"> + <td>{{ form.realname.label_tag }}:</td> + <td>{{ form.realname }} <span class="form-error"></span> {{ form.realname.errors }} </td> + </tr> + <tr style="height:35px"> + <td>{{ form.website.label_tag }}:</td> + <td>{{ form.website }} <span class="form-error"></span> {{ form.website.errors }} </td> + </tr> + <tr style="height:35px"> + <td>{{ form.city.label_tag }}:</td> + <td>{{ form.city }} <span class="form-error"></span> {{ form.city.errors }} </td> + </tr> + <tr style="height:35px"> + <td>{{ form.birthday.label_tag }}:</td> + <td>{{ form.birthday }} <span class="form-error"></span> {{ form.birthday.errors }} </td> + </tr> + <tr style="height:35px"> + <td></td> + <td class="title-desc">{{ form.birthday.help_text }}</td> + </tr> + <tr style="height:10px"> + <td colspan="2"> + </td> + </tr> + <tr> + <td style="vertical-align:top">{{ form.about.label_tag }}:</td> + <td>{{ form.about }} <span class="form-error"></span> {{ form.about.errors }} </td> + </tr> + + </table> + <div style="margin:30px 0 60px 0"> + <input type="submit" value="{% trans "Update" %}" class="submit" > + <input id="cancel" type="button" value="{% trans "Cancel" %}" class="submit" > + + </div> + </div> + </form> + +</div> +{% endblock %} +<!-- end user_edit.html --> |