Skip to content
Snippets Groups Projects

Označení neaktivovaných účtů -- vytvoření user_html_flags

Merged Jiří Kalvoda requested to merge jk/issue-196-v2 into devel
+ 5
14
@@ -56,28 +56,19 @@ class Row:
class CellLink(Cell):
url: str
hint: Optional[str]
html_suffix: Markup
def __init__(self, text: str, url: str, hint: Optional[str] = None):
def __init__(self, text: str, url: str, hint: Optional[str] = None, html_suffix: Markup = Markup("")):
Cell.__init__(self, text)
self.url = url
self.hint = hint
self.html_suffix = html_suffix
def to_html(self) -> str:
a = '<td><a href="' + escape(self.url) + '"'
if self.hint:
a += ' title="' + escape(self.hint) + '"'
return a + '>' + escape(self.text) + '</a>'
class CellLinkWithHtmlSuffix(CellLink):
html_suffix: Markup
def __init__(self, text: str, url: str, html_suffix, hint: Optional[str] = None):
CellLink.__init__(self, text, url, hint)
self.html_suffix = html_suffix
def to_html(self) -> str:
return super().to_html() + str(self.html_suffix)
return a + '>' + escape(self.text) + '</a>' + str(self.html_suffix)
class CellCheckbox(Cell):
@@ -211,7 +202,7 @@ def cell_email_link(user: db.User) -> CellLink:
return CellLink(user.email, 'mailto:' + urllib.parse.quote(user.email, safe='@'))
def cell_email_link_flags(user: db.User) -> CellMarkup:
return CellLinkWithHtmlSuffix(user.email, 'mailto:' + urllib.parse.quote(user.email, safe='@'), user_html_flags(user))
return CellLink(user.email, 'mailto:' + urllib.parse.quote(user.email, safe='@'), html_suffix=user_html_flags(user))
def cell_user_link(user: db.User, text: str) -> CellLink:
Loading