replaced submission input with multiline text area element
This commit is contained in:
parent
3bfebb9e99
commit
e9ffa70f05
1 changed files with 8 additions and 4 deletions
|
@ -249,8 +249,12 @@ def get_markup_with_links(text):
|
||||||
short_name = url.split("/")[2]
|
short_name = url.split("/")[2]
|
||||||
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
|
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
|
||||||
# surround all urls with html markup
|
# surround all urls with html markup
|
||||||
return re.sub(r"(\A|\s|\()(https?://[\w/\?\.\#=;,_\-\~&]*)(\)|\s|\Z)",
|
text = re.sub(r"(\A|\s|\()(https?://[\w/\?\.\#=;,_\-\~&]*)(\)|\s|\Z)",
|
||||||
get_link_markup, text)
|
get_link_markup, text)
|
||||||
|
text = text.replace("\r\n","\n")
|
||||||
|
text = text.replace("\r","\n")
|
||||||
|
text = text.replace("\n","<br />")
|
||||||
|
return text
|
||||||
|
|
||||||
def get_poll_setting_string(key, value):
|
def get_poll_setting_string(key, value):
|
||||||
if not key in POLL_SETTINGS.keys():
|
if not key in POLL_SETTINGS.keys():
|
||||||
|
@ -678,7 +682,7 @@ def show_admin_page(page=None, page_size=20):
|
||||||
try:
|
try:
|
||||||
page_size = int(page_size)
|
page_size = int(page_size)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
page_size = 20
|
page_size = 30
|
||||||
return show_poll_list("admin.html", page_size, page, filter_private=False)
|
return show_poll_list("admin.html", page_size, page, filter_private=False)
|
||||||
|
|
||||||
def show_poll_list(render_file, page_size, page=None, filter_private=True):
|
def show_poll_list(render_file, page_size, page=None, filter_private=True):
|
||||||
|
@ -701,8 +705,8 @@ def show_poll_list(render_file, page_size, page=None, filter_private=True):
|
||||||
page = max(1, page)
|
page = max(1, page)
|
||||||
start = (page - 1) * page_size
|
start = (page - 1) * page_size
|
||||||
if start >= len(polls):
|
if start >= len(polls):
|
||||||
start = 0
|
start = len(polls) - page_size
|
||||||
page = 1
|
page = (len(polls) + page_size - 1) / page_size
|
||||||
end = start + page_size - 1
|
end = start + page_size - 1
|
||||||
value_dict["polls"] = polls[start : end + 1]
|
value_dict["polls"] = polls[start : end + 1]
|
||||||
# show a link for the next page, if more polls are available
|
# show a link for the next page, if more polls are available
|
||||||
|
|
Loading…
Reference in a new issue