1 {% extends "base.html" %}
2 <!-- template ask.html -->
5 {% block title %}{% spaceless %}{% trans "Ask a 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">
12 //set current module button style
13 $("#nav_ask").attr('className',"on");
14 $('#editor').TextAreaResizer();
16 //toggle preview of editor
17 //todo remove copy-paste
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 $("#id_tags").autocomplete("/matching_tags", {
34 multipleSeparator: " ",
35 /*formatItem: function(row, i, max) {
36 return row.n + " ("+ row.c +")";
38 formatResult: function(row, i, max){
41 formatItem: function(row, i, max, value) {
42 return row[1].split(".")[0] + " (" + row[1].split(".")[1] + ")";
45 formatResult: function(row, i, max, value){
55 <div id="main-bar" class="headNormal">
56 {% trans "Ask a question" %}
58 <div id="main-body" class="ask-body">
60 <form id="fmask" action="" method="post" >
61 {% if not request.user.is_authenticated %}
63 <p>{% trans "login to post question info" %}</p>
66 {% ifequal settings.EMAIL_VALIDATION 'on' %}
67 {% if not request.user.email_isvalid %}
69 {% blocktrans with request.user.email as email %}must have valid {{email}} to post,
70 see {{email_validation_faq_url}}
76 <div class="form-item">
77 <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/>
78 {{ form.title }} {{ form.title.errors }}
79 <div class="title-desc">
80 {{ form.title.help_text }}
84 <div class="form-item">
85 <div id="wmd-button-bar" class="wmd-panel"></div>
86 {{ form.text }} {{ form.text.errors }}
88 <div class="preview-toggle">
92 <span id="pre-collapse" title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
94 {% if settings.WIKI_ON %}
96 {{ form.wiki }} <span class="help_text" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
103 <div id="previewer" class="wmd-preview"></div>
104 <span class="form-error"></span>
106 <div class="form-item">
107 <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br/>
108 {{ form.tags }} {{ form.tags.errors }}
110 <p class="title-desc">
111 {{ form.tags.help_text }}
113 {% if not request.user.is_authenticated %}
114 <input name="ask" type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" />
116 <input name="ask" type="submit" value="{% trans "Ask your question" %}" class="submit" />
124 {% include "question_edit_tips.html" %}
129 <!-- end template ask.html -->