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){
56 <div id="main-bar" class="headNormal">
57 {% trans "Ask a question" %}
59 <div id="main-body" class="ask-body">
61 <form id="fmask" action="" method="post" >
62 {% if not request.user.is_authenticated %}
64 <p>{% trans "login to post question info" %}</p>
67 {% ifequal settings.EMAIL_VALIDATION 'on' %}
68 {% if not request.user.email_isvalid %}
70 {% blocktrans with request.user.email as email %}must have valid {{email}} to post,
71 see {{email_validation_faq_url}}
77 <div class="form-item">
78 <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/>
79 {{ form.title }} {{ form.title.errors }}
80 <div class="title-desc">
81 {{ form.title.help_text }}
85 <div class="form-item">
86 <div id="wmd-button-bar" class="wmd-panel"></div>
89 <div class="preview-toggle">
93 <span id="pre-collapse" title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
95 {% if settings.WIKI_ON %}
97 {{ form.wiki }} <span class="help_text" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
104 <div id="previewer" class="wmd-preview"></div>
105 <span class="form-error"></span>
107 <div class="form-item">
108 <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br/>
109 {{ form.tags }} {{ form.tags.errors }}
111 <p class="title-desc">
112 {{ form.tags.help_text }}
114 {% if not request.user.is_authenticated %}
115 <input name="ask" type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" />
117 <input name="ask" type="submit" value="{% trans "Ask your question" %}" class="submit" />
125 {% include "question_edit_tips.html" %}
130 <!-- end template ask.html -->