From: Oleg Broytman Date: Mon, 11 Jun 2018 11:53:47 +0000 (+0300) Subject: Feat(web): В таблицах авторов и книг добавить заголовки колонок X-Git-Tag: 0.1.4~7 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=c98bc4c0207d594bb044163201e065924487f87e Feat(web): В таблицах авторов и книг добавить заголовки колонок --- diff --git a/m_librarian/translations/ru.mo b/m_librarian/translations/ru.mo index c047f7a..bd67d64 100644 Binary files a/m_librarian/translations/ru.mo and b/m_librarian/translations/ru.mo differ diff --git a/m_librarian/translations/ru.po b/m_librarian/translations/ru.po index 3633d51..9ccb069 100644 --- a/m_librarian/translations/ru.po +++ b/m_librarian/translations/ru.po @@ -1,5 +1,5 @@ # Russian translation -# Copyright 2016, 2017 (C) PhiloSoft Design +# Copyright 2016-2018 (C) PhiloSoft Design # Created by Oleg Broytman # msgid "" @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: 0.0.14\n" "Report-Msgid-Bugs-To: Oleg Broytman \n" "POT-Creation-Date: 2016-03-29\n" -"PO-Revision-Date: 2016-05-15\n" +"PO-Revision-Date: 2018-06-11\n" "Last-Translator: Oleg Broytman \n" "Language: Russian\n" "Language-Team: Oleg Broytman \n" @@ -60,3 +60,46 @@ msgstr "книг" msgid "bytes" msgstr "байт" + +msgid "surname" +msgstr "Фамилия" + +msgid "name" +msgstr "Имя" + +msgid "misc_name" +msgstr "Отчество" + +msgid "fullname" +msgstr "Полное имя" + +msgid "count" +msgstr "Число книг" + +msgid "title" +msgstr "Название" + +msgid "series" +msgstr "Серия" + +msgid "ser_no" +msgstr "Номер в серии" + +msgid "archive" +msgstr "Архив" + +msgid "file" +msgstr "Файл" + +msgid "size" +msgstr "Размер" + +msgid "lib_id" +msgstr "ID библиотеки" + +msgid "deleted" +msgstr "Удалена" + +msgid "date" +msgstr "Дата" + diff --git a/m_librarian/web/views/books_by_author.py b/m_librarian/web/views/books_by_author.py index 8136ece..1183fbd 100644 --- a/m_librarian/web/views/books_by_author.py +++ b/m_librarian/web/views/books_by_author.py @@ -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 ################################################## @@ -36,10 +37,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.1.0' __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1) -__CHEETAH_genTime__ = 1528670845.131662 -__CHEETAH_genTimestamp__ = 'Mon Jun 11 01:47:25 2018' +__CHEETAH_genTime__ = 1528717961.265576 +__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018' __CHEETAH_src__ = 'books_by_author.tmpl' -__CHEETAH_srcLastModified__ = 'Mon Jun 11 01:47:23 2018' +__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:27 2018' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -72,7 +73,7 @@ class books_by_author(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 @@ -88,61 +89,76 @@ class books_by_author(layout): ## START - generated method body write(u'''

''') - _v = VFFSL(SL,"title",True) # u'$title' on line 6, col 5 - if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 6, col 5. + _v = VFFSL(SL,"title",True) # u'$title' on line 7, col 5 + if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 7, col 5. write(u''' ''') - _v = VFFSL(SL,"author.fullname",True) # u'$author.fullname' on line 6, col 12 - if _v is not None: write(_filter(_v, rawExpr=u'$author.fullname')) # from line 6, col 12. + _v = VFFSL(SL,"author.fullname",True) # u'$author.fullname' on line 7, col 12 + if _v is not None: write(_filter(_v, rawExpr=u'$author.fullname')) # from line 7, col 12. write(u'''

''') - if VFFSL(SL,"books",True): # generated from line 8, col 1 + if VFFSL(SL,"books",True): # generated from line 9, col 1 write(u'''
+ + + ''') + 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 15, col 3 + write(u''' +''') + write(u''' ''') series = None columns1 = VFFSL(SL,"len",False)(VFFSL(SL,"columns",True))+1 - for book in VFFSL(SL,"books",True): # generated from line 13, col 3 - if VFFSL(SL,"book.series",True) != VFFSL(SL,"series",True): # generated from line 14, col 3 + for book in VFFSL(SL,"books",True): # generated from line 21, col 3 + if VFFSL(SL,"book.series",True) != VFFSL(SL,"series",True): # generated from line 22, col 3 series = VFFSL(SL,"book.series",True) write(u''' ''') write(u''' ''') - for column in VFFSL(SL,"columns",True): # generated from line 28, col 3 + for column in VFFSL(SL,"columns",True): # generated from line 36, col 3 write(u''' ''') write(u''' ''') write(u'''
 ''') + 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 16, col 36 + if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($_($column))')) # from line 16, col 36. + write(u'''
