Changeset 1150

Show
Ignore:
Timestamp:
01/15/08 14:02:46 (4 years ago)
Author:
william
Message:

changes after code review

Location:
Branches/wljohnston/starting_ie/TurtolCMS
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Branches/wljohnston/starting_ie/TurtolCMS/ConfigProcs.py

    r1026 r1150  
    195195  if theme != "NoTheme": 
    196196    theme = "/tcms/themes/%s" % theme 
     197   
     198  #dynamically set copyright date 
     199  import datetime 
     200  currentYear = datetime.date.today().year 
    197201   
    198202  cmds = [ ('Libraries' 
     
    346350(2, 'en', '<h3>Navigation</h3>\n<ul><li><a href="/">Home Page</a></li><li><a href="http://turtolcms.org">TurtolCMS Project</a></li></li></ul>\n'), 
    347351(3, 'en', '<h3>Help</h3>\n<p>Instructions and tutorials in the use of the TurtolCMS can be found at the <a href="http://turtolcms.org">TurtolCMS project site</a>.</p><p>Hosting for the TurtolCMS can be provided by (who else?) <a href="http://www.turtol.com/">Turtol.</a><br></p>'), 
    348 (4, 'en', '<span class="copyright">TurtolCMS copyright 2006 by Turtol, LLC.</span>'), 
     352(4, 'en', '<span class="copyright">TurtolCMS copyright %s by Turtol, LLC.</span>'), 
    349353(5, 'en', '<h1>TurtolCMS</h1>'), 
    350354(6, 'en', '<h1>Page Not Found</h1>\n<p>We are Sorry, but the requested page could not be found on our server. Please make sure the requeseted URL is correct</p>'), 
    351 (7, 'en', '<style type="text/css">\n.error{\n    color: red;\n  }\n</style>\n<h1>Forbidden</h1>\n<p class="error">We are sorry but you do not have permission to view the contents  of this page.<br />Please log in and try again</p><br /><br />\n<p>Click<a href="/"> here to go to the HOME page</a></p>') ''')] 
     355(7, 'en', '<style type="text/css">\n.error{\n    color: red;\n  }\n</style>\n<h1>Forbidden</h1>\n<p class="error">We are sorry but you do not have permission to view the contents  of this page.<br />Please log in and try again</p><br /><br />\n<p>Click<a href="/"> here to go to the HOME page</a></p>') ''' % (currentYear))] 
    352356 
    353357#FIXME: USE AN IMAGE THAT DOESN'T HAVE A WHITE BACK GROUND TO WORK BETTER WITH THEMES 
  • Branches/wljohnston/starting_ie/TurtolCMS/Core/__init__.py

    r1136 r1150  
    272272      #query for widgets with the same name on this page (including templates) 
    273273      from TurtolCMS.TcmsApiRoutines import _GetLayers 
    274       existingNameWidgets = "" 
    275       if self.id == "0": 
    276         sql = '''select id from tcms_widgets where name=%''' + '''s and page_id in (%s)''' \ 
    277           % ','.join([str(i[0]) for i in _GetLayers(context, pageid)]) 
    278       else:  
    279         sql = '''select id from tcms_widgets where name=%''' + '''s and page_id in (%s) and id<>%s''' \ 
    280           % (','.join([str(i[0]) for i in _GetLayers(context, pageid)]), self.id) 
    281         context.Log("SQL %s" % sql) 
    282       existingNameWidgets = context.ExecuteSQL(sql, name) 
    283       if existingNameWidgets: 
     274      extraSql = "" 
     275      if self.id != "0": 
     276        extraSql = '''and id<> %s''' % (self.id) 
     277      sql = '''select id from tcms_widgets where name=%''' + '''s and page_id in (%s) %s''' \ 
     278          % (','.join([str(i[0]) for i in _GetLayers(context, pageid)]), extraSql) 
     279      if context.ExecuteSQL(sql, name): 
    284280        context.Write("Please enter a unique Widget Name") 
    285281        err = "Duplicate Widget Name" 
     
    744740        name = name.rstrip("/") 
    745741      #validate that name is not already in use 
    746       if self._id == "0": 
    747         existingPages = ctx.ExecuteSQL('''SELECT name FROM tcms_pages WHERE name="%s"''' %(name)) 
    748       else: 
    749         existingPages = ctx.ExecuteSQL('''SELECT name FROM tcms_pages WHERE name="%s" and id<>"%s"''' % (name, self._id)) 
    750       if existingPages: 
     742      sql = '''SELECT name FROM tcms_pages WHERE name="%s"''' % name 
     743      #alter sql if editing 
     744      if self._id != "0": 
     745        sql = "%s%s" % (sql, '''and id <>"%s"''' % self._id) 
     746      if ctx.ExecuteSQL(sql): 
    751747        if self._pagetype == "roottemplate" or self._pagetype == "template": 
    752748          ctx.Write("Please enter a unique Template Name") 
  • Branches/wljohnston/starting_ie/TurtolCMS/TcmsApiRoutines.py

    r1066 r1150  
    416416      self._noFfMessage="" 
    417417      if userAgent.lower().find("firefox") < 0: 
    418         self._noFfMessage = '''The TurtolCMS editor has currently been tested only with the <a href="http://www.getfirefox.net" id='fflink'>Firefox</a> web browser. Using other browsers may lead to unexpected results.''' 
     418        self._noFfMessage = '''It is currently recommended to use the TurtolCMS editor with the <a href="http://www.getfirefox.net" id='fflink'>Firefox</a> web browser.''' 
    419419      self.Write (''' 
    420420      <div id="tcms_login">