Kawai Wiki

Rev

Rev 31 | Rev 35 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12 soliveira 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
26 soliveira 3
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>
12 soliveira 4
 
5
<html>
6
<head>
7
 
8
<title>Mentawai Web Framework</title>
9
 
10
<style type="text/css" media="all">
31 soliveira 11
@import url("<mtw:contextPath/>/GenerateCSS.getCSS.css");
12 soliveira 12
</style>
13
 
14
<meta http-equiv="imagetoolbar" content="no" />
15
<meta http-equiv="imagetoolbar" content="false" />
16
 
17
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
18
<link rel="icon" type="image/gif" href="/favicon.gif" />
31 soliveira 19
<link rel="stylesheet" href="<mtw:contextPath/>/GenerateCSS.getPrintCSS.css" type="text/css" media="print" />
12 soliveira 20
 
21
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
22
<meta name="author" content="Sergio Oliveira Junior" />
23
<meta name="email" content="sergio.oliveira.jr@gmail.com" />
24
 
25
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
26
<script type="text/javascript" src="jquery/jquery-1.6.4.min.js"></script>
27
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
28
 
29
<script language="JavaScript">
30
 
31
        $(document).ready(function() {
33 soliveira 32
 
33
        	<mtw:if test="showForm" value="login">
12 soliveira 34
 
33 soliveira 35
			showLoginDialog();
36
 
37
			</mtw:if>
38
 
12 soliveira 39
        });
40
 
28 soliveira 41
        function prepareEditPageDialog(myDialog, theTitle) {
12 soliveira 42
 
43
            options = {
44
                autoOpen: false,
45
                width: 800,
46
                modal: true,
47
                title: theTitle,
48
                buttons: [
49
                          {
50
                                text: "Save",
28 soliveira 51
                                click: function() { $('#editPageForm').submit(); }
12 soliveira 52
                          },
53
                          {
54
                                text: "Cancel",
55
                                click: function() { $(this).dialog("close"); }
56
                          }
57
                      ]
58
           };
59
 
60
          myDialog.dialog(options);
61
 
62
          return myDialog;
63
        }
33 soliveira 64
 
28 soliveira 65
        function showEditPageDialog(pageName) {
12 soliveira 66
 
28 soliveira 67
            $.getJSON('<mtw:contextPath />/Page.getPage.mtw?name=' + pageName, function(data) {
18 soliveira 68
 
28 soliveira 69
                $('#editPageTextArea').val(data.page.body);
70
                $('#editPageName').val(data.page.name);
71
                $('#editPageLanguageId').val(data.page.languageId);
12 soliveira 72
 
28 soliveira 73
                myDialog = $('#editPageDialog');
74
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
12 soliveira 75
                myDialog.dialog('open');
76
            });
77
 
78
            return false;
79
        }
33 soliveira 80
 
81
 
82
        function showLoginDialog() {
12 soliveira 83
 
33 soliveira 84
            myDialog = $('#loginDialog');
85
            myDialog = prepareLoginDialog(myDialog);
86
            myDialog.dialog('open');
87
 
88
            return false;
89
        }
90
 
91
 
92
      	function prepareLoginDialog(myDialog) {
93
 
94
            options = {
95
                autoOpen: false,
96
                width: 290,
97
                modal: true,
98
                title: "Login:",
99
                buttons: [
100
                          {
101
                                text: "Login",
102
                                click: function() { $('#loginForm').submit(); }
103
                          },
104
                          {
105
                                text: "Cancel",
106
                                click: function() { $(this).dialog("close"); }
107
                          }
108
                      ]
109
           };
110
 
111
          myDialog.dialog(options);
112
 
113
          return myDialog;
114
        }
115
 
12 soliveira 116
    </script>
117
 
118
</head>
119
 
120
<body class="composite">
121
 
122
<!-- For Testing -->
123
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
124
 
