Kawai Wiki

Rev

Rev 80 | Rev 83 | 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">
39 soliveira 34
				showLoginDialog();
35
			</mtw:if>
36
 
37
			<mtw:if test="showForm" value="add">
38
				showCreateNewPageDialog();
33 soliveira 39
			</mtw:if>
35 soliveira 40
 
41
			$('#loginDialog').keyup(function(e) {
42
    			if (e.keyCode == 13) {
43
        			$('#loginForm').submit();
44
    			}
45
			});
46
 
33 soliveira 47
 
12 soliveira 48
        });
49
 
28 soliveira 50
        function prepareEditPageDialog(myDialog, theTitle) {
12 soliveira 51
 
52
            options = {
53
                autoOpen: false,
54
                width: 800,
55
                modal: true,
56
                title: theTitle,
57
                buttons: [
58
                          {
59
                                text: "Save",
28 soliveira 60
                                click: function() { $('#editPageForm').submit(); }
12 soliveira 61
                          },
62
                          {
65 soliveira 63
                                text: "Preview",
64
                                click: function() { $('#editPagePreview').val('true'); $('#editPageForm').submit(); }
65
                          },
66
                          {
12 soliveira 67
                                text: "Cancel",
68
                                click: function() { $(this).dialog("close"); }
69
                          }
70
                      ]
71
           };
72
 
73
          myDialog.dialog(options);
74
 
75
          return myDialog;
76
        }
49 soliveira 77
 
78
        function prepareListAllPagesDialog(myDialog) {
79
 
80
            options = {
81
                autoOpen: false,
82
                width: 800,
53 soliveira 83
                height: 450,
49 soliveira 84
                modal: true,
85
                title: 'Pages:',
86
                buttons: [
87
                          {
55 soliveira 88
                                text: "FrontPage",
56 soliveira 89
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.setFrontPage.mtw'); $('#listAllPagesForm').submit(); }
49 soliveira 90
                          },
91
                          {
55 soliveira 92
                                text: "Delete",
57 soliveira 93
                                click: function() { $('#listAllPagesForm').attr('action', '<mtw:contextPath/>/Page.delete.mtw'); $('#listAllPagesForm').submit(); }
55 soliveira 94
                          },
95
                          {
49 soliveira 96
                                text: "Close",
97
                                click: function() { $(this).dialog("close"); }
98
                          }
99
                      ]
100
           };
101
 
102
          myDialog.dialog(options);
103
 
104
          return myDialog;
105
        }
106
 
81 soliveira 107
        function prepareListRevisionsDialog(myDialog, name, lang) {
108
 
109
            options = {
110
                autoOpen: false,
111
                width: 800,
112
                height: 450,
113
                modal: true,
114
                title: 'Revisions for ' + name + ' in ' + lang,
115
                buttons: [
116
                          {
117
                                text: "Close",
118
                                click: function() { $(this).dialog("close"); }
119
                          }
120
                      ]
121
           };
122
 
123
          myDialog.dialog(options);
124
 
125
          return myDialog;
126
        }
33 soliveira 127
 
41 soliveira 128
        function showEditPageDialog(pageName, lang) {
12 soliveira 129
 
41 soliveira 130
            $.getJSON('<mtw:contextPath />/Page.get.mtw?name=' + pageName + '&lang=' + lang, function(data) {
18 soliveira 131
 
72 soliveira 132
                if (data.page.systemPage) {
133
                	$('.editPageTitleCell').hide();
134
                } else {
135
                	$('.editPageTitleCell').show();
136
                	$('#editPageTitle').val(data.page.title);
137
                }
28 soliveira 138
                $('#editPageTextArea').val(data.page.body);
139
                $('#editPageName').val(data.page.name);
41 soliveira 140
                $('#editPageLang').val(data.page.lang);
12 soliveira 141
 
28 soliveira 142
                myDialog = $('#editPageDialog');
143
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
12 soliveira 144
                myDialog.dialog('open');
145
            });
146
 
147
            return false;
148
        }
63 soliveira 149
 
