diff options
author | Jay Parikh | 2012-07-25 16:32:02 +0530 |
---|---|---|
committer | Jay Parikh | 2012-07-25 16:32:02 +0530 |
commit | 9c1469d5a0230abfaf4fed99a7a7e41d3f21fec6 (patch) | |
tree | 1cdb940bec0e6a1655e033dc6f035987d30c0c0a /stapp/templates/video/home.html | |
parent | 92a7668ae75e6b6244083dc56cdf50567f72086e (diff) | |
download | stproject-9c1469d5a0230abfaf4fed99a7a7e41d3f21fec6.tar.gz stproject-9c1469d5a0230abfaf4fed99a7a7e41d3f21fec6.tar.bz2 stproject-9c1469d5a0230abfaf4fed99a7a7e41d3f21fec6.zip |
fixed the bug which didn't display the information for all modules
Diffstat (limited to 'stapp/templates/video/home.html')
-rw-r--r-- | stapp/templates/video/home.html | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/stapp/templates/video/home.html b/stapp/templates/video/home.html index 80cc29b..3b95d4e 100644 --- a/stapp/templates/video/home.html +++ b/stapp/templates/video/home.html @@ -1,12 +1,11 @@ {% extends "base.html" %} -<!DOCTYPE html> {% block title %} STProject {% endblock %} {% block script %} <script> -function myfunction(video,image,idname,iddesc) +function changeDetail(video,image,idname,iddesc) { document.getElementById('videodescription').innerHTML = document.getElementById(iddesc).value; document.getElementById('videoname').innerHTML = document.getElementById(idname).innerHTML; @@ -35,10 +34,9 @@ function myfunction(video,image,idname,iddesc) <div class="module-list"><h3>{{module.name}}</h3> <h5>{{module.description|safe}}</h5> {% for video in module.video_list.all %} - - <textarea style="display:none;" id=vdesc{{forloop.counter}}>{{video.description}} + <textarea style="display:none;" id=vdesclatest{{forloop.parentloop.counter}}{{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> + <a id='vnamelatest{{forloop.parentloop.counter}}{{forloop.counter}}' href=javascript:changeDetail("{{video.filename.url}}","{{video.image.url}}","vnamelatest{{forloop.parentloop.counter}}{{forloop.counter}}","vdesclatest{{forloop.parentloop.counter}}{{forloop.counter}}");>{{video.name}}</a> @@ -53,7 +51,10 @@ function myfunction(video,image,idname,iddesc) <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}}");>{{video.name}}</a> + <textarea style="display:none;" id=vdesc{{forloop.parentloop.counter}}{{forloop.counter}}>{{video.description}} + </textarea> + <a id='vname{{forloop.parentloop.counter}}{{forloop.counter}}' href=javascript:changeDetail("{{video.filename.url}}","{{video.image.url}}","vname{{forloop.parentloop.counter}}{{forloop.counter}}","vdesc{{forloop.parentloop.counter}}{{forloop.counter}}");>{{video.name}}</a> + <br /> {% endfor %}</div> {% endfor %} |