Commits

Guido Draheim committed a9ef2ca

with _selection

  • Participants
  • Parent commits 85c79df

Comments (0)

Files changed (3)

File src/dvbcronrecording/channelsconf.py

         
         newchannels_list = self._newchannels_list(cursor, req)
         channels_list = self._channelsconf_list(cursor, req, channeltype)
-        channeltypelist = ["all channel types", "radio channels", "video channels"]
+        channeltypelist = ["all channel types",
+                           "data channels", 
+                           "radio channels", 
+                           "video channels"]
 
         # passing variables to template
         data = {}
         data["channeltype"] = channeltype
         data["channeltypelist"] = channeltypelist
         data['new_datalist'] = newchannels_list
+        data['_selection'] = "channeltype="+quote2(channeltype)
         data["_pagenum"] = req.args.get("_pagenum", "0")
         data["_pagesize"] = req.args.get("_pagesize", "10")
         data['datalist'] = Paginator(channels_list, int(data["_pagenum"]), int(data["_pagesize"]))
     """
       Returns list of the channels.conf
     """
-    def _channelsconf_list(self, cursor, req, type1 = None):
+    def _channelsconf_list(self, cursor, req, channeltype = None):
         view = ['adapter']
         cols = ['adapter', 'title','frequency','polarity','source','symbolrate','vpid', 'apid', 'tpid']
         sql = "SELECT %s FROM recording_channelsconf" % (",".join(cols))
             if req.args.has_key(col):
                 view_vals += [ aff(req.args[col], "recording_channelsconf", col) ]
                 view_cols += [ col ]
-        if type1 in [ "audio", "video", "radio channels", "video channels" ]:
+        if channeltype in [ "audio", "video", "radio channels", "video channels" ]:
             type_cols += ["apid > 0"]
-        if type1 in [ "video", "video channels" ]:
+        elif channeltype in [ "data", "data channels"]:
+            type_cols += ["apid = 0"]
+        if channeltype in [ "video", "video channels" ]:
             type_cols += ["vpid > 0"]
-        elif type1 in [ "audio", "radio channels"]:
+        elif channeltype in [ "audio", "radio channels"]:
             type_cols += ["vpid = 0"]
         if view_cols:
             view_sql = " WHERE " + (" AND ".join([" %s = %%s" % col for col in view_cols ]))

File src/dvbcronrecording/messages.de.po

 msgid "radio channels"
 msgstr "Radiokanäle"
 
+msgid "data channels"
+msgstr "Datenkanäle"
+
 msgid "all channel types"
 msgstr "Alle Sendekanäle"
 

File src/dvbcronrecording/templates/paginator_datalist.html

   <ul class="pages">
     <li py:for="pagenum in xrange(datalist.num_pages)">
     <span class="${pagenum == datalist.page and 'selected' or ''}">
-      <a href="${href(req.path_info)}?_pagenum=${pagenum}&amp;_pagesize=${_pagesize}">${pagenum+1}</a>
+      <a href="${href(req.path_info)}?_pagenum=${pagenum}&amp;_pagesize=${_pagesize}&amp;${_selection}">${pagenum+1}</a>
     </span>
     </li>
   </ul>
     <li py:for="max_per_page in [10,25,200,1000, datalist.num_items]">
     <span class="${max_per_page == datalist.max_per_page and 'selected' or ''}" py:if="datalist.num_items >= max_per_page">
       <span py:if="datalist.num_items == max_per_page">${_(' of ')}</span>
-      <a href="${href(req.path_info)}?_pagenum=${datalist.page * datalist.max_per_page / max_per_page}&amp;_pagesize=${max_per_page}">${max_per_page}</a>
+      <a href="${href(req.path_info)}?_pagenum=${datalist.page * datalist.max_per_page / max_per_page}&amp;_pagesize=${max_per_page}&amp;${_selection}">${max_per_page}</a>
     </span>
     </li>
   </ul>${_('entries')})