Subversion Repositories SmartDukaan

Rev

Rev 6520 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link type="text/css" href="../../jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../jquery/jqueryui/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../jquery/jqueryui/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../jquery/jqueryui/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../jquery/jqueryui/ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="/content/jquery/validation/jquery.validate.js"></script>
<script>
function validateForm()
{
var x=document.forms["f"]["displayName"].value;
var y=document.forms["f"]["entityId"].value;
if (x==null || x=="")
  {
  alert("Tag name must be filled out");
  return false;
  }
if (y==null || y=="" || y.length !=7 || isNaN(y) )
  {
  alert("Entity Id is either wrong or Empty");
  return false;
  }
}

</script>
<script>
function getBaseURL() {
var url = location.href;  // entire url including querystring - also: window.location.href;
var baseURL = url.substring(0, url.indexOf('/', 14));
// Base Url for localhost
if (baseURL.indexOf('http://localhost') != -1) {
var url = location.href;  // window.location.href;
var pathname = location.pathname;  // window.location.pathname;
var index1 = url.indexOf(pathname);
var index2 = url.indexOf("/", index1 + 1);
var baseLocalUrl = url.substr(0, index2);
return baseLocalUrl + "/content/tag-page";
}
else {
return baseURL + "/content/tag-page";
}
}

</script>
<style>
* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
.textarea {width: 400px; height: 200px}
table {
    border-width: 1px 1px 1px 1px;
    border-spacing: 2px;
    border-style: outset outset outset outset;
    border-color: gray gray gray gray;
    border-collapse: separate;
    background-color: white;
        width: 16%;
}
th {
    border-width: 1px 1px 1px 1px;
    padding: 1px 1px 1px 1px;
    border-style: inset inset inset inset;
    border-color: gray gray gray gray;
    background-color: white;
    -moz-border-radius: 0px 0px 0px 0px;
        text-align: center;
        font-size: 13px;
}
td {
    border-width: 1px 1px 1px 1px;
    padding: 1px 1px 1px 1px;
    border-style: inset inset inset inset;
    border-color: gray gray gray gray;
    background-color: white;
    -moz-border-radius: 0px 0px 0px 0px;
        text-align: center;
        font-size: 14px;
}
</style>
<title>Edit {$action.getDisplayName()}</title>
</head>
<body>
<div>
<h1>Tag {$action.getDisplayName()}</h1>
<form id="f" name="f" action="/content/tag-page" onsubmit="return validateForm()" method="post">
    <label for="displayName">Tag Name: </label>
    <input id="displayName" name="displayName" value='$action.getDisplayName()' readonly/>
    <br></br>
    <label for="entityId">Entity: </label>
    <input id="entityId" name="entityId" type="text"/>
        <input type="submit" name="addType" value="+">
    <br/>
<p></p>
</form>
<button onclick="window.open(getBaseURL(),'_self','false');" class="button"><span class="icon">Done</span></button>
</div>
<h5>Entities Already Added :</h5>
<div>
         #drawAllentities1($action.getAllEntitiesByTagName())
</div>
</body>
</html>
#macro (drawAllentities1 $ent)
    <table id="Table">x
        <thead>
            <tr style="border: 1px">
                <th>#</th>
                <th>Entity ID</th>
                                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
    #foreach ( $entId in $ent )
            <tr style="border: 1px">
                <td>$velocityCount</td>
                <td>$entId</td>
                                <td><a href="/content/tag-page/${action.getDisplayName()}?_method=delete&entityId=${entId}"  id="$action.getDisplayName()" class="delete">Delete</a></td>
            </tr>
    #end
        </tbody>
    </table>

#end