from .tool.func import * async def main_setting_phrase(): with get_db_connect() as conn: curs = conn.cursor() if await acl_check('', 'owner_auth', '', '') == 1: return await re_error(conn, 0) i_list = [ 'contract', 'no_login_warning', 'edit_bottom_text', 'copyright_checkbox_text', 'check_key_text', 'email_title', 'email_text', 'email_insert_text', 'password_search_text', 'reset_user_text', 'error_401', 'error_404', 'approval_question', 'edit_help', 'upload_help', 'upload_default', 'license', 'topic_text', 'phrase_user_page_admin', 'phrase_user_page_owner', 'phrase_old_page_warning', 'bbs_help', 'bbs_comment_help', 'outdated_doc_warning', 'outdated_doc_warning_date', 'category_text', 'redirect_text', 'template_var_1', 'template_var_2', 'template_var_3', 'edit_only_bottom_text', 'move_bottom_text', 'delete_bottom_text', 'revert_bottom_text', ] if flask.request.method == 'POST': curs.executemany(db_change("update other set data = ? where name = ?"), [[flask.request.form.get(for_a, ''), for_a] for for_a in i_list]) await acl_check(tool = 'owner_auth', memo = 'edit_set (phrase)') return redirect(conn, '/setting/phrase') else: d_list = [] for i in i_list: curs.execute(db_change('select data from other where name = ?'), [i]) sql_d = curs.fetchall() if sql_d: d_list += [sql_d[0][0]] else: curs.execute(db_change('insert into other (name, data, coverage) values (?, ?, "")'), [i, '']) d_list += [''] return await render_template( await get_lang('text_setting'), await render_simple_set('''
'''), 0, [['setting', await get_lang('return')]] )