33 soliveira 125
<!-- For Editing Pages -->
28 soliveira 126
<div id="editPageDialog" style="display: none;">
127
<form id="editPageForm" action="<mtw:contextPath />/Page.editPage.mtw" method="post">
128
<input type="hidden" name="name" id ="editPageName" value="" />
129
<input type="hidden" name="languageId" id="editPageLanguageId" value="" />
12 soliveira 130
<table>
131
    <tr>
132
        <td>&nbsp;</td>
133
    </tr>
28 soliveira 134
    <mtw:outError field="html">
12 soliveira 135
        <tr>
136
            <td colspan="2"><span class="Negative" style="font-weight: bold;"><mtw:out /></span></td>
137
        </tr>
138
    </mtw:outError>
139
    <tr>
28 soliveira 140
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" /></td>
12 soliveira 141
    </tr>
142
</table>
143
</form>
144
</div>
145
 
33 soliveira 146
<!-- For Login -->
147
<div id="loginDialog" style="display: none;">
148
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
149
			<table>
150
				<tr>
151
					<td>
152
						Username:
153
					</td>
154
					<td>
155
						<mtw:input name="username" size="20" maxlength="20" />
156
						<mtw:outError field="username">
157
							<font color="red">
158
								<b><mtw:out /></b>
159
							</font>
160
						</mtw:outError>
161
					</td>
162
				</tr>
163
				<tr>
164
					<td>
165
						Password:
166
					</td>
167
					<td>
168
						<mtw:input name="password" type="password" size="20" maxlength="20" />
169
						<mtw:outError field="password">
170
							<font color="red">
171
								<b><mtw:out /></b>
172
							</font>
173
						</mtw:outError>
174
					</td>
175
				</tr>
176
			</table>
177
		</form>
178
</div>
179
 
180
 
12 soliveira 181
<div>
182
<table border="0">
183
    <tr>
184
        <td><a href="/"><img src="images/logos/logo.png" border="0"></img></a></td>
22 soliveira 185
        <td align="right" valign="bottom">
186
            <mtw:isLogged negate="true">
33 soliveira 187
                <a href="#" onclick="return showLoginDialog();">Login</a>
22 soliveira 188
            </mtw:isLogged>
189
            <mtw:isLogged>
190
                <a href="<mtw:contextPath/>/Page.create.mtw">Create New Page</a> |
191
                <a href="<mtw:contextPath/>/Page.list.mtw">List Pages</a> |
31 soliveira 192
                <a href="#" onclick="return showEditPageDialog('CSS');" title="<k:editTooltip name="css" />">Edit CSS</a> |
22 soliveira 193
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
194
            </mtw:isLogged>
195
            &nbsp;
196
            <a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" /></a>
197
            <a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" /></a>
198
            &nbsp;&nbsp;&nbsp;
199
        </td>
12 soliveira 200
    </tr>
201
</table>
202
</div>
203
 
204
<hr />
205
 
206
<div id="leftColumn"><mtw:isLogged>
207
    <mtw:hasAuthorization groups="admin, editor">
28 soliveira 208
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;"><a href="#" onclick="return showEditPageDialog('LeftColumn');" title="<k:editTooltip name="leftColumn" />">Edit</a></div>
12 soliveira 209
    </mtw:hasAuthorization>
210
</mtw:isLogged>
20 soliveira 211
<div id="navcolumn">
212
    <div>
22 soliveira 213
    <mtw:out value="leftColumn.body" />
20 soliveira 214
    </div>
215
<br />
12 soliveira 216
</div>
217
 
218
</div>
219
 
220
<div id="bodyColumn">
28 soliveira 221
    <mtw:hasAuthorization groups="admin, editor">
222
    <div style="text-align: right; padding-right: 14px;"><a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a></div>
223
    </mtw:hasAuthorization>
24 soliveira 224
    <mtw:out value="bodyColumn.body" />
12 soliveira 225
</div>
226
 
227
<div class="clear">
228
<hr />
229
</div>
230
 
231
<div id="footer">
232
<div class="xright">Copyright  2011</div>
233
<div class="clear">
234
<hr />
235
</div>
236
</div>
237
 
238
</body>
239
</html>