replaced submission input with multiline text area element

This commit is contained in:
phear 2011-12-16 16:28:04 +00:00
parent 3bfebb9e99
commit e9ffa70f05

View file

@ -249,8 +249,12 @@ def get_markup_with_links(text):
short_name = url.split("/")[2]
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
# 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)
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):
if not key in POLL_SETTINGS.keys():
@ -678,7 +682,7 @@ def show_admin_page(page=None, page_size=20):
try:
page_size = int(page_size)
except ValueError:
page_size = 20
page_size = 30
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):
@ -701,8 +705,8 @@ def show_poll_list(render_file, page_size, page=None, filter_private=True):
page = max(1, page)
start = (page - 1) * page_size
if start >= len(polls):
start = 0
page = 1
start = len(polls) - page_size
page = (len(polls) + page_size - 1) / page_size
end = start + page_size - 1
value_dict["polls"] = polls[start : end + 1]
# show a link for the next page, if more polls are available