Subversion Repositories SmartDukaan

Rev

Rev 9155 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8917 kshitij.so 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
 
3
<html>
9155 kshitij.so 4
#set ($banner = $action.getUpdates("SIDE_BANNER"))
5
#set ($mapdetails = $action.getbannermapdetail("SIDE_BANNER"))
6
#set ($uriMap = $action.getUriMapping("SIDE_BANNER"))
8917 kshitij.so 7
<head>
8
<link href="/css/imgareaselect-default.css" type="text/css" rel="stylesheet">
9
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
10
<script type="text/javascript" src="/js/jquery.validate.js"></script>
11
<script type="text/javascript" src="/js/jquery.js"></script>
12
<script src="/js/jquery.imgareaselect.pack.js" type="text/javascript"></script>
13
<script type="text/javascript">
14
 function showHide(option) {
15
 if (option.value == 'True') {
16
     document.getElementById('image-map-div').style.display = 'block';
17
    }
18
    else{
19
    document.getElementById('image-map-div').style.display = 'none';
20
    }
21
 }
22
</script>
23
<script type="text/javascript">
24
function validateForm()
25
{
26
var x=document.forms["uploadFileToMyFolder"]["bannerName"].value;
27
if (x==null || x=="")
28
  {
29
  alert("Banner name must be filled out");
30
  return false;
31
  }
32
}
33
</script>
34
<script type="text/javascript">
35
	$(function() {
36
	$('#add-map').live('click', function(){
37
		$('<br/><br/><label>Coordinates : </label> <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>'
38
				+'<br/><br/><label>Link : </label> <input id="mapLink" name = "mapLink" type = "textbox"/>').appendTo('#image-map-container');
39
	});
40
   });
41
   $(document).ready(function() {
42
  $('#cancelbutton').click(function(e) {
43
    window.location.href = '/user-image';
44
  });
45
});
46
</script>
47
<script type="text/javascript">
48
function preview(img, selection) {
49
    if (!selection.width || !selection.height)
50
        return;
51
 
52
    var scaleX = 100 / selection.width;
53
    var scaleY = 100 / selection.height;
54
 
55
    $('#preview img').css({
56
        width: Math.round(scaleX * 300),
57
        height: Math.round(scaleY * 300),
58
        marginLeft: -Math.round(scaleX * selection.x1),
59
        marginTop: -Math.round(scaleY * selection.y1)
60
    });
61
 
62
    $('#x1').val((Math.round(selection.x1)));
63
    $('#y1').val((Math.round(selection.y1)));
64
    $('#x2').val((Math.round(selection.x2)));
65
    $('#y2').val((Math.round(selection.y2)));  
66
}
67
 
68
$(function () {
69
    $('#photo').imgAreaSelect({ handles: true,
70
        fadeSpeed: 200, onSelectChange: preview });
71
});
72
</script>
73
<script>
74
$(function() {
75
	$('#add-uri').live('click', function(){
76
		$('<br/><br/><label>URI To Map With: </label> <input id="uri" name = "uri" type = "textbox"/>'
77
		+'<br><br><label>Acitive / InActive : </label><select id ="isActive" name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>').appendTo('#uri-container');
78
	 });
79
	});
80
</script>
81
 
82
	#if (!$banner.isHasMap())
83
		<style>
84
			#image-map-div {
85
			display : none
86
			}
87
			</style>
88
	#end
89
<style>
90
* { font-family: Verdana; font-size: 96%; }
91
		label {
92
    float: left;
93
    width: 150px;
94
}
95
select {
96
    width: 100px;
97
}
98
</style>
99
<title>Edit $action.getBannerName()</title>
100
</head>
101
<body>
102
<a href="/user-image">Back to listing</a>
103
<h2>Edit $action.getBannerName()</h2>
104
<div style="padding-bottom: 10px; float: left; width: 33%;" id="image">
105
	<img src='/images/banners/$banner.getImageName()' id="photo" style="float: left; width: 180px; height: 258px;">
106
		<div style="float: right; width: 15%; margin-bottom: 10px; margin-left: 10px;">
107
    <table style="">
108
      <thead>
109
        <tr>
110
          <th colspan="2" style="font-size: 110%; font-weight: bold; text-align: left; padding-left: 0.1em;">
111
            Coordinates
112
          </th>
113
        </tr>
114
      </thead>
115
      <tbody>
116
        <tr>
117
          <td style="width: 10%;"><b>X<sub>1</sub>:</b></td>
118
 		      <td style="width: 30%;"><input type="text" id="x1" value="-"></td>
119
        </tr>
120
        <tr>
121
          <td><b>Y<sub>1</sub>:</b></td>
