Subversion Repositories SmartDukaan

Rev

Rev 8590 | Rev 9155 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8590 Rev 8917
Line 1... Line 1...
1
#set($campaignName = $action.getNewsletterName())
1
#set($campaignName = $action.getNewsletterName())
2
#set($campaigns = $action.getCampaigns($campaignName))
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">
3
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
<html>
4
<html>
5
<head>
5
<head>
6
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
-
 
7
<style type="text/css">
6
<style type="text/css">
8
* { font-family: Verdana; font-size: 96%; }
7
* { font-family: Verdana; font-size: 96%; }
9
label {
8
label {
10
float: left;
9
float: left;
11
    width: 150px;
10
    width: 150px;
Line 35... Line 34...
35
  text-align: center;
34
  text-align: center;
36
  font-weight: normal;
35
  font-weight: normal;
37
  margin: 5px;
36
  margin: 5px;
38
}
37
}
39
</style>
38
</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
			$('html').html(data.replace(/<html>(.*)<\/html>/, "$1"));
-
 
52
        },
-
 
53
		 error : function() {
-
 
54
		 	alert("OOPS!!!Failed to do changes.Try Again.");
-
 
55
		 },
-
 
56
        cache: false,
-
 
57
        contentType: false,
-
 
58
        processData: false
-
 
59
    });
-
 
60
 
-
 
61
    return false;
-
 
62
});
-
 
63
});  
-
 
64
</script>
-
 
65
<script type="text/javascript">
-
 
66
$(function(){	
-
 
67
$(".delete").live('click', function(){
-
 
68
	var id = $((this)).attr("id");
-
 
69
	var name = $('#newsletterName').val();
-
 
70
	jQuery.ajax({
-
 
71
		url: "/user-image!deleteCampaign?campaignId="+id+"&newsletterName="+name,
-
 
72
		type: 'POST',
-
 
73
		async: false,
-
 
74
		success: function (data) {
-
 
75
			$('html').html(data.replace(/<html>(.*)<\/html>/, "$1"));
-
 
76
        },
-
 
77
		error : function() {
-
 
78
		 	alert("OOPS!!!Failed to do changes.Try Again.");
-
 
79
		 },
-
 
80
		 cache: false,
-
 
81
        contentType: false,
-
 
82
        processData: false
-
 
83
	});
-
 
84
	return false;	
-
 
85
});
-
 
86
});
-
 
87
</script>
-
 
88
</head>
39
</head>
89
<body>
40
<body>
90
<div id="content">
41
<div id="content">
-
 
42
<a href="/user-image">Back to listing</a>
91
<h3>Upload Campaign Images For $campaignName</h3>
43
<h3>Upload Campaign Images For $campaignName</h3>
92
<div style="color:blue;padding:0px;">
44
<div style="color:blue;padding:0px;">
93
    #sactionmessage()
45
    #sactionmessage()
94
    </div>
46
    </div>
95
    <div style="color:red;padding:0px">
47
    <div style="color:red;padding:0px">
96
    #sactionerror()
48
    #sactionerror()
97
</div>
49
</div>
98
<div style="padding-top: 20px;">
50
<div style="padding-top: 20px;">
-
 
51
<form id="uploadContentFile" action="/user-image!createNewsletter" enctype="multipart/form-data" method="post">
99
<label for="newsletterName">NewsLetter Name : </label>
52
<label for="newsletterName">NewsLetter Name : </label>
100
<input id="newsletterName" name="newsletterName" type="text" value="$campaignName" readonly="readonly"/>
53
<input id="newsletterName" name="newsletterName" type="text" value="$campaignName" readonly="readonly"/>
101
<br></br>
54
<br></br>
102
<form id="uploadContentFile" action="/user-image" enctype="multipart/form-data" method="post">
-
 
103
<label for="imagePath">Image Path : </label>
55
<label for="imagePath">Image Path : </label>
104
<input name="userImage" id="file" type="file" />
56
<input name="userImage" id="file" type="file" />
105
<br></br>
57
<br></br>
106
<label for="imageName">Image Name : </label>
58
<label for="imageName">Image Name : </label>
107
<input id="imageName" name="imageName" type="text"/>
59
<input id="imageName" name="imageName" type="text"/>
-
 
60
<span style="color:red;">*File extention mandatory</span>
108
<br></br>
61
<br></br>
109
<input type="submit" value="Update" name="upload" />
62
<input type="submit" value="Update" name="upload" />
110
</form>
63
</form>
111
</div>
64
</div>
112
<div id="campaign" style="padding-top: 20px;">
65
<div id="campaign" style="padding-top: 20px;">
113
#foreach($campaign in $campaigns)
66
#foreach($campaign in $campaigns)
114
	<div class="img">
67
	<div class="img">
115
		<a target="_blank" href="/images/campaignImages/$campaign.getImageName()"><img src="/images/campaignImages/$campaign.getImageName()" width="200" height="120"></a>
68
		<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>
69
		<div class="desc"><a class="delete" id="$campaign.getId()" href="/user-image!deleteCampaign?campaignId=$campaign.getId()&newsletterName=$campaignName" style="text-align:center;">Delete</a></div>
117
</div>
70
</div>
118
#end
71
#end
119
</div>	
72
</div>	
120
</div>
73
</div>
121
</body>
-
 
122
74
</body>
-
 
75
</html>
-
 
76
123
77