| 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 com %} |
2 |
{% load i18n %} |
|
3 |
{% load local_perms %} |
|
4 |
||
5 |
{% get_local_perm request can_manage_workspace as can_manage_workspace %} |
|
6 |
{% nb_texts as nb_texts %} |
|
7 |
{% nb_users as nb_users %} |
|
8 |
<div id="main-tabs"> |
|
9 |
<ul> |
|
10 |
<li><a id="dashboard_link" class="cust_behav" href="#dashboard">{% blocktrans %}Dashboard{% endblocktrans %}</a></li> |
|
11 |
<li><a id="text_link" class="cust_behav" href="#text">{% blocktrans with nb_texts as nb_texts %}Texts ({{ nb_texts }}){% endblocktrans %} </a></li> |
|
12 |
{% if can_manage_workspace %} |
|
13 |
<li><a id="user_link" class="cust_behav" href="#user">{% blocktrans with nb_users as nb_users %}People ({{ nb_users }}){% endblocktrans %}</a></li> |
|
14 |
<li><a id="settings_link" class="cust_behav" href="#settings">{% blocktrans %}Settings{% endblocktrans %}</a></li> |
|
15 |
{% endif %} |
|
| 64 | 16 |
<li><a id="followup_link" class="cust_behav" href="#followup">{% blocktrans %}Followup{% endblocktrans %}</a></li> |
| 0 | 17 |
</ul> |
18 |
</div> |
|
19 |
||
20 |
<script type="text/javascript"> |
|
21 |
<!-- |
|
22 |
tb_conf['dashboard-url'] = "{% url index %}"; |
|
23 |
tb_conf['text-url'] = "{% url text %}"; |
|
24 |
{% if can_manage_workspace %} |
|
25 |
tb_conf['user-url'] = "{% url user %}"; |
|
26 |
tb_conf['settings-url'] = "{% url settings %}"; |
|
27 |
{% endif %} |
|
| 63 | 28 |
tb_conf['followup-url'] = "{% url followup %}"; |
| 0 | 29 |
|
30 |
renderTabs = function (current_tab) { |
|
31 |
||
32 |
var tab_index = 0; |
|
33 |
|
|
34 |
if (current_tab == 'dashboard') { |
|
35 |
tab_index = 0; |
|
36 |
} |
|
37 |
||
38 |
if (current_tab == 'text') { |
|
39 |
tab_index = 1; |
|
40 |
} |
|
41 |
|
|
42 |
{% if can_manage_workspace %} |
|
43 |
if (current_tab == 'user') { |
|
44 |
tab_index = 2; |
|
45 |
} |
|
46 |
||
47 |
if (current_tab == 'settings') { |
|
48 |
tab_index = 3; |
|
49 |
} |
|
50 |
||
| 63 | 51 |
if (current_tab == 'followup') { |
| 0 | 52 |
tab_index = 4; |
53 |
} |
|
54 |
{% else %} |
|
| 63 | 55 |
if (current_tab == 'followup') { |
| 0 | 56 |
tab_index = 2; |
57 |
} |
|
58 |
{% endif %} |
|
59 |
|
|
|
536
0c625ce49a81
- updating jQuery (1.3.2 -> 1.10.2), jQuery UI, jQuery modules
Simon Descarpentries <sid@sopinspace.com>
parents:
64
diff
changeset
|
60 |
$("#main-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:
64
diff
changeset
|
61 |
$("#main-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:
64
diff
changeset
|
62 |
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:
64
diff
changeset
|
63 |
} ); |
| 0 | 64 |
|
65 |
$("#dashboard_link").attr("href", tb_conf['dashboard-url']) ; |
|
66 |
$("#text_link").attr("href", tb_conf['text-url']) ; |
|
67 |
{% if can_manage_workspace %} |
|
68 |
$("#user_link").attr("href", tb_conf['user-url']) ; |
|
69 |
$("#settings_link").attr("href", tb_conf['settings-url']) ; |
|
70 |
{% endif %} |
|
| 63 | 71 |
$("#followup_link").attr("href", tb_conf['followup-url']) ; |
| 0 | 72 |
|
73 |
} ; |
|
74 |
||
75 |
$(document).ready(function(){ |
|
76 |
renderTabs(tb_conf['current_tab']); |
|
77 |
}) ; |
|
78 |
--> |
|
79 |
</script> |