Source

trac-dvbcronrecording-plugin / src / dvbcronrecording / templates / recordinglist.html

Full commit
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <xi:include href="macros.html" />
<head><title>${title}</title></head>
<body>
<div id="ctxtnav" class="nav">
</div>

<div id="content" class="recordinglist">
  <h1>
    ${title}
  </h1>
  <xi:include href="channels_nav.html" />
  <xi:include href="recording_nav.html" />
  <div id="message">${message}</div><br />

  <table cellpadding="0" cellspacing="0">
        <tr>
      <th>&nbsp;</th>
      <th class="id">#</th>
      <th class="channel">${_('channel')}</th>
      <th class="newtime">${_('starts')}</th>
      <th class="endtime">${_('ends')}</th>
      <th class="extratime">${_('extra')}</th>
      <th class="weekday">${_('weekday')}</th>
      <th class="onlydate">${_('onlydate')}</th>
      <th class="status">${_('status')} / ${_('prio')}</th>
      <!-- </tr><tr> 
      <th class="title">title</th>
      <th class="action">action</th>
       -->
      </tr>
      
    <py:if test="perm.has_permission('DVBREC_LIST_APPEND')">
    <div py:for="item in defaults">
    <form method="post" action="${href.recording('newentry')}">
      <tr>
      <td class="id new" colspan="2">${_('NEW')}</td>
      <td class="channel"><select name="channelname">
        <option py:for="name in channelnamelist" 
                value="${name}" selected="${ (name == item.channelname) or None}">
                ${name}
        </option> 
      </select></td>
      <!-- 
      <td class="channel"><input type="text" name="channelname" value="${item.channelname}"></input></td>
       -->
      <td class="newtime"><input type="text" name="newtime" value="${item.newtime}"></input></td>
      <td class="endtime"><input type="text" name="endtime" value="${item.endtime}"></input></td>
      <td class="extratime"><input type="text" name="extratime" value="${item.extratime}"></input></td>
      <td class="weekday"><select name="weekday">
        <option py:for="name in sorted(weekdaynames)" 
                value="${name}" selected="${ (name == item.weekday) or None}">
                ${weekdaynames[name]}
        </option> 
      </select></td>
      <td class="onlydate"><input type="text" name="onlydate" value="${item.onlydate}"></input></td>
      <td class="status"><select name="status">
        <option py:for="name in sorted(statusnames)" 
                value="${name}" selected="${ (name == item.status) or None}">
                ${statusnames[name]}
        </option>
      </select><select name="priority">
        <option py:for="name in sorted(prioritynames)" 
                value="${name}" selected="${ (name == item.priority) or None}">
                ${prioritynames[name]}
        </option>
      </select></td>
      </tr><tr>
      <td align="right" colspan="2">&nbsp;&#x21AA;&nbsp;</td>
      <td colspan="6" class="title"><input type="text" name="title" value="${item.title}"></input></td>
      <td class="action"><input type="submit" value="${_('insert')}"></input></td>
      </tr>
     </form></div>    
    </py:if>
  
  <div py:for="item in recordings">
  <form method="post" action="${href.recording('update')}">
    <tr class="status${item.status}">
      <!-- 
      <td class="delaction">
        <py:if test="perm.has_permission('DVBREC_LIST_DELETE')">
          <a href="${href.recording('delete')}?id=${item.id}">
                <span class="delete">
                   &#x2716;
                </span>           
          </a>
        </py:if>              
       </td>
      -->       
      <td class="id" colspan="2">
        <a title="${item.channelname}">${item.id}</a>
        <input type="hidden" name="id" value="${item.id}"></input></td>
      <td class="channel"><select name="channelname">
        <option py:for="name in channelnamelist" 
                value="${name}" selected="${ (name == item.channelname) or None}">
                ${name}
        </option> 
      </select>
      </td>
      <!--
       <td class="channel"><input type="text" name="channelname" value="${item.channelname}"></input></td>
       -->
      <td class="newtime"><input type="text" name="newtime" value="${item.newtime}"></input></td>
      <td class="endtime"><input type="text" name="endtime" value="${item.endtime}"></input></td>
      <td class="extratime"><input type="text" name="extratime" value="${item.extratime}"></input></td>
      <td class="weekday"><select name="weekday">
        <option py:for="name in sorted(weekdaynames)" 
                value="${name}" selected="${ (name == item.weekday) or None}">
                ${weekdaynames[name]}
        </option> 
      </select></td>
      <td class="onlydate"><input type="text" name="onlydate" value="${item.onlydate}"></input></td>
      <td class="status"><select name="status">
        <option py:for="name in sorted(statusnames)" 
                value="${name}" selected="${ (name == item.status) or None}">
                ${statusnames[name]}
        </option>
      </select><select name="priority">
        <option py:for="name in sorted(prioritynames)" 
                value="${name}" selected="${ (name == item.priority) or None}">
                ${prioritynames[name]}
        </option>
      </select>
        <py:if test="perm.has_permission('DVBREC_LIST_DELETE')">
          <a href="${href.recording('delete')}?id=${item.id}">
                <span class="delete">
                   &#x2716;
                </span>           
                <!--  <span class="actionbuttion">${_('delete')}</span>  -->
          </a>
        </py:if>              
      </td>
   </tr><tr class="status${item.status}">
      <td align="right" colspan="2">&nbsp;&#x21AA;&nbsp;</td>
      <td colspan="6" class="title"><input type="text" name="title" value="${item.title}"></input></td>
      <td class="action">
        <input type="submit" value="${_('update')}" class="actionbutton" />
      </td>
    </tr>
    </form>
  </div>
  </table>
  <div>
    <div class="deleteold">
      <a href="${href.recording('deleteold')}">${_('delete old singular recording times')}</a>
     </div>
  </div>
</div>
<script><!--
function parentsUntil(node, selector) {
    var N = node;
    if (N && $(N).is(selector)) return N; else N = $(N).parent();
    if (N && $(N).is(selector)) return N; else N = $(N).parent();
    if (N && $(N).is(selector)) return N; else N = $(N).parent();
    if (N && $(N).is(selector)) return N; else N = $(N).parent();
    //if (N && $(N).is(selector)) return N; else N = $(N).parent();
    //if (N && $(N).is(selector)) return N; else N = $(N).parent();
    return N;
}
$(function() {
    $( ".onlydate input" ).datepicker({
    	onClose: function(dateText, inst) {
            var date = $(this).datepicker('getDate');
            var weekday = $.datepicker.formatDate('D', date);
            var form = parentsUntil(this, "tr");
            var select = $(".weekday select", form);
            var choose = "";
            $("option", select).each(function() {
            	if ($(this).text().trim() == (weekday)) {
           	    choose = $(this).val();
            	} 
            });
            if (choose != "")
                select.val(choose);
    	}
    });
});
--></script>
<hr />
</body></html>