65 soliveira 150
        function showEditPreviewDialog(pageName, lang) {
49 soliveira 151
 
63 soliveira 152
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
65 soliveira 153
 
72 soliveira 154
            	if (data.page.systemPage) {
155
                	$('.editPageTitleCell').hide();
156
                } else {
157
                	$('.editPageTitleCell').show();
158
                	$('#editPageTitle').val(data.page.title);
159
                }
65 soliveira 160
                $('#editPageTextArea').val(data.page.body);
161
                $('#editPageName').val(data.page.name);
162
                $('#editPageLang').val(data.page.lang);
163
 
164
                myDialog = $('#editPageDialog');
165
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
166
                myDialog.dialog('open');
167
            });
63 soliveira 168
 
65 soliveira 169
            return false;
170
        }
171
 
172
 
173
       	function showEditPreviewNewPageDialog(pageName, lang) {
174
 
175
            $.getJSON('<mtw:contextPath />/Page.getPreview.mtw?name=' + pageName + '&lang=' + lang, function(data) {
176
 
63 soliveira 177
           		$('#createNewPageName').val(data.page.name);
178
        		$('#createNewPageTitle').val(data.page.title);
179
        		$('#createNewPageLanguage').val(data.page.languageId);
180
        		$('#createNewPageTextArea').val(data.page.body);
181
        		$('#createNewPageNameError').text('');
182
        		$('#createNewPageTitleError').text('');
183
        		$('#createNewPageLanguageError').text('');
184
        		$('#createNewPageBodyError').text('');
185
 
186
				showCreateNewPageDialog();
72 soliveira 187
 
188
				$('#createPageLanguageCell').hide();
63 soliveira 189
            });
190
 
191
            return false;
192
        }
193
 
49 soliveira 194
        function showListAllPagesDialog() {
195
 
196
            $.getJSON('<mtw:contextPath />/Page.list.mtw', function(data) {
197
 
198
                tableData = '';
199
                tableData += '<tr>';
55 soliveira 200
                tableData += '<th>&nbsp;</th>';
49 soliveira 201
                tableData += '<th>Name</th>';
202
                tableData += '<th>Language</th>';
203
                tableData += '<th>Created By</th>';
204
                tableData += '<th>Modified By</th>';
205
                tableData += '<th>&nbsp;</th>';
81 soliveira 206
                tableData += '<th>&nbsp;</th>';
49 soliveira 207
                tableData += '</tr>';
208
 
209
                $.each(data.pages, function(i,page) {
55 soliveira 210
 
211
                	pageName = page.name;
49 soliveira 212
 
213
                    modifiedBy = '';
214
                    if (page.modifiedById > 0) {
215
                        modifiedBy = page.modifiedBy.username;
216
                    }
217
 
218
                    if (page.systemPage == true) {
55 soliveira 219
                        pageName = '*' + pageName;
49 soliveira 220
                    }
221
 
222
                    if (page.frontPage == true) {
55 soliveira 223
                        pageName = '[' + pageName + ']';
49 soliveira 224
                    }
52 soliveira 225
 
226
                    modifiedOnTitle = '';
227
                    if (page.formattedModifiedOn != null) {
228
                    	modifiedOnTitle = ' title="' + page.formattedModifiedOn + '"';
229
                    }
230
 
231
                    createdOnTitle = '';
232
                    if (page.formattedCreatedOn != null) {
233
                    	createdOnTitle = ' title="' + page.formattedCreatedOn + '"';
234
                    }
53 soliveira 235
 
55 soliveira 236
                    radioCell = '&nbsp;';
53 soliveira 237
                    viewCell = '&nbsp;';
55 soliveira 238
                    if (page.CSS == false && page.systemPage == false) {
81 soliveira 239
                    	viewCell = '<a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + page.name + '&lang=' + page.lang + '"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a> ';
55 soliveira 240
                    	if (page.frontPage == false) {
58 soliveira 241
                    		radioCell = '<input tabindex="-1" type="radio" name="pageId" id="pageId" value="' + page.id + '" />';
55 soliveira 242
                    	}
53 soliveira 243
                    }
79 soliveira 244
 
81 soliveira 245
                    viewRevisionsCell = '&nbsp;';
246
 
247
                    if (page.modified) {
248
                        viewRevisionsCell = '<a title="View Revisions" class="revisionLink" tabindex="-1" href="#" onclick="return showListRevisionsDialog(\'' + page.name + '\',\'' + page.lang + '\',\'' + page.language + '\');"><img src="<mtw:contextPath/>/images/folder.png" height="24" height="20" border="0" /></a>';
249
                    }
54 soliveira 250
 
251
                    nameTitle = '';
252
                    if (page.title != null && page.title != '') {
253
                    	nameTitle = ' title="' + page.title + '"';
254
                    }
49 soliveira 255
 
256
                    tableData += '<tr>';
55 soliveira 257
                    tableData += '<td>' + radioCell + '</td>';
258
                    tableData += '<td' + nameTitle + '>' + pageName + '</td>';
49 soliveira 259
                    tableData += '<td align="center">' + page.language + '</td>';
52 soliveira 260
                    tableData += '<td align="center"' + createdOnTitle + '>' + page.createdBy.username + '</td>';
261
                    tableData += '<td align="center"' + modifiedOnTitle + '>' + modifiedBy + '</td>';
53 soliveira 262
                    tableData += '<td align="center">' + viewCell + '</td>';
81 soliveira 263
                    tableData += '<td align="center">' + viewRevisionsCell + '</td>';
49 soliveira 264
                    tableData += '</tr>';
265
                });
266
 
267
                $('#listAllPagesTable').html(tableData);
268
 
81 soliveira 269
                myDialogDiv = $('#listAllPagesDialog');
270
                myDialog = prepareListAllPagesDialog(myDialogDiv);
49 soliveira 271
                myDialog.dialog('open');
58 soliveira 272
                $('.ui-dialog :button').blur();
49 soliveira 273
             });
274
 
275
            return false;
276
        }
