Subversion Repositories SmartDukaan

Rev

Rev 6875 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6848 kshitij.so 1
<!DOCTYPE html PUBLIC 
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
 
5
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
#set ($banner = $action.getUpdates())
7
#set ($mapdetails = $action.getbannermapdetails())
8
<head>
9
<link href="/css/imgareaselect-default.css" type="text/css" rel="stylesheet">
10
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
11
<script type="text/javascript" src="/js/jquery.validate.js"></script>
12
<script type="text/javascript" src="/js/jquery.js"></script>
13
<script src="/js/jquery.imgareaselect.pack.js" type="text/javascript"></script>
14
<script type="text/javascript">
15
 function showHide(option) {
16
 if (option.value == 'True') {
17
     document.getElementById('image-map-div').style.display = 'block';
18
    }
19
    else{
20
    document.getElementById('image-map-div').style.display = 'none';
21
    }
22
 }
23
</script>
24
<script type="text/javascript">
25
	$(function() {
26
	$('#add-map').live('click', function(){
27
		$('<br/><br/><label>Coordinates : </label> <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>'
28
				+'<br/><br/><label>Link : </label> <input id="mapLink" name = "mapLink" type = "textbox"/>').appendTo('#image-map-container');
29
	});
30
   });
31
</script>
32
<script type="text/javascript">
33
function preview(img, selection) {
34
    if (!selection.width || !selection.height)
35
        return;
36
 
37
    var scaleX = 100 / selection.width;
38
    var scaleY = 100 / selection.height;
39
 
40
    $('#preview img').css({
41
        width: Math.round(scaleX * 300),
42
        height: Math.round(scaleY * 300),
43
        marginLeft: -Math.round(scaleX * selection.x1),
44
        marginTop: -Math.round(scaleY * selection.y1)
45
    });
46
 
47
    $('#x1').val((Math.round(selection.x1*1.29)));
48
    $('#y1').val((Math.round(selection.y1*1.34)));
49
    $('#x2').val((Math.round(selection.x2*1.29)));
50
    $('#y2').val((Math.round(selection.y2*1.34)));  
51
}
52
 
53
$(function () {
54
    $('#photo').imgAreaSelect({ handles: true,
55
        fadeSpeed: 200, onSelectChange: preview });
56
});
57
</script>
58
 
59
	#if (!$banner.isHasMap())
60
		<style>
61
			#image-map-div {
62
			display : none
63
			}
64
			</style>
65
	#end
66
<style>
67
* { font-family: Verdana; font-size: 96%; }
68
		label {
69
    float: left;
70
    width: 150px;
71
}
72
select {
73
    width: 100px;
74
}
75
</style>
76
<title>Edit $action.getBannerName()</title>
77
</head>
78
<body>
79
<h2>Edit $action.getBannerName()</h2>
80
<div id="image" style="padding-bottom: 10px; height: 175px;">
81
	<img src='/images/banners/$banner.getImageName()' id="photo" style="float: left; width: 550px; height: 150px;">
82
		<div style="float: left; width: 18%; margin-bottom: 10px; margin-left: 10px;">
83
    <table style="">
84
      <thead>
85
        <tr>
86
          <th colspan="2" style="font-size: 110%; font-weight: bold; text-align: left; padding-left: 0.1em;">
87
            Coordinates
88
          </th>
89
        </tr>
90
      </thead>
91
      <tbody>
92
        <tr>
93
          <td style="width: 10%;"><b>X<sub>1</sub>:</b></td>
94
 		      <td style="width: 30%;"><input type="text" id="x1" value="-"></td>
95
        </tr>
96
        <tr>
97
          <td><b>Y<sub>1</sub>:</b></td>
98
          <td><input type="text" id="y1" value="-"></td>
99
        </tr>
100
        <tr>
101
          <td><b>X<sub>2</sub>:</b></td>
102
          <td><input type="text" id="x2" value="-"></td>
103
          <td></td>
104
          <td></td>
105
        </tr>
106
        <tr>
107
          <td><b>Y<sub>2</sub>:</b></td>
108
          <td><input type="text" id="y2" value="-"></td>
109
          <td></td>
110
          <td></td>
111
        </tr>
112
      </tbody>
113
    </table>
114
  </div>
115
	</div>
116
<div style="padding-bottom: 20px;" id="upload-form">
117
<form id="uploadFileToMyFolder" name="userImage" action="/user-image" enctype="multipart/form-data" method="post">
118
	  <label for="isActive">Active / InActive: </label>
119
	  #if ($banner.isIsActive())
120
      <select name="isActive"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
121
	  #else
122
		<select name="isActive"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
123
	  #end
124
      <br></br>
125
	  <label for="imagePath">Image Path: </label>
126
	  <input name="userImage" id="file" type="file">
127
	  <br></br>
128
	  <label for="bannerName">Banner Name: </label>
129
      <input id="bannerName" name="bannerName" value='$banner.getBannerName()'type="text"/>
130
      <br></br>
131
	  <label for="imageName">Image Name: </label>
132
      <input id="imageName" name="imageName" value='$banner.getImageName()'type="text"/>
133
      <br></br>
134
      <label for="link">Link: </label>
135
      <input id="link" name="link" value='$banner.getLink()' type="text"/>
136
	  <br></br>
137
      <label for="priority">Priority: </label>
138
	  <select name="priority">
139
		#foreach( $val in [1..10] )
140
			#if ($val == $banner.getPriority())
141
				<option value='$val' selected="selected">$val</option>
142
			#else
143
				<option value='$val'>$val</option>
144
			#end	
145
		#end
146
		</select>
147
	  <br></br>
148
	  <label for="hasMap">Add Map : </label>
149
	  #if ($banner.isHasMap())
150
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="True">Yes</option><option value="False">No</option></select>
151
	  #else
152
		<select name="hasMap" id="has_Map" onchange="showHide(this)"><option selected="selected" value="False">No</option><option value="True">Yes</option></select>
153
	  #end
154
      <br></br>
155
	  <div id = "image-map-div" align = "left">
156
				<h3>Map Details</h5>
157
                <div id = "image-map-container">
158
					#if (!$banner.isHasMap())
159
						<label>Coordinates : </label>
160
    				    <input id="mapCoordinates" name = "mapCoordinates" type = "textbox"/>
161
					    <br></br>
162
    				    <label>Link : </label>
163
    				    <input id="mapLink" name = "mapLink" type = "textbox"/>
164
					#end
165
					#foreach($mapdetail in $mapdetails)
166
    				<label>Coordinates : </label>
167
    				<input id="mapCoordinates" name = "mapCoordinates" value="$mapdetail.getCoordinates()" type = "text"/>
168
					<br></br>
169
    				<label>Link : </label>
170
    				<input id="mapLink" name = "mapLink" value="$mapdetail.getMapLink()" type = "text"/>
171
					<br></br>
172
					#end
173
                </div>
174
				<img id = "add-map" src = "/images/add.png" />
175
            </div>
176
	  <br>
177
	  <input style="margin-top: 8px;" name="upload" value="Update" type="submit">
178
	  <input id="Action" value="$action.getBannerName()" name="action" style="visibility: hidden;">
179
</form>
180
</div>
181
</body>
182
</html>