Browse Source

add recent discuss link

2du 3 years ago
parent
commit
d9618f0293
4 changed files with 3 additions and 39 deletions
  1. 0 1
      app.py
  2. 2 2
      route/recent_discuss.py
  3. 0 35
      route/recent_discuss_delete.py
  4. 1 1
      version.json

+ 0 - 1
app.py

@@ -471,7 +471,6 @@ app.route('/move/<everything:name>', methods = ['POST', 'GET'])(edit_move)
 app.route('/recent_discuss', defaults = { 'tool' : 'normal' })(recent_discuss)
 app.route('/recent_discuss/close', defaults = { 'tool' : 'close' })(recent_discuss)
 app.route('/recent_discuss/open', defaults = { 'tool' : 'open' })(recent_discuss)
-app.route('/recent_discuss/delete')(recent_discuss_delete)
 
 app.route('/thread/<int:topic_num>', methods = ['POST', 'GET'])(topic)
 app.route('/thread/0/<everything:doc_name>', defaults = { 'topic_num' : '0' }, methods = ['POST', 'GET'])(topic)

+ 2 - 2
route/recent_discuss.py

@@ -5,12 +5,11 @@ def recent_discuss(tool):
         curs = conn.cursor()
 
         div = ''
+        admin_auth = admin_check(3)
 
         if tool == 'normal':
             div += '<a href="/recent_discuss/close">(' + load_lang('close_discussion') + ')</a> '
             div += '<a href="/recent_discuss/open">(' + load_lang('open_discussion_list') + ')</a>'
-            if admin_check() == 1:
-                div += ' <a href="/recent_discuss/delete">(' + load_lang('delete') + ')</a>'
 
             m_sub = 0
         elif tool == 'close':
@@ -60,6 +59,7 @@ def recent_discuss(tool):
                     '<td>' + \
                         '<a href="/thread/' + data[3] + '">' + html.escape(data[1]) + '</a> ' + \
                         '<a href="/topic/' + url_pas(data[0]) + '">(' + html.escape(data[0]) + ')</a>' + \
+                        (' <a href="/thread/' + data[3] + '/tool">(' + load_lang('tool') + ')</a>' if admin_auth == 1 else '') + \
                     '</td>' + \
                     '<td>' + last_editor_ip_pas[last_editor[count]] + '</td>' + \
                     '<td>' + data[2] + '</td>' + \

+ 0 - 35
route/recent_discuss_delete.py

@@ -1,35 +0,0 @@
-from .tool.func import *
-
-def recent_discuss_delete():
-    with get_db_connect() as conn:
-        curs = conn.cursor()
-        
-        data_html = '' + \
-            '<a href="/recent_discuss">(' + load_lang('normal') + ')</a>' + \
-            '<ul id="opennamu_ul">' + \
-        ''
-        count = 0
-        
-        curs.execute(db_change("select title, sub, date, code, stop from rd order by date desc limit 50"))
-        for data in curs.fetchall():
-            if data[4] == '':
-                stop_code = ''
-            elif data[4] == 'O':
-                stop_code = ' (' + load_lang('close') + ')'
-            else:
-                stop_code = ' (' + load_lang('stop') + ')'
-
-            data_html += '' + \
-                '<li>' + \
-                    '<input type="checkbox" name="checkbox_' + str(count) + '"> ' + \
-                    html.escape(data[1]) + ' (' + html.escape(data[0]) + ')' + stop_code + \
-                '</li>' + \
-            ''
-            
-            count += 1
-            
-        return easy_minify(flask.render_template(skin_check(),
-            imp = [load_lang('recent_discussion'), wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('delete') + ') (' + load_lang('not_working') + ')', 0])],
-            data = data_html,
-            menu = 0
-        ))

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.6-RC2-dev134",
+        "r_ver" : "v3.4.6-RC2-dev135",
         "c_ver" : "3500358",
         "s_ver" : "3500111"
     }