79 soliveira 277
 
81 soliveira 278
        function showListRevisionsDialog(name, lang, language) {
79 soliveira 279
 
280
            $.getJSON('<mtw:contextPath />/Page.getRevisions.mtw?name=' + name + '&lang=' + lang, function(data) {
281
 
282
                tableData = '';
283
                tableData += '<tr>';
284
                tableData += '<th>Revision</th>';
285
                tableData += '<th>Author</th>';
80 soliveira 286
                tableData += '<th>Date</th>';
79 soliveira 287
                tableData += '<th>&nbsp;</th>';
288
                tableData += '</tr>';
289
 
290
                $.each(data.revisions, function(i,revision) {
291
 
292
                    tableData += '<tr>';
293
                    tableData += '<td>' + revision.revision + '</td>';
80 soliveira 294
                    tableData += '<td align="center">' + revision.user.username + '</td>';
295
                    tableData += '<td align="center">' + revision.formattedCreatedOn + '</td>';
81 soliveira 296
                    tableData += '<td align="center"><a title="View Page" tabindex="-1" href="<mtw:contextPath/>/Page.mtw?name=' + revision.name + '&lang=' + revision.lang + '&revision=' + revision.revision +'"><img src="<mtw:contextPath/>/images/view.png" border="0" /></a></td>';
79 soliveira 297
                    tableData += '</tr>';
298
                });
299
 
81 soliveira 300
                $('#listRevisionsTable').html(tableData);
301
                myDialog = $('#listRevisionsDialog');
302
                myDialog = prepareListRevisionsDialog(myDialog, name, language);
79 soliveira 303
                myDialog.dialog('open');
304
                $('.ui-dialog :button').blur();
305
             });
306
 
307
            return false;
308
        }
33 soliveira 309
 
36 soliveira 310
       	function showCreateNewPageDialog() {
311
 
42 soliveira 312
            $('#createNewPageFormName').val('<mtw:out value="bodyColumn.name" />');
313
            $('#createNewPageFormLang').val('<mtw:out value="bodyColumn.lang" />');
72 soliveira 314
            $('#createPageLanguageCell').show();
42 soliveira 315
 
36 soliveira 316
            myDialog = $('#createNewPageDialog');
317
            myDialog = prepareCreateNewPageDialog(myDialog);
318
            myDialog.dialog('open');
319
 
320
            return false;
321
        }
322
 
323
        function prepareCreateNewPageDialog(myDialog) {
324
 
325
            options = {
38 soliveira 326
            	close: function() { clearCreateNewPageForm(); },
36 soliveira 327
                autoOpen: false,
328
                width: 800,
329
                modal: true,
330
                title: "Create New Page:",
331
                buttons: [
332
                          {
38 soliveira 333
                                text: "Create",
334
                                click: function() { $('#createNewPageForm').submit(); }
36 soliveira 335
                          },
336
                          {
60 soliveira 337
                              text: "Preview",
338
                              click: function() { $('#createNewPageFormPreview').val('true'); $('#createNewPageForm').submit(); }
339
                          },
340
                          {
36 soliveira 341
                                text: "Cancel",
37 soliveira 342
                                click: function() {  $(this).dialog("close"); }
36 soliveira 343
                          }
344
                      ]
345
           };
346
 
347
          myDialog.dialog(options);
348
 
349
          return myDialog;
350
        }
