summaryrefslogtreecommitdiffstats
path: root/askbot/skins/default/templates/embed/ask_by_widget.html
blob: 8455ccdbb74fae8890ba4968b8588b04352dced3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{% extends "widget_base.html" %}
{% import "macros.html" as macros %}
{% block forestyle %}
  {% if editor_type == 'markdown' %}
  <link rel="stylesheet" type="text/css" href="{{"/js/wmd/wmd.css"|media}}" />
  {%endif%}
  {% if settings.USE_LOCAL_FONTS %}
    {% include "meta/fonts.html" %}
  {% else %}
    <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:400,700&amp;subset=latin,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css' />
  {% endif %}
  <style type="text/css" media="screen">
    body{
      font-family: Verdana, Arial, Helvetica, sans-serif;
    }
    #editor {
      display: block;
      min-height: 200px;
      width: 99.5%;
      margin: 0;
      border:none;
    }
    .wmd-container{
      border: #CCE6EC 3px solid;
      width: 100%;
    }

    #id_title{
      {% if editor_type == 'markdown' %}
      width: 100%;
      {%else%}
      padding: 0px 0 0 5px;
      width: 99.2%;
      {%endif%}
      font-size: 130%;
      border: #CCE6EC 3px solid;
      max-width: 600px;
    }

    #submit{
      float: right; 
      font-size: 130%;
    }

    .title{
      font-family: 'Open Sans Condensed', Arial, sans-serif; 
      font-size: 25px;
      margin-bottom: 10px;
    }

    #question-list {
      height: auto;
    }

    #question-list h2{
      text-decoration: none;
      margin: 0px;
      font-size: 13px;
      color: #005580;
      padding: 3px 0 3px 5px;
      margin-left: 15px;
      padding-bottom: 0;
      border-top: #F0F0EC 1px solid;
      border-left: #F0F0EC 1px solid;
      min-height: 30px;
      line-height: 30px;
      font-weight: normal
    }

    #question-list a:hover{
        color: #005580;
        text-decoration: underline;
    }

    #question-list a:visited{
      color: #005580;
      text-decoration: none;
    }

    #question-list span{
      width: 28px;
      height: 26px;
      line-height: 26px;
      text-align: center;
      margin-right: 10px;
      float: left;
      display: block;
      color: white;
      background: #B8D0D5;
      border-radius: 3px;
      -ms-border-radius: 3px;
      -moz-border-radius: 3px;
      -webkit-border-radius: 3px;
      -khtml-border-radius: 3px;
    }
    {% if editor_type == 'markdown' %}
    #wmd-button-bar {
      background: url({{"/js/wmd/images/editor-toolbar-background.png"|media}}) repeat-x bottom;
      height: 30px;
      border: 0;
      display: block;
    }
    {% endif %}

    {{widget.inner_style}}
  </style>
{%endblock%}

{%block body%}
<div class="title">{{widget.title}}</div>
<form action="." method="POST" accept-charset="utf-8">
  {% csrf_token %}
  <label>{%trans%}Please enter a descriptive title for your question{%endtrans%}</label>
  <div class="input-title">
    <input autocomplete="off" id="id_title" type="text" name="title" size="70" class='questionTitleInput'>
  </div>
  {% if related_questions %}
  <div id='question-list'>
  </div>
  {%endif%}
{% if widget.include_text_field %}
  {% if editor_type == 'markdown' %}
      <div class="wmd-container">
          <div id="wmd-button-bar" class="wmd-panel"></div>
          {{ form.text }}{# this element is resizable and will be wrapped by js #}
      </div>
  {% else %}
      <div class="wmd-container">
          {{ form.media }}
          {{ form.text }}
      </div>
  {% endif %}
{% endif %}
  {% if form.ask_anonymously %}
    <p>{{form.ask_anonymously.label_tag()}}: {{form.ask_anonymously}}</p>
  {%endif%}
  <input type="submit" value="Ask your question" id="submit" />
</form>
{{form.errors}}
{%endblock%}
{% block endjs %}
<script type="text/javascript" src='{{"/js/live_search_new_thread.js"|media}}'></script>
<script type="text/javascript" charset="utf-8">
    var minSearchWordLength = {{settings.MIN_SEARCH_WORD_LENGTH}};
    askbot['urls']['api_get_questions'] = '{% url api_get_questions %}';
    liveSearchNewThreadInit();
    $(document).ready(function(){
      $("#id_title").focus();
    });
</script>

<script type='text/javascript' src='{{"/js/editor.js"|media}}'></script>
{% if editor_type == 'markdown' %}
    <script type='text/javascript' src='{{"/js/wmd/showdown.js"|media}}'></script>
    <script type='text/javascript' src='{{"/js/wmd/wmd.js"|media}}'></script>
{% else %}
    {% include "meta/tinymce.html" %}
{% endif %}
{% endblock %}