]> git.phdru.name Git - m_librarian.git/blobdiff - m_librarian/web/views/list_authors.py
Feat(web): В таблицах авторов и книг добавить заголовки колонок
[m_librarian.git] / m_librarian / web / views / list_authors.py
index 5ee4af0a2c7cdc0c97d116db11d5afe3110668c8..f7047dd1ec0d5fe9ea9400a24da074e7cf57f40f 100644 (file)
@@ -26,6 +26,7 @@ import Cheetah.Filters as Filters
 import Cheetah.ErrorCatchers as ErrorCatchers
 from Cheetah.compat import unicode
 import cgi
+from m_librarian.translations import translations
 from views.layout import layout
 from views.search_authors_form import search_authors_form
 
@@ -37,10 +38,10 @@ VFN=valueForName
 currentTime=time.time
 __CHEETAH_version__ = '3.1.0'
 __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1528670903.492958
-__CHEETAH_genTimestamp__ = 'Mon Jun 11 01:48:23 2018'
+__CHEETAH_genTime__ = 1528717961.404398
+__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018'
 __CHEETAH_src__ = 'list_authors.tmpl'
-__CHEETAH_srcLastModified__ = 'Mon Jun 11 01:48:21 2018'
+__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:34 2018'
 __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
 
 if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
@@ -73,7 +74,7 @@ class list_authors(layout):
 
 
 
-        ## CHEETAH: generated from #def body at line 5, col 1.
+        ## CHEETAH: generated from #def body at line 6, 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
@@ -90,30 +91,44 @@ class list_authors(layout):
         
         write(u'''<h1>\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432</h1>
 ''')
-        _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 8, col 1
-        if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 8, col 1.
+        _v = VFFSL(SL,"search_authors_form",False)(searchList=VFFSL(SL,"searchList",True)) # u'$search_authors_form(searchList=$searchList)' on line 9, col 1
+        if _v is not None: write(_filter(_v, rawExpr=u'$search_authors_form(searchList=$searchList)')) # from line 9, col 1.
         write(u'''
 
 <h1>''')
-        _v = VFFSL(SL,"title",True) # u'$title' on line 10, col 5
-        if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 10, col 5.
+        _v = VFFSL(SL,"title",True) # u'$title' on line 11, col 5
+        if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 11, col 5.
         write(u'''</h1>
 
 ''')
-        if VFFSL(SL,"authors",True): # generated from line 12, col 1
+        if VFFSL(SL,"authors",True): # generated from line 13, col 1
             write(u'''  <table>
+  <tr>
+  ''')
+            if False:
+                _
+            _ = VFFSL(SL,"getattr",False)(VFFSL(SL,"translations",True), 'ugettext', None) or VFFSL(SL,"translations.gettext",True)
+            for column in VFFSL(SL,"columns",True): # generated from line 17, col 3
+                write(u'''    <td style="text-align: center">''')
+                if False:
+                    _(VFFSL(SL,"column",True))
+                _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(VFFSL(SL,"_",False)(VFFSL(SL,"column",True))) # u'$cgi.escape($_($column))' on line 18, col 36
+                if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($_($column))')) # from line 18, col 36.
+                write(u'''</td>
 ''')
-            for author in VFFSL(SL,"authors",True): # generated from line 14, col 3
+            write(u'''  </tr>
+''')
+            for author in VFFSL(SL,"authors",True): # generated from line 21, col 3
                 write(u'''  <tr>
 ''')
-                for column in VFFSL(SL,"columns",True): # generated from line 16, col 3
+                for column in VFFSL(SL,"columns",True): # generated from line 23, col 3
                     write(u'''    <td><a href="/books-by-author/''')
-                    _v = VFFSL(SL,"author.id",True) # u'$author.id' on line 17, col 35
-                    if _v is not None: write(_filter(_v, rawExpr=u'$author.id')) # from line 17, col 35.
+                    _v = VFFSL(SL,"author.id",True) # u'$author.id' on line 24, col 35
+                    if _v is not None: write(_filter(_v, rawExpr=u'$author.id')) # from line 24, col 35.
                     write(u'''/">
     ''')
-                    _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"author",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($author, $column) or ''))" on line 18, col 5
-                    if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($author, $column) or ''))")) # from line 18, col 5.
+                    _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"author",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($author, $column) or ''))" on line 25, col 5
+                    if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($author, $column) or ''))")) # from line 25, col 5.
                     write(u'''
     </a></td>
 ''')
@@ -121,7 +136,7 @@ class list_authors(layout):
 ''')
             write(u'''  </table>
 ''')
-        else: # generated from line 24, col 1
+        else: # generated from line 31, col 1
             write(u'''  <p>\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430!</p>
 ''')