1 {% extends "base.html" %}
2 <!-- question_edit.html -->
5 {% block title %}{% spaceless %}{% trans "Edit question" %}{% endspaceless %}{% endblock %}
7 <script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
8 <script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
9 <link rel="stylesheet" type="text/css" href="{% media "/media/js/wmd/wmd.css" %}" />
10 <script type="text/javascript">
11 //todo move javascript out
13 $("#nav_questions").attr('className',"on");
14 $('#editor').TextAreaResizer();
17 //toggle preview of editor
19 var txt = "[{% trans "hide preview" %}]";
20 $('#pre-collapse').text(txt);
21 $('#pre-collapse').bind('click', function(){
22 txt = display ? "[{% trans "show preview" %}]" : "[{% trans "hide preview" %}]";
24 $('#previewer').toggle();
25 $('#pre-collapse').text(txt);
28 //Tags autocomplete action
29 var tags = {{ tags|safe }};
30 $("#id_tags").autocomplete(tags, {
34 multipleSeparator: " ",
38 formatItem: function(row, i, max) {
39 return row.n + " ("+ row.c +")";
41 formatResult: function(row, i, max){
47 $('#id_revision').unbind().change(function(){
48 $("#select_revision").click();
56 <div id="main-bar" class="headNormal">
57 {% trans "Edit question" %} [<a href="{{ question.get_absolute_url }}">{% trans "back" %}</a>]
59 <div id="main-body" class="ask-body">
61 <form id="fmedit" action="{% url edit_question question.id %}" method="post" >
62 <label for="id_revision" ><strong>{% trans "revision" %}:</strong></label> <br/>
63 {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul }}{% endif %}
64 <div style="vertical-align:middle">
65 {{ revision_form.revision }} <input type="submit" style="display:none" id="select_revision" name="select_revision"
66 value="{% trans "select revision"%}">
68 <div class="form-item">
69 <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/>
70 {{ form.title }} {{ form.title.errors }}
71 <div class="title-desc">
72 {{ form.title.help_text }}
75 <div class="form-item">
76 <div id="wmd-button-bar" class="wmd-panel"></div>
78 <span class="form-error"></span>
79 <div class="preview-toggle">
83 <span id="pre-collapse" title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
85 {% if settings.WIKI_ON %}
86 <td style="text-align:right;">
87 {{ form.wiki }} <span style="color:#000;cursor:help" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
94 <div id="previewer" class="wmd-preview"></div>
96 <div class="form-item">
97 <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br/>
98 {{ form.tags }} {{ form.tags.errors }}
99 <div class="title-desc">
100 {{ form.tags.help_text }}
103 <strong>{{ form.summary.label_tag }}</strong> <br/>
104 {{ form.summary }} {{ form.summary.errors }}
105 <div class="title-desc">
106 {{ form.summary.help_text }}
108 <div class="error" ></div>
109 <input type="submit" value="{% trans "Save edit" %}" class="submit" />
110 <input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" />
117 {% include "question_edit_tips.html" %}
122 <!-- end question_edit.html -->