Kawai Wiki

Rev

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