351
 
33 soliveira 352
 
353
        function showLoginDialog() {
12 soliveira 354
 
42 soliveira 355
            $('#loginFormName').val('<mtw:out value="bodyColumn.name" />');
356
            $('#loginFormLang').val('<mtw:out value="bodyColumn.lang" />');
357
 
33 soliveira 358
            myDialog = $('#loginDialog');
359
            myDialog = prepareLoginDialog(myDialog);
360
            myDialog.dialog('open');
361
 
362
            return false;
363
        }
364
 
35 soliveira 365
        function clearLoginForm() {
366
        	$('#loginUsername').val('');
367
        	$('#loginPassword').val('');
368
        	$('#loginUsernameError').text('');
369
        	$('#loginPasswordError').text('');
36 soliveira 370
        }
33 soliveira 371
 
36 soliveira 372
        function clearCreateNewPageForm() {
373
        	$('#createNewPageName').val('');
374
        	$('#createNewPageTitle').val('');
375
        	$('#createNewPageLanguage').val('');
376
        	$('#createNewPageTextArea').val('');
39 soliveira 377
        	$('#createNewPageNameError').text('');
378
        	$('#createNewPageTitleError').text('');
379
        	$('#createNewPageLanguageError').text('');
380
        	$('#createNewPageBodyError').text('');
36 soliveira 381
        }
382
 
33 soliveira 383
      	function prepareLoginDialog(myDialog) {
384
 
385
            options = {
35 soliveira 386
            	close: function() { clearLoginForm(); },
33 soliveira 387
                autoOpen: false,
388
                width: 290,
389
                modal: true,
390
                title: "Login:",
391
                buttons: [
392
                          {
393
                                text: "Login",
394
                                click: function() { $('#loginForm').submit(); }
395
                          },
396
                          {
397
                                text: "Cancel",
37 soliveira 398
                                click: function() {  $(this).dialog("close"); }
33 soliveira 399
                          }
400
                      ]
401
           };
402
 
403
          myDialog.dialog(options);
404
 
405
          return myDialog;
406
        }
37 soliveira 407
 
408
      	function prepareConfirmDialog(myDialog) {
33 soliveira 409
 
37 soliveira 410
            options = {
411
                autoOpen: false,
412
                width: 300,
413
                modal: true,
414
                title: "Confirmation:",
415
                buttons: [
416
                          {
417
                                text: "Yes",
418
                                click: function() { $(this).dialog("close"); }
419
                          },
420
                          {
421
                                text: "No",
422
                                click: function() {  $(this).dialog("close"); }
423
                          }
424
                      ]
425
           };
426
 
427
          myDialog.dialog(options);
428
 
429
          return myDialog;
430
        }
431
 
432
         function showConfirmDialog() {
433
 
434
            myDialog = $('#confirmDialog');
435
            myDialog = prepareConfirmDialog(myDialog);
436
            myDialog.dialog('open');
437
 
438
            return false;
439
        }
440
 
12 soliveira 441
    </script>
442
 
443
</head>
444
 
445
<body class="composite">
446
 
447
<!-- For Testing -->
448
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>
449
 
37 soliveira 450
<!-- Close Confirm -->
451
<div id="confirmDialog" style="display: none;">
452
	<span id="confirmMessage">The confirmation message goes here.</span>
453
</div>
454
 
33 soliveira 455
<!-- For Editing Pages -->
28 soliveira 456
<div id="editPageDialog" style="display: none;">
41 soliveira 457
<form id="editPageForm" action="<mtw:contextPath />/Page.edit.mtw" method="post">
28 soliveira 458
<input type="hidden" name="name" id ="editPageName" value="" />
41 soliveira 459
<input type="hidden" name="lang" id="editPageLang" value="" />
65 soliveira 460
<input type="hidden" name="isPreview" id="editPagePreview" value="false" />
12 soliveira 461
<table>
462
    <tr>
