[xiph-commits] r3224 - in arkaiv/trunk: . arkaiv/controllers arkaiv/model arkaiv/templates data/templates

dcrowdy at svn.annodex.net dcrowdy at svn.annodex.net
Wed Sep 5 20:03:52 PDT 2007


Author: dcrowdy
Date: 2007-09-05 20:03:52 -0700 (Wed, 05 Sep 2007)
New Revision: 3224

Added:
   arkaiv/trunk/arkaiv/templates/playlists.mak
   arkaiv/trunk/arkaiv/templates/playlistview.mak
Modified:
   arkaiv/trunk/TODO
   arkaiv/trunk/arkaiv/controllers/page.py
   arkaiv/trunk/arkaiv/controllers/page.pyc
   arkaiv/trunk/arkaiv/model/__init__.py
   arkaiv/trunk/arkaiv/model/__init__.pyc
   arkaiv/trunk/arkaiv/model/cmmlparser.py
   arkaiv/trunk/arkaiv/model/cmmlparser.pyc
   arkaiv/trunk/arkaiv/templates/autohandler
   arkaiv/trunk/arkaiv/templates/searchresults.mak
   arkaiv/trunk/data/templates/autohandler.py
   arkaiv/trunk/data/templates/autohandler.pyc
Log:
Basic playlists for clips implemented.


Modified: arkaiv/trunk/TODO
===================================================================
--- arkaiv/trunk/TODO	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/TODO	2007-09-06 03:03:52 UTC (rev 3224)
@@ -1,12 +1,16 @@
 TODO
 
-Implement addition of ogg file tag information.
+Add end time field to clips table in database
 
-Implement removal of meta tags from the head.
+Check whether a collection name already exists before adding.
 
-When going to an item from a clip link on the search results page, any
-subsequent attempts to jump to clips fail.  Fix.
+Check whether a playlist name already exists before adding.
 
+Check whether a file name already exists before copying a new item into the
+archive.
+
+Implement addition of ogg file tag information.
+
 Just been at a coding gathering at Silvia Pfeiffer's house, and Marcin Lubonski
 suggested it'd be good to be able to locally annotate remote media.  A feature
 well worth considering.  The idea of leaving the media files in their original
@@ -23,20 +27,27 @@
 
 DONE 
 
+
+Tue Sep  4 09:36:51 EST 2007
+Implement removal of meta tags from the head.
+
+When going to an item from a clip link on the search results page, any
+subsequent attempts to jump to clips fail.  Fix.
+
+
 Thu Aug 30 09:43:10 EST 2007
-
 Better screen layout in the main display page needed
 
 Handle whitespace in a source file name - doesn't do this at all at the moment
 
 Clips should have an image generated for the link display
 
+
 Mon Aug 27 11:09:20 EST 2007
-
 Should really rename anxParser to cmmlParser, as that is what it is...
 
+
 Sat Aug 25 10:05:09 EST 2007
-
 Shoud be able to edit the item title - question is whether it should be the
 same as the head title.
 
@@ -47,17 +58,19 @@
 it as a separate class?  Quite a bit of cleaning up to do with functions that
 pass a cmmlfile name variable into functions of that class.
 
+
 Fri Aug 24 12:04:05 EST 2007
-
 The local dir import function needs to have the meta tag syncing ability added
 to it - ie get it in line with the add media function.
 
+
 Thu Aug 23 09:40:06 EST 2007
 Fix the clip annotation function, so that the cmml source is parsed and
 modified.
 
 When adding a head meta tag - no id is given; need to sync that up too.
 
+
 General policy notes
 ====================
 

Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/arkaiv/controllers/page.py	2007-09-06 03:03:52 UTC (rev 3224)
@@ -82,6 +82,63 @@
 
         return render('/addannodexform.mak')
 
