from .tool.func import * def topic_close_list_2(conn, name, tool): curs = conn.cursor() div = '' if flask.request.method == 'POST': t_num = '' while 1: curs.execute("select title from topic where title = ? and sub = ? limit 1", [name, flask.request.form.get('topic', None) + t_num]) if curs.fetchall(): if t_num == '': t_num = ' 2' else: t_num = ' ' + str(int(t_num.replace(' ', '')) + 1) else: break return redirect('/topic/' + url_pas(name) + '/sub/' + url_pas(flask.request.form.get('topic', 'test') + t_num)) else: plus = '' menu = [['topic/' + url_pas(name), load_lang('return')]] if tool == 'close': curs.execute("select sub from rd where title = ? and stop = 'O' order by sub asc", [name]) sub = load_lang('close') elif tool == 'agree': curs.execute("select sub from rd where title = ? and agree = 'O' order by sub asc", [name]) sub = load_lang('agreement') else: curs.execute("select sub from rd where title = ? order by date desc", [name]) sub = load_lang('discussion_list') menu = [['w/' + url_pas(name), load_lang('document')]] plus = ''' (''' + load_lang('close') + ''') (''' + load_lang('agreement') + ''')