463
        <td>&nbsp;</td>
464
    </tr>
72 soliveira 465
                <tr class="editPageTitleCell">
466
                    <td>
467
                        Title:
468
                    </td>
469
                    <td>
470
                        <mtw:input id="editPageTitle" name="title" size="40" maxlength="60" />
471
                        <span id="editPageTitleError">
472
                        <mtw:outError field="title">
473
                            <font color="red">
474
                                <b><mtw:out /></b>
475
                            </font>
476
                        </mtw:outError>
477
                        </span>
478
                    </td>
479
                </tr>
480
                <tr class="editPageTitleCell"><td>&nbsp;</td></tr>
12 soliveira 481
    <tr>
72 soliveira 482
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" />
483
        <span id="editPageTextAreaError">
484
                        <mtw:outError field="body">
485
                            <font color="red">
486
                                <b><mtw:out /></b>
487
                            </font>
488
                        </mtw:outError>
489
                        </span>
490
 
491
        </td>
12 soliveira 492
    </tr>
493
</table>
494
</form>
495
</div>
496
 
33 soliveira 497
<!-- For Login -->
498
<div id="loginDialog" style="display: none;">
499
		<form action="<mtw:contextPath />/Login.mtw" method="post" id="loginForm">
42 soliveira 500
            <input type="hidden" name="name" value="" id="loginFormName" />
501
            <input type="hidden" name="lang" value="" id="loginFormLang" />
33 soliveira 502
			<table>
503
				<tr>
504
					<td>
505
						Username:
506
					</td>
507
					<td>
35 soliveira 508
						<mtw:input id="loginUsername" name="username" size="20" maxlength="20" />
509
						<span id="loginUsernameError">
33 soliveira 510
						<mtw:outError field="username">
511
							<font color="red">
512
								<b><mtw:out /></b>
513
							</font>
514
						</mtw:outError>
35 soliveira 515
						</span>
33 soliveira 516
					</td>
517
				</tr>
518
				<tr>
519
					<td>
520
						Password:
521
					</td>
522
					<td>
35 soliveira 523
						<mtw:input id="loginPassword" name="password" type="password" size="20" maxlength="20" />
524
						<span id="loginPasswordError">
33 soliveira 525
						<mtw:outError field="password">
526
							<font color="red">
527
								<b><mtw:out /></b>
528
							</font>
529
						</mtw:outError>
35 soliveira 530
						</span>
33 soliveira 531
					</td>
532
				</tr>
533
			</table>
534
		</form>
535
</div>
536
 
49 soliveira 537
<!-- For displaying all pages -->
538
<div id="listAllPagesDialog" style="display: none;">
56 soliveira 539
    <form action="#" method="post" id="listAllPagesForm">
53 soliveira 540
    <table id="listAllPagesTable">
49 soliveira 541
    </table>
56 soliveira 542
    </form>
49 soliveira 543
</div>
544
 
81 soliveira 545
 
546
<!-- For displaying revisions -->
547
<div id="listRevisionsDialog" style="display: none;">
548
    <form action="#" method="post" id="listRevisionsForm">
549
    <table id="listRevisionsTable">
550
    </table>
551
    </form>
552
</div>
553
 
36 soliveira 554
<!-- Create New Page -->
555
<div id="createNewPageDialog" style="display: none;">
556
		<form action="<mtw:contextPath />/Page.add.mtw" method="post" id="createNewPageForm">
42 soliveira 557
            <input type="hidden" name="name" value="" id="createNewPageFormName" />
558
            <input type="hidden" name="lang" value="" id="createNewPageFormLang" />
60 soliveira 559
            <input type="hidden" name="isPreview" value="false" id="createNewPageFormPreview" />
36 soliveira 560
			<table>
561
				<tr>
562
					<td>
563
						Name:
564
					</td>
565
					<td>
39 soliveira 566
						<mtw:input id="createNewPageName" name="newPage.name" size="40" maxlength="30" />
36 soliveira 567
						<span id="createNewPageNameError">
39 soliveira 568
						<mtw:outError field="newPage.name">
36 soliveira 569
							<font color="red">
570
								<b><mtw:out /></b>
571
							</font>
572
						</mtw:outError>
573
						</span>
574
					</td>
575
				</tr>
576
				<tr>
577
					<td>
578
						Title:
579
					</td>
580
					<td>
