From 23a7477871ae2a50bb08fb6a6accd8f87f829426 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 11 Jun 2018 15:04:07 +0300 Subject: [PATCH] =?utf8?q?Fix(web):=20=D0=92=D1=8B=D1=80=D0=BE=D0=B2=D0=BD?= =?utf8?q?=D1=8F=D1=82=D1=8C=20=D1=87=D0=B8=D1=81=D0=BB=D0=B0=20=D0=B2?= =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Выровнять число книг автора и номер книги в серии. --- m_librarian/web/static/style.css | 1 + m_librarian/web/views/books_by_author.py | 25 ++++++++++++++-------- m_librarian/web/views/books_by_author.tmpl | 7 +++++- m_librarian/web/views/list_authors.py | 25 ++++++++++++++-------- m_librarian/web/views/list_authors.tmpl | 7 +++++- m_librarian/web/views/list_books.py | 25 ++++++++++++++-------- m_librarian/web/views/list_books.tmpl | 7 +++++- 7 files changed, 67 insertions(+), 30 deletions(-) diff --git a/m_librarian/web/static/style.css b/m_librarian/web/static/style.css index 63f6fd2..6e73187 100644 --- a/m_librarian/web/static/style.css +++ b/m_librarian/web/static/style.css @@ -40,4 +40,5 @@ tr:hover { td, th { text-align: left; + margin-left: 2ex; } diff --git a/m_librarian/web/views/books_by_author.py b/m_librarian/web/views/books_by_author.py index 1183fbd..e53f1d5 100644 --- a/m_librarian/web/views/books_by_author.py +++ b/m_librarian/web/views/books_by_author.py @@ -37,10 +37,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.1.0' __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1) -__CHEETAH_genTime__ = 1528717961.265576 -__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018' +__CHEETAH_genTime__ = 1528718535.338311 +__CHEETAH_genTimestamp__ = 'Mon Jun 11 15:02:15 2018' __CHEETAH_src__ = 'books_by_author.tmpl' -__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:27 2018' +__CHEETAH_srcLastModified__ = 'Mon Jun 11 15:02:13 2018' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -142,23 +142,30 @@ class books_by_author(layout): write(u'''"> ''') for column in VFFSL(SL,"columns",True): # generated from line 36, col 3 - 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 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. + if VFFSL(SL,"column",True) == 'ser_no': # generated from line 37, col 3 + style = ' style="text-align: right; width: 5ex"' + else: # generated from line 39, col 3 + style = '' + 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 42, col 13 + if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 42, col 13. write(u''' ''') write(u''' ''') write(u''' ''') - else: # generated from line 46, col 1 + else: # generated from line 51, 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 30a5d8f..d8a319c 100644 --- a/m_librarian/web/views/books_by_author.tmpl +++ b/m_librarian/web/views/books_by_author.tmpl @@ -34,7 +34,12 @@ $cgi.escape($series, 1)#slurp #for $column in $columns - $cgi.escape(unicode($getattr($book, $column) or '')) + #if $column == 'ser_no' + #set $style = ' style="text-align: right; width: 5ex"' + #else + #set $style = '' + #end if + $cgi.escape(unicode($getattr($book, $column) or '')) #end for #end for diff --git a/m_librarian/web/views/list_authors.py b/m_librarian/web/views/list_authors.py index f7047dd..41fab34 100644 --- a/m_librarian/web/views/list_authors.py +++ b/m_librarian/web/views/list_authors.py @@ -38,10 +38,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.1.0' __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1) -__CHEETAH_genTime__ = 1528717961.404398 -__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018' +__CHEETAH_genTime__ = 1528718535.495412 +__CHEETAH_genTimestamp__ = 'Mon Jun 11 15:02:15 2018' __CHEETAH_src__ = 'list_authors.tmpl' -__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:34 2018' +__CHEETAH_srcLastModified__ = 'Mon Jun 11 15:02:07 2018' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -122,13 +122,20 @@ class list_authors(layout): write(u''' ''') for column in VFFSL(SL,"columns",True): # generated from line 23, col 3 - 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 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. + _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 30, col 5 + if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($author, $column) or ''))")) # from line 30, col 5. write(u''' ''') @@ -136,7 +143,7 @@ class list_authors(layout): ''') write(u''' ''') - else: # generated from line 31, col 1 + else: # generated from line 36, 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 74a2bce..bdfd9fd 100644 --- a/m_librarian/web/views/list_authors.tmpl +++ b/m_librarian/web/views/list_authors.tmpl @@ -21,7 +21,12 @@ $search_authors_form(searchList=$searchList) #for $author in $authors #for $column in $columns - + #if $column == 'count' + #set $style = ' style="text-align: right; width: 5ex"' + #else + #set $style = '' + #end if + $cgi.escape(unicode($getattr($author, $column) or '')) #end for diff --git a/m_librarian/web/views/list_books.py b/m_librarian/web/views/list_books.py index 0eadec0..b0306dc 100644 --- a/m_librarian/web/views/list_books.py +++ b/m_librarian/web/views/list_books.py @@ -37,10 +37,10 @@ VFN=valueForName currentTime=time.time __CHEETAH_version__ = '3.1.0' __CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1) -__CHEETAH_genTime__ = 1528717961.535029 -__CHEETAH_genTimestamp__ = 'Mon Jun 11 14:52:41 2018' +__CHEETAH_genTime__ = 1528718535.673384 +__CHEETAH_genTimestamp__ = 'Mon Jun 11 15:02:15 2018' __CHEETAH_src__ = 'list_books.tmpl' -__CHEETAH_srcLastModified__ = 'Mon Jun 11 14:52:39 2018' +__CHEETAH_srcLastModified__ = 'Mon Jun 11 15:02:00 2018' __CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: @@ -145,23 +145,30 @@ class list_books(layout): write(u'''"> ''') for column in VFFSL(SL,"columns",True): # generated from line 39, col 3 - 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 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. + if VFFSL(SL,"column",True) == 'ser_no': # generated from line 40, col 3 + style = ' style="text-align: right; width: 5ex"' + else: # generated from line 42, col 3 + style = '' + 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 45, col 13 + if _v is not None: write(_filter(_v, rawExpr=u"$cgi.escape(unicode($getattr($book, $column) or ''))")) # from line 45, col 13. write(u''' ''') write(u''' ''') write(u''' ''') - else: # generated from line 50, col 1 + else: # generated from line 55, 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 7a78f97..1c0ebde 100644 --- a/m_librarian/web/views/list_books.tmpl +++ b/m_librarian/web/views/list_books.tmpl @@ -37,7 +37,12 @@ $cgi.escape($series, 1)#slurp #for $column in $columns - $cgi.escape(unicode($getattr($book, $column) or '')) + #if $column == 'ser_no' + #set $style = ' style="text-align: right; width: 5ex"' + #else + #set $style = '' + #end if + $cgi.escape(unicode($getattr($book, $column) or '')) #end for #end for -- 2.39.2