]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: Added direct play/download button to the finished recordings tab
authorJaroslav Kysela <perex@perex.cz>
Wed, 18 Jun 2014 07:35:59 +0000 (09:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 18 Jun 2014 07:35:59 +0000 (09:35 +0200)
src/webui/static/app/dvr.js

index cdc8f43c0ab8e661e5c6d975a472f50edbaa460a..7ca5daa8d0875fe7b0ffa47c2ecb064336c0906c 100644 (file)
@@ -212,19 +212,31 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
         return tvheadend.dvrprio.getById(value).data.name;
     }
 
-    var dvrCm = new Ext.grid.ColumnModel([actions, {
-            width: 250,
-            id: 'title',
-            header: "Title",
-            sortable: true,
-            dataIndex: 'title'
-        }, {
-            width: 100,
-            id: 'episode',
-            header: "Episode",
-            sortable: true,
-            dataIndex: 'episode'
-        }, {
+    var cols = [actions];
+    if (iconCls === 'television')
+        cols.push({
+            width: 40,
+            header: "Play",
+            renderer: function(v, o, r) {
+                return "<a href='" + r.data['url'] + "'>Play</a>";
+            }
+        });
+    cols.push({
+        width: 250,
+        id: 'title',
+        header: "Title",
+        sortable: true,
+        dataIndex: 'title'
+    });
+    cols.push({
+        width: 100,
+        id: 'episode',
+        header: "Episode",
+        sortable: true,
+        dataIndex: 'episode'
+    });
+    if (iconCls === 'clock')
+        cols.push({
             width: 100,
             id: 'pri',
             header: "Priority",
@@ -232,29 +244,34 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
             dataIndex: 'pri',
             renderer: renderPri,
             hidden: iconCls !== 'clock'
-        }, {
-            width: 100,
-            id: 'start',
-            header: iconCls === 'clock' ? "Start" : "Date/Time",
-            sortable: true,
-            dataIndex: 'start',
-            renderer: renderDate
-        }, {
-            width: 100,
-            hidden: true,
-            id: 'end',
-            header: "End",
-            sortable: true,
-            dataIndex: 'end',
-            renderer: renderDate
-        }, {
-            width: 100,
-            id: 'duration',
-            header: "Duration",
-            sortable: true,
-            dataIndex: 'duration',
-            renderer: renderDuration
-        }, {
+        });
+    cols.push({
+        width: 100,
+        id: 'start',
+        header: iconCls === 'clock' ? "Start" : "Date/Time",
+        sortable: true,
+        dataIndex: 'start',
+        renderer: renderDate
+    });
+    cols.push({
+        width: 100,
+        hidden: true,
+        id: 'end',
+        header: "End",
+        sortable: true,
+        dataIndex: 'end',
+        renderer: renderDate
+    });
+    cols.push({
+        width: 100,
+        id: 'duration',
+        header: "Duration",
+        sortable: true,
+        dataIndex: 'duration',
+        renderer: renderDuration
+    });
+    if (iconCls === 'television')
+        cols.push({
             width: 100,
             id: 'filesize',
             header: "Filesize",
@@ -262,20 +279,24 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
             dataIndex: 'filesize',
             renderer: renderSize,
             hidden: iconCls !== 'television'
-        }, {
-            width: 250,
-            id: 'channel',
-            header: "Channel",
-            sortable: true,
-            dataIndex: 'channel'
-        }, {
-            width: 200,
-            id: 'creator',
-            header: "Created by",
-            sortable: true,
-            hidden: true,
-            dataIndex: 'creator'
-        }, {
+        });
+    cols.push({
+        width: 250,
+        id: 'channel',
+        header: "Channel",
+        sortable: true,
+        dataIndex: 'channel'
+    });
+    cols.push({
+        width: 200,
+        id: 'creator',
+        header: "Created by",
+        sortable: true,
+        hidden: true,
+        dataIndex: 'creator'
+    });
+    if (iconCls === 'clock')
+        cols.push({
             width: 200,
             id: 'config_name',
             header: "DVR Configuration",
@@ -290,14 +311,18 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
             },
             dataIndex: 'config_name',
             hidden: iconCls !== 'clock'
-        }, {
+        });
+    if (iconCls === 'exclamation')
+        cols.push({
             width: 200,
             id: 'status',
             header: "Status",
             sortable: true,
             dataIndex: 'status',
             hidden: iconCls !== 'exclamation'
-        }]);
+        });
+
+    var dvrCm = new Ext.grid.ColumnModel({columns: cols});
 
     function addEntry() {