39 soliveira 581
						<mtw:input id="createNewPageTitle" name="newPage.title" size="40" maxlength="60" />
36 soliveira 582
						<span id="createNewPageTitleError">
39 soliveira 583
						<mtw:outError field="newPage.title">
36 soliveira 584
							<font color="red">
585
								<b><mtw:out /></b>
586
							</font>
587
						</mtw:outError>
588
						</span>
589
					</td>
590
				</tr>
67 soliveira 591
				<tr id="createPageLanguageCell">
36 soliveira 592
					<td>
593
						Language:
594
					</td>
595
					<td>
39 soliveira 596
						<mtw:select name="newPage.languageId" list="languages" id="createNewPageLanguage" emptyField="true" />
36 soliveira 597
						<span id="createNewPageLanguageError">
39 soliveira 598
						<mtw:outError field="newPage.languageId">
36 soliveira 599
							<font color="red">
600
								<b><mtw:out /></b>
601
							</font>
602
						</mtw:outError>
603
						</span>
604
					</td>
605
				</tr>
606
				<tr>
39 soliveira 607
        			<td colspan="2">
608
        				<mtw:textarea id="createNewPageTextArea" name="newPage.body" style="width: 100%; height: 465px;" />
609
        				<span id="createNewPageBodyError">
610
						<mtw:outError field="newPage.body">
611
							<font color="red">
612
								<b><mtw:out /></b>
613
							</font>
614
						</mtw:outError>
615
						</span>
616
        			</td>
36 soliveira 617
    			</tr>
618
			</table>
619
		</form>
620
</div>
33 soliveira 621
 
36 soliveira 622
 
12 soliveira 623
<div>
624
<table border="0">
625
    <tr>
75 soliveira 626
        <td>
627
 
76 soliveira 628
        <k:html name="logo" />
75 soliveira 629
        <mtw:hasAuthorization groups="admin">
630
        <mtw:if test="logo.preview" value="false">
631
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" style="font-size: 8px;" onclick="return showEditPageDialog('logo', 'en');" title="<k:editTooltip name="logo" />">Edit Logo</a>
632
        </mtw:if>
633
        <mtw:if test="logo.preview" value="true">
634
        <br/>&nbsp;&nbsp;&nbsp;&nbsp;
635
        <span style="font-size: 10px; font-weight: bold;">Preview</span><span style="font-size: 8px;">&nbsp;&nbsp;-&nbsp;</span>
636
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Save</a>&nbsp;
637
        <a style="font-size: 8px;" href="#" onclick="return showEditPreviewDialog('<mtw:out value="logo.name" />', '<mtw:out value="logo.language.locale" />');" title="<k:editTooltip name="logo" />">Edit</a>&nbsp;
638
        <a style="font-size: 8px;" href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="logo.name" />&lang=<mtw:out value="logo.language.locale" />">Discard</a>
639
        </mtw:if>
640
        </mtw:hasAuthorization>
641
 
642
        </td>
22 soliveira 643
        <td align="right" valign="bottom">
644
            <mtw:isLogged negate="true">
33 soliveira 645
                <a href="#" onclick="return showLoginDialog();">Login</a>
22 soliveira 646
            </mtw:isLogged>
647
            <mtw:isLogged>
36 soliveira 648
                <a href="#" onclick="return showCreateNewPageDialog();">Create New Page</a> |
49 soliveira 649
                <a href="#" onclick="return showListAllPagesDialog();">List Pages</a> |
44 soliveira 650
                <mtw:hasAuthorization groups="admin">
74 soliveira 651
 
652
                <mtw:if test="css.preview" value="true">
653
                <b>CSS</b> -
654
                <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Save</a>&nbsp;
655
                <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="css.name" />', '<mtw:out value="css.language.locale" />');" title="<k:editTooltip name="css" />">Edit</a>&nbsp;
656
                <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="css.name" />&lang=<mtw:out value="css.language.locale" />">Discard</a> |
657
                </mtw:if>
658
 
659
                <mtw:if test="css.preview" value="false">
41 soliveira 660
                <a href="#" onclick="return showEditPageDialog('CSS', 'en');" title="<k:editTooltip name="css" />">Edit CSS</a> |
74 soliveira 661
                </mtw:if>
662
 
663
 
44 soliveira 664
                </mtw:hasAuthorization>
