Subversion Repositories SmartDukaan

Rev

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

<!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>$action.getEntityID() - All Media</title>
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
<style type="text/css">

* { font-family: Verdana; font-size: 96%; }
label { width: 10em; float: left; }
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
p { clear: both; }
.submit { margin-left: 12em; }
em { font-weight: bold; padding-right: 1em; vertical-align: top; }

table {
    border-width: 1px 1px 1px 1px;
    border-spacing: 2px;
    border-style: outset outset outset outset;
    border-color: gray gray gray gray;
    border-collapse: separate;
    background-color: white;
}
th {
    border-width: 1px 1px 1px 1px;
    padding: 1px 1px 1px 1px;
    border-style: inset inset inset inset;
    border-color: gray gray gray gray;
    background-color: white;
    -moz-border-radius: 0px 0px 0px 0px;
}
td {
    border-width: 1px 1px 1px 1px;
    padding: 1px 1px 1px 1px;
    border-style: inset inset inset inset;
    border-color: gray gray gray gray;
    background-color: white;
    -moz-border-radius: 0px 0px 0px 0px;
}
</style>
<script>
$(document).ready(function() {
    $("#f").validate();
        
                $("input[name='mediatype']").change(function()
        {
         
                var newradio= $("input[name='mediatype']:checked")[0];
                
                
                if(newradio.value == "image"){
                        
                        $("#youtubeURL").hide("fast");
                        $("#youtubelabel").hide("fast");
                        
                        $("#pic").show("fast");
                        $("#piclabel").show("fast");
                        
                        $("#videotype").hide("fast");
                        $("#videotypelabel").hide("fast");
                }
                else
                {
                        
                        $("#youtubeURL").show("fast");
                        $("#youtubelabel").show("fast");
                        
                        $("#pic").hide("fast");
                        $("#piclabel").hide("fast");
                        
                        $("#videotype").show("fast");
                        $("#videotypelabel").show("fast");
                }
                

        });
                

    
});

</script>
</head>
<body>
<div>
    <h1>$action.getEntityID() - All Media</h1>
    <form id="f" name="f" action="/content/media" method="post" enctype="multipart/form-data">
                <label>Media type:</label>
                <input type="radio" name="mediatype" id="mediatype" value="image" checked> Image
                <input type="radio" name="mediatype" id="mediatype" value="video"> Video<br>

        <label id="">* Label:</label>
        <input type="text" name="label" id="label" class="required" value=""/><p/>
                <label id="titlelabel">* Title:</label>
        <input type="text" name="title" id="title" value=""/><p/>
                <label id="piclabel">Image file:</label>
        <input type="file" name="pic" id="pic" value=""/><p/>
                
                <label id="youtubelabel" style="display:none">Youtube URL:</label>
        <input type="text" style="display:none" name="youtubeURL" id="youtubeURL" class="url" value=""/><p/>
                <label id="videotypelabel" style="display:none" >Video type:</label>
                <div id="videotype" style="display:none" >
                <input type="radio" name="videoType" id="videotype" value="withskin" checked> With Skin
                <input type="radio" name="videoType" id="videotype" value="withoutskin" > Without Skin<br>
                </div>          
        
        <input type="hidden" name="entityID" value="$action.getEntityID()">
                <input type="hidden" name="slideID" value="$action.getSlideID()">       
        <input type="submit" name="imageupload" value="Save">
    </form>
    <p></p>
    <table>
        <thead>
            <tr style="border: 1px">
                <th>#</th>
                <th>Label</th>
                <th>Type</th>
                                <th>Title</th>
                                <th>File Name</th>
                <th>Video Type</th>
                                <th></th>
            </tr>
        </thead>
        <tbody>
                        

#foreach( $label in $medias.keySet() )
    <li>Key: $key -> Value: $medias.get($key)</li>
#end

        #set ( $allmedia = $action.getAllMedia() )
    #foreach ( $label in $allmedia.keySet() )
                #set($media = $allmedia.get($label))
            <tr style="border: 1px">
                <td>$velocityCount</td>
                <td>$media.getLabel()</td>
                <td>$media.getType()</td>
                                <td>$media.getTitle()</td>
                #if($media.getType() == "image")
                <td><a href="/db/media/$action.getEntityID()/$media.getFileName()" target="_blank">$media.getFileName()</a></td>
                #else
                <td><a href="$media.getLocation()" target="_blank">$media.getLocation()</a></td>
                                #end
                                <td>
                                #if($media.getType() == "youtube")
                                        $media.getVideoType()
                                #end
                                </td>
                <td><a href="/content/media/$media.getEncodedLabel()?_method=delete&entityID=$action.getEntityID()&slideID=$action.getSlideID()">Delete</a></td>
            </tr>
    #end
        </tbody>
    </table>
</div>
</body>
</html>