Guido Draheim avatar Guido Draheim committed e8d80a8

added daypicker to recordinglist

Comments (0)

Files changed (4)

src/dvbcronrecording/core.py

         
         # database commit and return page content
         commit()
-
-        add_stylesheet(req, 'common/css/wiki.css')
-        add_stylesheet(req, PACKAGE+'/css/recordinglist.css')
-        add_script(req, 'common/js/trac.js')
-        add_script(req, 'common/js/wikitoolbar.js')
-        
+       
         if not message: message = translate("fully internationalized")
         # import locale
         # from trac.util.translation import get_negotiated_locale
         data['channelnamelist'] = [ "" ] + self._channelname_list(req)
         data['_'] = translate
 
+        add_stylesheet(req, 'common/css/wiki.css')
+        add_stylesheet(req, '%s/css/recordinglist.css' % (PACKAGE))
+        add_script(req, '%s/js/jquery.ui.datepicker.js' % (PACKAGE))
+        if req.locale:
+            add_script(req, '%s/js/jquery.ui.datepicker-%s.js' % (PACKAGE, req.locale))
+        add_script(req, 'common/js/trac.js')
+        add_script(req, 'common/js/wikitoolbar.js')
         return ('recordinglist.html', data, None)
 
     # ====================================================================

src/dvbcronrecording/htdocs/css/recordinglist.css

  .delete { font-weight: normal; font-size: small; 
            border: 1px solid gray; padding: 1px 3px ;
            background-color: #FDD; }
- 
+
+
+#ui-datepicker-div { background-color: white; }
+.ui-datepicker-header { background-color: #FEE; width: 100%; text-align: both; }
+
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month, 
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;  }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } 
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }

src/dvbcronrecording/templates/recordinglist.html

   </h1>
   <xi:include href="channels_nav.html" />
   <xi:include href="recording_nav.html" />
-  <div>${message}</div><br />
+  <div id="message">${message}</div><br />
 
   <table cellpadding="0" cellspacing="0">
         <tr>
   </div>
   </table>
 </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>
 
 README = spec(RPM, "description")
  
 setup(
-  package_data = { PACKAGE: ['templates/*.html', 'htdocs/css/*.css',  
+  package_data = { PACKAGE: ['templates/*.html', 
+                             'htdocs/css/*.css',  
+                             'htdocs/js/*.js',  
                              "locale/*/LC_MESSAGES/*.mo"]},
   name = PACKAGENAME,
   version = VERSION,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.