Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
208 naveen 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
<head>
7
<title>$action.getEntityID() - All Media</title>
212 naveen 8
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
9
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
208 naveen 10
<style type="text/css">
212 naveen 11
 
12
* { font-family: Verdana; font-size: 96%; }
13
label { width: 10em; float: left; }
14
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
15
p { clear: both; }
16
.submit { margin-left: 12em; }
17
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
18
 
208 naveen 19
table {
20
    border-width: 1px 1px 1px 1px;
21
    border-spacing: 2px;
22
    border-style: outset outset outset outset;
23
    border-color: gray gray gray gray;
24
    border-collapse: separate;
25
    background-color: white;
26
}
27
th {
28
    border-width: 1px 1px 1px 1px;
29
    padding: 1px 1px 1px 1px;
30
    border-style: inset inset inset inset;
31
    border-color: gray gray gray gray;
32
    background-color: white;
33
    -moz-border-radius: 0px 0px 0px 0px;
34
}
35
td {
36
    border-width: 1px 1px 1px 1px;
37
    padding: 1px 1px 1px 1px;
38
    border-style: inset inset inset inset;
39
    border-color: gray gray gray gray;
40
    background-color: white;
41
    -moz-border-radius: 0px 0px 0px 0px;
42
}
43
</style>
212 naveen 44
<script>
45
$(document).ready(function() {
46
    $("#f").validate();
480 rajveer 47
 
2720 mandeep.dh 48
    $('#mediaType').change(function()
49
    {
50
        var newselect = $("#mediaType option:selected").val();
480 rajveer 51
 
2720 mandeep.dh 52
        if(newselect == "IMAGE" || newselect == "DOCUMENT") {
53
            $("#file").show("fast");
54
            $("#text").hide("fast");
55
        }
56
        else {
57
            $("#file").hide("fast");
58
            $("#text").show("fast");
59
        }
60
    });
212 naveen 61
});
62
 
63
</script>
208 naveen 64
</head>
65
<body>
66
<div>
67
    <h1>$action.getEntityID() - All Media</h1>
212 naveen 68
    <form id="f" name="f" action="/content/media" method="post" enctype="multipart/form-data">
2720 mandeep.dh 69
        <table>
70
            <colgroup >
71
                <col width="100"/>
72
                <col width="300"/>
73
                <col width="*"/>
74
            </colgroup>
75
            <tr >
76
                <td >
77
                    <label id="">* Label:</label>
78
                </td>
79
                <td >
80
                    <input type="text" name="label" id="label" class="required" value=""/><p/>
81
                </td>
82
            </tr>
83
            <tr >
84
                <td >
85
                    <label id="titlelabel">* Title:</label>
86
                </td>
87
                <td >
88
                    <input type="text" name="title" id="title" value=""/><p/>
89
                </td>
90
            </tr>
91
            <tr >
92
                <td >
93
                    <label>Media type:</label>
94
                </td>
95
                <td >
96
                    <select name="mediaType" id="mediaType">
97
                    #foreach( $mediaType in $action.getMediaTypes() )
98
                        #if($mediaType.name() == "IMAGE")
99
                            <option value="$mediaType.name()" selected="selected">$mediaType.name()</option>
100
                        #else
101
                            <option value="$mediaType.name()">$mediaType.name()</option>
102
                        #end
103
                    #end
104
                    </select>
105
                </td>
106
            </tr>
107
            <tr >
108
                <td >
109
                    <label>Location:</label>
110
                </td>
111
                <td >
112
                    <input type="file" name="upload"   id="file" value=""/>
113
                    <input type="text" name="location" id="text" value="" style="display:none" class="url"/>
114
                </td>
115
            </tr>
116
        </table>
480 rajveer 117
 
208 naveen 118
        <input type="hidden" name="entityID" value="$action.getEntityID()">
2720 mandeep.dh 119
        <input type="hidden" name="slideID" value="$action.getSlideID()">   
208 naveen 120
        <input type="submit" name="imageupload" value="Save">
121
    </form>
122
    <p></p>
123
    <table>
124
        <thead>
125
            <tr style="border: 1px">
126
                <th>#</th>
127
                <th>Label</th>
128
                <th>Type</th>
2720 mandeep.dh 129
                <th>Title</th>
130
                <th>Location</th>
131
                <th></th>
208 naveen 132
            </tr>
133
        </thead>
134
        <tbody>
2720 mandeep.dh 135
            #set ( $allmedia = $action.getAllMedia() )
136
            #foreach ( $label in $allmedia.keySet() )
137
                #set($media = $allmedia.get($label))
138
                    <tr style="border: 1px">
139
                        <td>$velocityCount</td>
140
                        <td>$media.getLabel()</td>
141
                        <td>$media.getType().name()</td>
142
                        <td>$media.getTitle()</td>
143
                        #if($media.getType().getInputType() == "file")
144
                            <td><a href="/db/media/$action.getEntityID()/$media.getFileName()" target="_blank">$media.getFileName()</a></td>
145
                        #else
146
                            <td><a href="$media.getLocation()" target="_blank">$media.getLocation()</a></td>
147
                        #end
148
                        <td><a href="/content/media/id?_method=delete&entityID=$action.getEntityID()&slideID=$action.getSlideID()&label=$media.getEncodedLabel()">Delete</a></td>
149
                    </tr>
150
            #end
208 naveen 151
        </tbody>
152
    </table>
153
</div>
154
</body>
155
</html>