122
          <td><input type="text" id="y1" value="-"></td>
123
        </tr>
124
        <tr>
125
          <td><b>X<sub>2</sub>:</b></td>
126
          <td><input type="text" id="x2" value="-"></td>
127
          <td></td>
128
          <td></td>
129
        </tr>
130
        <tr>
131
          <td><b>Y<sub>2</sub>:</b></td>
132
          <td><input type="text" id="y2" value="-"></td>
133
          <td></td>
134
          <td></td>
135
        </tr>
136
      </tbody>
137
    </table>
138
  </div>
139
</div>
140
<div id="upload-form" style="padding-bottom: 20px; float: right; width: 50%;">
141
<form id="uploadFileToMyFolder" name="userImage" action="/user-image" onsubmit="return validateForm()" enctype="multipart/form-data" method="post">
142
	  <label for="imagePath">Image Path: </label>
143
	  <input name="userImage" id="file" type="file">
144
	  <br></br>
145
	  <label for="bannerName">Banner Name: </label>
146
      <input id="bannerName" name="bannerName" value='$banner.getBannerName()'type="text"/>
147
      <br></br>
148
	  <label for="fileExtenstion">Image Extention : </label>
149
	  <select name="fileExtention" id="fileExtention">
150
	  #foreach( $ext in ['jpg','jpeg','png','gif'] )
151
		#if ($ext == $action.getFileExtention())
152
				<option value='$ext' selected="selected">$ext</option>
153
			#else
154
				<option value='$ext'>$ext</option>
155
			#end	
156
	  #end
157
	  </select>
158
	  <br></br>
159
      <label for="link">Link: </label>
160
      <input id="link" name="link" value='$banner.getLink()' type="text"/>
161
	  <br></br>
162
	  #foreach ($uri in $uriMap)
9155 kshitij.so 163
		<input id="uri" name="uri" value = "-" type="hidden"/>
8917 kshitij.so 164
		<label>Acitive / InActive : </label>
165
		#if ($uri.isIsActive())
166
			<select name="isActive"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
167
		#else
168
			<select name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
169
		#end
10095 kshitij.so 170
		<br></br>
171
		<label>Target : </label>
172
			#if ($uri.isTarget())
173
				<select name="linkTarget"><option selected="selected" value="True">New Window</option><option value="False">Same Window</option></select>
174
			#else
175
				<select name="linkTarget"><option selected="selected" value="False">Same Window</option><option value="True">New Window</option></select>
176
			#end
8917 kshitij.so 177
	  #end
178
	  <br></br>
179
      <label for="priority">Priority: </label>
180
	  <select name="priority">
181
		#foreach( $val in [1..10] )
182
			#if ($val == $banner.getPriority())
183
				<option value='$val' selected="selected">$val</option>
184
			#else
185
				<option value='$val'>$val</option>
186
			#end	
187
		#end
188
		</select>
189
	  <br></br>
190
	  <label for="hasMap">Add Map : </label>
191
	  #if ($banner.isHasMap())
192
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="True">Yes</option><option value="False">No</option></select>
193
	  #else
194
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
195
	  #end
196
      <br></br>
197
	  <div id = "image-map-div" align = "left">
198
				<h3>Map Details</h5>
199
                <div id = "image-map-container">
200
					#if (!$banner.isHasMap())
201
						<label>Coordinates : </label>
202
    				    <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
203
					    <br></br>
204
    				    <label>Link : </label>
205
    				    <input id="mapLink" name = "mapLink" type = "textbox"/>
206
					#end
207
					#foreach($mapdetail in $mapdetails)
208
    				<label>Coordinates : </label>
209
    				<input id="mapCoordinates" name = "mapCoordinates" value="$mapdetail.getCoordinates()" type = "text"/>
210
					<br></br>
211
    				<label>Link : </label>
212
    				<input id="mapLink" name = "mapLink" value="$mapdetail.getMapLink()" type = "text"/>
213
					<br></br>
214
					#end
215
                </div>
216
				<img id = "add-map" src = "/images/add.png" />
217
            </div>
218
	  <br>
219
	  <input style="margin-top: 8px;" name="upload" value="Update" type="submit">
220
	  <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
9155 kshitij.so 221
	  <input id="Action" value="$action.getBannerName()" name="action" style="visibility: hidden;" />
222
	  <input id="BannerType" value="$banner.getBannerType()" name="bannerType" style="visibility: hidden;">
223
      <input id="ActionType" value="$banner.getBannerType()" name="actionType" style="visibility: hidden;" />
8917 kshitij.so 224
</form>
225
</div>
226
</body>
227
</html>