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
|
<script type="text/template" class="activity_stream">
<%- activity.id %>
<% if (num_entries > 0) {
var last_date;
_.each(stream, function(act) { %>
<%
var new_date = new Date(act.mkdate * 1000);
var new_date_string = ('0' + new_date.getDate()).slice(-2) + '.'
+ ('0' + (new_date.getMonth()+1)).slice(-2) + '.'
+ new_date.getFullYear();
if (last_date != new_date_string) { %>
<% last_date = new_date_string; %>
<span class="activity-day"><%- last_date %></span>
<% } %>
<%= activity({
activity : act,
user_id : user_id,
activity_urls : activity_urls
}) %>
<% });
} else { %>
<?= MessageBox::info(_('Keine (weiteren) Aktivitäten gefunden.')) ?>
<% } %>
</script>
<script type="text/template" class="activity-load-error">
<?= MessageBox::error(_('Aktivitäten konnten nicht geladen werden')) ?>
</script>
<script type="text/template" class="activity">
<section class="activity">
<header>
<span class="provider_circle <% if (activity.actor.id == user_id) { %>right<% } else { %>left<% } %>">
<% var treffer = activity.provider.match(/.*\\(.*)Provider/) %>
<% var provider = treffer[1].toLowerCase(); %>
<% if (provider === 'blubber') { %>
<?= Icon::create('blubber', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'documents') { %>
<?= Icon::create('files', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'forum') { %>
<?= Icon::create('forum', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'message') { %>
<?= Icon::create('mail', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'news') { %>
<?= Icon::create('news', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'participants') { %>
<?= Icon::create('persons', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'schedule') { %>
<?= Icon::create('schedule', 'info_alt')->asImg(32) ?>
<% } else if(provider === 'wiki') { %>
<?= Icon::create('wiki', 'info_alt')->asImg(32) ?>
<% } else { %>
<?= Icon::create('activity', 'info_alt')->asImg(32) ?>
<% } %>
</span>
<div class="activity-heading">
<% if (activity.actor.type !== 'anonymous') { %>
<a href="<%- STUDIP.URLHelper.getURL('dispatch.php/profile?username=' + activity.actor.details.name.username) %>">
<img src="<%- activity.actor.details.avatar_medium %>" class="activity-avatar">
</a>
<% } %>
<h3>
<%- activity.title %>
</h3>
</div>
<div class="activity-date">
<?= _('Am <%- new Date(activity.mkdate * 1000).toLocaleString() %> Uhr') ?>
</div>
</header>
<section class="activity-content">
<section class="activity-description">
<span class="activity-details">
<%= activity.content %>
</span>
</section>
<div class='clear'></div>
</section>
<footer>
<span class="activity-object-link">
<%= activity_urls({urls: activity.object_url}) %>
</span>
</footer>
</section>
</script>
<script type="text/template" class="activity-urls">
<ul>
<% _.each(urls, function(name, link) { %>
<li>
<a href="<%= link %>">
<%- name %>
</a>
</li>
<% }) %>
</ul>
</script>
|