| author | Yves-Marie Haussonne <ymh.work+github@gmail.com> |
| Fri, 09 May 2014 18:35:26 +0200 | |
| changeset 656 | a84519031134 |
| parent 536 | 0c625ce49a81 |
| permissions | -rw-r--r-- |
| 0 | 1 |
{% load i18n %} |
2 |
{% load com %} |
|
3 |
{% load local_perms %} |
|
4 |
||
5 |
{% get_local_text_perm request text can_edit_text as can_edit_text %} |
|
6 |
{% get_local_text_perm request text can_manage_text as can_manage_text %} |
|
7 |
||
8 |
<div id="text-tabs"> |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
9 |
<ul> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
10 |
<li><a id="view_tab_link" class="cust_behav" href="#autoexpand_text_view_frame_container">{% blocktrans %}Text{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
11 |
{% if can_edit_text %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
12 |
<li><a id="edit_tab_link" class="cust_behav" href="#text_edit">{% blocktrans %}Edit{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
13 |
{% endif %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
14 |
{% if can_manage_text %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
15 |
<li><a id="share_tab_link" class="cust_behav" href="#text_share">{% blocktrans %}People{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
16 |
{% endif %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
17 |
<li><a id="history_tab_link" class="cust_behav" href="#text_history">{% blocktrans %}Versions{% endblocktrans %} ({{ text.get_versions_number }})</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
18 |
{% if can_manage_text %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
19 |
<li><a id="settings_tab_link" class="cust_behav" href="#text_settings">{% blocktrans %}Settings{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
20 |
{% endif %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
21 |
{% if user.is_authenticated %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
22 |
<li><a id="followup_tab_link" class="cust_behav" href="#followup_settings">{% blocktrans %}Followup{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
23 |
{% endif %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
24 |
<li><a id="embed_tab_link" class="cust_behav" href="#text_embed">{% blocktrans %}Embed{% endblocktrans %}</a></li> |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
25 |
</ul> |
| 0 | 26 |
</div> |
27 |
||
28 |
<script type="text/javascript"> |
|
29 |
<!-- |
|
30 |
tb_conf['text-view-url'] = "{% url text-view text.key %}"; |
|
31 |
tb_conf['edit-view-url'] = "{% url text-edit text.key %}"; |
|
32 |
||
33 |
{% if can_manage_text %} |
|
34 |
tb_conf['share-view-url'] = "{% url text-share text.key %}"; |
|
35 |
{% endif %} |
|
36 |
tb_conf['history-view-url'] = "{% url text-history text.key %}"; |
|
37 |
||
38 |
{% if can_manage_text %} |
|
39 |
tb_conf['settings-view-url'] = "{% url text-settings text.key %}"; |
|
40 |
{% endif %} |
|
41 |
||
42 |
{% if user.is_authenticated %} |
|
| 63 | 43 |
tb_conf['followup-view-url'] = "{% url text-followup text.key %}"; |
44 |
{% endif %} |
|
45 |
||
46 |
tb_conf['embed-view-url'] = "{% url text-embed text.key %}"; |
|
| 0 | 47 |
|
48 |
renderTabs = function (current_tab) { |
|
49 |
||
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
50 |
var delta = -1; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
51 |
var tab_index = 0; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
52 |
|
| 126 | 53 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
54 |
if (current_tab == 'view') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
55 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
56 |
} |
| 0 | 57 |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
58 |
{% if can_edit_text %} |
| 126 | 59 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
60 |
if (current_tab == 'edit') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
61 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
62 |
} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
63 |
{% endif %} |
| 0 | 64 |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
65 |
{% if can_manage_text %} |
| 126 | 66 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
67 |
if (current_tab == 'share') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
68 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
69 |
} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
70 |
{% endif %} |
| 126 | 71 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
72 |
if (current_tab == 'history') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
73 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
74 |
} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
75 |
|
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
76 |
{% if can_manage_text %} |
| 126 | 77 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
78 |
if (current_tab == 'settings') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
79 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
80 |
} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
81 |
{% endif %} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
82 |
{% if user.is_authenticated %} |
| 126 | 83 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
84 |
if (current_tab == 'followup') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
85 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
86 |
} |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
87 |
{% endif %} |
| 126 | 88 |
delta = delta + 1; |
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
89 |
if (current_tab == 'embed') { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
90 |
tab_index = delta; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
91 |
} |
| 126 | 92 |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
93 |
$("#text-tabs").tabs({ ajaxOptions: { async: false }, active: tab_index}); |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
94 |
$("#text-tabs").on( "tabsbeforeactivate", function( event, ui ) { |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
95 |
window.location = ui.newTab.children ().first ().attr ('href'); |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
96 |
} ); |
| 0 | 97 |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
98 |
$("#view_tab_link").attr("href", tb_conf['text-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
99 |
$("#edit_tab_link").attr("href", tb_conf['edit-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
100 |
$("#share_tab_link").attr("href", tb_conf['share-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
101 |
$("#history_tab_link").attr("href", tb_conf['history-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
102 |
$("#settings_tab_link").attr("href", tb_conf['settings-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
103 |
$("#followup_tab_link").attr("href", tb_conf['followup-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
104 |
$("#embed_tab_link").attr("href", tb_conf['embed-view-url']) ; |
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
105 |
|
|
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
106 |
$("#text-tabs").trigger("tabs_ready"); |
| 0 | 107 |
|
108 |
} ; |
|
109 |
||
110 |
$(document).ready(function(){ |
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
126
diff
changeset
|
111 |
renderTabs(tb_conf['current_tab']); |
| 0 | 112 |
}) ; |
113 |
--> |
|
114 |
</script> |