forked from ThinkUpLLC/ThinkUp
/
dashboard.tpl
343 lines (315 loc) · 17.1 KB
/
dashboard.tpl
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
{include file="_header.tpl"}
{include file="_statusbar.tpl"}
<div class="container_24">
<div class="clearfix">
<!-- begin left nav -->
<div class="grid_4 alpha omega" style="background-color:#e6e6e6">
<div id="nav-sidebar">
<ul id="top-level-sidenav">
<li style="list-style: none">
{if $instance}
<ul>
<li>
<ul class="side-subnav">
<li{if $smarty.get.v eq ''} class="currentview"{/if}><br />
<a href="{$site_root_path}index.php?u={$instance->network_username|urlencode}&n={$instance->network|urlencode}">Dashboard</a>
</li>
{/if}
{if $sidebar_menu}
{foreach from=$sidebar_menu key=smkey item=sidebar_menu_item name=smenuloop}
{if $sidebar_menu_item->header}
</ul>
</li>
<li>{$sidebar_menu_item->header}
<ul class="side-subnav">
{/if}
<li{if $smarty.get.v eq $smkey} class="currentview"{/if}>
<a href="{$site_root_path}index.php?v={$smkey}&u={$instance->network_username|urlencode}&n={$instance->network|urlencode}">{$sidebar_menu_item->name}</a></li>
{/foreach}
</ul>
</li>
</ul>
{/if}
</li>
</ul>
</div>
</div>
<div class="thinkup-canvas round-all grid_20 alpha omega prepend_20 append_20" style="min-height:340px">
<div class="prefix_1 suffix_1">
{include file="_usermessage.tpl"}
{if $instance}
<!--begin public user dashboard-->
{if $user_details}
<div class="grid_18 alpha omega">
<div class="clearfix dashboard-header round-all">
<div class="grid_2 alpha">
<div class="avatar-container">
<img src="{$user_details->avatar}" class="avatar2"/>
<img src="{$site_root_path}plugins/{$user_details->network|get_plugin_path}/assets/img/favicon.ico" class="service-icon2"/>
</div>
</div>
<div class="grid_15 omega">
<span class="tweet">{$user_details->username} <span style="color:#ccc">{$user_details->network|capitalize}</span></span><br />
<div class="small">
{if $instance->crawler_last_run eq 'realtime'}<span style="color:green;">●</span> Updated in realtime{else}Updated {$instance->crawler_last_run|relative_datetime} ago{/if}{if !$instance->is_active} (paused){/if}
</div>
</div>
</div>
</div>
{/if}
{if $data_template}
{include file=$data_template}
<div class="float-l" id="older-posts-div">
{if $next_page}
<a href="{$site_root_path}index.php?{if $smarty.get.v}v={$smarty.get.v}&{/if}{if $smarty.get.u}u={$smarty.get.u}&{/if}{if $smarty.get.n}n={$smarty.get.n|urlencode}&{/if}page={$next_page}" id="next_page">< Older Posts</a>
{/if}
{if $last_page}
| <a href="{$site_root_path}index.php?{if $smarty.get.v}v={$smarty.get.v}&{/if}{if $smarty.get.u}u={$smarty.get.u}&{/if}{if $smarty.get.n}n={$smarty.get.n|urlencode}&{/if}page={$last_page}" id="last_page">Newer Posts ></a>
{/if}
</div>
{else} <!-- else if $data_template -->
{if $hot_posts|@count > 3}
<h2>Hot Posts</h2>
{foreach from=$hot_posts key=tid item=t name=foo}
{if $smarty.foreach.foo.index < 3}
{if $instance->network eq "twitter"}
{include file="_post.counts_no_author.tpl" post=$t}
{else}
{include file="_post.counts_no_author.tpl" post=$t show_favorites_instead_of_retweets=true}
{/if}
{/if}
{/foreach}
{else}
{if $recent_posts}
<h2>Recent posts</h2>
{foreach from=$recent_posts key=tid item=t name=foo}
{if $smarty.foreach.foo.index < 3}
{if $instance->network eq "twitter"}
{include file="_post.counts_no_author.tpl" post=$t}
{else}
{include file="_post.counts_no_author.tpl" post=$t show_favorites_instead_of_retweets=true}
{/if}
{/if}
{/foreach}
{/if}
{/if}
{if $hot_posts|@count > 3}
<div class="clearfix">
<!-- show retweets and replies for twitter; show favorites and replies for others -->
<div id="hot_posts">
</div>
{/if}
{if $most_replied_to_1wk}
<div class="clearfix">
<h2>This Week's Most {if $instance->network eq 'google+'}Discussed{else}Replied-To{/if} Posts</h2>
{foreach from=$most_replied_to_1wk key=tid item=t name=foo}
{if $instance->network eq "twitter"}
{include file="_post.counts_no_author.tpl" post=$t headings="NONE"}
{else}
{include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true}
{/if}
{/foreach}
</div>
{/if}
{if $most_faved_1wk}
<div class="clearfix">
<h2>This Week's Most {if $instance->network eq 'google+'}+1'ed{else}Liked{/if} Posts</h2>
{foreach from=$most_faved_1wk key=tid item=t name=foo}
{include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true}
{/foreach}
</div>
{/if}
{if $follower_count_history_by_day.history && $follower_count_history_by_week.history}
<div class="clearfix">
<div class="grid_9 alpha">
<div id="follower_count_history_by_day"></div>
{if $follower_count_history_by_day.trend}({if $follower_count_history_by_day.trend > 0}<span style="color:green">+{else}<span style="color:red">{/if}{$follower_count_history_by_day.trend|number_format}</span>/day){/if}
</div>
<div class="grid_9 omega">
<div id="follower_count_history_by_week"></div>
{if $follower_count_history_by_week.trend != 0}({if $follower_count_history_by_week.trend > 0}<span style="color:green">+{else}<span style="color:red">{/if}{$follower_count_history_by_week.trend|number_format}</span>/week){/if}
</div>
</div>
<script type="text/javascript">
// Load the Visualization API and the standard charts
google.load('visualization', '1');
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawCharts);
{literal}
function drawCharts() {
{/literal}
var follower_count_history_by_day_data = new google.visualization.DataTable(
{$follower_count_history_by_day.vis_data});
var follower_count_history_by_week_data = new google.visualization.DataTable(
{$follower_count_history_by_week.vis_data});
var follower_description = '{if $instance->network eq 'twitter'}Followers{elseif $instance->network eq 'facebook page'}Fans{elseif $instance->network eq 'facebook'}Friends{/if}';
var hot_posts_data = new google.visualization.DataTable({$hot_posts_data});
var client_usage_data = new google.visualization.DataTable({$all_time_clients_usage});
{literal}
var follower_count_history_by_day_chart = new google.visualization.ChartWrapper({
containerId: 'follower_count_history_by_day',
chartType: 'LineChart',
dataTable: follower_count_history_by_day_data,
options: {
title: follower_description + ' Count By Day',
titleTextStyle: {color: '#848884', fontSize: 16},
width: 350,
height: 250,
legend: "top",
interpolateNulls: true,
vAxis: {
minValue: 0
}
},
});
follower_count_history_by_day_chart.draw();
var follower_count_history_by_week_chart = new google.visualization.ChartWrapper({
containerId: 'follower_count_history_by_week',
chartType: 'LineChart',
dataTable: follower_count_history_by_week_data,
options: {
title: follower_description + ' Count By Week',
titleTextStyle: {color: '#848884', fontSize: 16},
width: 350,
height: 250,
legend: "top",
interpolateNulls: true,
vAxis: {
minValue: 0
}
},
});
follower_count_history_by_week_chart.draw();
if (typeof(replies) != 'undefined') {
var post_types = new google.visualization.DataTable();
post_types.addColumn('number', 'Conversationalist');
post_types.addColumn('number', 'Broadcaster');
post_types.addRow([{v: replies/100, f: replies + '%'}, {v: links/100, f: links + '%'}]);
var post_type_chart = new google.visualization.ChartWrapper({
containerId: 'post_types',
chartType: 'BarChart',
dataTable: post_types,
options: {
title: 'Post Types',
titleTextStyle: {color: '#848884', fontSize: 19},
width: 300,
height: 150,
legend: 'top',
hAxis: {
minValue: 0,
maxValue: 1,
format:'#,###%'
}
}
});
post_type_chart.draw();
}
var hot_posts_chart = new google.visualization.ChartWrapper({
containerId: 'hot_posts',
chartType: 'BarChart',
dataTable: hot_posts_data,
options: {
title: 'Recent Activity',
titleTextStyle: {color: '#848884', fontSize: 19},
isStacked: true,
width: 700,
height: 300,
legend: 'right',
hAxis: {
minValue: 0,
},
vAxis: {
textStyle: {fontSize: 9},
},
chartArea:{width:"40%"}
}
});
hot_posts_chart.draw();
var client_usage_chart = new google.visualization.ChartWrapper({
containerId: 'client_usage',
// chartType: 'ColumnChart',
chartType: 'PieChart',
dataTable: client_usage_data,
options: {
title: 'Client Usage (All Posts)',
titleTextStyle: {color: '#848884', fontSize: 19},
width: 400,
height: 300,
sliceVisibilityThreshold: 1/100,
pieSliceText: 'label',
}
});
client_usage_chart.draw();
}
{/literal}
</script>
{/if}
{if $follower_count_history_by_week.milestone}
<div class="small gray">
Next milestone: <span style="background-color:#FFFF80;color:black">{$follower_count_history_by_week.milestone.will_take} week{if $follower_count_history_by_week.milestone.will_take > 1}s{/if}</span> till you reach <span style="background-color:#FFFF80;color:black">{$follower_count_history_by_week.milestone.next_milestone|number_format} followers</span> at this rate. <a href="{$site_root_path}index.php?v=followers-history&u={$instance->network_username}&n={$instance->network}">More...</a>
</div>
{/if}
{if $least_likely_followers}
<div class="clearfix">
<h2>Most Discerning Followers</h2>
<div class="clearfix">
{foreach from=$least_likely_followers key=uid item=u name=foo}
<div class="avatar-container" style="float:left;margin:7px;">
<a href="http://twitter.com/{$u.user_name}" title="{$u.user_name}"><img src="{$u.avatar}" class="avatar2"/><img src="{$site_root_path}plugins/{$u.network}/assets/img/favicon.ico" class="service-icon2"/></a>
</div>
{/foreach}
<div class="clearfix small prepend">
<br ><br > <a href="{$site_root_path}index.php?v=followers-leastlikely&u={$instance->network_username}&n={$instance->network}">More...</a></div>
</div>
</div>
{/if}
{if $most_retweeted_1wk}
<div class="clearfix">
<h2>This Week's Most {if $instance->network eq 'google+'}Reshared{else}Retweeted{/if}</h2>
{foreach from=$most_retweeted_1wk key=tid item=t name=foo}
{include file="_post.counts_no_author.tpl" post=$t show_favorites_instead_of_retweets=false}
{/foreach}
</div>
{/if}
{if $instance->network eq 'twitter' }
<div class="clearfix">
<div class="public_user_stats">
<div class="grid_8 alpha">
<h2></h2>
<div id="post_types"></div>
<div class="clearfix small prepend">
{$instance->percentage_replies|round}% posts are replies<br>
{$instance->percentage_links|round}% posts contain links<br>
</div>
<script>
var replies = {$instance->percentage_replies|round};
var links = {$instance->percentage_links|round};
</script>
</div>
<div class="grid_8 omega">
<div id="client_usage">
</div>
</div>
</div>
<small>Recently posting about {$instance->posts_per_day|round} times a day{if $latest_clients_usage}, mostly using {foreach from=$latest_clients_usage key=name item=num_posts name=foo}{$name}{if !$smarty.foreach.foo.last} and {/if}{/foreach}{/if}</small>
{/if}
{/if} <!-- end if $data_template -->
{/if}
{if !$instance}
<div style="width:60%;text-align:center;">
{if $add_user_buttons}
{foreach from=$add_user_buttons key=smkey item=button name=smenuloop}
<br><br>
<div style="float:right;"><a href="{$site_root_path}account/?p={$button}" class="tt-button ui-state-default tt-button-icon-right ui-corner-all"><span class="ui-icon ui-icon-circle-arrow-e"></span>Add a {if $button eq 'googleplus'}Google+{else}{$button|ucwords}{/if} Account</a></div>
{/foreach}
{/if}
<br><br>
<div style="float:right;"><a href="{$site_root_path}account/" class="tt-button ui-state-default tt-button-icon-right ui-corner-all"><span class="ui-icon ui-icon-circle-arrow-e"></span>Adjust Your Settings</a></div>
</div>
{/if}
</div> <!-- /.prefix_1 -->
</div> <!-- /.thinkup-canvas -->
</div> <!-- /.clearfix -->
</div> <!-- /.container_24 -->
<script type="text/javascript" src="{$site_root_path}assets/js/linkify.js"></script>
{include file="_footer.tpl"}