''') - if VFFSL(SL,"book.series",True): # generated from line 18, col 3 - _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(VFFSL(SL,"series",True), 1) # u'$cgi.escape($series, 1)' on line 19, col 1 - if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($series, 1)')) # from line 19, col 1. - else: # generated from line 20, col 3 + if VFFSL(SL,"book.series",True): # generated from line 26, col 3 + _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(VFFSL(SL,"series",True), 1) # u'$cgi.escape($series, 1)' on line 27, col 1 + if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($series, 1)')) # from line 27, col 1. + else: # generated from line 28, col 3 write(u'''\u0412\u043d\u0435 \u0441\u0435\u0440\u0438\u0439''') write(u'''
''') - _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"book",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($book, $column) or ''))" on line 29, col 7 - if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 29, col 7. + _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"book",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($book, $column) or ''))" on line 37, col 7 + if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 37, col 7. write(u'''
''') - else: # generated from line 38, col 1 + else: # generated from line 46, col 1 write(u'''

\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438!

''') diff --git a/m_librarian/web/views/books_by_author.tmpl b/m_librarian/web/views/books_by_author.tmpl index 52a7eb3..30a5d8f 100644 --- a/m_librarian/web/views/books_by_author.tmpl +++ b/m_librarian/web/views/books_by_author.tmpl @@ -1,5 +1,6 @@ #encoding utf-8 #import cgi +#from m_librarian.translations import translations #extends views.layout #attr $title = 'Список книг автора' #def body @@ -8,6 +9,13 @@ #if $books
+ + + #set $_ = $getattr($translations, 'ugettext', None) or $translations.gettext + #for $column in $columns + + #end for + #set $series = None #set $columns1 = $len($columns)+1 #for $book in $books diff --git a/m_librarian/web/views/list_authors.py b/m_librarian/web/views/list_authors.py index 5ee4af0..f7047dd 100644 --- a/m_librarian/web/views/list_authors.py +++ b/m_librarian/web/views/list_authors.py @@ -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'''

\u041f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u0440\u043e\u0432

''') - _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'''

''') - _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'''

''') - if VFFSL(SL,"authors",True): # generated from line 12, col 1 + if VFFSL(SL,"authors",True): # generated from line 13, col 1 write(u'''
 $cgi.escape($_($column))
+ + ''') + 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''' ''') - for author in VFFSL(SL,"authors",True): # generated from line 14, col 3 + write(u''' +''') + for author in VFFSL(SL,"authors",True): # generated from line 21, col 3 write(u''' ''') - 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''' ''') @@ -121,7 +136,7 @@ class list_authors(layout): ''') write(u'''
''') + 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'''
''') - _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'''
''') - else: # generated from line 24, col 1 + else: # generated from line 31, col 1 write(u'''

\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430!

''') diff --git a/m_librarian/web/views/list_authors.tmpl b/m_librarian/web/views/list_authors.tmpl index a872afc..74a2bce 100644 --- a/m_librarian/web/views/list_authors.tmpl +++ b/m_librarian/web/views/list_authors.tmpl @@ -1,5 +1,6 @@ #encoding utf-8 #import cgi +#from m_librarian.translations import translations #extends views.layout #attr $title = 'Список авторов' #def body @@ -11,6 +12,12 @@ $search_authors_form(searchList=$searchList) #if $authors + + #set $_ = $getattr($translations, 'ugettext', None) or $translations.gettext + #for $column in $columns + + #end for + #for $author in $authors #for $column in $columns diff --git a/m_librarian/web/views/list_books.py b/m_librarian/web/views/list_books.py index 0b2f8c6..0eadec0 100644 --- a/m_librarian/web/views/list_books.py +++ b/m_librarian/web/views/list_books.py @@ -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 ################################################## @@ -36,10 +37,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.1.0' __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1) -__CHEETAH_genTime__ = 1528670845.332275 -__CHEETAH_genTimestamp__ = 'Mon Jun 11 01:47:25 2018' +__CHEETAH_genTime__ = 1528717961.535029 +__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018' __CHEETAH_src__ = 'list_books.tmpl' -__CHEETAH_srcLastModified__ = 'Mon Jun 11 01:46:57 2018' +__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:39 2018' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -72,7 +73,7 @@ class list_books(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 @@ -88,64 +89,79 @@ class list_books(layout): ## START - generated method body write(u'''