22 soliveira 665
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
666
            </mtw:isLogged>
667
            &nbsp;
39 soliveira 668
            <mtw:isLocale value="pt">
669
	            <a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #ccc;" /></a>
670
    	        <a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #fff;" /></a>
671
            </mtw:isLocale>
672
            <mtw:isLocale value="en">
673
            	<a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" style="border: 3px solid #fff;" /></a>
674
            	<a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" style="border: 3px solid #ccc;" /></a>
675
            </mtw:isLocale>
22 soliveira 676
            &nbsp;&nbsp;&nbsp;
677
        </td>
12 soliveira 678
    </tr>
679
</table>
680
</div>
681
 
682
<hr />
683
 
684
<div id="leftColumn"><mtw:isLogged>
44 soliveira 685
    <mtw:hasAuthorization groups="admin">
73 soliveira 686
 
687
        <mtw:if test="leftColumn.preview" value="true">
688
        <div style="text-align: left; padding-left: 8px; padding-top: 6px;">
689
            <b>Preview</b>
690
            &nbsp;-&nbsp;
691
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Save</a>&nbsp;&nbsp;
692
            <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="leftColumn.name" />', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a>&nbsp;&nbsp;
693
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="leftColumn.name" />&lang=<mtw:out value="leftColumn.language.locale" />">Discard</a>
694
        </div>
695
        </mtw:if>
696
 
697
        <mtw:if test="leftColumn.preview" value="false">
41 soliveira 698
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;"><a href="#" onclick="return showEditPageDialog('LeftColumn', '<mtw:out value="leftColumn.language.locale" />');" title="<k:editTooltip name="leftColumn" />">Edit</a></div>
73 soliveira 699
        </mtw:if>
700
 
701
 
12 soliveira 702
    </mtw:hasAuthorization>
703
</mtw:isLogged>
20 soliveira 704
<div id="navcolumn">
705
    <div>
22 soliveira 706
    <mtw:out value="leftColumn.body" />
20 soliveira 707
    </div>
708
<br />
12 soliveira 709
</div>
710
 
711
</div>
712
 
713
<div id="bodyColumn">
28 soliveira 714
    <mtw:hasAuthorization groups="admin, editor">
63 soliveira 715
 
716
    <mtw:if test="bodyColumn.preview" value="true">
65 soliveira 717
 
718
    	<mtw:if test="bodyColumn.new" value="true">
71 soliveira 719
			<div style="text-align: left; padding-left: 4px;">
720
			<b>This is a Preview</b>
721
			&nbsp;-&nbsp;
722
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
723
            <a href="#" onclick="return showEditPreviewNewPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>&nbsp;&nbsp;
69 soliveira 724
			<a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
66 soliveira 725
			</div>
65 soliveira 726
    	</mtw:if>
727
    	<mtw:if test="bodyColumn.new" value="false">
71 soliveira 728
            <div style="text-align: left; padding-left: 4px;">
729
            <b>This is a Preview</b>
730
            &nbsp;-&nbsp;
731
            <a href="<mtw:contextPath/>/Page.savePreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Save</a>&nbsp;&nbsp;
732
            <a href="#" onclick="return showEditPreviewDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a>&nbsp;&nbsp;
733
            <a href="<mtw:contextPath/>/Page.discardPreview.mtw?name=<mtw:out value="bodyColumn.name" />&lang=<mtw:out value="bodyColumn.language.locale" />">Discard</a>
66 soliveira 734
			</div>
65 soliveira 735
    	</mtw:if>
736
 
63 soliveira 737
    </mtw:if>
738
 
739
    <mtw:if test="bodyColumn.preview" value="false">
41 soliveira 740
    <div style="text-align: right; padding-right: 14px;"><a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />', '<mtw:out value="bodyColumn.language.locale" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a></div>
63 soliveira 741
    </mtw:if>
742
 
28 soliveira 743
    </mtw:hasAuthorization>
24 soliveira 744
    <mtw:out value="bodyColumn.body" />
12 soliveira 745
</div>
746
 
747
<div class="clear">
748
<hr />
749
</div>
750
 
751
<div id="footer">
63 soliveira 752
<div class="xright">Copyright (c) 2011</div>
12 soliveira 753
<div class="clear">
754
<hr />
755
</div>
756
</div>
757
 
758
</body>
759
</html>