216 |
22 Mar 05 |
nicklas |
1 |
<%-- $Id$ |
216 |
22 Mar 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Johan Enell |
216 |
22 Mar 05 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
216 |
22 Mar 05 |
nicklas |
9 |
|
216 |
22 Mar 05 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
216 |
22 Mar 05 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
216 |
22 Mar 05 |
nicklas |
13 |
of the License, or (at your option) any later version. |
216 |
22 Mar 05 |
nicklas |
14 |
|
216 |
22 Mar 05 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
216 |
22 Mar 05 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
216 |
22 Mar 05 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
216 |
22 Mar 05 |
nicklas |
18 |
GNU General Public License for more details. |
216 |
22 Mar 05 |
nicklas |
19 |
|
216 |
22 Mar 05 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
216 |
22 Mar 05 |
nicklas |
22 |
------------------------------------------------------------------ |
216 |
22 Mar 05 |
nicklas |
23 |
This is the welcome page once the user has logged in to BASE. |
216 |
22 Mar 05 |
nicklas |
24 |
It should do a lot more than display an empty page.... |
216 |
22 Mar 05 |
nicklas |
25 |
|
216 |
22 Mar 05 |
nicklas |
26 |
...To be done.... |
216 |
22 Mar 05 |
nicklas |
27 |
|
216 |
22 Mar 05 |
nicklas |
28 |
@author Nicklas |
216 |
22 Mar 05 |
nicklas |
29 |
@version 2.0 |
216 |
22 Mar 05 |
nicklas |
30 |
--%> |
5426 |
24 Sep 10 |
nicklas |
31 |
<%@ page pageEncoding="UTF-8" session="false" |
1907 |
06 Feb 06 |
nicklas |
32 |
import="net.sf.basedb.core.SessionControl" |
1907 |
06 Feb 06 |
nicklas |
33 |
import="net.sf.basedb.core.DbControl" |
1907 |
06 Feb 06 |
nicklas |
34 |
import="net.sf.basedb.core.User" |
1907 |
06 Feb 06 |
nicklas |
35 |
import="net.sf.basedb.core.Group" |
1907 |
06 Feb 06 |
nicklas |
36 |
import="net.sf.basedb.core.Message" |
1907 |
06 Feb 06 |
nicklas |
37 |
import="net.sf.basedb.core.Project" |
1907 |
06 Feb 06 |
nicklas |
38 |
import="net.sf.basedb.core.News" |
1907 |
06 Feb 06 |
nicklas |
39 |
import="net.sf.basedb.core.Include" |
1907 |
06 Feb 06 |
nicklas |
40 |
import="net.sf.basedb.core.Location" |
2425 |
26 Jun 06 |
nicklas |
41 |
import="net.sf.basedb.core.Type" |
1907 |
06 Feb 06 |
nicklas |
42 |
import="net.sf.basedb.core.Quota" |
1907 |
06 Feb 06 |
nicklas |
43 |
import="net.sf.basedb.core.QuotaType" |
1907 |
06 Feb 06 |
nicklas |
44 |
import="net.sf.basedb.core.ItemQuery" |
1907 |
06 Feb 06 |
nicklas |
45 |
import="net.sf.basedb.core.ItemResultList" |
1907 |
06 Feb 06 |
nicklas |
46 |
import="net.sf.basedb.core.SystemItems" |
1907 |
06 Feb 06 |
nicklas |
47 |
import="net.sf.basedb.core.query.Orders" |
2425 |
26 Jun 06 |
nicklas |
48 |
import="net.sf.basedb.core.query.Expression" |
1907 |
06 Feb 06 |
nicklas |
49 |
import="net.sf.basedb.core.query.Hql" |
1907 |
06 Feb 06 |
nicklas |
50 |
import="net.sf.basedb.core.query.Restrictions" |
1907 |
06 Feb 06 |
nicklas |
51 |
import="net.sf.basedb.core.query.Expressions" |
1907 |
06 Feb 06 |
nicklas |
52 |
import="net.sf.basedb.clients.web.Base" |
1907 |
06 Feb 06 |
nicklas |
53 |
import="net.sf.basedb.clients.web.util.HTML" |
2942 |
22 Nov 06 |
nicklas |
54 |
import="net.sf.basedb.util.formatter.Formatter" |
2942 |
22 Nov 06 |
nicklas |
55 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5479 |
08 Nov 10 |
nicklas |
56 |
import="net.sf.basedb.clients.web.servlet.RssNewsFeed" |
2753 |
20 Oct 06 |
nicklas |
57 |
import="net.sf.basedb.util.Values" |
5474 |
03 Nov 10 |
nicklas |
58 |
import="java.util.Date" |
5474 |
03 Nov 10 |
nicklas |
59 |
import="java.util.List" |
5474 |
03 Nov 10 |
nicklas |
60 |
import="java.util.ArrayList" |
5474 |
03 Nov 10 |
nicklas |
61 |
import="java.util.Set" |
5474 |
03 Nov 10 |
nicklas |
62 |
import="java.util.HashSet" |
216 |
22 Mar 05 |
nicklas |
63 |
%> |
216 |
22 Mar 05 |
nicklas |
64 |
<%@ taglib |
216 |
22 Mar 05 |
nicklas |
65 |
prefix="base" uri="/WEB-INF/base.tld" |
216 |
22 Mar 05 |
nicklas |
66 |
%> |
1907 |
06 Feb 06 |
nicklas |
67 |
<%! |
1907 |
06 Feb 06 |
nicklas |
68 |
private String getPrintableQuota(long myQuota, long groupQuota) |
1907 |
06 Feb 06 |
nicklas |
69 |
{ |
1907 |
06 Feb 06 |
nicklas |
70 |
String printable = ""; |
2425 |
26 Jun 06 |
nicklas |
71 |
if (myQuota == Quota.UNDEFINED && groupQuota == Quota.UNDEFINED) |
1907 |
06 Feb 06 |
nicklas |
72 |
{ |
2425 |
26 Jun 06 |
nicklas |
73 |
// Both are undefined |
2425 |
26 Jun 06 |
nicklas |
74 |
printable = ""; |
2425 |
26 Jun 06 |
nicklas |
75 |
} |
2425 |
26 Jun 06 |
nicklas |
76 |
else if (myQuota < 0 && groupQuota < 0) |
2425 |
26 Jun 06 |
nicklas |
77 |
{ |
2425 |
26 Jun 06 |
nicklas |
78 |
// both are unlimited or one is unlimited and the other is undefined |
1907 |
06 Feb 06 |
nicklas |
79 |
printable = "unlimited"; |
1907 |
06 Feb 06 |
nicklas |
80 |
} |
2425 |
26 Jun 06 |
nicklas |
81 |
else if (myQuota >= 0 && groupQuota >= 0) |
1907 |
06 Feb 06 |
nicklas |
82 |
{ |
2425 |
26 Jun 06 |
nicklas |
83 |
// both are well-defined; use min value |
2425 |
26 Jun 06 |
nicklas |
84 |
printable = Values.formatBytes(Math.min(myQuota, groupQuota)); |
2425 |
26 Jun 06 |
nicklas |
85 |
} |
2425 |
26 Jun 06 |
nicklas |
86 |
else |
2425 |
26 Jun 06 |
nicklas |
87 |
{ |
2425 |
26 Jun 06 |
nicklas |
88 |
// Only one is well-defined; use max value |
1907 |
06 Feb 06 |
nicklas |
89 |
printable = Values.formatBytes(Math.max(myQuota, groupQuota)); |
1907 |
06 Feb 06 |
nicklas |
90 |
} |
1907 |
06 Feb 06 |
nicklas |
91 |
return printable; |
1907 |
06 Feb 06 |
nicklas |
92 |
} |
1907 |
06 Feb 06 |
nicklas |
93 |
%> |
216 |
22 Mar 05 |
nicklas |
94 |
<% |
373 |
07 Apr 05 |
nicklas |
95 |
SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
216 |
22 Mar 05 |
nicklas |
96 |
String ID = sc.getId(); |
216 |
22 Mar 05 |
nicklas |
97 |
|
1907 |
06 Feb 06 |
nicklas |
98 |
DbControl dc = null; |
1907 |
06 Feb 06 |
nicklas |
99 |
try |
1907 |
06 Feb 06 |
nicklas |
100 |
{ |
7954 |
12 May 21 |
nicklas |
101 |
dc = sc.newDbControl(":Home page"); |
1907 |
06 Feb 06 |
nicklas |
102 |
User user = User.getById(dc, sc.getLoggedInUserId()); |
1907 |
06 Feb 06 |
nicklas |
103 |
Quota quota = user.getQuota(); |
1907 |
06 Feb 06 |
nicklas |
104 |
Group quotaGroup = user.getQuotaGroup(); |
1907 |
06 Feb 06 |
nicklas |
105 |
Quota groupQuota = quotaGroup == null ? null : quotaGroup.getQuota(); |
1907 |
06 Feb 06 |
nicklas |
106 |
|
2942 |
22 Nov 06 |
nicklas |
107 |
Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); |
2942 |
22 Nov 06 |
nicklas |
108 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
2942 |
22 Nov 06 |
nicklas |
109 |
|
1907 |
06 Feb 06 |
nicklas |
110 |
ItemQuery<Message> messageQuery = Message.getQuery(user); |
1907 |
06 Feb 06 |
nicklas |
111 |
messageQuery.order(Orders.desc(Hql.property("timeSent"))); |
1907 |
06 Feb 06 |
nicklas |
112 |
messageQuery.restrict(Restrictions.eq(Hql.property("read"), Expressions.parameter("isread", false))); |
1907 |
06 Feb 06 |
nicklas |
113 |
ItemResultList<Message> messages = messageQuery.list(dc); |
1907 |
06 Feb 06 |
nicklas |
114 |
|
5474 |
03 Nov 10 |
nicklas |
115 |
List<Project> projects = new ArrayList<Project>(); |
5474 |
03 Nov 10 |
nicklas |
116 |
String tmp = sc.getUserClientSetting("projects.recentActive"); |
5474 |
03 Nov 10 |
nicklas |
117 |
Set<Integer> recentProjects = new HashSet<Integer>(); |
5474 |
03 Nov 10 |
nicklas |
118 |
if (tmp != null) |
5474 |
03 Nov 10 |
nicklas |
119 |
{ |
5474 |
03 Nov 10 |
nicklas |
120 |
for (String id : tmp.split(":")) |
5474 |
03 Nov 10 |
nicklas |
121 |
{ |
5474 |
03 Nov 10 |
nicklas |
122 |
try |
5474 |
03 Nov 10 |
nicklas |
123 |
{ |
5474 |
03 Nov 10 |
nicklas |
124 |
Project p = Project.getById(dc, Values.getInt(id)); |
5474 |
03 Nov 10 |
nicklas |
125 |
if (!p.isRemoved()) |
5474 |
03 Nov 10 |
nicklas |
126 |
{ |
5474 |
03 Nov 10 |
nicklas |
127 |
recentProjects.add(p.getId()); |
5474 |
03 Nov 10 |
nicklas |
128 |
projects.add(p); |
5474 |
03 Nov 10 |
nicklas |
129 |
} |
5474 |
03 Nov 10 |
nicklas |
130 |
} |
5474 |
03 Nov 10 |
nicklas |
131 |
catch (RuntimeException ex) |
5474 |
03 Nov 10 |
nicklas |
132 |
{} |
5474 |
03 Nov 10 |
nicklas |
133 |
} |
5474 |
03 Nov 10 |
nicklas |
134 |
} |
1907 |
06 Feb 06 |
nicklas |
135 |
ItemQuery<Project> projectQuery = Project.getQuery(); |
4897 |
21 Apr 09 |
nicklas |
136 |
projectQuery.order(Orders.asc(Hql.property("name"))); |
1907 |
06 Feb 06 |
nicklas |
137 |
projectQuery.include(Include.MINE, Include.SHARED); |
5474 |
03 Nov 10 |
nicklas |
138 |
projectQuery.restrict(Restrictions.not(Restrictions.in(Hql.property("id"), Expressions.parameter("projects")))); |
5474 |
03 Nov 10 |
nicklas |
139 |
projectQuery.setParameter("projects", recentProjects, Type.INT); |
5474 |
03 Nov 10 |
nicklas |
140 |
projects.addAll(projectQuery.list(dc)); |
1907 |
06 Feb 06 |
nicklas |
141 |
|
1907 |
06 Feb 06 |
nicklas |
142 |
QuotaType totalQuotaType = QuotaType.getById(dc, SystemItems.getId(QuotaType.TOTAL)); |
1907 |
06 Feb 06 |
nicklas |
143 |
ItemQuery<QuotaType> quotaTypeQuery = QuotaType.getQuery(); |
1907 |
06 Feb 06 |
nicklas |
144 |
quotaTypeQuery.order(Orders.asc(Hql.property("id"))); |
1907 |
06 Feb 06 |
nicklas |
145 |
quotaTypeQuery.restrict( |
1907 |
06 Feb 06 |
nicklas |
146 |
Restrictions.neq( |
1907 |
06 Feb 06 |
nicklas |
147 |
Hql.property("id"), |
1907 |
06 Feb 06 |
nicklas |
148 |
Hql.entity(totalQuotaType) |
1907 |
06 Feb 06 |
nicklas |
149 |
) |
1907 |
06 Feb 06 |
nicklas |
150 |
); |
1907 |
06 Feb 06 |
nicklas |
151 |
ItemResultList<QuotaType> quotaTypes = quotaTypeQuery.list(dc); |
1907 |
06 Feb 06 |
nicklas |
152 |
|
1907 |
06 Feb 06 |
nicklas |
153 |
ItemQuery<News> newsQuery = News.getQuery(); |
2425 |
26 Jun 06 |
nicklas |
154 |
Expression today = Expressions.parameter("today"); |
2425 |
26 Jun 06 |
nicklas |
155 |
newsQuery.restrict(Restrictions.lteq(Hql.property("startDate"), today)); |
2473 |
31 Jul 06 |
nicklas |
156 |
newsQuery.restrict( |
2473 |
31 Jul 06 |
nicklas |
157 |
Restrictions.or( |
2473 |
31 Jul 06 |
nicklas |
158 |
Restrictions.gteq(Hql.property("endDate"), today), |
2473 |
31 Jul 06 |
nicklas |
159 |
Restrictions.eq(Hql.property("endDate"), null) |
2473 |
31 Jul 06 |
nicklas |
160 |
) |
2473 |
31 Jul 06 |
nicklas |
161 |
); |
7394 |
09 Jun 17 |
nicklas |
162 |
newsQuery.order(Orders.desc(Hql.property("sticky"))); |
1907 |
06 Feb 06 |
nicklas |
163 |
newsQuery.order(Orders.desc(Hql.property("newsDate"))); |
4576 |
13 Oct 08 |
nicklas |
164 |
newsQuery.order(Orders.desc(Hql.property("id"))); |
2425 |
26 Jun 06 |
nicklas |
165 |
newsQuery.setParameter("today", new Date(), Type.DATE); |
7999 |
10 Aug 21 |
nicklas |
166 |
List<News> news = newsQuery.list(dc); |
5918 |
21 Dec 11 |
nicklas |
167 |
|
5918 |
21 Dec 11 |
nicklas |
168 |
String help = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.help")); |
5918 |
21 Dec 11 |
nicklas |
169 |
String faq = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.faq")); |
5918 |
21 Dec 11 |
nicklas |
170 |
String reportBug = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.reportbug")); |
5918 |
21 Dec 11 |
nicklas |
171 |
boolean hasHelp = help != null || faq != null || reportBug != null; |
216 |
22 Mar 05 |
nicklas |
172 |
%> |
7430 |
07 Dec 17 |
nicklas |
173 |
<base:page title="Welcome to BASE" id="homepage"> |
6604 |
18 Nov 14 |
nicklas |
174 |
<base:head styles="login.css" scripts="~home.js"/> |
6180 |
22 Oct 12 |
nicklas |
175 |
<base:body> |
1907 |
06 Feb 06 |
nicklas |
176 |
|
5918 |
21 Dec 11 |
nicklas |
177 |
<h1>Welcome to BASE</h1> |
1907 |
06 Feb 06 |
nicklas |
178 |
|
5918 |
21 Dec 11 |
nicklas |
179 |
<div class="content"> |
1907 |
06 Feb 06 |
nicklas |
180 |
|
5918 |
21 Dec 11 |
nicklas |
181 |
<div class="absolutefull" style="width: 50%;"> |
5918 |
21 Dec 11 |
nicklas |
182 |
|
5970 |
17 Feb 12 |
nicklas |
183 |
<div class="absolutefull" style="left: 1em; right: 0.5em; bottom: <%=hasHelp ? "16em" : "1em" %>;"> |
5918 |
21 Dec 11 |
nicklas |
184 |
|
5918 |
21 Dec 11 |
nicklas |
185 |
<div class="absolutefull" style="height: 50%;"> |
6613 |
21 Nov 14 |
nicklas |
186 |
<div class="absolutefull" style="height: 2em; overflow: hidden;"> |
7999 |
10 Aug 21 |
nicklas |
187 |
<h3 style="height: 100%; padding-top: 0.2em;"><base:icon image="project.png" />Projects (<%=projects.size()%>)</h3> |
5918 |
21 Dec 11 |
nicklas |
188 |
</div> |
6613 |
21 Nov 14 |
nicklas |
189 |
<div id="projectsSection" class="absolutefull welcomesection" style="top: 2em; bottom: 0.5em;"> |
1907 |
06 Feb 06 |
nicklas |
190 |
<% |
5918 |
21 Dec 11 |
nicklas |
191 |
if (projects.size() == 0) |
4738 |
04 Feb 09 |
martin |
192 |
{ |
4738 |
04 Feb 09 |
martin |
193 |
%> |
7999 |
10 Aug 21 |
nicklas |
194 |
<div style="margin: 0.25em;"> |
5918 |
21 Dec 11 |
nicklas |
195 |
You are not member of any projects. |
7999 |
10 Aug 21 |
nicklas |
196 |
</div> |
4738 |
04 Feb 09 |
martin |
197 |
<% |
4738 |
04 Feb 09 |
martin |
198 |
} |
5918 |
21 Dec 11 |
nicklas |
199 |
else |
1907 |
06 Feb 06 |
nicklas |
200 |
{ |
5918 |
21 Dec 11 |
nicklas |
201 |
int activeProjectId = sc.getActiveProjectId(); |
5918 |
21 Dec 11 |
nicklas |
202 |
%> |
7999 |
10 Aug 21 |
nicklas |
203 |
<table style="border-spacing: 0.25em 2px; border-collapse: separate;"> |
5918 |
21 Dec 11 |
nicklas |
204 |
<% |
5918 |
21 Dec 11 |
nicklas |
205 |
if (activeProjectId == 0) |
1907 |
06 Feb 06 |
nicklas |
206 |
{ |
1907 |
06 Feb 06 |
nicklas |
207 |
%> |
5946 |
03 Feb 12 |
nicklas |
208 |
<td><base:icon image="warning.png" /></td> |
5918 |
21 Dec 11 |
nicklas |
209 |
<td><i>No active project</i></td> |
6180 |
22 Oct 12 |
nicklas |
210 |
<td> </td> |
1907 |
06 Feb 06 |
nicklas |
211 |
<% |
1907 |
06 Feb 06 |
nicklas |
212 |
} |
5918 |
21 Dec 11 |
nicklas |
213 |
for (Project p : projects) |
1907 |
06 Feb 06 |
nicklas |
214 |
{ |
5918 |
21 Dec 11 |
nicklas |
215 |
int projectId = p.getId(); |
5918 |
21 Dec 11 |
nicklas |
216 |
if (projectId == activeProjectId) |
5918 |
21 Dec 11 |
nicklas |
217 |
{ |
5918 |
21 Dec 11 |
nicklas |
218 |
%> |
5918 |
21 Dec 11 |
nicklas |
219 |
<tr> |
5946 |
03 Feb 12 |
nicklas |
220 |
<td><base:icon image="bullet.png" /></td> |
5918 |
21 Dec 11 |
nicklas |
221 |
<td><b><%=Base.getLinkedName(ID, p, false, true)%></b></td> |
5918 |
21 Dec 11 |
nicklas |
222 |
<td>[active]</td> |
5918 |
21 Dec 11 |
nicklas |
223 |
</tr> |
5918 |
21 Dec 11 |
nicklas |
224 |
<% |
5918 |
21 Dec 11 |
nicklas |
225 |
} |
5918 |
21 Dec 11 |
nicklas |
226 |
else |
5918 |
21 Dec 11 |
nicklas |
227 |
{ |
5918 |
21 Dec 11 |
nicklas |
228 |
%> |
5918 |
21 Dec 11 |
nicklas |
229 |
<tr> |
5918 |
21 Dec 11 |
nicklas |
230 |
<td> </td> |
5918 |
21 Dec 11 |
nicklas |
231 |
<td><%=Base.getLinkedName(ID, p, false, true)%></td> |
6180 |
22 Oct 12 |
nicklas |
232 |
<td>[<span class="link auto-init" data-auto-init="activate-project" |
6180 |
22 Oct 12 |
nicklas |
233 |
data-project-id="<%=projectId%>">set active</span>]</td> |
5918 |
21 Dec 11 |
nicklas |
234 |
</tr> |
5918 |
21 Dec 11 |
nicklas |
235 |
<% |
5918 |
21 Dec 11 |
nicklas |
236 |
} |
1907 |
06 Feb 06 |
nicklas |
237 |
} |
5918 |
21 Dec 11 |
nicklas |
238 |
%> |
5918 |
21 Dec 11 |
nicklas |
239 |
</table> |
5918 |
21 Dec 11 |
nicklas |
240 |
<% |
1907 |
06 Feb 06 |
nicklas |
241 |
} |
1907 |
06 Feb 06 |
nicklas |
242 |
%> |
5918 |
21 Dec 11 |
nicklas |
243 |
</div> |
1907 |
06 Feb 06 |
nicklas |
244 |
</div> |
1907 |
06 Feb 06 |
nicklas |
245 |
|
5918 |
21 Dec 11 |
nicklas |
246 |
<div class="absolutefull" style="height: 50%; top: auto;"> |
6613 |
21 Nov 14 |
nicklas |
247 |
<div class="absolutefull" style="height: 2em; top: 0.5em; overflow: hidden;"> |
7999 |
10 Aug 21 |
nicklas |
248 |
<h3 style="height: 100%; padding-top: 0.2em;"><base:icon image="message.png" />New messages (<%=messages.size()%>)</h3> |
4738 |
04 Feb 09 |
martin |
249 |
</div> |
6613 |
21 Nov 14 |
nicklas |
250 |
<div id="messagesSection" class="absolutefull news welcomesection" style="top: 2.5em;"> |
4738 |
04 Feb 09 |
martin |
251 |
<% |
5918 |
21 Dec 11 |
nicklas |
252 |
String broadcastTitle = (String)application.getAttribute("broadcast.title"); |
5918 |
21 Dec 11 |
nicklas |
253 |
if (broadcastTitle != null) |
4738 |
04 Feb 09 |
martin |
254 |
{ |
5918 |
21 Dec 11 |
nicklas |
255 |
String broadcastMessage = (String)application.getAttribute("broadcast.message"); |
4738 |
04 Feb 09 |
martin |
256 |
%> |
7394 |
09 Jun 17 |
nicklas |
257 |
<div class="item note sticky"> |
5970 |
17 Feb 12 |
nicklas |
258 |
<div class="headline"> |
5970 |
17 Feb 12 |
nicklas |
259 |
<span class="date"><%=dateFormatter.format(new Date())%></span> |
5970 |
17 Feb 12 |
nicklas |
260 |
<%=HTML.encodeTags(broadcastTitle)%> |
5970 |
17 Feb 12 |
nicklas |
261 |
</div> |
5970 |
17 Feb 12 |
nicklas |
262 |
<div class="text"><%=HTML.niceFormat(broadcastMessage)%></div> |
4738 |
04 Feb 09 |
martin |
263 |
</div> |
5918 |
21 Dec 11 |
nicklas |
264 |
<% |
5918 |
21 Dec 11 |
nicklas |
265 |
} |
5918 |
21 Dec 11 |
nicklas |
266 |
if (messages.size() == 0 && broadcastTitle == null) |
5918 |
21 Dec 11 |
nicklas |
267 |
{ |
5918 |
21 Dec 11 |
nicklas |
268 |
%> |
7999 |
10 Aug 21 |
nicklas |
269 |
<div style="margin: 0.25em;"> |
5918 |
21 Dec 11 |
nicklas |
270 |
No new messages. |
7999 |
10 Aug 21 |
nicklas |
271 |
</div> |
4738 |
04 Feb 09 |
martin |
272 |
<% |
4738 |
04 Feb 09 |
martin |
273 |
} |
5918 |
21 Dec 11 |
nicklas |
274 |
else |
5918 |
21 Dec 11 |
nicklas |
275 |
{ |
5918 |
21 Dec 11 |
nicklas |
276 |
for (Message m : messages) |
5918 |
21 Dec 11 |
nicklas |
277 |
{ |
5918 |
21 Dec 11 |
nicklas |
278 |
String fullName = m.getName(); |
5918 |
21 Dec 11 |
nicklas |
279 |
String text = Values.trimString(m.getDescription(), 100); |
5918 |
21 Dec 11 |
nicklas |
280 |
%> |
5918 |
21 Dec 11 |
nicklas |
281 |
<div class="item"> |
5970 |
17 Feb 12 |
nicklas |
282 |
<div class="headline"> |
6180 |
22 Oct 12 |
nicklas |
283 |
<span class="link auto-init" data-auto-init="item-link" |
6180 |
22 Oct 12 |
nicklas |
284 |
data-item-type="MESSAGE" data-item-id="<%=m.getId()%>" |
6180 |
22 Oct 12 |
nicklas |
285 |
title="<%=HTML.encodeTags(fullName)%>"> |
5970 |
17 Feb 12 |
nicklas |
286 |
<span class="date"><%=dateTimeFormatter.format(m.getTimeSent())%></span> |
5970 |
17 Feb 12 |
nicklas |
287 |
<%=HTML.encodeTags(fullName)%></a> |
5970 |
17 Feb 12 |
nicklas |
288 |
</div> |
5970 |
17 Feb 12 |
nicklas |
289 |
<div class="text"><%=HTML.encodeTags(text)%></div> |
5918 |
21 Dec 11 |
nicklas |
290 |
</div> |
5918 |
21 Dec 11 |
nicklas |
291 |
<% |
5918 |
21 Dec 11 |
nicklas |
292 |
} |
5918 |
21 Dec 11 |
nicklas |
293 |
} |
5918 |
21 Dec 11 |
nicklas |
294 |
%> |
5918 |
21 Dec 11 |
nicklas |
295 |
</div> |
4738 |
04 Feb 09 |
martin |
296 |
</div> |
5918 |
21 Dec 11 |
nicklas |
297 |
</div> |
5918 |
21 Dec 11 |
nicklas |
298 |
|
4897 |
21 Apr 09 |
nicklas |
299 |
<% |
5918 |
21 Dec 11 |
nicklas |
300 |
if (hasHelp) |
4897 |
21 Apr 09 |
nicklas |
301 |
{ |
4897 |
21 Apr 09 |
nicklas |
302 |
%> |
5970 |
17 Feb 12 |
nicklas |
303 |
<div class="absolutefull" style="left: 1em; right: 0.5em; top: auto; height: 14em; bottom: 1em; "> |
6613 |
21 Nov 14 |
nicklas |
304 |
<div class="absolutefull" style="height: 2em; overflow: hidden;"> |
7999 |
10 Aug 21 |
nicklas |
305 |
<h3 style="height: 100%; padding-top: 0.2em;"><base:icon image="help.png" />Help</h3> |
5918 |
21 Dec 11 |
nicklas |
306 |
</div> |
7999 |
10 Aug 21 |
nicklas |
307 |
<div id="helpSection" class="absolutefull welcomesection" style="top: 2em; padding: 0.25em;"> |
4897 |
21 Apr 09 |
nicklas |
308 |
<% |
4897 |
21 Apr 09 |
nicklas |
309 |
if (help != null) |
4897 |
21 Apr 09 |
nicklas |
310 |
{ |
4897 |
21 Apr 09 |
nicklas |
311 |
%> |
5970 |
17 Feb 12 |
nicklas |
312 |
<a href="<%=help%>" target="Help"><base:icon image="bullet.png" /> Help…</a><br> |
4897 |
21 Apr 09 |
nicklas |
313 |
<% |
4897 |
21 Apr 09 |
nicklas |
314 |
} |
4897 |
21 Apr 09 |
nicklas |
315 |
%> |
4897 |
21 Apr 09 |
nicklas |
316 |
<% |
4897 |
21 Apr 09 |
nicklas |
317 |
if (faq != null) |
4897 |
21 Apr 09 |
nicklas |
318 |
{ |
4897 |
21 Apr 09 |
nicklas |
319 |
%> |
5970 |
17 Feb 12 |
nicklas |
320 |
<a href="<%=faq%>" target="FAQ"><base:icon image="bullet.png" /> Frequently asked questions…</a><br> |
4897 |
21 Apr 09 |
nicklas |
321 |
<% |
4897 |
21 Apr 09 |
nicklas |
322 |
} |
4897 |
21 Apr 09 |
nicklas |
323 |
%> |
4897 |
21 Apr 09 |
nicklas |
324 |
<% |
4897 |
21 Apr 09 |
nicklas |
325 |
if (reportBug != null) |
4897 |
21 Apr 09 |
nicklas |
326 |
{ |
4897 |
21 Apr 09 |
nicklas |
327 |
%> |
5970 |
17 Feb 12 |
nicklas |
328 |
<a href="<%=reportBug%>" target="ReportBug"><base:icon image="bug.png" /> Report a bug…</a><br> |
4897 |
21 Apr 09 |
nicklas |
329 |
<% |
4897 |
21 Apr 09 |
nicklas |
330 |
} |
4897 |
21 Apr 09 |
nicklas |
331 |
%> |
4897 |
21 Apr 09 |
nicklas |
332 |
</div> |
5918 |
21 Dec 11 |
nicklas |
333 |
</div> |
4897 |
21 Apr 09 |
nicklas |
334 |
<% |
4897 |
21 Apr 09 |
nicklas |
335 |
} |
4897 |
21 Apr 09 |
nicklas |
336 |
%> |
4897 |
21 Apr 09 |
nicklas |
337 |
|
5918 |
21 Dec 11 |
nicklas |
338 |
</div> |
5918 |
21 Dec 11 |
nicklas |
339 |
<div class="absolutefull" style="width: 50%; left: auto;"> |
5918 |
21 Dec 11 |
nicklas |
340 |
|
5970 |
17 Feb 12 |
nicklas |
341 |
<div class="absolutefull" style="left: 0.5em; right: 1em; bottom: 16em;"> |
6613 |
21 Nov 14 |
nicklas |
342 |
<div class="absolutefull" style="height: 2em; overflow: hidden;"> |
7999 |
10 Aug 21 |
nicklas |
343 |
<h3 style="height: 100%; padding-top: 0.2em;"><base:icon image="news.png" />News and announcements (<%=news.size()%>) |
5918 |
21 Dec 11 |
nicklas |
344 |
<% |
5918 |
21 Dec 11 |
nicklas |
345 |
if (RssNewsFeed.isEnabled()) |
5918 |
21 Dec 11 |
nicklas |
346 |
{ |
5918 |
21 Dec 11 |
nicklas |
347 |
%> |
6180 |
22 Oct 12 |
nicklas |
348 |
<a href="../info/news.rss" |
6180 |
22 Oct 12 |
nicklas |
349 |
title="Subscribe to news from this BASE server"><base:icon image="rss.png" style="float: right;"/></a> |
5918 |
21 Dec 11 |
nicklas |
350 |
<% |
5918 |
21 Dec 11 |
nicklas |
351 |
} |
5918 |
21 Dec 11 |
nicklas |
352 |
%> |
5918 |
21 Dec 11 |
nicklas |
353 |
</h3> |
5918 |
21 Dec 11 |
nicklas |
354 |
</div> |
6613 |
21 Nov 14 |
nicklas |
355 |
<div id="newsSection" class="absolutefull news welcomesection" style="top: 2em;"> |
5918 |
21 Dec 11 |
nicklas |
356 |
<% |
5918 |
21 Dec 11 |
nicklas |
357 |
if (news.size() == 0) |
5918 |
21 Dec 11 |
nicklas |
358 |
{ |
5918 |
21 Dec 11 |
nicklas |
359 |
%> |
7999 |
10 Aug 21 |
nicklas |
360 |
<div style="margin: 0.25em;"> |
5918 |
21 Dec 11 |
nicklas |
361 |
Nothing new. |
7999 |
10 Aug 21 |
nicklas |
362 |
</div> |
5918 |
21 Dec 11 |
nicklas |
363 |
<% |
5918 |
21 Dec 11 |
nicklas |
364 |
} |
5918 |
21 Dec 11 |
nicklas |
365 |
else |
5918 |
21 Dec 11 |
nicklas |
366 |
{ |
5918 |
21 Dec 11 |
nicklas |
367 |
for (News n : news) |
5918 |
21 Dec 11 |
nicklas |
368 |
{ |
5918 |
21 Dec 11 |
nicklas |
369 |
%> |
7394 |
09 Jun 17 |
nicklas |
370 |
<div class="item <%=n.isSticky() ? "note sticky" :""%>"> |
5970 |
17 Feb 12 |
nicklas |
371 |
<div class="headline"> |
5970 |
17 Feb 12 |
nicklas |
372 |
<span class="date"><%=dateFormatter.format(n.getNewsDate())%></span> |
5970 |
17 Feb 12 |
nicklas |
373 |
<%=HTML.encodeTags(n.getName())%> |
5970 |
17 Feb 12 |
nicklas |
374 |
</div> |
5970 |
17 Feb 12 |
nicklas |
375 |
<div class="text"><%=HTML.niceFormat(n.getDescription())%></div> |
5918 |
21 Dec 11 |
nicklas |
376 |
</div> |
5918 |
21 Dec 11 |
nicklas |
377 |
<% |
5918 |
21 Dec 11 |
nicklas |
378 |
} |
5918 |
21 Dec 11 |
nicklas |
379 |
} |
5918 |
21 Dec 11 |
nicklas |
380 |
%> |
5918 |
21 Dec 11 |
nicklas |
381 |
</div> |
5918 |
21 Dec 11 |
nicklas |
382 |
</div> |
5918 |
21 Dec 11 |
nicklas |
383 |
|
5970 |
17 Feb 12 |
nicklas |
384 |
<div class="absolutefull" style="left: 0.5em; right: 1em; top: auto; height: 14em; bottom: 1em;"> |
6613 |
21 Nov 14 |
nicklas |
385 |
<div class="absolutefull" style="height: 2em; overflow: hidden;"> |
7999 |
10 Aug 21 |
nicklas |
386 |
<h3 style="height: 100%; padding-top: 0.2em;"><base:icon image="diskusage.png" />Disk usage</h3> |
5918 |
21 Dec 11 |
nicklas |
387 |
</div> |
6613 |
21 Nov 14 |
nicklas |
388 |
<div id="quotaSection" class="absolutefull welcomesection" style="top: 2em;"> |
5479 |
08 Nov 10 |
nicklas |
389 |
<% |
5918 |
21 Dec 11 |
nicklas |
390 |
if (quotaGroup != null) |
4897 |
21 Apr 09 |
nicklas |
391 |
{ |
4897 |
21 Apr 09 |
nicklas |
392 |
%> |
8013 |
13 Aug 21 |
nicklas |
393 |
<div style="margin: 0.25em;"> |
5918 |
21 Dec 11 |
nicklas |
394 |
Using quota from group: <%=Base.getLinkedName(ID, quotaGroup, false, true)%> |
8013 |
13 Aug 21 |
nicklas |
395 |
</div> |
4897 |
21 Apr 09 |
nicklas |
396 |
<% |
4897 |
21 Apr 09 |
nicklas |
397 |
} |
1907 |
06 Feb 06 |
nicklas |
398 |
%> |
7596 |
22 Feb 19 |
nicklas |
399 |
<table style="width: 100%; border-bottom-width: 1px; border-bottom-style: dotted; margin-bottom: 0.5em;"> |
5918 |
21 Dec 11 |
nicklas |
400 |
<tr style="text-align: center;"> |
5918 |
21 Dec 11 |
nicklas |
401 |
<th></th> |
5918 |
21 Dec 11 |
nicklas |
402 |
<th colspan="2">Primary location</th> |
5918 |
21 Dec 11 |
nicklas |
403 |
<th>External</th> |
5918 |
21 Dec 11 |
nicklas |
404 |
</tr> |
5918 |
21 Dec 11 |
nicklas |
405 |
<tr style="text-align: center;"> |
5918 |
21 Dec 11 |
nicklas |
406 |
<th></th> |
5918 |
21 Dec 11 |
nicklas |
407 |
<th>Used</th> |
5918 |
21 Dec 11 |
nicklas |
408 |
<th>Assigned</th> |
5918 |
21 Dec 11 |
nicklas |
409 |
<th>Used</th> |
5918 |
21 Dec 11 |
nicklas |
410 |
</tr> |
1907 |
06 Feb 06 |
nicklas |
411 |
<% |
5918 |
21 Dec 11 |
nicklas |
412 |
long myPrimaryUsage = user.getDiskUsage(totalQuotaType, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
413 |
long myPrimaryQuota = quota.getQuotaValue(totalQuotaType, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
414 |
long groupPrimaryQuota = groupQuota == null ? Quota.UNDEFINED : groupQuota.getQuotaValue(totalQuotaType, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
415 |
long myExternalUsage = user.getDiskUsage(totalQuotaType, Location.EXTERNAL); |
1907 |
06 Feb 06 |
nicklas |
416 |
%> |
7596 |
22 Feb 19 |
nicklas |
417 |
<tr style="text-align: center; border-bottom-width: 1px; border-bottom-style: dotted;"> |
5918 |
21 Dec 11 |
nicklas |
418 |
<th>Total</th> |
1907 |
06 Feb 06 |
nicklas |
419 |
<td><%=getPrintableQuota(myPrimaryUsage, Quota.UNDEFINED)%></td> |
1907 |
06 Feb 06 |
nicklas |
420 |
<td><%=getPrintableQuota(myPrimaryQuota, groupPrimaryQuota)%></td> |
5330 |
29 Apr 10 |
nicklas |
421 |
<td><%=getPrintableQuota(myExternalUsage, Quota.UNDEFINED)%></td> |
1907 |
06 Feb 06 |
nicklas |
422 |
</tr> |
1907 |
06 Feb 06 |
nicklas |
423 |
<% |
5918 |
21 Dec 11 |
nicklas |
424 |
for (QuotaType qt : quotaTypes) |
5918 |
21 Dec 11 |
nicklas |
425 |
{ |
5918 |
21 Dec 11 |
nicklas |
426 |
myPrimaryUsage = user.getDiskUsage(qt, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
427 |
myPrimaryQuota = quota.getQuotaValue(qt, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
428 |
groupPrimaryQuota = groupQuota == null ? Quota.UNDEFINED : groupQuota.getQuotaValue(qt, Location.PRIMARY); |
5918 |
21 Dec 11 |
nicklas |
429 |
myExternalUsage = user.getDiskUsage(qt, Location.EXTERNAL); |
5918 |
21 Dec 11 |
nicklas |
430 |
%> |
5918 |
21 Dec 11 |
nicklas |
431 |
<tr style="text-align: center;"> |
5918 |
21 Dec 11 |
nicklas |
432 |
<th><%=HTML.encodeTags(qt.getName())%></th> |
5918 |
21 Dec 11 |
nicklas |
433 |
<td><%=getPrintableQuota(myPrimaryUsage, Quota.UNDEFINED)%></td> |
5918 |
21 Dec 11 |
nicklas |
434 |
<td><%=getPrintableQuota(myPrimaryQuota, groupPrimaryQuota)%></td> |
5918 |
21 Dec 11 |
nicklas |
435 |
<td><%=getPrintableQuota(myExternalUsage, Quota.UNDEFINED)%></td> |
5918 |
21 Dec 11 |
nicklas |
436 |
</tr> |
5918 |
21 Dec 11 |
nicklas |
437 |
<% |
5918 |
21 Dec 11 |
nicklas |
438 |
} |
5918 |
21 Dec 11 |
nicklas |
439 |
%> |
5918 |
21 Dec 11 |
nicklas |
440 |
</table> |
5918 |
21 Dec 11 |
nicklas |
441 |
<base:buttongroup> |
6180 |
22 Oct 12 |
nicklas |
442 |
<base:button id="btnViewDiskUsage" image="bullet.png" title="View details" /> |
5918 |
21 Dec 11 |
nicklas |
443 |
</base:buttongroup> |
5918 |
21 Dec 11 |
nicklas |
444 |
</div> |
1907 |
06 Feb 06 |
nicklas |
445 |
</div> |
5918 |
21 Dec 11 |
nicklas |
446 |
</div> |
5918 |
21 Dec 11 |
nicklas |
447 |
</div> |
480 |
27 Apr 05 |
nicklas |
448 |
</base:body> |
216 |
22 Mar 05 |
nicklas |
449 |
</base:page> |
1907 |
06 Feb 06 |
nicklas |
450 |
<% |
1907 |
06 Feb 06 |
nicklas |
451 |
} |
1907 |
06 Feb 06 |
nicklas |
452 |
finally |
1907 |
06 Feb 06 |
nicklas |
453 |
{ |
1907 |
06 Feb 06 |
nicklas |
454 |
if (dc != null) dc.close(); |
1907 |
06 Feb 06 |
nicklas |
455 |
} |
1907 |
06 Feb 06 |
nicklas |
456 |
%> |