''') - _v = VFFSL(SL,"title",True) # u'$title' on line 6, col 5 - if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 6, col 5. + _v = VFFSL(SL,"title",True) # u'$title' on line 7, col 5 + if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 7, col 5. write(u'''

''') - if VFFSL(SL,"books_by_author",True): # generated from line 8, col 1 + if VFFSL(SL,"books_by_author",True): # generated from line 9, col 1 write(u'''
$cgi.escape($_($column))
+ + + ''') + 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 15, col 3 + write(u''' +''') + write(u''' ''') series = None columns1 = VFFSL(SL,"len",False)(VFFSL(SL,"columns",True))+1 - for author in VFFSL(SL,"sorted",False)(VFFSL(SL,"books_by_author",True)): # generated from line 13, col 3 + for author in VFFSL(SL,"sorted",False)(VFFSL(SL,"books_by_author",True)): # generated from line 21, col 3 books = VFFSL(SL,"books_by_author",True)[VFFSL(SL,"author",True)] - for book in VFFSL(SL,"books",True): # generated from line 15, col 5 - if VFFSL(SL,"book.series",True) != VFFSL(SL,"series",True): # generated from line 16, col 5 + for book in VFFSL(SL,"books",True): # generated from line 23, col 5 + if VFFSL(SL,"book.series",True) != VFFSL(SL,"series",True): # generated from line 24, col 5 series = VFFSL(SL,"book.series",True) write(u''' ''') write(u''' ''') - for column in VFFSL(SL,"columns",True): # generated from line 31, col 3 + for column in VFFSL(SL,"columns",True): # generated from line 39, col 3 write(u''' ''') write(u''' ''') write(u'''
 ''') + 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 16, col 36 + if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($_($column))')) # from line 16, col 36. + write(u'''
''') - _v = VFFSL(SL,"author",True) # u'$author' on line 20, col 3 - if _v is not None: write(_filter(_v, rawExpr=u'$author')) # from line 20, col 3. + _v = VFFSL(SL,"author",True) # u'$author' on line 28, col 3 + if _v is not None: write(_filter(_v, rawExpr=u'$author')) # from line 28, col 3. write(u''' \u2014 ''') - if VFFSL(SL,"book.series",True): # generated from line 21, col 3 - _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(VFFSL(SL,"series",True), 1) # u'$cgi.escape($series, 1)' on line 22, col 1 - if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($series, 1)')) # from line 22, col 1. - else: # generated from line 23, col 3 + if VFFSL(SL,"book.series",True): # generated from line 29, col 3 + _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(VFFSL(SL,"series",True), 1) # u'$cgi.escape($series, 1)' on line 30, col 1 + if _v is not None: write(_filter(_v, rawExpr=u'$cgi.escape($series, 1)')) # from line 30, col 1. + else: # generated from line 31, col 3 write(u'''\u0412\u043d\u0435 \u0441\u0435\u0440\u0438\u0439''') write(u'''
''') - _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"book",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($book, $column) or ''))" on line 32, col 7 - if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 32, col 7. + _v = VFN(VFFSL(SL,"cgi",True),"escape",False)(unicode(VFFSL(SL,"getattr",False)(VFFSL(SL,"book",True), VFFSL(SL,"column",True)) or '')) # u"$cgi.escape(unicode($getattr($book, $column) or ''))" on line 40, col 7 + if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 40, col 7. write(u'''
''') - else: # generated from line 42, col 1 + else: # generated from line 50, col 1 write(u'''

\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438!

''') diff --git a/m_librarian/web/views/list_books.tmpl b/m_librarian/web/views/list_books.tmpl index 5822ce2..7a78f97 100644 --- a/m_librarian/web/views/list_books.tmpl +++ b/m_librarian/web/views/list_books.tmpl @@ -1,5 +1,6 @@ #encoding utf-8 #import cgi +#from m_librarian.translations import translations #extends views.layout #attr $title = 'Список книг' #def body @@ -8,6 +9,13 @@ #if $books_by_author
+ + + #set $_ = $getattr($translations, 'ugettext', None) or $translations.gettext + #for $column in $columns + + #end for + #set $series = None #set $columns1 = $len($columns)+1 #for $author in $sorted($books_by_author)
 $cgi.escape($_($column))