Subversion Repositories SmartDukaan

Rev

Rev 8433 | Rev 8917 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8578 kshitij.so 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
6848 kshitij.so 2
 
8578 kshitij.so 3
<html>
6848 kshitij.so 4
#set ($banner = $action.getUpdates())
5
#set ($mapdetails = $action.getbannermapdetails())
8578 kshitij.so 6
#set ($uriMap = $action.getUriMapping())
6848 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>
8433 amit.gupta 23
<script type="text/javascript">
6875 kshitij.so 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>
6848 kshitij.so 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
   });
6875 kshitij.so 41
   $(document).ready(function() {
42
  $('#cancelbutton').click(function(e) {
43
    window.location.href = '/user-image';
44
  });
45
});
6848 kshitij.so 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*1.29)));
63
    $('#y1').val((Math.round(selection.y1*1.34)));
64
    $('#x2').val((Math.round(selection.x2*1.29)));
65
    $('#y2').val((Math.round(selection.y2*1.34)));  
66
}
67
 
68
$(function () {
69
    $('#photo').imgAreaSelect({ handles: true,
70
        fadeSpeed: 200, onSelectChange: preview });
71
});
72
</script>
8578 kshitij.so 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>
6848 kshitij.so 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
<h2>Edit $action.getBannerName()</h2>
103
<div id="image" style="padding-bottom: 10px; height: 175px;">
104
	<img src='/images/banners/$banner.getImageName()' id="photo" style="float: left; width: 550px; height: 150px;">
105
		<div style="float: left; width: 18%; margin-bottom: 10px; margin-left: 10px;">
106
    <table style="">
107
      <thead>
108
        <tr>
109
          <th colspan="2" style="font-size: 110%; font-weight: bold; text-align: left; padding-left: 0.1em;">
110
            Coordinates
111
          </th>
112
        </tr>
113
      </thead>
114
      <tbody>
115
        <tr>
116
          <td style="width: 10%;"><b>X<sub>1</sub>:</b></td>
117
 		      <td style="width: 30%;"><input type="text" id="x1" value="-"></td>
118
        </tr>
119
        <tr>
120
          <td><b>Y<sub>1</sub>:</b></td>
121
          <td><input type="text" id="y1" value="-"></td>
122
        </tr>
123
        <tr>
124
          <td><b>X<sub>2</sub>:</b></td>
125
          <td><input type="text" id="x2" value="-"></td>
126
          <td></td>
127
          <td></td>
128
        </tr>
129
        <tr>
130
          <td><b>Y<sub>2</sub>:</b></td>
131
          <td><input type="text" id="y2" value="-"></td>
132
          <td></td>
133
          <td></td>
134
        </tr>
135
      </tbody>
136
    </table>
137
  </div>
138
	</div>
139
<div style="padding-bottom: 20px;" id="upload-form">
6875 kshitij.so 140
<form id="uploadFileToMyFolder" name="userImage" action="/user-image" onsubmit="return validateForm()" enctype="multipart/form-data" method="post">
6848 kshitij.so 141
	  <label for="imagePath">Image Path: </label>
142
	  <input name="userImage" id="file" type="file">
143
	  <br></br>
144
	  <label for="bannerName">Banner Name: </label>
145
      <input id="bannerName" name="bannerName" value='$banner.getBannerName()'type="text"/>
146
      <br></br>
147
      <label for="link">Link: </label>
148
      <input id="link" name="link" value='$banner.getLink()' type="text"/>
149
	  <br></br>
8578 kshitij.so 150
	  <div id="uri-div">
151
		<div id="uri-container">
152
			#foreach ($uri in $uriMap)
153
			<label>URI To Map With: </label>
154
			<input id="uri" name="uri" value = "$uri.getUri()" type="textbox"/>
155
			<br><br>
156
			<label>Acitive / InActive : </label>
157
			#if ($uri.isIsActive())
158
				<select name="isActive"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
159
			#else
160
				<select name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
161
			#end
162
			<br><br>
163
			#end
164
		</div>
165
	  <img id = "add-uri" src = "/images/add.png" />
166
	  </div>
6848 kshitij.so 167
      <label for="priority">Priority: </label>
168
	  <select name="priority">
169
		#foreach( $val in [1..10] )
170
			#if ($val == $banner.getPriority())
171
				<option value='$val' selected="selected">$val</option>
172
			#else
173
				<option value='$val'>$val</option>
174
			#end	
175
		#end
176
		</select>
177
	  <br></br>
178
	  <label for="hasMap">Add Map : </label>
179
	  #if ($banner.isHasMap())
180
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="True">Yes</option><option value="False">No</option></select>
181
	  #else
182
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
183
	  #end
184
      <br></br>
185
	  <div id = "image-map-div" align = "left">
186
				<h3>Map Details</h5>
187
                <div id = "image-map-container">
188
					#if (!$banner.isHasMap())
189
						<label>Coordinates : </label>
190
    				    <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
191
					    <br></br>
192
    				    <label>Link : </label>
193
    				    <input id="mapLink" name = "mapLink" type = "textbox"/>
194
					#end
195
					#foreach($mapdetail in $mapdetails)
196
    				<label>Coordinates : </label>
197
    				<input id="mapCoordinates" name = "mapCoordinates" value="$mapdetail.getCoordinates()" type = "text"/>
198
					<br></br>
199
    				<label>Link : </label>
200
    				<input id="mapLink" name = "mapLink" value="$mapdetail.getMapLink()" type = "text"/>
201
					<br></br>
202
					#end
203
                </div>
204
				<img id = "add-map" src = "/images/add.png" />
205
            </div>
206
	  <br>
207
	  <input style="margin-top: 8px;" name="upload" value="Update" type="submit">
6875 kshitij.so 208
	  <input type="button" id="cancelbutton" name="cancel" value="Cancel"/>
6848 kshitij.so 209
	  <input id="Action" value="$action.getBannerName()" name="action" style="visibility: hidden;">
210
</form>
211
</div>
212
</body>
213
</html>