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 var tags = {{ tags|safe }};
30 $("#id_tags").autocomplete(tags, {
35 multipleSeparator: " ",
36 formatItem: function(row, i, max) {
37 return row.n + " ("+ row.c +")";
39 formatResult: function(row, i, max){
50 <div id="main-bar" class="headNormal">
51 {% trans "Ask a question" %}
53 <div id="main-body" class="ask-body">
55 <form id="fmask" action="" method="post" >
56 {% if not request.user.is_authenticated %}
58 <p>{% trans "login to post question info" %}</p>
61 {% ifequal settings.EMAIL_VALIDATION 'on' %}
62 {% if not request.user.email_isvalid %}
64 {% blocktrans with request.user.email as email %}must have valid {{email}} to post,
65 see {{email_validation_faq_url}}
71 <div class="form-item">
72 <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/>
73 {{ form.title }} {{ form.title.errors }}
74 <div class="title-desc">
75 {{ form.title.help_text }}
79 <div class="form-item">
80 <div id="wmd-button-bar" class="wmd-panel"></div>
83 <div class="preview-toggle">
87 <span id="pre-collapse" title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
89 {% if settings.WIKI_ON %}
91 {{ form.wiki }} <span class="help_text" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
98 <div id="previewer" class="wmd-preview"></div>
99 <span class="form-error"></span>
101 <div class="form-item">
102 <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br/>
103 {{ form.tags }} {{ form.tags.errors }}
105 <p class="title-desc">
106 {{ form.tags.help_text }}
108 {% if not request.user.is_authenticated %}
109 <input name="ask" type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" />
111 <input name="ask" type="submit" value="{% trans "Ask your question" %}" class="submit" />
119 {% include "question_edit_tips.html" %}
124 <!-- end template ask.html -->