From: Oleg Broytman Date: Mon, 11 Jun 2018 12:04:07 +0000 (+0300) Subject: Fix(web): Выровнять числа вправо X-Git-Tag: 0.1.4~6 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=23a7477871ae2a50bb08fb6a6accd8f87f829426;p=m_librarian.git Fix(web): Выровнять числа вправо Выровнять число книг автора и номер книги в серии. --- 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