[cpif] r80 - in trunk/frontend-web: . skins/default skins/default/body skins/default/footer skins/default/header

svn at argo.es svn at argo.es
Wed May 23 16:32:04 CEST 2007


Author: alvaro
Date: Wed May 23 16:32:02 2007
New Revision: 80

Log:
Un poco de limpieza en la estructura de los skins y en la organizacion
del codigo


Added:
   trunk/frontend-web/skins/default/body_generic.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/default.html
   trunk/frontend-web/skins/default/body_show_thread.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/body_thread.html
   trunk/frontend-web/skins/default/body_show_thread_entry.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/thread_entry.html
   trunk/frontend-web/skins/default/body_threadlist.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/body.html
   trunk/frontend-web/skins/default/body_threadlist_group.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/thread_group.html
   trunk/frontend-web/skins/default/body_threadlist_thread.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/thread.html
   trunk/frontend-web/skins/default/body_threadlist_thread_unread.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/body/thread_unread.html
   trunk/frontend-web/skins/default/footer.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/footer/default.html
   trunk/frontend-web/skins/default/header.html
      - copied unchanged from r79, /trunk/frontend-web/skins/default/header/default.html
Removed:
   trunk/frontend-web/skins/default/body/
   trunk/frontend-web/skins/default/footer/
   trunk/frontend-web/skins/default/header/
Modified:
   trunk/frontend-web/skins.py

Modified: trunk/frontend-web/skins.py
==============================================================================
--- trunk/frontend-web/skins.py	(original)
+++ trunk/frontend-web/skins.py	Wed May 23 16:32:02 2007
@@ -6,15 +6,15 @@
   available_skins = {}
 
   skin_files = {
-      'header': 'header/default.html',
-      'body_thread':   'body/body_thread.html',
-      'thread_entry':   'body/thread_entry.html',
-      'error':   'body/default.html',
-      'body':   'body/body.html',
-      'thread_unread': 'body/thread_unread.html',
-      'thread': 'body/thread.html',
-      'group_date': 'body/thread_group.html',
-      'footer': 'footer/default.html'
+      'header':        'header.html',
+      'body_thread':   'body_show_thread.html',
+      'thread_entry':  'body_show_thread_entry.html',
+      'error':         'body_generic.html',
+      'body':          'body_threadlist.html',
+      'thread_unread': 'body_threadlist_thread_unread.html',
+      'thread':        'body_threadlist_thread.html',
+      'group_date':    'body_threadlist_group.html',
+      'footer':        'footer.html'
       }
 
   __text = []
@@ -37,6 +37,7 @@
     self.__url=""
     self.reset()
     self.__t_count = 0
+    self.__style=["odd","even"]
     self.__dict={
         "version": globales.version,
         "page_title": "cpif",
@@ -81,12 +82,9 @@
   def thread_entries(self,e):
     """Format some entries inside a thread"""
     for msg_num,author,date,text in e:
-      if self.__t_count % 2:
-        format = "even"
-        self.__t_count = 0
-      else:
-        format = "odd"
-        self.__t_count = 1
+      format = self.__style.pop(0)
+      self.__style.append(format)
+
       file = "%s/%s" % (self.available_skins[self.skin], self.skin_files['thread_entry'])
       import time
       aux = self.__load_file(file) % {"msg_num":msg_num, "author":author, "date":time.ctime(date), "text":text,"format":format }
@@ -98,12 +96,9 @@
     # FIXME: No me gusta pasarle el array entero de hilos para hacer la busqueda de la fecha
     if self.__url=="listado hilos":
       for thread,title,not_read in t:
-        if self.__t_count % 2:
-          format = "even"
-          self.__t_count = 0
-        else:
-          format = "odd"
-          self.__t_count = 1
+        format = self.__style.pop(0)
+        self.__style.append(format)
+
         import time
         ts_created=time.ctime(threads[thread]["TS"])
         if not_read:



More information about the cpif mailing list