]> git.parisson.com Git - telecaster-cgi.git/commitdiff
- fix HTML and CSS bugs
authoryomguy <yomguy@parisson.com>
Tue, 21 Sep 2010 13:32:56 +0000 (13:32 +0000)
committeryomguy <yomguy@parisson.com>
Tue, 21 Sep 2010 13:32:56 +0000 (13:32 +0000)
- put webview out main method

css/telecaster.css
station.py
telecaster.py
webview.py

index b8c6e6a2cc36815c5f3c24c102ddc2fbb00d5ba3..5dc55cbd408fc2360e9f3855afd8227135110c56 100644 (file)
@@ -13,9 +13,9 @@ div.header {
 div.title_main {
         margin-left:42px;
         margin-top:-26px;
-        padding: 0.em;
+        padding: 0em;
         font-size: 1.5em;
-        /* text-decoration: underline; */
+       /*text-decoration: underline;*/
 }
 
 div.bg { background-color: #FFFFFF;
index 7c77c3d396f2c188a0291e8240a88bb187d751ca..3d3a1f9223415f07a7975b0e750b4778bd1a2f97 100644 (file)
@@ -229,6 +229,6 @@ class Station(Conference):
 
     def stop(self):
         self.rec_stop()
-        time.sleep(1)
+        time.sleep(3)
         self.deefuzzer_stop()
         self.del_lock()
index 20df966e2b5ad6c9566877aa690d4816c498cd11..f69e327f77994baec27909de710119c077e986f5 100755 (executable)
@@ -68,25 +68,25 @@ class TeleCaster:
         if not os.path.exists(self.user_dir):
             os.makedirs(self.user_dir)
         self.lock_file = self.user_dir + os.sep + 'telecaster.lock'
+        self.form = WebView(self.conf, version)
 
     def main(self):
         edcast_pid = get_pid('edcast_jack', self.uid)
         deefuzzer_pid = get_pid('/usr/bin/deefuzzer', self.uid)
         writing = edcast_pid != []
         casting = deefuzzer_pid != []
-        form = WebView(self.conf, version)
 
-        if deefuzzer_pid == [] and form.has_key("action") and \
-            form.has_key("department") and form.has_key("conference") and \
-            form.has_key("professor") and form.has_key("comment") and \
-            form["action"].value == "start":
+        if deefuzzer_pid == [] and self.form.has_key("action") and \
+            self.form.has_key("department") and self.form.has_key("conference") and \
+            self.form.has_key("professor") and self.form.has_key("comment") and \
+            self.form["action"].value == "start":
 
             self.conference_dict = {'title': self.title,
-                        'department': form.getfirst("department"),
-                        'conference': form.getfirst("conference"),
-                        'session': form.getfirst("session"),
-                        'professor': form.getfirst("professor"),
-                        'comment': form.getfirst("comment")}
+                        'department': self.form.getfirst("department"),
+                        'conference': self.form.getfirst("conference"),
+                        'session': self.form.getfirst("session"),
+                        'professor': self.form.getfirst("professor"),
+                        'comment': self.form.getfirst("comment")}
 
             s = Station(self.conf_file, self.conference_dict, self.lock_file)
             s.start()
@@ -94,12 +94,12 @@ class TeleCaster:
             time.sleep(2)
             self.main()
 
-        elif deefuzzer_pid != [] and os.path.exists(self.lock_file) and not form.has_key("action"):
+        elif deefuzzer_pid != [] and os.path.exists(self.lock_file) and not self.form.has_key("action"):
             self.conference_dict = get_conference_from_lock(self.lock_file)
-            form.stop_form(self.conference_dict, writing, casting)
+            self.form.stop_form(self.conference_dict, writing, casting)
             self.logger.write_info('page stop')
 
-        elif deefuzzer_pid and form.has_key("action") and form["action"].value == "stop":
+        elif deefuzzer_pid and self.form.has_key("action") and self.form["action"].value == "stop":
             if os.path.exists(self.lock_file):
                 self.conference_dict = get_conference_from_lock(self.lock_file)
             s = Station(self.conf_file, self.conference_dict, self.lock_file)
@@ -109,7 +109,7 @@ class TeleCaster:
             self.main()
 
         elif deefuzzer_pid == []:
-            form.start_form(writing, casting)
+            self.form.start_form(writing, casting)
             self.logger.write_info('page start')
 
 
index cce7e0dd9bb66633b2232686e329ac51ac5f76d0..215934fa87a923bb64bc8ef007eaae853d425e8e 100644 (file)
@@ -101,6 +101,7 @@ class WebView(FieldStorage):
 
         print "<link href=\"/telecaster/css/telecaster.css\" rel=\"stylesheet\" type=\"text/css\">"
 
+    def javascript(self):
         print '<script language="Javascript" type="text/javascript" >'
         print 'function choix(formulaire)'
         print '{var j; var i = formulaire.department.selectedIndex;'
@@ -133,17 +134,16 @@ class WebView(FieldStorage):
         #print "  getRSS(url)"
         #print "  setTimeout(\"rss_reload(\'\" + url + \"\')\", 10000);}"
         #print "</script>"
-
+    
+    def sub_header(self):
         if self.refresh:
             print "<meta http-equiv=\"refresh\" content=\"" + str(self.refresh_value) + "; URL=telecaster.py\">"
-
         print "</HEAD>\n"
-
         #print "<BODY bgcolor =\"#ffffff\" onload=\"rss_reload(\'" + self.rss_url + "\');\">"
         print "<BODY>"
         print "<div class=\"bg\">"
         print "<div class=\"header\">"
-        print "<img src=\"img/logo_telecaster_wh.png\">"
+        print "<img src=\"img/logo_telecaster_wh.png\" alt=\"logo_telecaster\">"
         print "<div class=\"title_main\">&nbsp;TeleCaster - Audio Web Live Recording</div>"
         print "</div>"
 
@@ -211,17 +211,20 @@ class WebView(FieldStorage):
             pass
         print "<tr><td>JACK audio server</td><TD> : </TD>"
         print "<td>%s</td></tr>" % jackd_info
-        print "<td><div class=\"buttons\">"
+        print "<tr><td><div class=\"buttons\">"
         if self.writing:
-            print "<button type=\"submit\" class=\"positive\"><img src=\"img/drive_add.png\" alt=\"\">Recording...</button>"
+            print "<button class=\"positive\"><img src=\"img/drive_add.png\" alt=\"\">Recording...</button>"
         else:
-            print "<button type=\"submit\" class=\"negative\"><img src=\"img/drive_error.png\" alt=\"\">NOT Recording !</button>"
-        print "</div></td><TD> </TD><td><div class=\"buttons\">"
+            print "<button class=\"negative\"><img src=\"img/drive_error.png\" alt=\"\">NOT Recording !</button>"
+        print "</div></td>"
+        print "<TD> </TD>"
+        print "<td><div class=\"buttons\">"
         if self.casting:
-            print "<button type=\"submit\" class=\"positive\"><img src=\"img/transmit_add.png\" alt=\"\">Diffusing...</button>"
+            print "<button class=\"positive\"><img src=\"img/transmit_add.png\" alt=\"\">Diffusing...</button>"
         else:
-            print "<button type=\"submit\" class=\"negative\"><img src=\"img/transmit_error.png\" alt=\"\">NOT Diffusing !</button>"
+            print "<button class=\"negative\"><img src=\"img/transmit_error.png\" alt=\"\">NOT Diffusing !</button>"
         print "</div>"
+        print "</td></tr>"
         print "</table>"
         print "</div>"
 
@@ -232,20 +235,22 @@ class WebView(FieldStorage):
         self.refresh = False
         
         self.header()
+        self.javascript()
+        self.sub_header()
         self.hardware_data()
-        print "<form method=\"post\" action=\"telecaster.py\" name=\"formulaire\">"
+        print "<form method=\"POST\" action=\"telecaster.py\" name=\"formulaire_start\">"
         print "<div class=\"main\">"
         print "<table class=\"form\">"
         print "<TR><TH align=\"left\">Titre</TH><TD> : </TD><TD>"+self.title+"</TD></TR>"
         print "<TR><TH align=\"left\">D&eacute;partement</TH><TD> : </TD>"
         print "<TD><select name=\"department\" onChange=\"choix(this.form)\">"
-        print "<option selected>...........Choisissez un d&eacute;partement...........</option>"
+        print "<option value=\"unknown\">...........Choisissez un d&eacute;partement...........</option>"
         for department in self.departments:
             print "<option value=\""+department['name']+"\">"+department['name']+"</option>"
         print "</select></TD></TR>"
         print "<TR><TH align=\"left\">Conf&eacute;rence</TH><TD> : </TD>"
         print "<TD><select name=\"conference\">"
-        print "<option selected>...........Choisissez une conf&eacute;rence...........</option>"
+        print "<option value=\"unknown\">...........Choisissez une conf&eacute;rence...........</option>"
         for i in range(1,self.conference_nb_max):
             print "<option></option>"
         print "</select></TD></TR>"
@@ -283,7 +288,9 @@ class WebView(FieldStorage):
         self.refresh = True
         
         self.header()
+        self.sub_header()
         self.hardware_data()
+        print "<form method=\"POST\" action=\"telecaster.py\" name=\"formulaire_stop\">"
         print "<div class=\"main\">"
         print "<table class=\"form\">"
         print "<TR><TH align=\"left\">Titre</TH><TD> : </TD><TD>"+self.title+"</TD></TR>"
@@ -295,16 +302,15 @@ class WebView(FieldStorage):
         print "</table>"
         print "</div>"
         print "<div class=\"tools\">"
-        print "<form method=\"post\" action=\"telecaster.py\">"
         print "<div class=\"buttons\">"
-        print "<button type=\"submit\"><img src=\"img/arrow_refresh.png\" alt=\"\">Refresh</button>"
+        print "<button><img src=\"img/arrow_refresh.png\" alt=\"\">Refresh</button>"
         print "<a href=\"http://"+self.url+":"+self.port+"/"+self.mount_point+"\"><img src=\"img/control_play_blue.png\" alt=\"\">Play</a>"
         print "<button type=\"submit\" name=\"action\" value=\"stop\" class=\"negative\"><img src=\"img/cancel.png\" alt=\"\">Stop</button>"
         print "<a href=\"http://"+self.url+"/archives/\"><img src=\"img/folder_go.png\" alt=\"\">Archives</a>"
         print "<a href=\"http://"+self.url+"/trash/\"><img src=\"img/bin.png\" alt=\"\">Trash</a>"
         print "</div>"
-        print "</form>"
         print "</div>"
+        print "</form>"
         self.colophon()
         self.footer()