showing multi etymology now, some toggle is there to limit things.
[worddb.git] / templates / words / view.html
blob227e8959bcc7d978de2b22316bfb4ccd172671ae
1 {% extends "base.html" %}
3 {% block title %}{{ wordname }}{% endblock %}
5 {% load choice2select %}
7 {% block extra_body_late %}
8 <script type="text/javascript" src="/w/static/js/jquery-autocomplete/jquery.autocomplete.js">
9 </script>
10 <script type="text/javascript" src="/w/static/js/jquery.m2m.js">
11 </script>
12 <script type="text/javascript" src="/w/static/js/jquery.etymology.js">
13 </script>
14 <script type="text/javascript" src="/w/static/js/jquery.translations.js">
15 </script>
16 <script type="text/javascript" src="/w/static/js/jquery.hoverIntent.js">
17 </script>
18 <script type="text/javascript" src="/w/static/js/jquery.forms.js">
19 </script>
20 <script type="text/javascript" src="/w/static/js/worddb.lib.js">
21 </script>
22 <script type="text/javascript" src="/w/static/js/jquery.meaning.js">
23 </script>
24 {% endblock %}
26 {% block extra_head_late %}
27 <link rel="stylesheet" href="/w/static/js/jquery-autocomplete/jquery.autocomplete.css" />
28 <link rel="stylesheet" href="/w/static/js/jquery.m2m.css" />
29 <link rel="stylesheet" href="/w/static/js/jquery.etymology.css" />
30 <link rel="stylesheet" href="/w/static/js/jquery.translations.css" />
31 <link rel="stylesheet" href="/w/static/js/jquery.forms.css" />
32 <link rel="stylesheet" href="/w/static/js/jquery.meaning.css" />
33 {% endblock %}
35 {% block extra_script %}
36 jQuery(function($){
37 $(".m2m").m2mize({ relation_name: "synonym", word: "love" });
38 $(".etymology_container").etymologyzer({});
39 $(".languages").translatize({});
40 $(".forms").formize({});
41 $("div.meaning").meaningize({});
42 });
43 {% endblock %}
45 {% block extra_style %}
46 h1.word {
47 font-weight: bold;
48 font-size: 3em;
50 h2.forms {
51 padding-left: 30px;
53 {% endblock %}
54 {% block content %}
55 {% if link_list %}
56 This word has other forms.
57 <ul>
58 {% for word in link_list %}
59 <li><a href="{{ word.get_absolute_url }}">{{ word }}</a></li>
60 {% endfor %}
61 </ul>
62 {% endif %}
63 <table class=fixed>
64 {% for word in word_list %}
65 <tr>
66 <td>
67 <h1 class="word">{{ word.word }}</h1>
68 <h2 class="forms w_{{ word.id }}" id="{{ word.word }}">
69 {% for form in word.get_form_data %}
70 <div class="form f_{{ form.form }}">
71 <div class="formui">
72 <div class="f">
73 {{ form.form }}
74 <img class="del"
75 src="/media/img/admin/icon_deletelink.gif"
77 <div class="del_form">
78 Are you sure you want to delete this form?
79 <form method="post"
80 action="/w/ajax/word/remove-form/"
82 <input type="hidden" name="word"
83 value="{{ word.id }}"
85 <input type="hidden" name="form"
86 value="{{ form.form }}"
88 <input type="submit" value="Delete"> or
89 <a href="#f" class="cancel">Cancel</a>
90 </form>
91 </div>
92 </div>
93 <ul>
94 {% for pronunciation in form.pronunciations %}
95 <li
96 class="p_{{ pronunciation.pronunciation_key }}"
98 <span class="pro">
99 {{ pronunciation.pronunciation_key }}
100 </span>
101 <div class="edit_pro dnone">
102 Edit
103 <form name="edit_pron" method="post"
104 action="/w/ajax/word/edit-pronunciation/">
105 <input type="hidden" name="word"
106 value="{{ word.id }}"
108 <input type="hidden"
109 name="pronunciation"
110 value="{{ pronunciation.id }}"
112 <input type="text" name="key">
113 <input type="submit" value="Edit">
114 </form>
116 <form name="del_pro" method="post"
117 action="/w/ajax/word/remove-pronunciation/"
119 <input type="hidden" name="word"
120 value="{{ word.id }}"
122 <input type="hidden"
123 name="pronunciation"
124 value="{{ pronunciation.id }}"
126 <input type="submit" value="Delete">
128 <a href="#f" class="cancel">Cancel</a>
129 </form>
130 </div>
131 </li>
132 {% endfor %}
133 </ul>
134 </div>
135 <div class="visible">{{ form.form }}</div>
136 </div>
137 {% endfor %}
138 </h2>
139 </td>
140 <td>
141 <div class="languages w_{{ word.id }} lang_{{ word.language }}">
142 <div class="translations">
143 Language: <i>{{ word.get_language_display }}</i><br>
144 <a class="add_translation" href="#add">
145 <img src="/media/img/admin/icon_addlink.gif">
146 Add new translation
147 </a><br>
148 {% if word.translations.count %}
149 Translations:
150 <ul>
151 {% for tr in word.translations.all %}
152 <li class="w_{{ tr.id }}">
153 <a href="{{ tr.get_absolute_url }}">{{ tr.word }}</a>,
154 <i>{{ tr.get_language_display }}</i>
155 </li>
156 {% endfor %}
157 </ul>
158 {% else %}
159 No Translations.
160 {% endif %}
161 </div>
162 <div class="visible">Language: <i>{{ word.get_language_display }}</i></div>
163 </div>
164 </td>
165 </tr>
167 <tr>
168 <td width="70%">
169 <div class="meaning w_{{ word.id }}">
170 <h2>Meaning</h2>
171 <ul class="langol">
172 {% regroup word.visible_meanings.all by language as lang_meanings_set %}
173 {% for lang_meanings in lang_meanings_set %}
174 <li class="langpol">
175 {{ lang_meanings.list.0.get_language_display }}
176 <ul class="pol">
177 {% regroup lang_meanings.list by pol as meanings %}
178 {% for pol in meanings %}
179 <li class="pol">
180 {{ pol.list.0.get_pol_display }}
181 <ul class="meaning_set">
182 {% for item in pol.list %}
183 <li class="m_{{ item.id }} pol_{{ item.pol }} lang_{{ item.language }}">
184 <span class="m">{{ item.meaning }}</span>
185 <i class="usage">{{ item.usage }}</i>
186 </li>
187 {% endfor %}
188 </ul>
189 </li>
190 {% endfor %}
191 </ul>
192 </li>
193 {% endfor %}
194 </ul>
195 </div>
196 <div class="etymology_container w_{{ word.id }}">
197 <h2>Etymology</h2>
198 <dl>
199 {% for etymology in word.etymology_set.all %}
200 <dt class="w_{{ word.id }} etymology e_{{ etymology.id }} elang_{{ etymology.language }}">
201 {{ etymology.get_language_display }}
202 </dt>
203 <dd>{{ etymology.text|linebreaksbr }}</dd>
204 {% endfor %}
205 </dl>
206 </div>
207 </td>
209 <td width="30%">
210 <div class="m2m r_synonym w_{{ word.id }} lang_{{ word.language }}">
211 <div class="header">Synonyms</div>
212 <ul>
213 {% for synonym in word.synonyms.all %}
214 <li class="w_{{ synonym.id }}">
215 <a href="{{ synonym.get_absolute_url }}">{{ synonym.word }}</a>
216 </li>
217 {% endfor %}
218 </ul>
219 </div>
220 <div class="m2m r_antonym w_{{ word.id }} lang_{{ word.language }}">
221 <div class="header">Antonyms</div>
222 <ul>
223 {% for antonym in word.antonyms.all %}
224 <li class="w_{{ antonym.id }}">
225 <a href="{{ antonym.get_absolute_url }}">{{ antonym.word }}</a>
226 </li>
227 {% endfor %}
228 </ul>
229 </div>
230 <div class="m2m r_thesaurus w_{{ word.id }} lang_{{ word.language }}">
231 <div class="header">Thesaurus</div>
232 <ul>
233 {% for thesaurus in word.thesaurus.all %}
234 <li class="w_{{ thesaurus.id }}">
235 <a href="{{ thesaurus.get_absolute_url }}">{{ thesaurus.word }}</a>
236 </li>
237 {% endfor %}
238 </ul>
239 </div>
240 <div class="m2m r_rhyme w_{{ word.id }} lang_{{ word.language }}">
241 <div class="header">Rhymes with</div>
242 <ul>
243 {% for rhyme in word.rhymes.all %}
244 <li class="w_{{ rhyme.id }}">
245 <a href="{{ rhyme.get_absolute_url }}">{{ rhyme.word }}</a>
246 </li>
247 {% endfor %}
248 </ul>
249 </div>
250 <div class="m2m r_related w_{{ word.id }} lang_{{ word.language }}">
251 <div class="header">See also</div>
252 <ul>
253 {% for related in word.relateds.all %}
254 <li class="w_{{ related.id }}">
255 <a href="{{ related.get_absolute_url }}">{{ related.word }}</a>
256 </li>
257 {% endfor %}
258 </ul>
259 </div>
260 </table>
261 </td>
262 </tr>
263 </table>
264 {% endfor %}
265 <div class="add_new_word">
266 <h1>{{ wordname }}</h1>
267 <form method="post" action="/w/ajax/word/add/">
268 add new word.
269 {{ "worddb.words.models.LanguageChoices"|choice2select:"language" }}
270 <input type="hidden" name="w" value="{{ wordname }}">
271 <input type="submit" value="Add">
272 </form>
273 </div>
274 <div class="select_language_c2s dnone">
275 {{ "worddb.words.models.LanguageChoices"|choice2select:"language" }}
276 </div>
277 <div class="select_pol_c2s dnone">
278 {{ "worddb.words.models.POLChoices"|choice2select:"pol" }}
279 </div>
280 {% endblock %}