|
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 |
|
|
|
60 |
$("#main-tabs").tabs({ ajaxOptions: { async: false }, selected: tab_index}) ; |
|
|
61 |
|
|
|
62 |
$('.cust_behav').click(function() { |
|
|
63 |
window.location = this.href; |
|
|
64 |
}); |
|
|
65 |
|
|
|
66 |
$("#dashboard_link").attr("href", tb_conf['dashboard-url']) ; |
|
|
67 |
$("#text_link").attr("href", tb_conf['text-url']) ; |
|
|
68 |
{% if can_manage_workspace %} |
|
|
69 |
$("#user_link").attr("href", tb_conf['user-url']) ; |
|
|
70 |
$("#settings_link").attr("href", tb_conf['settings-url']) ; |
|
|
71 |
{% endif %} |
|
63
|
72 |
$("#followup_link").attr("href", tb_conf['followup-url']) ; |
|
0
|
73 |
|
|
|
74 |
} ; |
|
|
75 |
|
|
|
76 |
$(document).ready(function(){ |
|
|
77 |
renderTabs(tb_conf['current_tab']); |
|
|
78 |
}) ; |
|
|
79 |
--> |
|
|
80 |
</script> |