+    def playlistpage(self):
+        """ controller for the main playlist listing page
+
+        """
+        c.playlists=model.getplaylists()
+        return render('/playlists.mak')
+
+    def addplaylist(self):
+        """ Controller to add a new playlist
+
+        """
+        model.addnewplaylist(request.params['newplaylist'])
+        c.playlists = model.getplaylists()
+        return render('/playlists.mak')
+
+    def addtoplaylist(self):
+        nclips = int(request.params['numclips'])
+        playlist = request.params['playlist']
+        print playlist
+        for i in range(nclips):
+            try:
+                clipid = request.params[str(i)]
+                model.addcliptoplaylist(playlist, clipid)
+            #    print clipid
+            except:
+                pass
+
+        return
+
+    def displayplaylist(self):
+        # Need to extract appropriate info for the playlist selected
+        playlistid = int(request.params['id'])
+        
+        clips = model.getclipsfromplaylist(playlistid)
+        print clips
+        # send a list of dictionaries to the template
+        c.cliplist = []
+        for clip in clips:
+            clipdict = {}
+            item = model.getitemforclip(clip.ixc)
+            sourceid = model.getsourcesforitem(item.ixi)
+            oggsource = model.getsourcepath(sourceid)
+            #print oggsource
+            cmmlfile = model.getitemcmmlfile(item.ixi)
+            #print cmmlfile
+            urlpath = split(cmmlfile, path_base)
+            # Now split off the extension
+            urlpath = os.path.splitext(urlpath[1])[0]
+            #clipimageurl = media_url_base + os.path.dirname(urlpath) + "/"
+            #print clipimageurl
+            clipdict['id'] = clip.ixc
+            clipdict['url'] = media_url_base + urlpath + ".anx" + "?id=" + clip.id
+            print clipdict['url']
+            c.cliplist.append(clipdict)
+
+        return render('/playlistview.mak')
+
     def addannodexindirform(self):
         collectionlist = model.getcollections()
         c.collectioninfo = ""
@@ -142,6 +199,7 @@
         else:
             sourcedict['clipdetail'] = "?id=" + c.playclip
 
+#        sourcedict['urlpath'] = url['base'] +    # + "?id=" + c.playclip
         sourcedict['urlpath'] = url   # + "?id=" + c.playclip
         sourcedict['clipimageurl'] = clipimageurl
         # now get some source info:
@@ -243,7 +301,8 @@
         # Get a list of clip dictionary objects
         cliplist = model.getclipinfoforitem(clip['itemid'])
         parser = cmmlParser()
-        parser.addclipstocmmlfile(cmmlfile, cliplist)
+        parser.setcmmlfilename(cmmlfile)
+        parser.addclipstocmmlfile(cliplist)
         redirect_to(action='displayitem', id=clip['itemid'], 
                     playclip=clip['id'], edit="yes")
 
@@ -255,7 +314,8 @@
         cmmlfile = model.getitemcmmlfile(itemid)
         cliplist = model.getclipinfoforitem(itemid)
         parser = cmmlParser()
-        parser.addclipstocmmlfile(cmmlfile, cliplist)
+        parser.setcmmlfilename(cmmlfile)
+        parser.addclipstocmmlfile(cliplist)
 
         redirect_to(action='displayitem', id=itemid, edit="yes")
 
@@ -315,7 +375,7 @@
         # Get the title for the item (head title)
         parser = cmmlParser()
         parser.setcmmlfilename(newcmmlname)
-        title = parser.gettitle(newcmmlname) 
+        title = parser.gettitle() 
         # adding an item here, even though we don't actually have the source
         # anx file in place yet...
         newanxname = basename + ".anx"
@@ -323,7 +383,7 @@
 
         # Need to update the source tag in the cmml file 
         parser.updatesourcetag(newoggname)
-        parser.addmetaid(newcmmlname, newitemid) 
+        parser.addmetaid(newitemid) 
 
         # Once the meta tag addition has been added to pyannodex, this stuff
         # can be replaced.
@@ -346,7 +406,10 @@
                 print "getting a clip image"
                 #clipdict['img_src'] = ""
                 try:
