Kawai Wiki

Rev

Rev 29 | Rev 33 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
<%@ taglib uri="/WEB-INF/tld/taglib.tld" prefix="k" %>

<html>
<head>

<title>Mentawai Web Framework</title>

<style type="text/css" media="all">
@import url("<mtw:contextPath/>/GenerateCSS.getCSS.css");
</style>

<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="imagetoolbar" content="false" />

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/gif" href="/favicon.gif" />
<link rel="stylesheet" href="<mtw:contextPath/>/GenerateCSS.getPrintCSS.css" type="text/css" media="print" />

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="author" content="Sergio Oliveira Junior" />
<meta name="email" content="sergio.oliveira.jr@gmail.com" />

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery/jquery-1.6.4.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<script language="JavaScript">
    
        $(document).ready(function() {

        });
        
        function prepareEditPageDialog(myDialog, theTitle) {

            options = {
                autoOpen: false,
                width: 800,
                modal: true,
                title: theTitle,
                buttons: [
                          {
                                text: "Save",
                                click: function() { $('#editPageForm').submit(); }
                          },
                          {
                                text: "Cancel",
                                click: function() { $(this).dialog("close"); }
                          }
                      ]
           };

          myDialog.dialog(options);

          return myDialog;
        }
    
        function showEditPageDialog(pageName) {

            $.getJSON('<mtw:contextPath />/Page.getPage.mtw?name=' + pageName, function(data) {

                $('#editPageTextArea').val(data.page.body);
                $('#editPageName').val(data.page.name);
                $('#editPageLanguageId').val(data.page.languageId);

                myDialog = $('#editPageDialog');
                myDialog = prepareEditPageDialog(myDialog, 'Editing <i><font color="darkblue">' + pageName + "</font></i> in <i>" + data.page.language + "<i>...");
                myDialog.dialog('open');
            });
            
            return false;
        }

    </script>

</head>

<body class="composite">

<!-- For Testing -->
<div id="dialog" title="Dialog Title" style="display: none;">I'm in a dialog</div>

<div id="editPageDialog" style="display: none;">
<form id="editPageForm" action="<mtw:contextPath />/Page.editPage.mtw" method="post">
<input type="hidden" name="name" id ="editPageName" value="" />
<input type="hidden" name="languageId" id="editPageLanguageId" value="" />
<table>
    <tr>
        <td>&nbsp;</td>
    </tr>
    <mtw:outError field="html">
        <tr>
            <td colspan="2"><span class="Negative" style="font-weight: bold;"><mtw:out /></span></td>
        </tr>
    </mtw:outError>
    <tr>
        <td colspan="2"><mtw:textarea id="editPageTextArea" name="body" style="width: 100%; height: 465px;" /></td>
    </tr>
</table>
</form>
</div>

<div>
<table border="0">
    <tr>
        <td><a href="/"><img src="images/logos/logo.png" border="0"></img></a></td>
        <td align="right" valign="bottom">
            <mtw:isLogged negate="true">
                <a href="jsp/login.jsp">Login</a>
            </mtw:isLogged>
            <mtw:isLogged>
                <a href="<mtw:contextPath/>/Page.create.mtw">Create New Page</a> |
                <a href="<mtw:contextPath/>/Page.list.mtw">List Pages</a> |
                <a href="#" onclick="return showEditPageDialog('CSS');" title="<k:editTooltip name="css" />">Edit CSS</a> |
                <a href="<mtw:contextPath/>/Logout.mtw">Logout</a> (<mtw:out value="sessionUser.username" />)
            </mtw:isLogged>
            &nbsp;
            <a href="<mtw:urlWithLoc loc="pt" />"><img src="images/brazil.gif" border="0" width="20" height="13" /></a>
            <a href="<mtw:urlWithLoc loc="en" />"><img src="images/usa.gif" width="20" height="13" border="0" /></a>
            &nbsp;&nbsp;&nbsp;
        </td>
    </tr>
</table>
</div>

<hr />

<div id="leftColumn"><mtw:isLogged>
    <mtw:hasAuthorization groups="admin, editor">
        <div style="text-align: right; padding-right: 14px; padding-top: 6px;"><a href="#" onclick="return showEditPageDialog('LeftColumn');" title="<k:editTooltip name="leftColumn" />">Edit</a></div>
    </mtw:hasAuthorization>
</mtw:isLogged>
<div id="navcolumn">
    <div>
    <mtw:out value="leftColumn.body" />
    </div>
<br />
</div>

</div>

<div id="bodyColumn">
    <mtw:hasAuthorization groups="admin, editor">
    <div style="text-align: right; padding-right: 14px;"><a href="#" onclick="return showEditPageDialog('<mtw:out value="bodyColumn.name" />');" title="<k:editTooltip name="bodyColumn" />">Edit</a></div>
    </mtw:hasAuthorization>
    <mtw:out value="bodyColumn.body" />
</div>

<div class="clear">
<hr />
</div>

<div id="footer">
<div class="xright">Copyright © 2011</div>
<div class="clear">
<hr />
</div>
</div>

</body>
</html>