recent_discuss_delete.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from .tool.func import *
  2. def recent_discuss_delete():
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. data_html = '' + \
  6. '<a href="/recent_discuss">(' + load_lang('normal') + ')</a>' + \
  7. '<ul id="opennamu_ul">' + \
  8. ''
  9. count = 0
  10. curs.execute(db_change("select title, sub, date, code, stop from rd order by date desc limit 50"))
  11. for data in curs.fetchall():
  12. if data[4] == '':
  13. stop_code = ''
  14. elif data[4] == 'O':
  15. stop_code = ' (' + load_lang('close') + ')'
  16. else:
  17. stop_code = ' (' + load_lang('stop') + ')'
  18. data_html += '' + \
  19. '<li>' + \
  20. '<input type="checkbox" name="checkbox_' + str(count) + '"> ' + \
  21. html.escape(data[1]) + ' (' + html.escape(data[0]) + ')' + stop_code + \
  22. '</li>' + \
  23. ''
  24. count += 1
  25. return easy_minify(flask.render_template(skin_check(),
  26. imp = [load_lang('recent_discussion'), wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('delete') + ') (' + load_lang('not_working') + ')', 0])],
  27. data = data_html,
  28. menu = 0
  29. ))