-                    clipdict['img_src'] = self.__createimageforclip(newcmmlname, clipdict)
+                    # this fails very badly - stopping the web server even, so 
+                    # has been disabled for the moment.
+                    print "multiple clip image import disabled for now"
+#                    clipdict['img_src'] = self.__createimageforclip(newcmmlname, clipdict)
                 except:
                     print "problem with clip image for id " + str(clipdict['itemid'])
                     clipdict['img_src'] = ""
@@ -409,6 +472,13 @@
             result['item'] = model.getitemforclip(clipid) 
             c.clips.append(result)
 
+        # we want to be able to add found items to a playlist
+        c.playlists=model.getplaylists()
+        c.playlistinfo = ""
+        for playlist in c.playlists:
+            c.playlistinfo = c.playlistinfo + "<option>" + playlist.name + "</option>"
+            
+
         return render('/searchresults.mak')
 
     def editheadmetaname(self):
@@ -462,7 +532,7 @@
         # Get the title for the item (head title)
         parser = cmmlParser()
         parser.setcmmlfilename(newcmmlname)
-        title = parser.gettitle(newcmmlname) 
+        title = parser.gettitle() 
         # adding an item here, even though we don't actually have the source
         # anx file in place yet...
         basename = os.path.splitext(newoggname)[0]
@@ -471,7 +541,7 @@
         newitemid = model.addsource(title, newoggname, newcmmlname)
        # Need to update the source tag in the cmml file 
         parser.updatesourcetag(newoggname)
-        parser.addmetaid(newcmmlname, newitemid) 
+        parser.addmetaid(newitemid) 
  
         headinfo = {}
         headinfo['itemid']= newitemid 
@@ -556,3 +626,19 @@
 
         redirect_to(action='displayitem', id=itemid, edit="yes")
 
+    def __geturlforcmmlfile(self, cmmlfile, clipid):
+        """ Given a cmml filename and clipid (optional), returns
+            url information - a base path and the clip id detail
+        """
+        url={}
+        urlpath = split(cmmlfile, path_base)
+        urlpath = os.path.splitext(urlpath[1])[0]
+        #clipimageurl = media_url_base + os.path.dirname(urlpath) + "/"
+        url['base'] = media_url_base + urlpath + ".anx"
+        if clipid=="":
+            url['clipdetail'] = ""
+        else:
+            url['clipdetail'] = "?id=" + clipid
+
+        return url
+

Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/model/__init__.py
===================================================================
--- arkaiv/trunk/arkaiv/model/__init__.py	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/arkaiv/model/__init__.py	2007-09-06 03:03:52 UTC (rev 3224)
@@ -41,6 +41,19 @@
 	sqla.Column('ixi', sqla.Integer, sqla.ForeignKey('items.ixi'))
 )
 
+playlists_table = sqla.Table('playlists', sac.metadata,
+    sqla.Column('ixp', sqla.Integer, primary_key=True),
+    sqla.Column('name', sqla.String())
+)
+
+playlist_items_table = sqla.Table('playlist_items', sac.metadata,
+    sqla.Column('ixpi', sqla.Integer, primary_key=True),
+    sqla.Column('ixp', sqla.Integer(), sqla.ForeignKey('playlists.ixp')),
+    sqla.Column('ixi', sqla.Integer(), sqla.ForeignKey('items.ixi')),
+    sqla.Column('ixc', sqla.Integer(), sqla.ForeignKey('clips.ixc'))
+)
+
+
 sources_table = sqla.Table('sources', sac.metadata,
 	sqla.Column('ixs', sqla.Integer, primary_key=True),
 	sqla.Column('path', sqla.String())
@@ -156,6 +169,14 @@
     def __str__(self):
         return self.name
 
+class Playlist(object):
+    def __str__(self):
+        return self.name
+
+class Playlistitems(object):
+    def __str__(self):
+        return self.name
+
 class Source(object):
     def __str__(self):
         return self.name
@@ -216,6 +237,13 @@
                            secondary = collection_items_table)},
                            extension=sac.ext)
 
