Subversion Repositories SmartDukaan

Rev

Rev 9155 | Go to most recent revision | Details | 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>
4
#set ($banner = $action.getUpdates())
5
#set ($mapdetails = $action.getbannermapdetails())
6
#set ($uriMap = $action.getUriMapping())
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)
163
		<input id="uri" name="uri" value = "$uri.getUri()" type="hidden"/>
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
170
	  #end
171
	  <br></br>
172
      <label for="priority">Priority: </label>
173
	  <select name="priority">
174
		#foreach( $val in [1..10] )
175
			#if ($val == $banner.getPriority())
176
				<option value='$val' selected="selected">$val</option>
177
			#else
178
				<option value='$val'>$val</option>
179
			#end	
180
		#end
181
		</select>
182
	  <br></br>
183
	  <label for="hasMap">Add Map : </label>
184
	  #if ($banner.isHasMap())
185
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="True">Yes</option><option value="False">No</option></select>
186
	  #else
187
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
188
	  #end
189
      <br></br>
190
	  <div id = "image-map-div" align = "left">
191
				<h3>Map Details</h5>
192
                <div id = "image-map-container">
193
					#if (!$banner.isHasMap())
194
						<label>Coordinates : </label>
195
    				    <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
196
					    <br></br>
197
    				    <label>Link : </label>
198
    				    <input id="mapLink" name = "mapLink" type = "textbox"/>
199
					#end
200
					#foreach($mapdetail in $mapdetails)
201
    				<label>Coordinates : </label>
202
    				<input id="mapCoordinates" name = "mapCoordinates" value="$mapdetail.getCoordinates()" type = "text"/>
203
					<br></br>
204
    				<label>Link : </label>
205
    				<input id="mapLink" name = "mapLink" value="$mapdetail.getMapLink()" type = "text"/>
206
					<br></br>
207
					#end
208
                </div>
209
				<img id = "add-map" src = "/images/add.png" />
210
            </div>
211
	  <br>
212
	  <input style="margin-top: 8px;" name="upload" value="Update" type="submit">
213
	  <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
214
	  <input id="Action" value="$action.getBannerName()" name="action" style="visibility: hidden;">
215
</form>
216
</div>
217
</body>
218
</html>