1
|
<%@ taglib prefix="s" uri="/struts-tags"%>
|
2
|
<%@ page contentType="text/html; charset=UTF-8"%>
|
3
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
<head>
|
7
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
<title>DRIVER Communities</title>
|
9
|
<link href='<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/assets/<s:property value="#application['webInterfaceLayoutManager'].cssFileName" />' rel="stylesheet" type="text/css" />
|
10
|
<link href="<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/assets/SimpleTabs.css" rel="stylesheet" type="text/css" />
|
11
|
<link rel="shortcut icon" href="<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/images/favicon.ico" />
|
12
|
<!-- MB - ADD mootools here: new version -->
|
13
|
<script type="text/javascript" src='<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/js/mootools-1.2.3-core.js'></script>
|
14
|
<script type="text/javascript" src='<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/js/mootools-1.2.3.1-more.js'></script>
|
15
|
|
16
|
<script type="text/javascript" language="javascript">
|
17
|
function checkAdd() {
|
18
|
var title = document.getElementById('addCommunityAnnouncementActionTitle');
|
19
|
var expirationDate = document.getElementById('addCommunityAnnouncementActionExpirationDate');
|
20
|
var content = document.getElementById('addCommunityAnnouncementActionContent');
|
21
|
if ((title.value == null) || (title.value == '')) {
|
22
|
alert('Please enter a title');
|
23
|
title.focus();
|
24
|
return false;
|
25
|
}
|
26
|
var date = expirationDate.value;
|
27
|
if ((date == null) || (date == '')) {
|
28
|
alert('Please enter a valid expiration date');
|
29
|
expirationDate.focus();
|
30
|
return false;
|
31
|
}
|
32
|
if (!(new RegExp("\\d\\d?/\\d\\d?/\\d{2,4}").test(date))) {
|
33
|
alert('Please enter a valid expiration date');
|
34
|
expirationDate.focus();
|
35
|
return false;
|
36
|
}
|
37
|
var dateTokens = date.split("/");
|
38
|
var day = parseInt(dateTokens[0]);
|
39
|
var month = parseInt(dateTokens[1]);
|
40
|
var year = parseInt(dateTokens[2]);
|
41
|
if ((year < 1) || (month < 1) || (month > 12) || (day < 1) || (day > 31) ||
|
42
|
(((month == 4) || (month == 6) || (month == 9) || (month == 11)) && (day > 30)) || ((month == 2) && (day > 29)) ||
|
43
|
((((year % 4 != 0) || (year % 100 == 0)) && (year % 400 != 0)) && (month == 2) && (day > 28))) {
|
44
|
alert('Please enter a valid expiration date');
|
45
|
expirationDate.focus();
|
46
|
return false;
|
47
|
}
|
48
|
if (new Date(year, month, day).getTime() <= new Date().getTime()) {
|
49
|
alert('Please enter a valid expiration date');
|
50
|
expirationDate.focus();
|
51
|
return false;
|
52
|
}
|
53
|
if ((content.value == null) || (content.value == '')) {
|
54
|
alert('Please enter content');
|
55
|
content.focus();
|
56
|
return false;
|
57
|
}
|
58
|
expirationDate.value = month + '/' + day + '/' + year;
|
59
|
return true;
|
60
|
}
|
61
|
|
62
|
function resetAdd() {
|
63
|
var title = document.getElementById('addCommunityAnnouncementActionTitle');
|
64
|
var expirationDate = document.getElementById('addCommunityAnnouncementActionExpirationDate');
|
65
|
var content = document.getElementById('addCommunityAnnouncementActionContent');
|
66
|
title.value = '';
|
67
|
expirationDate.value = '';
|
68
|
content.value = '';
|
69
|
title.focus();
|
70
|
return false;
|
71
|
}
|
72
|
|
73
|
function checkMaxLength(maxLength) {
|
74
|
var content = document.getElementById('addCommunityAnnouncementActionContent');
|
75
|
if (content.value.length > maxLength)
|
76
|
content.value = content.value.substring(0, maxLength);
|
77
|
}
|
78
|
</script>
|
79
|
</head>
|
80
|
<body>
|
81
|
<div id="center">
|
82
|
<div id="wrapper">
|
83
|
<div class="wrapper_shadowleft">
|
84
|
<div class="wrapper_shadowright">
|
85
|
<div id="container">
|
86
|
<jsp:include page="/pages/banner.jsp" />
|
87
|
<jsp:include page="/pages/menu.jsp" />
|
88
|
<p class="clear" />
|
89
|
<div id="leftcolumn">
|
90
|
<b class="curved_top">
|
91
|
<b class="curved_t1"></b>
|
92
|
<b class="curved_t2"></b>
|
93
|
<b class="curved_t3"></b>
|
94
|
<b class="curved_t4"></b>
|
95
|
</b>
|
96
|
<div class="curved_container clearfix">
|
97
|
<div class="featured_top leftcolumn_top">Communities</div>
|
98
|
<s:if test="%{displayMyDriverMenu}">
|
99
|
<jsp:include page="/pages/community/myCommunitiesMenu.jsp" />
|
100
|
</s:if>
|
101
|
<s:else>
|
102
|
<s:set name="action" value="%{'ViewCommunity.action'}"/>
|
103
|
<jsp:include page="/pages/community/allCommunitiesMenu.jsp" />
|
104
|
</s:else>
|
105
|
</div>
|
106
|
<b class="curved_bottom">
|
107
|
<b class="curved_b4"></b>
|
108
|
<b class="curved_b3"></b>
|
109
|
<b class="curved_b2"></b>
|
110
|
<b class="curved_b1"></b>
|
111
|
</b>
|
112
|
</div>
|
113
|
<div id="maincolumn2">
|
114
|
<div id="communityPage">
|
115
|
<b class="curved_top">
|
116
|
<b class="curved_t1"></b>
|
117
|
<b class="curved_t2"></b>
|
118
|
<b class="curved_t3"></b>
|
119
|
<b class="curved_t4"></b>
|
120
|
</b>
|
121
|
<div class="curved_container clearfix">
|
122
|
<div class="featured_top communityPage_top">
|
123
|
<img src="<s:property value="#application[@gr.uoa.di.driver.web.listeners.DriverContextListener@APACHE_URL]"/>/static-content/images/icons.communities.png" alt="DRIVER Communities" width="16" height="16" class="absmiddle" />
|
124
|
|
125
|
<a href="ViewCommunity.action?communityId=<s:property value="communityId" /><s:if test="%{displayMyDriverMenu}">&displayMyDriverMenu=true</s:if><s:if test="%{initialLetter != null}">&initialLetter=<s:property value="initialLetter" /></s:if>">
|
126
|
<s:property value="community.name" />
|
127
|
</a>
|
128
|
</div>
|
129
|
<s:set name="selectedTab" value="%{1}"/>
|
130
|
<jsp:include page="/pages/community/tabsMenu.jsp" />
|
131
|
<div class="tab-wrapper clearfix">
|
132
|
<div class="communitySubmenu">
|
133
|
Add community announcement
|
134
|
</div>
|
135
|
<div class="mydriveritem col1">
|
136
|
|
137
|
<form id="addCommunityAnnouncementAction" onSubmit="return checkAdd();" onReset="return resetAdd();" action="AddCommunityAnnouncement2.action" method="POST">
|
138
|
<input type="hidden" id="addCommunityAnnouncementActionCommunityId" name="communityId" value="<s:property value="communityId" />" />
|
139
|
<div class="communityField">
|
140
|
<span class="communityFieldNm">Title</span>
|
141
|
</div>
|
142
|
<div class="communityField">
|
143
|
<input type="text" name="title" value="" id="addCommunityAnnouncementActionTitle" maxlength="<s:property value="smallFieldLength" />" size="<s:property value="mediumFieldLength" />" />
|
144
|
(max <s:property value="smallFieldLength" /> chars)
|
145
|
</div>
|
146
|
<div class="communityField">
|
147
|
<span class="communityFieldNm">Expiration Date (d/m/y)</span>
|
148
|
</div>
|
149
|
<div class="communityField">
|
150
|
<input type="text" name="expirationDate" id="addCommunityAnnouncementActionExpirationDate" maxlength="10" size="10" />
|
151
|
</div>
|
152
|
<div class="communityField">
|
153
|
<span class="communityFieldNm">Content</span>
|
154
|
(max <s:property value="largeFieldLength" /> chars)
|
155
|
</div>
|
156
|
<div class="communityField">
|
157
|
<textarea id="addCommunityAnnouncementActionContent" name="content" cols="60" rows="5" onkeyup="checkMaxLength(<s:property value="largeFieldLength" />);"></textarea>
|
158
|
</div>
|
159
|
<div class="communityField">
|
160
|
<input type="submit" id="addCommunityAnnouncementActionAdd" value="Add" />
|
161
|
<input type="reset" id="addCommunityAnnouncementActionReset" value="Reset" />
|
162
|
</div>
|
163
|
</form>
|
164
|
</div>
|
165
|
</div>
|
166
|
</div>
|
167
|
<b class="curved_bottom">
|
168
|
<b class="curved_b4"></b>
|
169
|
<b class="curved_b3"></b>
|
170
|
<b class="curved_b2"></b>
|
171
|
<b class="curved_b1"></b>
|
172
|
</b>
|
173
|
</div>
|
174
|
<div id="footer">
|
175
|
<s:action name="FooterPage" executeResult="true"/>
|
176
|
</div>
|
177
|
</div>
|
178
|
</div>
|
179
|
</div>
|
180
|
</div>
|
181
|
</div>
|
182
|
</body>
|
183
|
</html>
|