diff options
author | Mike Chen <chagel@gmail.com> | 2009-07-05 10:23:06 +0800 |
---|---|---|
committer | Mike Chen <chagel@gmail.com> | 2009-07-05 10:23:06 +0800 |
commit | 2acb62174ab2cac9c7a88faafcb5f0a22a54db6f (patch) | |
tree | 93e9d22d6fb8a6c882e3915a8511a3ac542a1e67 /templates/revisions_answer.html | |
download | askbot-2acb62174ab2cac9c7a88faafcb5f0a22a54db6f.tar.gz askbot-2acb62174ab2cac9c7a88faafcb5f0a22a54db6f.tar.bz2 askbot-2acb62174ab2cac9c7a88faafcb5f0a22a54db6f.zip |
initiliaze git rep
Diffstat (limited to 'templates/revisions_answer.html')
-rw-r--r-- | templates/revisions_answer.html | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/templates/revisions_answer.html b/templates/revisions_answer.html new file mode 100644 index 00000000..ece59d6e --- /dev/null +++ b/templates/revisions_answer.html @@ -0,0 +1,100 @@ +{% extends "base_content.html" %} +{% load extra_tags %} +{% load extra_filters %} +{% load humanize %} +{% block title %}{% spaceless %}版本历史{% endspaceless %}{% endblock %} +{% block forejs %} + <script type='text/javascript' src='/content/js/com.cnprog.editor.js'></script> + <script type='text/javascript' src='/content/js/com.cnprog.post.js'></script> + <script type="text/javascript"> + + $().ready(function(){ + $("#nav_questions").attr('className',"on"); + $('div.revision div[id^=rev-header-]').bind('click', function(){ + var revId = this.id.substr(11); + toggleRev(revId); + + }); + lanai.highlightSyntax(); + }); + + function toggleRev(id) { + var arrow = $("#rev-arrow-" + id); + var visible = arrow.attr("src").indexOf("hide") > -1; + + arrow.attr("src", "/content/images/expander-arrow-" + (visible ? "show" : "hide") + ".gif"); + $("#rev-body-" + id).slideToggle("fast"); + } + + </script> +{% endblock %} + +{% block content %} +<div id="main-bar" class="headNormal"> + 版本历史 [<a href="{{ post.get_absolute_url }}">返回</a>] +</div> +<div id="main-body" class=""> + <div id="revisions"> + {% for revision in revisions %} + <div class="revision"> + <div id="rev-header-{{ revision.revision }}" class="header {% ifequal post.author_id revision.author_id %}author{% endifequal %}"> + <div class="header-controls"> + <table width="100%"> + <tr> + <td width="20" style="vertical-align:middle"><img id="rev-arrow-{{ revision.revision }}" src="/content/images/expander-arrow-show.gif"></td> + <td width="30px" style="vertical-align:middle"><span class="revision-number" title="版本 {{ revision.revision }}">{{ revision.revision }}</span></td> + <td width="200px" style="vertical-align:middle"> + {% if revision.summary %} + <div class="summary"><span>{{ revision.summary }}<span></div> + {% endif %} + {% if request.user|can_edit_post:post %} + <a href="{% url edit_answer post.id %}?revision={{ revision.revision }}">编辑</a> + {% endif %} + + </td> + <td align="right"> + <div class="revision-mark" > + <table width="100%" style="text-align:left" > + <tr > + <td colspan="2" style="padding:3px 0 3px 0"> + {% ifequal revision.revision 1 %} + 提问于<strong title="{{ post.added_at }}">{% diff_date post.added_at %}</strong> + {% else %} + 更新于<strong title="{{ post.last_edited_at }}">{% diff_date revision.revised_at %}</strong> + {% endifequal %} + </td> + + </tr> + <tr> + <td width="35px" style="vertical-align:bottom; "> + {% gravatar revision.author 32 %} + </td> + <td style="width:120px; vertical-align:top"> + <div style="height:18px"> + <a href="/users/{{ revision.author.id }}/{{ revision.author.username }}">{{ revision.author.username }}</a></div> + <div> + {% get_score_badge revision.author %} + </div> + </td> + </tr> + + </table> + </div> + </td> + </tr> + + </table> + </div> + </div> + <div id="rev-body-{{ revision.revision }}" class="answerbody"> + {{ revision.diff|safe }} + </div> + </div> + {% endfor %} + </div> +</div> +{% endblock %} + +{% block endjs %} +{% endblock %} + |