Kawai Wiki

Rev

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