diff options
author | Jay Parikh | 2012-07-23 15:27:25 +0530 |
---|---|---|
committer | Jay Parikh | 2012-07-23 15:27:25 +0530 |
commit | 92a7668ae75e6b6244083dc56cdf50567f72086e (patch) | |
tree | 261d6365af8c4403e57c89213f06471b3cb8344a | |
parent | 4e91b6ee6bc6a329b7382afabcc233a9e3b6e192 (diff) | |
download | stproject-92a7668ae75e6b6244083dc56cdf50567f72086e.tar.gz stproject-92a7668ae75e6b6244083dc56cdf50567f72086e.tar.bz2 stproject-92a7668ae75e6b6244083dc56cdf50567f72086e.zip |
modification to change the description and name of the video being played
-rw-r--r-- | stapp/templates/video/home.html | 19 | ||||
-rw-r--r-- | stapp/video/views.py | 1 |
2 files changed, 12 insertions, 8 deletions
diff --git a/stapp/templates/video/home.html b/stapp/templates/video/home.html index 275a77a..80cc29b 100644 --- a/stapp/templates/video/home.html +++ b/stapp/templates/video/home.html @@ -6,15 +6,12 @@ {% block script %} <script> -function myfunction(video,image) +function myfunction(video,image,idname,iddesc) { - //document.getElementById('videoname').innerHTML= videoname; - //alert(v); + document.getElementById('videodescription').innerHTML = document.getElementById(iddesc).value; + document.getElementById('videoname').innerHTML = document.getElementById(idname).innerHTML; document.getElementById('mainvideo').poster = image; document.getElementById('mainvideo').src = video; - - //document.getElementById('videodescription').innerHTML= " " + v; - } </script> {% endblock %} @@ -38,7 +35,13 @@ function myfunction(video,image) <div class="module-list"><h3>{{module.name}}</h3> <h5>{{module.description|safe}}</h5> {% for video in module.video_list.all %} - <a href=javascript:myfunction("{{video.filename.url}}","{{video.image.url}}");javascript:document.getElementById('videoname').innerHTML={{video.name}}; >{{video.name}}</a> + + <textarea style="display:none;" id=vdesc{{forloop.counter}}>{{video.description}} + </textarea> + <a id='vname{{forloop.counter}}' href=javascript:myfunction("{{video.filename.url}}","{{video.image.url}}","vname{{forloop.counter}}","vdesc{{forloop.counter}}");>{{video.name}}</a> + + + <br /> {% endfor %}</div> {% endfor %} @@ -50,7 +53,7 @@ function myfunction(video,image) <div class="module-list"><h3>{{module.name}}</h3> <h5>{{module.description|safe}}</h5> {% for video in module.video_list.all %} - <a href=javascript:myfunction("{{video.filename.url}}","{{video.image.url}}");javascript:document.getElementById('videoname').innerHTML={{video.name}}; >{{video.name}}</a> + <a href=javascript:myfunction("{{video.filename.url}}","{{video.image.url}}");>{{video.name}}</a> <br /> {% endfor %}</div> {% endfor %} diff --git a/stapp/video/views.py b/stapp/video/views.py index 544c2b0..8b7240d 100644 --- a/stapp/video/views.py +++ b/stapp/video/views.py @@ -15,6 +15,7 @@ def show(request): latest_modules = Module.objects.order_by('-modified')[0:3] all_modules = Module.objects.order_by('modified') + context = { 'latest_modules' : latest_modules , 'play' : latest_video, 'all_modules':all_modules} return render(request, 'video/home.html', context) |