| 8578 |
kshitij.so |
1 |
#set($campaignName = $action.getNewsletterName())
|
|
|
2 |
#set($campaigns = $action.getCampaigns($campaignName))
|
|
|
3 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
4 |
<html>
|
|
|
5 |
<head>
|
|
|
6 |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
|
|
|
7 |
<style type="text/css">
|
|
|
8 |
* { font-family: Verdana; font-size: 96%; }
|
|
|
9 |
label {
|
|
|
10 |
float: left;
|
|
|
11 |
width: 150px;
|
|
|
12 |
}
|
|
|
13 |
select {
|
|
|
14 |
width: 100px;
|
|
|
15 |
}
|
|
|
16 |
div.img
|
|
|
17 |
{
|
|
|
18 |
margin: 5px;
|
|
|
19 |
padding: 5px;
|
|
|
20 |
border: 1px solid #0000ff;
|
|
|
21 |
height: auto;
|
|
|
22 |
width: auto;
|
|
|
23 |
float: left;
|
|
|
24 |
text-align: center;
|
|
|
25 |
}
|
|
|
26 |
div.img img
|
|
|
27 |
{
|
|
|
28 |
display: inline;
|
|
|
29 |
margin: 5px;
|
|
|
30 |
border: 1px solid #ffffff;
|
|
|
31 |
}
|
|
|
32 |
div.img a:hover img {border: 1px solid #0000ff;}
|
|
|
33 |
div.desc
|
|
|
34 |
{
|
|
|
35 |
text-align: center;
|
|
|
36 |
font-weight: normal;
|
|
|
37 |
margin: 5px;
|
|
|
38 |
}
|
|
|
39 |
</style>
|
|
|
40 |
<script type="text/javascript">
|
|
|
41 |
$(function(){
|
|
|
42 |
$("#uploadContentFile").live('submit', function(){
|
|
|
43 |
var formData = new FormData($(this)[0]);
|
|
|
44 |
var name = $('#newsletterName').val();
|
|
|
45 |
jQuery.ajax({
|
|
|
46 |
url: "/user-image!createNewsletter?newsletterName="+name,
|
|
|
47 |
type: 'POST',
|
|
|
48 |
data: formData,
|
|
|
49 |
async: false,
|
|
|
50 |
success: function (data) {
|
|
|
51 |
alert("Changes propagated successfully");
|
|
|
52 |
window.location.reload();
|
|
|
53 |
$('#uploadContentFile')[0].reset();
|
|
|
54 |
},
|
|
|
55 |
error : function() {
|
|
|
56 |
alert("OOPS!!!Failed to do changes.Try Again.");
|
|
|
57 |
},
|
|
|
58 |
cache: false,
|
|
|
59 |
contentType: false,
|
|
|
60 |
processData: false
|
|
|
61 |
});
|
|
|
62 |
|
|
|
63 |
return false;
|
|
|
64 |
});
|
|
|
65 |
});
|
|
|
66 |
</script>
|
|
|
67 |
<script type="text/javascript">
|
|
|
68 |
$(function(){
|
|
|
69 |
$(".delete").live('click', function(){
|
|
|
70 |
var id = $((this)).attr("id");
|
|
|
71 |
jQuery.ajax({
|
|
|
72 |
url: "/user-image!deleteCampaign?campaignId="+id,
|
|
|
73 |
type: 'POST',
|
|
|
74 |
success: function (data) {
|
|
|
75 |
alert("Changes propagated successfully");
|
|
|
76 |
window.location.reload();
|
|
|
77 |
},
|
|
|
78 |
error : function() {
|
|
|
79 |
alert("OOPS!!!Failed to do changes.Try Again.");
|
|
|
80 |
},
|
|
|
81 |
cache: false,
|
|
|
82 |
contentType: false,
|
|
|
83 |
processData: false
|
|
|
84 |
});
|
|
|
85 |
return false;
|
|
|
86 |
});
|
|
|
87 |
});
|
|
|
88 |
</script>
|
|
|
89 |
</head>
|
|
|
90 |
<body>
|
|
|
91 |
<h3>Upload Campaign Images For $campaignName</h3>
|
|
|
92 |
<div style="display: none;" class="msgSuccess">
|
|
|
93 |
<p style="font-size: 12px; color: green;">Image Uploaded Sucessfully</p>
|
|
|
94 |
</div>
|
|
|
95 |
<div style="display: none;" class="msgError">
|
|
|
96 |
<p style="font-size: 12px; color: red;">Image Failed to upload</p>
|
|
|
97 |
</div>
|
|
|
98 |
<div style="padding-top: 20px;">
|
|
|
99 |
<label for="newsletterName">NewsLetter Name : </label>
|
|
|
100 |
<input id="newsletterName" name="newsletterName" type="text" value="$campaignName" readonly="readonly"/>
|
|
|
101 |
<br></br>
|
|
|
102 |
<form id="uploadContentFile" action="/user-image" enctype="multipart/form-data" method="post">
|
|
|
103 |
<label for="imagePath">Image Path : </label>
|
|
|
104 |
<input name="userImage" id="file" type="file" />
|
|
|
105 |
<br></br>
|
|
|
106 |
<label for="imageName">Image Name : </label>
|
|
|
107 |
<input id="imageName" name="imageName" type="text"/>
|
|
|
108 |
<br></br>
|
|
|
109 |
<input type="submit" value="Update" name="upload" />
|
|
|
110 |
</form>
|
|
|
111 |
</div>
|
|
|
112 |
<div id="campaign" style="padding-top: 20px;">
|
|
|
113 |
#foreach($campaign in $campaigns)
|
|
|
114 |
<div class="img">
|
|
|
115 |
<a target="_blank" href="/images/campaignImages/$campaign.getImageName()"><img src="/images/campaignImages/$campaign.getImageName()" width="200" height="120"></a>
|
|
|
116 |
<div class="desc"><a class="delete" id="$campaign.getId()" href="#" style="text-align:center;">Delete</a></div>
|
|
|
117 |
</div>
|
|
|
118 |
#end
|
|
|
119 |
</div>
|
|
|
120 |
|
|
|
121 |
</body>
|