+
+sqla.mapper(Playlist, playlists_table, extension=sac.ext)
+
+sqla.mapper(Playlistitems, playlist_items_table, extension=sac.ext)
+
+#sqla.mapper(Collection, collections_table, extension=sac.ext)
+
 sqla.mapper(Source, sources_table, properties = {
 	'my_items' : sqla.relation(Item, secondary = item_sources_table)
 	},
@@ -268,6 +296,50 @@
     sac.session.flush()
     return itemlist
 
+def getplaylists():
+    """ Return a list of all current playlists
+
+    """
+    play = playlists_table
+    p = play.select().execute().fetchall()
+    return p
+
+def addnewplaylist(name):
+    """ Add a new named playlist to the database
+
+    """
+    newplaylist = Playlist()
+    newplaylist.name = name
+    sac.session.flush()
+    return
+
+def addcliptoplaylist(list, clipid):
+    # get the id for the list
+    p_q = sac.query(Playlist)
+    p = p_q.get_by(name=list)
+    # get the item id:
+    ic_q = sac.query(Itemclips)
+    ic = ic_q.get_by(ixc=clipid)
+    # add an entry to playlist_items
+    pi = Playlistitems()
+    pi.ixc = clipid
+    pi.ixi = ic.ixi
+    pi.ixp = p.ixp
+
+    sac.session.flush()
+    return
+
+def getclipsfromplaylist(listid):
+    pi_q = sac.query(Playlistitems)
+    pi = pi_q.filter_by(ixp=listid)
+    c_q = sac.query(Clip)
+    cliplist = []
+    for item in pi:
+        c = c_q.get_by(ixc=item.ixc)
+        cliplist.append(c)
+        
+    return cliplist
+
 def addsource(itemname, source, cmmlfile):
     new_item = Item()
     new_source = Source()
@@ -357,7 +429,7 @@
     return sid 
 
 def getsourcepath(id):
-    """ get the source path given an itemid
+    """ get the source path given a sourceid
 
         Returns the source path
      """

Modified: arkaiv/trunk/arkaiv/model/__init__.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/model/cmmlparser.py
===================================================================
--- arkaiv/trunk/arkaiv/model/cmmlparser.py	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/arkaiv/model/cmmlparser.py	2007-09-06 03:03:52 UTC (rev 3224)
@@ -10,16 +10,19 @@
         return
 
     def setcmmlfilename(self, filename):
+        """ parses a cmml file and sets up the basic tree
+
+        """
         self.cmmlfilename = filename
         self.Etree = ElementTree
         self.doc = self.Etree.parse(self.cmmlfilename)
         self.root = self.doc.getroot()
         return
 
-    def runcommand(self, cmd):
-        runit = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        out, err = runit.communicate()
-        print out + err
+#    def runcommand(self, cmd):
+#        runit = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+#        out, err = runit.communicate()
+#        print out + err
 
 
     def edithead(self, headid, text):
@@ -34,7 +37,10 @@
         self.doc.write(self.cmmlfilename)
         return
 
-    def addmetaid(self, cmmlfile, id):
+    def addmetaid(self, id):
+        """ Adds a meta tag to the head that matches the itemid
+            in the database
+        """
         head = self.root.getiterator('head')
         
         for h in head:
@@ -46,7 +52,9 @@
         return
     
     def addmetaitem(self, metadict):
-
+        """ Given a dictionary of meta info, adds a meta element to
+            the head of the cmmlfile
+        """
         head = self.root.getiterator('head')
         
         for h in head:
@@ -58,11 +66,9 @@
         return
 
     def updatesourcetag(self, sourcename):
-        # updates the source file location in the cmml file
-#        Etree = ElementTree
-#        doc = Etree.parse(cmmlfilename)
-#        root = doc.getroot()
-        
+        """ Updates the source file location in the cmml file
+
+        """
         stream = self.root.getiterator('stream')
         for s in stream:
             i = s.find('import')
@@ -71,10 +77,11 @@
         self.doc.write(self.cmmlfilename)
         return
 
-    def gettitle(self, cmmlfilename):
-        Etree = ElementTree
-        doc = Etree.parse(cmmlfilename)
-        root = doc.getroot()
+    def gettitle(self):
+        """ Returns the title (from the head) of the cmml file
+
+        """
+        root = self.doc.getroot()
         head = root.getiterator('head')
         for h in head:
             t = h.find('title')
@@ -111,9 +118,6 @@
         """ given a cmmlfile, returns a list of the meta tags in the head
 
         """
-        #Etree = ElementTree
-        #doc = Etree.parse(cmmlfilename)
-        #root = doc.getroot()
         head = self.root.getiterator('head')
         metalist = []
         for h in head:
@@ -128,11 +132,12 @@
 
         return metalist
 
-    def addclipstocmmlfile(self, cmmlfile, cliplist):
-
-        Etree = ElementTree
-        doc = Etree.parse(cmmlfile)
-        root = doc.getroot()
+    def addclipstocmmlfile(self, cliplist):
+        """ Given a list of dictionary objects representing clips, removes
+            the old list of clips from the cmml file, then writes a new list.
+            Note that the cliplist is assumed to be in temporal order
+        """
+        root = self.doc.getroot()
         # First, we get rid of the old list of clips from the cmml
         clips = root.getiterator('clip')
         for c in clips:
@@ -140,16 +145,15 @@
 
        # Now we write the new clips back
         for clip in cliplist:
-            newclip = Etree.SubElement(root, 'clip')
-#            newclip.set('id', clip['id'])
+            newclip = self.Etree.SubElement(root, 'clip')
             newclip.set('start', str(clip['start_time']))
             newclip.set('id', str(clip['id']))
-            img = Etree.SubElement(newclip, 'img')
+            img = self.Etree.SubElement(newclip, 'img')
             img.set('src', str(clip['img_src']))
-            desc = Etree.SubElement(newclip, 'desc')
+            desc = self.Etree.SubElement(newclip, 'desc')
             desc.text = clip['desc']
         
-        doc.write(cmmlfile)
+        self.doc.write(self.cmmlfilename)
         return
 
     def syncheadmetas(self, metalist):
@@ -157,9 +161,7 @@
 
             Returns nothing - that's probably a _bad thing_
         """
-        Etree = ElementTree
-        doc = Etree.parse(self.cmmlfilename)
-        root = doc.getroot()
+        root = self.doc.getroot()
         head = root.getiterator('head')
         for h in head:
             mlist = h.findall('meta')
@@ -170,18 +172,19 @@
         head = root.getiterator('head')
         for h in head:
             for meta in metalist:
-                newmeta = Etree.SubElement(h, 'meta')
+                newmeta = self.Etree.SubElement(h, 'meta')
                 newmeta.set('id', str(meta.id))
                 newmeta.set('name', meta.name)
                 newmeta.set('content', meta.content)
 
-        doc.write(self.cmmlfilename)
+        self.doc.write(self.cmmlfilename)
         return
 
     def editmeta(self, metaid, field, text):
-        Etree = ElementTree
-        doc = Etree.parse(self.cmmlfilename)
-        root = doc.getroot()
+        """ Edits a meta tag, given the field (name or content) and the
+            text for that element
+        """
+        root = self.doc.getroot()
         head = root.getiterator('head')
         for h in head:
             mlist = h.findall('meta')
@@ -189,10 +192,13 @@
                 if m.get('id') == metaid:
                     m.set(field, text)
 
-        doc.write(self.cmmlfilename)
+        self.doc.write(self.cmmlfilename)
         return
 
     def createnewfile(self, sourcefilename, oggsourcename):
+        """ Creates a new cmmlfile from scratch, given just source file
+            information
+        """
         Etree = ElementTree
         root = Etree.Element('cmml')
         stream = Etree.SubElement(root, 'stream')
@@ -206,13 +212,13 @@
 
         return
 
-    def __getelementiterator(self, element):
-        Etree = ElementTree
-        doc = Etree.parse(self.cmmlfilename)
-        root = doc.getroot()
-        
-        elementiterator = root.getiterator(element)
-        return
+#    def __getelementiterator(self, element):
+#        Etree = ElementTree
+#        doc = Etree.parse(self.cmmlfilename)
+#        root = doc.getroot()
+#        
+#        elementiterator = root.getiterator(element)
+#        return
 
 #    def addheadmetas(metalist):
 #        root = self.doc.getroot()

Modified: arkaiv/trunk/arkaiv/model/cmmlparser.pyc
===================================================================
(Binary files differ)

Modified: arkaiv/trunk/arkaiv/templates/autohandler
===================================================================
--- arkaiv/trunk/arkaiv/templates/autohandler	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/arkaiv/templates/autohandler	2007-09-06 03:03:52 UTC (rev 3224)
@@ -13,6 +13,7 @@
   <li>${ h.link_to("All Items", h.url(action="mainpage")) }</li>
   <li>${ h.link_to("Collections", h.url(action="collections")) }</li>
   <li>${ h.link_to("Add media", h.url(action="addannodexform")) }</li>
+  <li>${ h.link_to("Playlists", h.url(action="playlistpage")) }</li>
   <li>${ h.link_to("Help", h.url(action="displayhelp")) }</li>
   <li><span class="searchpadding">
 ${ h.form(h.url(action='search'), multipart=True) }

Added: arkaiv/trunk/arkaiv/templates/playlists.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/playlists.mak	                        (rev 0)
+++ arkaiv/trunk/arkaiv/templates/playlists.mak	2007-09-06 03:03:52 UTC (rev 3224)
@@ -0,0 +1,20 @@
+<%inherit file="/autohandler"/> 
+<h2>
+Playlists
+</h2>
+
+% for p in c.playlists:
+<li>
+${ h.link_to(p.name, h.url(action="displayplaylist", id=p.ixp))}
+${p.ixp}
+${p.name}
+</li>
+% endfor
+
+<hr>
+Add new playlist:
+${ h.form(h.url(action='addplaylist'), multipart=True) } 
+${ h.text_field('newplaylist') }
+${ h.submit('Add') } 
+${ h.end_form() } 
+

Added: arkaiv/trunk/arkaiv/templates/playlistview.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/playlistview.mak	                        (rev 0)
+++ arkaiv/trunk/arkaiv/templates/playlistview.mak	2007-09-06 03:03:52 UTC (rev 3224)
@@ -0,0 +1,88 @@
+<%inherit file="/autohandler"/> 
+<h2>
+Playlist view
+</h2>
+
+<form name="clips">
+% for clip in c.cliplist:
+<label for="${clip['id']}">
+<input id="${clip['id']}" type="checkbox" name="list" value="${clip['url']}" checked/>
+${clip['url']}
+</label>
+<br>
+% endfor
+</form>
+<embed type="application/liboggplay" src="${c.cliplist[0]['url']}" width=320 height=240/>
+
+<form name="api">
+<input type="button" value="Play" onclick='Play()'/>
+<input type="button" value="Pause" onclick='Pause()'/>
+<input type="button" value="Playlist next" onclick='PlaylistNext()'/>
+<input type="button" value="Playlist prev" onclick='PlaylistPrev()'/>
+<br>
+<textarea name="ofield" cols="60" rows="9"></textarea>
+<br>
+<input type="text" name="ifield" size="20"/>
+
+</form>
+
+<script>
+var plugin = document.embeds[0];
+var input  = document.api.ifield;
+var output = document.api.ofield;
+var clips = document.clips.list;
+
+addOutput("clips length is " + clips.length);
+
+for (i=1; i < clips.length; i++) {
+	addOutput(clips[i].value)
+	addOutput("in the loop" + i)
+	plugin.appendMovie(clips[i].value)
+}
+
+GetPlaylistLength();
+
+function Play() {
+  plugin.play();
+  addOutput("Play!");
+}
+
+function Pause() {
+  plugin.pause();
+  addOutput("Pause!");
+}
+
+function GetPlaylistLength() {
+  addOutput("Playlist length: " + plugin.getPlaylistLength());
+}
+
+function PlaylistNext() {
+  addOutput("Playing next movie - " +
+            (plugin.playlistNext() ? "succeeded" : "failed"));
+}
+
+function PlaylistPrev() {
+  addOutput("Playing prev movie - " +
+            (plugin.playlistPrev() ? "succeeded" : "failed"));
+}
+
+var outLines = 0;
+
+function addOutput(str) {
+  if (outLines == 0) {
+    output.value = str;
+  } else {
+    output.value = str + "\n" + output.value;
+  }
+  outLines++;
+  if (outLines == 11) {
+    i = output.value.lastIndexOf("\n");
+    output.value = output.value.substr(0, i);
+    outLines--;
+  }
+
+}
+
+</script>
+<hr>
+

Modified: arkaiv/trunk/arkaiv/templates/searchresults.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/searchresults.mak	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/arkaiv/templates/searchresults.mak	2007-09-06 03:03:52 UTC (rev 3224)
@@ -28,16 +28,32 @@
 <hr>
 Clips:
 <table>
+<form name='clips' action='addtoplaylist'>
 <tr>
 <td>id</td>
 <td>desc</td>
 <td></td>
 </tr>
+<%
+i = 0
+%>
 % for clipresult in c.clips:
 <tr>
 <td>${clipresult['clip'].id}</td>
 <td>${clipresult['clip'].desc}</td>
 <td>${ h.link_to(clipresult['item'].name, h.url(action="displayitem", edit="no", id=clipresult['item'].ixi, playclip=clipresult['clip'].id))}</td>
+<td><input type='checkbox' name='${i}' value='${clipresult['clip'].ixc}'></td>
+<td>${i}</td>
 </tr>
+<%
+i = i + 1
+%>
 % endfor
 </table>
+Playlist:
+${ h.select("playlist", c.playlistinfo)}
+
+${ h.hidden_field('numclips', value=i) }
+${ h.submit('Add') } 
+</form>
+

Modified: arkaiv/trunk/data/templates/autohandler.py
===================================================================
--- arkaiv/trunk/data/templates/autohandler.py	2007-09-05 01:53:26 UTC (rev 3223)
+++ arkaiv/trunk/data/templates/autohandler.py	2007-09-06 03:03:52 UTC (rev 3224)
@@ -1,7 +1,7 @@
 from mako import runtime, filters, cache
 UNDEFINED = runtime.UNDEFINED
 _magic_number = 2
-_modified_time = 1188780210.5353839
+_modified_time = 1188983566.0871749
 _template_filename=u'/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/autohandler'
 _template_uri=u'/autohandler'
 _template_cache=cache.Cache(__name__, _modified_time)
@@ -30,18 +30,21 @@
         context.write(unicode( h.link_to("Add media", h.url(action="addannodexform")) ))
         context.write(u'</li>\n  <li>')
         # SOURCE LINE 16
+        context.write(unicode( h.link_to("Playlists", h.url(action="playlistpage")) ))
+        context.write(u'</li>\n  <li>')
+        # SOURCE LINE 17
         context.write(unicode( h.link_to("Help", h.url(action="displayhelp")) ))
         context.write(u'</li>\n  <li><span class="searchpadding">\n')
-        # SOURCE LINE 18
+        # SOURCE LINE 19
         context.write(unicode( h.form(h.url(action='search'), multipart=True) ))
         context.write(u'\n')
-        # SOURCE LINE 19
+        # SOURCE LINE 20
         context.write(unicode( h.text_field('searchterms', value="Search") ))
         context.write(u' \n')
-        # SOURCE LINE 20
+        # SOURCE LINE 21
         context.write(unicode( h.end_form() ))
         context.write(u' \n  </span>\n  </li>\n</ul>\n</div>\n</p>\n\n        <!--div class="content"-->\n')
-        # SOURCE LINE 28
+        # SOURCE LINE 29
         context.write(unicode(next.body()))
         context.write(u'\n        <p class="footer">\n        </p>\n        <!--/div-->\n    </body>\n</html>\n\n')
         return ''

Modified: arkaiv/trunk/data/templates/autohandler.pyc
===================================================================
(Binary files differ)



More information about the commits mailing list