]> git.phdru.name Git - m_librarian.git/blobdiff - m_librarian/web/views/search_authors_form.py
Feat(web): Preserve values in form
[m_librarian.git] / m_librarian / web / views / search_authors_form.py
index 1e304437900683b865de2300769518fc75273c40..8ab0a8bafce32419d8cb6af912d3d5dca11b8cb8 100644 (file)
@@ -25,6 +25,7 @@ from Cheetah.CacheRegion import CacheRegion
 import Cheetah.Filters as Filters
 import Cheetah.ErrorCatchers as ErrorCatchers
 from Cheetah.compat import unicode
+from bottle import html_escape
 
 ##################################################
 ## MODULE CONSTANTS
@@ -34,10 +35,10 @@ VFN=valueForName
 currentTime=time.time
 __CHEETAH_version__ = '3.1.0'
 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1522958937.217914
-__CHEETAH_genTimestamp__ = 'Thu Apr  5 23:08:57 2018'
+__CHEETAH_genTime__ = 1522963362.420098
+__CHEETAH_genTimestamp__ = 'Fri Apr  6 00:22:42 2018'
 __CHEETAH_src__ = 'search_authors_form.tmpl'
-__CHEETAH_srcLastModified__ = 'Thu Apr  5 23:08:55 2018'
+__CHEETAH_srcLastModified__ = 'Fri Apr  6 00:22:40 2018'
 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
 
 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
@@ -66,6 +67,62 @@ class search_authors_form(Template):
             self._initCheetahInstance(**cheetahKWArgs)
         
 
+    def search_type_checked(self, value, **KWS):
+
+
+
+        ## CHEETAH: generated from #def $search_type_checked($value) at line 3, col 1.
+        trans = KWS.get("trans")
+        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
+            trans = self.transaction # is None unless self.awake() was called
+        if not trans:
+            trans = DummyTransaction()
+            _dummyTrans = True
+        else: _dummyTrans = False
+        write = trans.response().write
+        SL = self._CHEETAH__searchList
+        _filter = self._CHEETAH__currentFilter
+        
+        ########################################
+        ## START - generated method body
+        
+        if VFFSL(SL,"getVar",False)('search_type', '') == VFFSL(SL,"value",True): # generated from line 4, col 1
+            write(u'''checked''')
+        
+        ########################################
+        ## END - generated method body
+        
+        return _dummyTrans and trans.response().getvalue() or ""
+        
+
+    def case_sensitive_checked(self, **KWS):
+
+
+
+        ## CHEETAH: generated from #def $case_sensitive_checked at line 8, col 1.
+        trans = KWS.get("trans")
+        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
+            trans = self.transaction # is None unless self.awake() was called
+        if not trans:
+            trans = DummyTransaction()
+            _dummyTrans = True
+        else: _dummyTrans = False
+        write = trans.response().write
+        SL = self._CHEETAH__searchList
+        _filter = self._CHEETAH__currentFilter
+        
+        ########################################
+        ## START - generated method body
+        
+        if VFFSL(SL,"getVar",False)('case_sensitive', None): # generated from line 9, col 1
+            write(u'''checked''')
+        
+        ########################################
+        ## END - generated method body
+        
+        return _dummyTrans and trans.response().getvalue() or ""
+        
+
     def respond(self, trans=None):
 
 
@@ -85,16 +142,31 @@ class search_authors_form(Template):
         ## START - generated method body
         
         write(u'''<form action="/search_authors/" method="POST">
-  <input name="search_authors" type="text" style="width: 80%">
+  <input name="search_authors" value="''')
+        _v = VFFSL(SL,"html_escape",False)(VFFSL(SL,"getVar",False)('search_authors', '')) # u"$html_escape($getVar('search_authors', ''))" on line 14, col 39
+        if _v is not None: write(_filter(_v, rawExpr=u"$html_escape($getVar('search_authors', ''))")) # from line 14, col 39.
+        write(u'''" type="text" style="width: 80%">
   <br>
-  <input name="search_type" value="start" type="radio">
+  <input name="search_type" value="start" ''')
+        _v = VFFSL(SL,"search_type_checked",False)('start') # u"$search_type_checked('start')" on line 16, col 43
+        if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('start')")) # from line 16, col 43.
+        write(u''' type="radio">
   \u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435
-  <input name="search_type" value="substring" type="radio">
+  <input name="search_type" value="substring" ''')
+        _v = VFFSL(SL,"search_type_checked",False)('substring') # u"$search_type_checked('substring')" on line 18, col 47
+        if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('substring')")) # from line 18, col 47.
+        write(u''' type="radio">
   \u041f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430
-  <input name="search_type" value="full" type="radio">
+  <input name="search_type" value="full" ''')
+        _v = VFFSL(SL,"search_type_checked",False)('full') # u"$search_type_checked('full')" on line 20, col 42
+        if _v is not None: write(_filter(_v, rawExpr=u"$search_type_checked('full')")) # from line 20, col 42.
+        write(u''' type="radio">
   \u0422\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435
   <br>
-  <input name="case_sensitive" type="checkbox">
+  <input name="case_sensitive" type="checkbox" ''')
+        _v = VFFSL(SL,"case_sensitive_checked",True) # u'$case_sensitive_checked' on line 23, col 48
+        if _v is not None: write(_filter(_v, rawExpr=u'$case_sensitive_checked')) # from line 23, col 48.
+        write(u'''>
   \u0420\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u0435/\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435
   <br>
   <input name="submit" type="submit">