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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
{% extends "gstudio/base.html" %}
{% load i18n comments gstudio_tags %}
{% block title %}{{ object.title }}{% endblock %}
{% block meta-description %}{% if object.excerpt %}{{ object.excerpt|striptags }}{% else %}{{ object.content|striptags|truncatewords:100 }}{% endif %}{% endblock %}
{% block meta-keywords %}{% if object.tags %}{{ object.tags }}{% else %}{{ block.super }}{% endif %}{% endblock %}
{% block link %}
{{ block.super }}
{% with object.previous_nodetype as previous_nodetype %}{% if previous_nodetype %}
<link rel="prev" title="{{ previous_nodetype.title }}" href="{{ previous_nodetype.get_absolute_url }}" />
{% endif %}{% endwith %}
{% with object.next_nodetype as next_nodetype %}{% if next_nodetype %}
<link rel="next" title="{{ next_nodetype.title }}" href="{{ next_nodetype.get_absolute_url }}" />
{% endif %}{% endwith %}
<link rel="shortlink" href="{{ object.short_url }}" />
<link rel="canonical" href="{{ object.get_absolute_url }}" />
{% with year=object.creation_date|date:"Y" month=object.creation_date|date:"m" day=object.creation_date|date:"d" %}
<link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed of discussions on" %} '{{ object.title }}'"
href="{% url gstudio_nodetype_discussion_feed year month day object.slug %}" />
<link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed of comments on" %} '{{ object.title }}'"
href="{% url gstudio_nodetype_comment_feed year month day object.slug %}" />
<link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed of pingbacks on" %} '{{ object.title }}'"
href="{% url gstudio_nodetype_pingback_feed year month day object.slug %}" />
<link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed of trackbacks on" %} '{{ object.title }}'"
href="{% url gstudio_nodetype_trackback_feed year month day object.slug %}" />
{% endwith %}
{% endblock %}
{% block content %}
{% block nodetype-content %}
<h2 class="nodetype-title">
<a href="{{ object.get_absolute_url }}" title="{{ object.title }}" rel="bookmark">
{{ object.title }}
</a>
<a href="{{ object.ref.get_edit_url }}" target="_blank" title = "edit">[edit]</a>
</h2>
{% with object.html_content|safe as object_content %}
<!-- Neighbourhood listing starts -->
<!--Name,Plural Name , Alternate Name ,Type of -->
<b>Name:<nbsp></b> {{ object.title }} <br/>
{% if object.get_rendered_nbh.plural %}
<b> Plural Name:<nbsp></b>
{{object.get_rendered_nbh.plural}} <br/>
{% endif %}
{% if object.get_rendered_nbh.altnames %}
<b> Alternate names:<nbsp></b>
{{object.get_rendered_nbh.altnames}} <br/>
{% endif %}
{% if object.get_rendered_nbh.type_of %}
<b> Type of:<nbsp></b>
{% for typekey,typevalue in object.get_rendered_nbh.type_of.items %}
<a href="{{typevalue}}" title = "{{typekey}}">{{typekey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Member of metatypes -->
{% if object.get_rendered_nbh.member_of_metatypes %}
<b> Member of Metatypes:<nbsp></b>
{% for mkey,mvalue in object.get_rendered_nbh.member_of_metatypes.items %}
<a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Subtypes -->
{% if object.get_rendered_nbh.contains_subtypes %}
<b> Contains SubTypes:<nbsp></b>
{% for stkey,stvalue in object.get_rendered_nbh.contains_subtypes.items %}
<a href="{{stvalue}}" title = "{{stkey}}">{{stkey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Members -->
{% if object.get_rendered_nbh.contains_members %}
<b>Contains Members:<nbsp></b>
{% for mkey,mvalue in object.get_rendered_nbh.contains_members.items %}
<a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Authors -->
{% if object.get_rendered_nbh.authors %}
<b>Authors: <nbsp> </b>
{% endif %}
{% for author in object.authors.all %}
<span class="vcard author">
<a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author"
title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a>
</span>{% if not forloop.last %}, {% endif %}
{% endfor %} <br/>
<!-- Prior nodes -->
{% if object.get_rendered_nbh.priornodes %}
<b>Prior nodes:<nbsp></b>
{% for mkey,mvalue in object.get_rendered_nbh.priornodes.items %}
<a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Posterior nodes -->
{% if object.get_rendered_nbh.posteriornodes %}
<b>Posterior nodes:<nbsp></b>
{% for mkey,mvalue in object.get_rendered_nbh.posteriornodes.items %}
<a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>;
{% endfor %}<br/>
{% endif %}
<!-- Relations -->
{% if object.get_rendered_nbh.relations %}
{% for relkey,relvalue in object.get_rendered_nbh.relations.items %}
<b>{{relkey}}:<nbsp></b>
{% for relk, relv in relvalue.items %}
<a href="{{relv}}" title = "{{relk}}">{{relk}}</a>;
{% endfor %}<br/>
{% endfor %}
{% endif %}
<!-- Attributes -->
{% if object.get_rendered_nbh.attributes %}
{% for atkey,atvalue in object.get_rendered_nbh.attributes.items %}
{% if atvalue %}
<b>{{atkey}}:<nbsp> </b>
{% for atr in atvalue %}
{% for urlkey,urlvalue in object.get_edit_url_for_ats.items %}
{% ifequal atr urlvalue %}
{{atr}}<a href="{{ urlkey}}" title = "edit">[edit]</a> ;
{% endifequal %}
{% endfor %}
{% endfor %} <br/>
{% endif %}
{% endfor %}
{% endif %}
<!-- Left roles -->
{% if object.get_rendered_nbh.leftroles %}
<b>Left roles:<nbsp> </b>
{% for lrkey,lrvalue in object.get_rendered_nbh.leftroles.items %}
<a href="{{lrvalue}}" title = "{{lrkey}}">{{lrkey}}</a>;
{% endfor %} <br/>
{% endif %}
<!-- Right roles -->
{% if object.get_rendered_nbh.rightroles %}
<b>Right roles:<nbsp> </b>
{% for rrkey,rrvalue in object.get_rendered_nbh.rightroles.items %}
<a href="{{rrvalue}}" title = "{{rrkey}}">{{rrkey}}</a>;
{% endfor %} <br/>
{% endif %}
<!-- Attributes -->
{% if object.get_rendered_nbh.ats %}
<b>Subjecttype of:<nbsp> </b>
{% for atkey,atvalue in object.get_rendered_nbh.ats.items %}
<a href="{{atvalue}}" title = "{{atkey}}">{{atkey}}</a>;
{% endfor %} <br/>
{% endif %}
<!-- Content -->
{% if object.content %}
<b>Content:<nbsp></b>{{object_content}}
{% endif %}
<!-- Neighbourhood Listing ends -->
<script type="text/javascript" >
var s = 0
var i
{% if object.get_rendered_nbh.count_plural %}
var i = parseInt({{ object.get_rendered_nbh.count_plural }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_altnames %}
i = parseInt({{ object.get_rendered_nbh.count_altnames }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_type_of %}
i = parseInt({{ object.get_rendered_nbh.count_type_of }})
s = s + i
{% endif %}
{% if object.get_rendered_nbh.count_member_of_metatypes %}
i = parseInt({{ object.get_rendered_nbh.count_member_of_metatypes }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_member_of_metatypes %}
i = parseInt({{ object.get_rendered_nbh.count_member_of_metatypes }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_contains_members %}
var b = parseInt({{ object.get_rendered_nbh.count_contains_members }})
s = parseInt(s + i)
{% endif %}
/* {% if object.get_rendered_nbh.count_siblings %}
i = parseInt({{ object.get_rendered_nbh.count_siblings }})
s = parseInt(s + i)
{% endif %}*/
{% if object.get_rendered_nbh.count_priornodes %}
i = parseInt({{ object.get_rendered_nbh.count_priornodes }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_posteriornodes %}
i = parseInt({{ object.get_rendered_nbh.count_posteriornodes }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_relations %}
i = parseInt({{ object.get_rendered_nbh.count_relations }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_attributes %}
i = parseInt({{ object.get_rendered_nbh.count_attributes }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_leftroles %}
i = parseInt({{ object.get_rendered_nbh.count_leftroles }})
s = parseInt(s + i)
{% endif %}
{% if object.get_rendered_nbh.count_rightroles %}
i = parseInt({{ object.get_rendered_nbh.count_rightroles }})
s = parseInt(s + i)
{% endif %}
if ( s > 0)
{
s = parseInt(s)
//alert(s)
}
</script>
{% endwith %}
{% endblock %}
<!-- Dynamic form begins -->
{% if user.is_authenticated %}
<p>
{% if object.reftype == 'Objecttype' %}
<b>Add Attribute for: </b>
{% for key,value in object.get_at_url_add.items %}
<a href="/{{value}}" onclick="return showAddAnotherPopup(this);"> {{key}} </a><nbsp>;<br/>
{% endfor %}
</p>
<p>
<b>Add Attributes:(</b>
<a href="/admin/gstudio/attribute
/add" class="add-another" id="add_id_{{ field }}" onclick="return showAddAnotherPopup(this);">
<img width="10" height="10" alt="Add Another" src="/static/grappelli/img/admin/icon_addlink.gif">
</a>
<b>)</b>
{% for i in object.getat %}
<a href="{{ get_absolute_url }}/objects/dynamicAttribute/save/{{ i }}/{{ object.title }}">{{ i }}</a><nbsp>;
{% endfor %}
</p>
<p>
<b>Add Relations:(</b>
<a href="/admin/gstudio/relation
/add" class="add-another" id="add_id_{{ field }}" onclick="return showAddAnotherPopup(this);">
<img width="10" height="10" alt="Add Another" src="/static/grappelli/img/admin/icon_addlink.gif">
</a>
<b>)</b>
{% for i in object.getrt %}
<a href="{{ get_absolute_url }}/objects/dynamicRelation/displaymem/{{ i }}/{{ object.title }}">{{ i }}</a><nbsp>;
{% endfor %}
{% endif %}
{% endif %}
</p>
<!-- Dyanic form ends -->
<div class="nodetype-content">
</div>
{% block nodetype-widgets %}
<div class="nodetype-widgets span-16 last"> {% with object.next_nodetype as next_nodetype %}
{% if object.posteriornodes.all %}
<div class="nodetype-next">
<h5>{% trans "Posterior node" %}</h5>
{% for items in object.posteriornodes.all %}
<a href="{{ items.get_absolute_url }}" title = "{{ items.title }}"> {{ items.title }}</a>;
{% endfor %}
</div>
{% endif %}
{% endwith %}
<!-- {% with object.previous_nodetype as previous_nodetype %} -->
{% if object.priornodes.all %}
<div class="nodetype-next">
<h5>{% trans "Prior node" %}</h5>
{% for items in object.priornodes.all %}
<a href="{{ items.get_absolute_url }}" title = "{{ items.title }}"> {{ items.title }}</a>;
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% if object.related_published %}
<div class="nodetype-related">
<h5>{% trans "Related node types" %}</h5>
<ul>
{% for nodetype in object.related_published %}
<li>
<a href="{{ nodetype.get_absolute_url }}" title="{{ nodetype.title }}" rel="bookmark">{{ nodetype.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% endblock %}
{% block nodetype-comments %}
<div id="comments" class="span-16 last">
<h5>{% trans "Comments" %}</h5>
{% with object.comments as comment_list %}
{% if comment_list.count %}
<ol id="comment-list" class="span-15 last">
{% for comment in comment_list %}
<li id="comment_{{ comment.pk }}" class="comment vcard {% cycle box1,box2 %}{% if comment.user in object.authors.all %} post-author{% endif %} span-15 last">
<div class="span-2">
<img src="{% get_gravatar comment.email 60 "G" %}" class="gravatar photo" alt="{{ comment.user_name }}"/>
</div>
<div class="comment-body span-13 last">
<div class="comment-author span-13 last">
{% if comment.url %}
<a href="{{ comment.url }}" class="fn url" title = "{{ comment.user_name }}">{{ comment.user_name }}</a>
{% else %}
{{ comment.user_name }}
{% endif %}
{% trans "on" %} {{ comment.submit_date|date:"SHORT_DATETIME_FORMAT" }}
</div>
<div class="span-13 last">
{{ comment.comment|linebreaks }}
</div>
</div>
</li>
{% endfor %}
</ol>
{% if not object.comments_are_open %}
<p>{% trans "Comments are closed." %}</p>
{% endif %}
{% else %}
{% if object.comments_are_open %}
<p>{% trans "No comments yet." %}</p>
{% else %}
<p>{% trans "Comments are closed." %}</p>
{% endif %}
{% endif %}
{% endwith %}
</div>
{% endblock %}
{% block nodetype-pingbacks %}
<div id="pingbacks" class="span-16 last">
<h5>{% trans "Pingbacks" %}</h5>
{% with object.pingbacks as pingback_list %}
{% if pingback_list.count %}
<ol id="pingback-list" class="span-15 last">
{% for pingback in pingback_list %}
<li id="pingback_{{ pingback.pk }}" class="pingback {% cycle box1,box2 %} span-15 last">
<div class="pingback-body span-15 last">
<div class="pingback-author span-15 last">
<a href="{{ pingback.url }}" title = "{{ pingback.user_name }}">{{ pingback.user_name }}</a>
{% trans "on" %} {{ pingback.submit_date|date:"SHORT_DATETIME_FORMAT" }}
</div>
<div class="span-15 last">
<cite>
{{ pingback.comment }}
</cite>
</div>
</div>
</li>
{% endfor %}
</ol>
{% endif %}
{% if object.pingback_enabled %}
<p>{% trans "Pingbacks are open." %}</p>
{% else %}
<p>{% trans "Pingbacks are closed." %}</p>
{% endif %}
{% endwith %}
</div>
{% endblock %}
{% block nodetype-trackbacks %}
{% with object.trackbacks as trackback_list %}
{% if trackback_list.count or object.pingback_enabled %}
<div id="trackbacks" class="span-16 last">
<h5>{% trans "Trackbacks" %}</h5>
{% if trackback_list.count %}
<ol id="trackback-list" class="span-15 last">
{% for trackback in trackback_list %}
<li id="trackback_{{ trackback.pk }}" class="trackback {% cycle box1,box2 %} span-15 last">
<div class="trackback-body span-15 last">
<div class="trackback-author span-15 last">
<a href="{{ trackback.url }}" title = "{{ trackback.user_name }}">{{ trackback.user_name }}</a>
{% trans "on" %} {{ trackback.submit_date|date:"SHORT_DATETIME_FORMAT" }}
</div>
<div class="span-15 last">
<cite>
{{ trackback.comment }}
</cite>
</div>
</div>
</li>
{% endfor %}
</ol>
{% endif %}
{% if object.pingback_enabled %}
<p>
<a href="{% url gstudio_nodetype_trackback object.pk %}" rel="trackback" title = "Trackback URL">
{% trans "Trackback URL" %}</a>
</p>
{% endif %}
</div>
{% endif %}
{% endwith %}
{% endblock %}
{% block nodetype-comments-form %}
{% if object.comments_are_open %}
<div class="commentForm span-16 last">
{% render_comment_form for object %}
</div>
{% endif %}
{% endblock %}
{% endblock %}
{% block admin_tools %}
{% if perms.gstudio.change_nodetype %}
<li>
<a href="{% url admin:gstudio_objecttype_change object.pk %}" title="{% trans "Edit the nodetype" %}">
{% trans "Edit the node type" %}
</a>
</li>
{% endif %}
{% endblock %}
|