blob: e5306f309b855bdbdf215fcf7f032f33f32f9559 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001[define title]Updates[end]
2[if-any updates_data]
3
4[define even]Yes[end]
5
6<div id="colcontrol">
7<div class="list">
8 <table style="width: 100%;" cellspacing="0" cellpadding="0">
9 <tbody><tr>
10 <td style="text-align: left;">
11 Details:
12 <a id="detailsshow" href="#" class="showAll">Show all</a>
13 <a id="detailshide" href="#" class="hideAll">Hide all</a></td>
14 <td>
15 [include "../framework/artifact-list-pagination-part.ezt"]
16 </td>
17 </tr>
18 </tbody>
19 </table>
20 </div>
21
22 <table cellspacing="0" cellpadding="0" border="0" width="100%" id="resultstable" class="results" style="table-layout:fixed; width:100%">
23 <tbody>
24 <tr>
25 <td style="padding:0px" width="100%">
26
27 <div id='activity-streams-list' class='activity-stream-list'>
28 [if-any updates_data.today]
29 <h4>Today</h4>
30 <ul class='activity-stream'>
31 [for updates_data.today]
32 [include "updates-entry-part.ezt" updates_data.today]
33 [end]
34 </ul>
35 [end]
36
37 [if-any updates_data.yesterday]
38 <h4>Yesterday</h4>
39 <ul class='activity-stream'>
40 [for updates_data.yesterday]
41 [include "updates-entry-part.ezt" updates_data.yesterday]
42 [end]
43 </ul>
44 [end]
45
46 [if-any updates_data.pastweek]
47 <h4>Last 7 days</h4>
48 <ul class='activity-stream'>
49 [for updates_data.pastweek]
50 [include "updates-entry-part.ezt" updates_data.pastweek]
51 [end]
52 </ul>
53 [end]
54
55 [if-any updates_data.pastmonth]
56 <h4>Last 30 days</h4>
57 <ul class='activity-stream'>
58 [for updates_data.pastmonth]
59 [include "updates-entry-part.ezt" updates_data.pastmonth]
60 [end]
61 </ul>
62 [end]
63
64 [if-any updates_data.thisyear]
65 <h4>Earlier this year</h4>
66 <ul class='activity-stream'>
67 [for updates_data.thisyear]
68 [include "updates-entry-part.ezt" updates_data.thisyear]
69 [end]
70 </ul>
71 [end]
72
73 [if-any updates_data.older]
74 <h4>Older</h4>
75 <ul class='activity-stream'>
76 [for updates_data.older]
77 [include "updates-entry-part.ezt" updates_data.older]
78 [end]
79 </ul>
80 [end]
81 </div>
82
83 </td></tr></tbody></table>
84
85 <div class="list-foot">
86 [include "../framework/artifact-list-pagination-part.ezt"]
87 </div>
88</div>
89
90[else]
91
92 [if-any no_stars]
93 [is user_updates_tab_mode "st2"]
94 <div class="display-error">There are no starred projects.</div>
95 [else][is user_updates_tab_mode "st3"]
96 <div class="display-error">There are no starred developers.</div>
97 [end][end]
98 [else][if-any no_activities]
99 <div class="display-error">There are no updates yet.</div>
100 [end][end]
101
102[end]
103
104[if-any updates_data]
105<script type="text/javascript" nonce="[nonce]">
106runOnLoad(function() {
107
108 /**
109 * Shows the activity detail for the particular activity selected.
110 */
111 function handleActivityLinkClick(e) {
112 var targetEl;
113
114 if (!e) {
115 var e = window.event;
116 }
117 if (e.target) {
118 targetEl = e.target;
119
120 } else if (e.srcElement) {
121 targetEl = e.srcElement;
122 }
123 if (targetEl.nodeType == 3) {
124 targetEl = targetEl.parentNode;
125 }
126
127 while (targetEl.tagName.toLowerCase() != 'li') {
128 targetEl = targetEl.parentNode;
129 }
130 if (targetEl.className.indexOf('click') != -1) {
131 targetEl.className = targetEl.className.replace(/click/, '');
132 } else {
133 targetEl.className += ' click';
134 }
135
136 e.preventDefault();
137 }
138
139 /**
140 * Array of <li> elements for activity streams
141 */
142 var _CS_asElemList = document.getElementById('activity-streams-list').
143 getElementsByTagName('li');
144
145 /**
146 * Shows all activity details
147 */
148 function expandAll(event) {
149 for (var i=0; i < _CS_asElemList.length; i++) {
150 _CS_asElemList[[]i].className = 'click';
151 }
152 event.preventDefault();
153 }
154
155 /**
156 * Hides all activity details
157 */
158 function closeAll(event) {
159 for (var i=0; i < _CS_asElemList.length; i++) {
160 _CS_asElemList[[]i].className = '';
161 }
162 event.preventDefault();
163 }
164
165 if ($("detailsshow"))
166 $("detailsshow").addEventListener("click", expandAll);
167 if ($("detailshide"))
168 $("detailshide").addEventListener("click", closeAll);
169
170 var activityLinks = document.getElementsByClassName("activity");
171 for (var i = 0; i < activityLinks.length; ++i) {
172 var link = activityLinks[[]i];
173 link.addEventListener("click", handleActivityLinkClick);
174 }
175});
176</script>
177[end]