Kawai Wiki

Rev

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