CVS: tmda-cgi ChangeLog,1.73,1.74 EditList.py,1.8,1.9

Jim Ramsay <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv17161

Modified Files:
	ChangeLog EditList.py 
Log Message:
Improved themeability of the list of links for the Lists in the sidebar.  The style is now defined in the theme's 'editlist.html' file.

Also caused this list of links to be alphabetised.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/ChangeLog,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- ChangeLog	6 Dec 2003 22:26:39 -0000	1.73
+++ ChangeLog	8 Dec 2003 20:01:16 -0000	1.74
@@ -1,3 +1,7 @@
+2003-12-08  Jim Ramsay      <[email protected]>
+
+	* Improved the themeability of the editlist page.
+
 2003-12-06  Jim Ramsay      <[email protected]>
 
 	* Improved efficiency for header searching.

Index: EditList.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/EditList.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- EditList.py	23 Aug 2003 18:55:52 -0000	1.8
+++ EditList.py	8 Dec 2003 20:01:17 -0000	1.9
@@ -71,6 +71,7 @@
           Buttons[CgiUtil.ExpandUser(Test[2])] = \
             (Filename, SysButtons["other"])
   Files = Buttons.keys()
+  Files.sort()
 
   if len(Files):
     # Which filter are we editing?
@@ -96,24 +97,48 @@
     T["NoLists"]
     NoneList.Add()
 
-  # Generate button HTML
+  # Generate dynamic list of Lists to edit in the sidebar
   HTML = ""
+  CurrentListEntry = T['CurrentListEntry']
+  ListEntry = T['ListEntry']
   for FileNum in range(len(Files)):
     File = Files[FileNum]
+    listDict = {}
+    listDict['Theme'] = Template.Template.Dict["ThemeDir"]
     if File == EditFile:
-      HTML += '<tr><td><img src="%s/' % Template.Template.Dict["ThemeDir"]
-      HTML += """%(hfn)s" width="%(width)d" height="%(height)d" alt=""" % \
-        Buttons[File][1]
-      HTML += '"%s"></td></tr>\n' % Buttons[File][0]
+      listDict["listGraphicFilename"] = Buttons[File][1]['hfn']
+      listDict["listGraphicHeight"] = Buttons[File][1]['height']
+      listDict["listGraphicWidth"] = Buttons[File][1]['width']
+      listDict["listGraphicAlt"] = Buttons[File][0]
+      listDict["listName"] = os.path.basename(File)
+      HTML += CurrentListEntry % listDict
       T["ListNum"] = FileNum
     else:
-      HTML += '<tr><td><a href="%s?cmd=editlist%d&SID=%s"><img src="%s/' % \
-        (os.environ["SCRIPT_NAME"], FileNum, PVars.SID,
-        Template.Template.Dict["ThemeDir"])
-      HTML += """%(fn)s" border="0" width="%(width)d"
-height="%(height)d" alt=""" % Buttons[File][1]
-      HTML += '"%s"></td></tr>\n' % Buttons[File][0]
+      listDict["listLink"] = "%s?cmd=editlist%d&SID=%s" % (os.environ["SCRIPT_NAME"], FileNum, PVars.SID )
+      listDict["listGraphicFilename"] = Buttons[File][1]['fn']
+      listDict["listGraphicHeight"] = Buttons[File][1]['height']
+      listDict["listGraphicWidth"] = Buttons[File][1]['width']
+      listDict["listGraphicAlt"] = Buttons[File][0]
+      listDict["listName"] = os.path.basename(File)
+      HTML += ListEntry % listDict
+
   T["Lists"] = HTML
+      
+
+    # OLD--------v
+#    if File == EditFile:
+#      HTML += '<tr><td><img src="%s/' % Template.Template.Dict["ThemeDir"]
+#      HTML += """%(hfn)s" width="%(width)d" height="%(height)d" alt=""" % \
+#        Buttons[File][1]
+#      HTML += '"%s"></td></tr>\n' % Buttons[File][0]
+#    else:
+#      HTML += '<tr><td><a href="%s?cmd=editlist%d&SID=%s"><img src="%s/' % \
+#        (os.environ["SCRIPT_NAME"], FileNum, PVars.SID,
+#        Template.Template.Dict["ThemeDir"])
+#      HTML += """%(fn)s" border="0" width="%(width)d"
+#height="%(height)d" alt=""" % Buttons[File][1]
+#      HTML += '"%s"></td></tr>\n' % Buttons[File][0]
+#  T["Lists"] = HTML
 
   # Any subcommand?
   if Form.has_key("subcmd"):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.