Subversion Repositories SmartDukaan

Rev

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

Rev 1378 Rev 2720
Line 42... Line 42...
42
}
42
}
43
</style>
43
</style>
44
<script>
44
<script>
45
$(document).ready(function() {
45
$(document).ready(function() {
46
    $("#f").validate();
46
    $("#f").validate();
47
	
-
 
48
		$("input[name='mediatype']").change(function()
-
 
49
        {
-
 
50
         
-
 
51
		var newradio= $("input[name='mediatype']:checked")[0];
-
 
52
		
-
 
53
		
-
 
54
		if(newradio.value == "image"){
-
 
55
			
-
 
56
			$("#youtubeURL").hide("fast");
-
 
57
			$("#youtubelabel").hide("fast");
-
 
58
			
-
 
59
			$("#pic").show("fast");
-
 
60
			$("#piclabel").show("fast");
-
 
61
			
-
 
62
			$("#videotype").hide("fast");
-
 
63
			$("#videotypelabel").hide("fast");
-
 
64
		}
-
 
65
		else
-
 
66
		{
-
 
67
			
-
 
68
			$("#youtubeURL").show("fast");
-
 
69
			$("#youtubelabel").show("fast");
-
 
70
			
-
 
71
			$("#pic").hide("fast");
-
 
72
			$("#piclabel").hide("fast");
-
 
73
			
-
 
74
			$("#videotype").show("fast");
-
 
75
			$("#videotypelabel").show("fast");
-
 
76
		}
-
 
77
		
-
 
78
 
47
 
79
        });
48
    $('#mediaType').change(function()
80
		
49
    {
-
 
50
        var newselect = $("#mediaType option:selected").val();
81
 
51
 
-
 
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
        }
82
    
60
    });
83
});
61
});
84
 
62
 
85
</script>
63
</script>
86
</head>
64
</head>
87
<body>
65
<body>
88
<div>
66
<div>
89
    <h1>$action.getEntityID() - All Media</h1>
67
    <h1>$action.getEntityID() - All Media</h1>
90
    <form id="f" name="f" action="/content/media" method="post" enctype="multipart/form-data">
68
    <form id="f" name="f" action="/content/media" method="post" enctype="multipart/form-data">
-
 
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 >
91
		<label>Media type:</label>
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 >
92
		<input type="radio" name="mediatype" id="mediatype" value="image" checked> Image
112
                    <input type="file" name="upload"   id="file" value=""/>
93
		<input type="radio" name="mediatype" id="mediatype" value="video"> Video<br>
113
                    <input type="text" name="location" id="text" value="" style="display:none" class="url"/>
-
 
114
                </td>
-
 
115
            </tr>
-
 
116
        </table>
94
 
117
 
95
        <label id="">* Label:</label>
-
 
96
        <input type="text" name="label" id="label" class="required" value=""/><p/>
-
 
97
		<label id="titlelabel">* Title:</label>
-
 
98
        <input type="text" name="title" id="title" value=""/><p/>
-
 
99
		<label id="piclabel">Image file:</label>
-
 
100
        <input type="file" name="pic" id="pic" value=""/><p/>
-
 
101
		
-
 
102
		<label id="youtubelabel" style="display:none">Youtube URL:</label>
-
 
103
        <input type="text" style="display:none" name="youtubeURL" id="youtubeURL" class="url" value=""/><p/>
-
 
104
		<label id="videotypelabel" style="display:none" >Video type:</label>
-
 
105
		<div id="videotype" style="display:none" >
-
 
106
		<input type="radio" name="videoType" id="videotype" value="withskin" checked> With Skin
-
 
107
		<input type="radio" name="videoType" id="videotype" value="withoutskin" > Without Skin<br>
-
 
108
		</div>		
-
 
109
        
-
 
110
        <input type="hidden" name="entityID" value="$action.getEntityID()">
118
        <input type="hidden" name="entityID" value="$action.getEntityID()">
111
		<input type="hidden" name="slideID" value="$action.getSlideID()">	
119
        <input type="hidden" name="slideID" value="$action.getSlideID()">   
112
        <input type="submit" name="imageupload" value="Save">
120
        <input type="submit" name="imageupload" value="Save">
113
    </form>
121
    </form>
114
    <p></p>
122
    <p></p>
115
    <table>
123
    <table>
116
        <thead>
124
        <thead>
117
            <tr style="border: 1px">
125
            <tr style="border: 1px">
118
                <th>#</th>
126
                <th>#</th>
119
                <th>Label</th>
127
                <th>Label</th>
120
                <th>Type</th>
128
                <th>Type</th>
121
				<th>Title</th>
129
                <th>Title</th>
122
				<th>File Name</th>
-
 
123
                <th>Video Type</th>
130
                <th>Location</th>
124
				<th></th>
131
                <th></th>
125
            </tr>
132
            </tr>
126
        </thead>
133
        </thead>
127
        <tbody>
134
        <tbody>
128
			
-
 
129
 
-
 
130
#foreach( $label in $medias.keySet() )
-
 
131
    <li>Key: $key -> Value: $medias.get($key)</li>
-
 
132
#end
-
 
133
 
-
 
134
	#set ( $allmedia = $action.getAllMedia() )
135
            #set ( $allmedia = $action.getAllMedia() )
135
    #foreach ( $label in $allmedia.keySet() )
136
            #foreach ( $label in $allmedia.keySet() )
136
		#set($media = $allmedia.get($label))
137
                #set($media = $allmedia.get($label))
137
            <tr style="border: 1px">
138
                    <tr style="border: 1px">
138
                <td>$velocityCount</td>
139
                        <td>$velocityCount</td>
139
                <td>$media.getLabel()</td>
140
                        <td>$media.getLabel()</td>
140
                <td>$media.getType()</td>
141
                        <td>$media.getType().name()</td>
141
				<td>$media.getTitle()</td>
142
                        <td>$media.getTitle()</td>
142
                #if($media.getType() == "image")
143
                        #if($media.getType().getInputType() == "file")
143
                <td><a href="/db/media/$action.getEntityID()/$media.getFileName()" target="_blank">$media.getFileName()</a></td>
144
                            <td><a href="/db/media/$action.getEntityID()/$media.getFileName()" target="_blank">$media.getFileName()</a></td>
144
                #else
145
                        #else
145
                <td><a href="$media.getLocation()" target="_blank">$media.getLocation()</a></td>
146
                            <td><a href="$media.getLocation()" target="_blank">$media.getLocation()</a></td>
146
				#end
-
 
147
				<td>
-
 
148
				#if($media.getType() == "youtube")
-
 
149
					$media.getVideoType()
147
                        #end
150
				#end
-
 
151
				</td>
-
 
152
                <td><a href="/content/media/id?_method=delete&entityID=$action.getEntityID()&slideID=$action.getSlideID()&label=$media.getEncodedLabel()">Delete</a></td>
148
                        <td><a href="/content/media/id?_method=delete&entityID=$action.getEntityID()&slideID=$action.getSlideID()&label=$media.getEncodedLabel()">Delete</a></td>
153
            </tr>
149
                    </tr>
154
    #end
150
            #end
155
        </tbody>
151
        </tbody>
156
    </table>
152
    </table>
157
</div>
153
</div>
158
</body>
154
</body>
159
</html>
155
</html>