2du 4 years ago
parent
commit
1f8ec15a43

+ 40 - 21
app.py

@@ -1,5 +1,11 @@
 # Init
-from route import *
+import os
+import re
+
+for i_data in os.listdir("route"):
+    f_src = re.search(r"(.+)\.py$", i_data)
+    if f_src:
+        exec("from route." + f_src.group(1) + " import *")
 
 # Init-Version
 version_list = json.loads(open('version.json', encoding = 'utf8').read())
@@ -148,12 +154,12 @@ create_data['html_filter'] = ['html', 'kind', 'plus', 'plus_t']
 create_data['vote'] = ['name', 'id', 'subject', 'data', 'user', 'type', 'acl']
 for create_table in create_data:
     try:
-        curs.execute(db_change('select test from ' + i + ' limit 1'))
+        curs.execute(db_change('select test from ' + create_table + ' limit 1'))
     except:
         try:
-            curs.execute(db_change('create table ' + i + '(test longtext)'))
+            curs.execute(db_change('create table ' + create_table + '(test longtext)'))
         except:
-            curs.execute(db_change("alter table " + i + " add test longtext"))
+            curs.execute(db_change("alter table " + create_table + " add test longtext"))
             
     for create in create_data[create_table]:
         try:
@@ -367,18 +373,11 @@ def list_long_page(tool = 'long_page'):
 def give_admin_groups(name = None):
     return give_admin_groups_2(conn, name)
 
+# 다듬어야할 듯
 @app.route('/delete_admin_group/<name>', methods = ['POST', 'GET'])
 def give_delete_admin_group(name = None):
     return give_delete_admin_group_2(conn, name)
 
-@app.route('/hidden/<everything:name>')
-def give_history_hidden(name = None):
-    return give_history_hidden_2(conn, name)
-
-@app.route('/add_history/<everything:name>', methods = ['POST', 'GET'])
-def give_history_add(name = None):
-    return give_history_add_2(conn, name)
-
 @app.route('/check/<name>')
 def give_user_check(name = None):
     return give_user_check_2(conn, name)
@@ -428,7 +427,8 @@ def recent_discuss():
     return recent_discuss_2(conn)
 
 @app.route('/block_log')
-@app.route('/<regex("block_user|block_admin"):tool>/<name>')
+@app.route('/<regex("block_user"):tool>/<name>')
+@app.route('/<regex("block_admin"):tool>/<name>')
 def recent_block(name = None, tool = None):
     return recent_block_2(conn, name, tool)
 
@@ -438,13 +438,31 @@ def recent_block(name = None, tool = None):
 def recent_changes(name = None, tool = 'record'):
     return recent_changes_2(conn, name, tool)
 
-@app.route('/history_tool/<everything:name>')
-def recent_history_tool(name = None):
-    return recent_history_tool_2(conn, name)
+@app.route('/history/tool/<int(signed=True):rev>/<everything:name>')
+def recent_history_tool(name = 'Test', rev = 1):
+    return recent_history_tool_2(conn, name, rev)
+
+@app.route('/history/delete/<int(signed=True):rev>/<everything:name>', methods = ['POST', 'GET'])
+def recent_history_delete(name = 'Test', rev = 1):
+    return recent_history_delete_2(conn, name, rev)
+
+@app.route('/history/hidden/<int(signed=True):rev>/<everything:name>')
+def recent_history_hidden(name = 'Test', rev = 1):
+    return recent_history_hidden_2(conn, name, rev)
+
+@app.route('/history/reset/<everything:name>', methods = ['POST', 'GET'])
+def recent_history_reset(name = 'Test'):
+    return recent_history_reset_2(conn, name)
+
+@app.route('/history/add/<everything:name>', methods = ['POST', 'GET'])
+def recent_history_add(name = None):
+    return recent_history_add_2(conn, name)
 
-@app.route('/history_delete/<everything:name>', methods = ['POST', 'GET'])
-def recent_history_delete(name = None):
-    return recent_history_delete_2(conn, name)
+'''
+@app.route('/record/reset/<name>', methods = ['POST', 'GET'])
+def recent_record_reset():
+    return recent_record_reset_2(conn)
+'''
 
 # Func-search
 @app.route('/search', methods=['POST'])
@@ -477,9 +495,10 @@ def edit_backlink_reset(name = 'Test'):
 def edit_delete(name = None):
     return edit_delete_2(conn, name)
 
+# 수정 필요
 @app.route('/many_delete', methods = ['POST', 'GET'])
-def edit_many_delete(name = None):
-    return edit_many_delete_2(conn)
+def edit_delete_many():
+    return edit_delete_many_2(conn)
 
 @app.route('/move/<everything:name>', methods = ['POST', 'GET'])
 def edit_move(name = None):

+ 6 - 4
lang/en-US.json

@@ -383,11 +383,7 @@
         "application_submitted": "Applicatied successfully for registration",
         "waiting_for_approval": "Application for registration has been made successfully. Please wait for approval by administrators.",
         "ie_no_data_required" : "Operation cannot continue because all required data has not been collected.",
-        "http_warring" : "Warning: If you are not on HTTPS connection, Your information can be leaked. We won't response to that.",
-        "user_head_warring" : "User data will be deleted if you close the browser or when you sign in.",
-        "no_login_warring" : "You are not logged in. The IP address will be logged when editing or discussing with non-login.",
         "user_reset_sign" : "Your account information has changed like this.",
-        "update_warring" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder disappear.",
         "default_edit_help" : "Describe it here",
         "markup_enabled" : "Markup enabled",
         "many_delete_help" : "Please write down the document[s] name one by one on the line.",
@@ -433,4 +429,10 @@
             "restart_fail_error" : "Restart failed. Please use manual restart.",
             "same_email_error" : "There are users using the same email.",
             "input_email_error" : "There is a problem with the input value."
+        "_comment_3.2_" : "Warning",
+            "http_warning" : "Warning: If you are not on HTTPS connection, Your information can be leaked. We won't response to that.",
+            "user_head_warning" : "User data will be deleted if you close the browser or when you sign in.",
+            "no_login_warning" : "You are not logged in. The IP address will be logged when editing or discussing with non-login.",
+            "update_warning" : "Manual updates are recommended if your version is 0.2 or lower than the latest version. For Windows, the contents of the route folder disappear.",
+            "history_delete_warning" : "If you erase history, it's hard to restore it, so make a careful decision."
 }

+ 6 - 5
lang/ko-KR.json

@@ -109,7 +109,7 @@
     "topic_tool": "토론 관리 도구",
     "user_document": "사용자 문서",
     "id": "아이디",
-    "no_login_warring": "비로그인 상태입니다. 편집 시 지금 접속한 IP가 기록됩니다.",
+    "no_login_warning": "비로그인 상태입니다. 편집 시 지금 접속한 IP가 기록됩니다.",
     "decument_404_error": "이 문서는 존재하지 않습니다.",
     "key": "키",
     "lastest": "최신",
@@ -187,8 +187,8 @@
     "editor": "편집자",
     "wiki_secret_key": "위키 비밀 키",
     "band_ban": "대역 차단",
-    "http_warring": "경고: HTTPS 연결을 사용하지 않는다면 개인정보가 유출될 수 있습니다. 이 사항에 의해 입는 피해는 사용자에게 책임이 있음을 알려드립니다.",
-    "update_warring": "최신 버전보다 0.2 버전 이상 낮은 경우 수동 업데이트를 권장합니다. 윈도우의 경우 route 폴더의 내용이 사라집니다.",
+    "http_warning": "경고: HTTPS 연결을 사용하지 않는다면 개인정보가 유출될 수 있습니다. 이 사항에 의해 입는 피해는 사용자에게 책임이 있음을 알려드립니다.",
+    "update_warning": "최신 버전보다 0.2 버전 이상 낮은 경우 수동 업데이트를 권장합니다. 윈도우의 경우 route 폴더의 내용이 사라집니다.",
     "discussion_name": "토론 제목",
     "discussion": "토론",
     "main": "메인",
@@ -263,7 +263,7 @@
     "other": "기타",
     "edit": "편집",
     "open_discussion_list": "열린 토론 목록",
-    "user_head_warring": "비로그인시 브라우저를 닫거나 로그인시 사용자가 지정한 정보는 삭제됩니다.",
+    "user_head_warning": "비로그인시 브라우저를 닫거나 로그인시 사용자가 지정한 정보는 삭제됩니다.",
     "email_required": "이메일 사용",
     "1_day": "1일",
     "regex_error": "정규표현식에 오류가 있습니다.",
@@ -400,5 +400,6 @@
     "server_set" : "서버 관련 설정",
     "edit_set" : "편집 관련 설정",
     "wiki_shutdown" : "위키 엔진 종료",
-    "shutdown" : "종료"
+    "shutdown" : "종료",
+    "history_delete_warning" : "역사를 지울 경우 복구하기 어려우니 신중하게 결정하세요."
 }

+ 0 - 133
route/__init__.py

@@ -1,133 +0,0 @@
-# Import
-# Import-votete
-from .vote import *
-from .vote_end import *
-from .vote_close import *
-from .vote_add import *
-from .vote_select import *
-
-# Import-search
-from .search import *
-from .search_goto import *
-from .search_deep import *
-
-# Import-application
-from .application_submitted import *
-from .applications import *
-
-# Import-give
-from .give_user_ban import *
-from .give_user_check_delete import *
-from .give_history_hidden import *
-from .give_acl import *
-from .give_admin_groups import *
-from .give_history_add import *
-from .give_user_check import *
-from .give_delete_admin_group import *
-from .give_admin import *
-
-# Import-list
-from .list_admin_group import *
-from .list_image_file import *
-from .list_user_topic import *
-from .list_acl import *
-from .list_title_index import *
-from .list_not_close_topic import *
-from .list_admin import *
-from .list_old_page import *
-from .list_please import *
-from .list_user import *
-from .list_admin_use import *
-from .list_long_page import *
-
-# Import-main
-from .main_file import *
-from .main_other import *
-from .main_views import *
-from .main_upload import *
-from .main_skin_set import *
-from .main_setting import *
-from .main_error_404 import *
-from .main_title_random import *
-from .main_image_view import *
-from .main_manager import *
-from .main_test_func import *
-from .main_shutdown import *
-from .main_restart import *
-from .main_update import *
-
-# Import-api
-from .api_topic_sub import *
-from .api_search import *
-from .api_skin_info import *
-from .api_recent_change import *
-from .api_w import *
-from .api_title_index import *
-from .api_sitemap import *
-from .api_raw import *
-from .api_sha224 import *
-from .api_user_info import *
-from .api_markup import *
-from .api_image_view import *
-from .api_version import *
-
-# Import-user
-from .user_info import *
-from .user_setting import *
-from .user_setting_email import *
-from .user_setting_email_check import *
-from .user_setting_pw_change import *
-from .user_tool import *
-from .user_count_edit import *
-from .user_custom_head_view import *
-from .user_watch_list import *
-from .user_watch_list_name import *
-from .user_alarm import *
-from .user_alarm_del import *
-
-# Import-inter_wiki
-from .inter_wiki_plus import *
-from .inter_wiki_del import *
-from .inter_wiki import *
-
-# Import-login
-from .login import *
-from .login_2fa import *
-from .login_check_key import *
-from .login_logout import *
-from .login_register import *
-from .login_need_email import *
-
-# Import-topic
-from .topic_admin import *
-from .topic_stop import *
-from .topic import *
-from .topic_change import *
-from .topic_block import *
-from .topic_close_list import *
-from .topic_delete import *
-from .topic_tool import *
-from .topic_top import *
-from .topic_acl import *
-
-# Import-recent
-from .recent_changes import *
-from .recent_history_tool import *
-from .recent_block import *
-from .recent_history_delete import *
-from .recent_discuss import *
-
-# Import-topic
-from .edit import *
-from .edit_delete import *
-from .edit_backlink_reset import *
-from .edit_revert import *
-from .edit_move import *
-from .edit_many_delete import *
-
-# Import-view
-from .view_xref import *
-from .view_raw import *
-from .view_diff_data import *
-from .view_read import *
-from .view_down import *

+ 6 - 6
route/edit.py

@@ -96,19 +96,19 @@ def edit_2(conn, name):
                     
         else:
             data = flask.request.form.get('content', '')
-            warring_edit = load_lang('exp_edit_conflict') + ' '
+            warning_edit = load_lang('exp_edit_conflict') + ' '
 
             if flask.request.form.get('ver', '0') == '0':
-                warring_edit += '<a href="/raw/' + url_pas(name) + '">(r' + doc_ver + ')</a>'
+                warning_edit += '<a href="/raw/' + url_pas(name) + '">(r' + doc_ver + ')</a>'
             else:
-                warring_edit += '' + \
+                warning_edit += '' + \
                     '<a href="/diff/' + url_pas(name) + '?first=' + flask.request.form.get('ver', '1') + '&second=' + doc_ver + '">' + \
                         '(r' + doc_ver + ')' + \
                     '</a>' + \
                 ''
 
-            warring_edit += '<hr class="main_hr">'
-            editor_top_text = warring_edit + editor_top_text
+            warning_edit += '<hr class="main_hr">'
+            editor_top_text = warning_edit + editor_top_text
 
         editor_top_text += '' + \
             '<a href="/edit_filter">(' + load_lang('edit_filter_rule') + ')</a>' + \
@@ -199,7 +199,7 @@ def edit_2(conn, name):
                             name="ver" 
                             value="''' + doc_ver + '''">
                     <hr class="main_hr">
-                    ''' + captcha_get() + ip_warring() + cccb_text + '''
+                    ''' + captcha_get() + ip_warning() + cccb_text + '''
                     <button id="save"
                             type="submit" 
                             onclick="

+ 1 - 1
route/edit_delete.py

@@ -64,7 +64,7 @@ def edit_delete_2(conn, name):
             imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('delete') + ')', 0])],
             data = '''
                 <form method="post">
-                    ''' + ip_warring() + '''
+                    ''' + ip_warning() + '''
                     <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
                     <hr class="main_hr">
                     ''' + captcha_get() + '''

+ 2 - 2
route/edit_many_delete.py → route/edit_delete_many.py

@@ -1,7 +1,7 @@
 from .tool.func import *
 from . import edit_delete
 
-def edit_many_delete_2(conn):
+def edit_delete_many_2(conn):
     curs = conn.cursor()
 
     ip = ip_check()
@@ -27,4 +27,4 @@ def edit_many_delete_2(conn):
                 </form>
             ''',
             menu = [['manager/1', load_lang('return')]]
-        ))     
+        ))

+ 1 - 1
route/edit_move.py

@@ -159,7 +159,7 @@ def edit_move_2(conn, name):
             imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('move') + ')', 0])],
             data = '''
                 <form method="post">
-                    ''' + ip_warring() + '''
+                    ''' + ip_warning() + '''
                     <input placeholder="''' + load_lang('document_name') + '" value="' + name + '''" name="title" type="text">
                     <hr class=\"main_hr\">
                     <input placeholder="''' + load_lang('why') + '''" name="send" type="text">

+ 1 - 1
route/edit_revert.py

@@ -71,7 +71,7 @@ def edit_revert_2(conn, name):
                     <form method="post">
                         <span>r''' + flask.request.args.get('num', '0') + '''</span>
                         <hr class=\"main_hr\">
-                        ''' + ip_warring() + '''
+                        ''' + ip_warning() + '''
                         <input placeholder="''' + load_lang('why') + '''" name="send" type="text">
                         <hr class=\"main_hr\">
                         ''' + captcha_get() + '''

+ 1 - 1
route/login.py

@@ -66,7 +66,7 @@ def login_2(conn):
                         <hr class=\"main_hr\">
                         ''' + captcha_get() + '''
                         <button type="submit">''' + load_lang('login') + '''</button>
-                        ''' + http_warring() + '''
+                        ''' + http_warning() + '''
                     </form>
                     ''',
             menu = [['user', load_lang('return')]]

+ 1 - 1
route/login_2fa.py

@@ -55,7 +55,7 @@ def login_2fa_2(conn):
                         <hr class=\"main_hr\">
                         ''' + captcha_get() + '''
                         <button type="submit">''' + load_lang('login') + '''</button>
-                        ''' + http_warring() + '''
+                        ''' + http_warning() + '''
                     </form>
                     ''',
             menu = [['user', load_lang('return')]]

+ 1 - 1
route/login_register.py

@@ -129,7 +129,7 @@ def login_register_2(conn):
                     
                     <button type="submit">''' + load_lang('save') + '''</button>
                     
-                    ''' + http_warring() + '''
+                    ''' + http_warning() + '''
                 </form>
                 <script>
                     document.getElementById('oauth_google').href = '' +

+ 0 - 1
route/main_manager.py

@@ -39,7 +39,6 @@ def main_manager_2(conn, num, r_ver):
                 <ul class="inside_ul">
                     <li><a href="/admin_group">''' + load_lang('admin_group_list') + '''</a></li>
                     <li><a href="/many_delete">''' + load_lang('many_delete') + '''</a></li>
-                    <li><a href="/many_delete_history">''' + load_lang('many_history_delete') + '''</a></li>
                     <li><a href="/applications">''' + load_lang('application_list') + '''</a></li>
                     <li><a href="/api/sitemap.xml">''' + load_lang('get_sitemap') + '''</a></li>
                     <li><a href="/register">''' + load_lang('add_user') + '''</a></li>

+ 1 - 1
route/main_setting.py

@@ -227,7 +227,7 @@ def main_setting_2(conn, num, db_set):
     elif num == 2:
         i_list = [
             'contract',
-            'no_login_warring',
+            'no_login_warning',
             'edit_bottom_text',
             'copyright_checkbox_text',
             'check_key_text',

+ 1 - 1
route/main_update.py

@@ -44,7 +44,7 @@ def main_update_2(conn, r_ver):
     else:
         return easy_minify(flask.render_template(skin_check(),
             imp = [load_lang('update'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
-            data = load_lang('update_warring') + '''
+            data = load_lang('update_warning') + '''
                 <hr class=\"main_hr\">
                 <ul class="inside_ul">
                     <li>''' + load_lang('version') + ' : ' + r_ver + '''</li>

+ 11 - 11
route/recent_changes.py

@@ -91,7 +91,7 @@ def recent_changes_2(conn, name, tool):
             send = '<br>'
 
             if data[4]:
-                if not re.search(r"^(?: *)$", data[4]):
+                if not re.search(r"^(?: +)$", data[4]):
                     send = data[4]
 
             if re.search(r"\+", data[5]):
@@ -102,10 +102,7 @@ def recent_changes_2(conn, name, tool):
                 leng = '<span style="color:gray;">(' + data[5] + ')</span>'
 
             ip = all_ip[data[3]]
-            if tool == 'history':
-                m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '&type=history">(' + load_lang('tool') + ')</a>'
-            else:
-                m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '">(' + load_lang('tool') + ')</a>'
+            m_tool = '<a href="/history/tool/' + data[0] + '/' + url_pas(data[1]) + '">(' + load_lang('tool') + ')</a>'
 
             style = ['', '']
             date = data[2]
@@ -114,15 +111,11 @@ def recent_changes_2(conn, name, tool):
                 if admin == 1:
                     style[0] = 'id="toron_color_grey"'
                     style[1] = 'id="toron_color_grey"'
-
-                    send += ' (' + load_lang('hide') + ')'
                 else:
                     ip = ''
                     ban = ''
                     date = ''
 
-                    send = '(' + load_lang('hide') + ')'
-
                     style[0] = 'style="display: none;"'
                     style[1] = 'id="toron_color_grey"'
 
@@ -174,13 +167,20 @@ def recent_changes_2(conn, name, tool):
                     ''' + div
 
                     if admin == 1:
-                        menu += [['add_history/' + url_pas(name), load_lang('history_add')]]
+                        menu += [
+                            ['history/add/' + url_pas(name), load_lang('history_add')],
+                            ['history/reset/' + url_pas(name), load_lang('history_reset')]
+                        ]
 
                 title = name
                 div += next_fix('/history/' + url_pas(name) + '?tool=' + set_type + '&num=', num, data_list)
             else:
                 title = load_lang('edit_record')
-                menu = [['other', load_lang('other')], ['user', load_lang('user')], ['count/' + url_pas(name), load_lang('count')]]
+                menu = [
+                    ['other', load_lang('other')], 
+                    ['user', load_lang('user')], 
+                    ['count/' + url_pas(name), load_lang('count')]
+                ]
                 div += next_fix('/record/' + url_pas(name) + '?num=', num, data_list)
         else:
             div = '' + \

+ 1 - 1
route/give_history_add.py → route/recent_history_add.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def give_history_add_2(conn, name):
+def recent_history_add_2(conn, name):
     curs = conn.cursor()
 
     ip = ip_check()

+ 5 - 3
route/recent_history_delete.py

@@ -1,15 +1,15 @@
 from .tool.func import *
 
-def recent_history_delete_2(conn, name):
+def recent_history_delete_2(conn, name, rev):
     curs = conn.cursor()
 
-    num = str(int(number_check(flask.request.args.get('num', '1'))))
+    num = str(rev)
 
     if admin_check() != 1:
         return re_error('/error/3')
 
     if flask.request.method == 'POST':
-        admin_check(None, 'history delete r' + num)
+        admin_check(None, 'history delete ' + name + ' r' + num)
 
         curs.execute(db_change("delete from history where id = ? and title = ?"), [num, name])
         conn.commit()
@@ -20,6 +20,8 @@ def recent_history_delete_2(conn, name):
             imp = [name, wiki_set(), wiki_custom(), wiki_css(['(r' + num + ')', 0])],
             data = '''
                 <form method="post">
+                    <span>''' + load_lang('history_delete_warning') + '''</span>
+                    <hr class="main_hr">
                     <button type="submit">''' + load_lang('history_delete') + '''</button>
                 </form>
             ''',

+ 3 - 3
route/give_history_hidden.py → route/recent_history_hidden.py

@@ -1,9 +1,9 @@
 from .tool.func import *
 
-def give_history_hidden_2(conn, name):
+def recent_history_hidden_2(conn, name, rev):
     curs = conn.cursor()
-
-    num = number_check(flask.request.args.get('num', '1'))
+    
+    num = str(rev)
 
     if admin_check(6, 'history_hidden (' + name + '#' + num + ')') == 1:
         curs.execute(db_change("select title from history where title = ? and id = ? and hide = 'O'"), [name, num])

+ 27 - 0
route/recent_history_reset.py

@@ -0,0 +1,27 @@
+from .tool.func import *
+
+def recent_history_reset_2(conn, name):
+    curs = conn.cursor()
+
+    if admin_check() != 1:
+        return re_error('/error/3')
+
+    if flask.request.method == 'POST':
+        admin_check(None, 'history reset ' + name)
+
+        curs.execute(db_change("delete from history where title = ?"), [name])
+        conn.commit()
+
+        return redirect('/history/' + url_pas(name))
+    else:
+        return easy_minify(flask.render_template(skin_check(),
+            imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('history_reset') + ')', 0])],
+            data = '''
+                <form method="post">
+                    <span>''' + load_lang('history_delete_warning') + '''</span>
+                    <hr class="main_hr">
+                    <button type="submit">''' + load_lang('history_reset') + '''</button>
+                </form>
+            ''',
+            menu = [['history/' + url_pas(name), load_lang('return')]]
+        ))

+ 17 - 13
route/recent_history_tool.py

@@ -1,9 +1,9 @@
 from .tool.func import *
 
-def recent_history_tool_2(conn, name):
+def recent_history_tool_2(conn, name, rev):
     curs = conn.cursor()
 
-    num = str(int(number_check(flask.request.args.get('num', '1'))))
+    num = str(rev)
 
     data = '' + \
         '<h2>' + load_lang('tool') + '</h2>' + \
@@ -11,26 +11,30 @@ def recent_history_tool_2(conn, name):
             '<li><a href="/raw/' + url_pas(name) + '?num=' + num + '">' + load_lang('raw') + '</a></li>' + \
     ''
 
-    if flask.request.args.get('type', '') == 'history':
-        data += '<li><a href="/revert/' + url_pas(name) + '?num=' + num + '">' + load_lang('revert') + '</a></li>'
-        if (int(num) - 1) > 0:
-            data += '<li><a href="/diff/' + url_pas(name) + '?first=' + str(int(num) - 1) + '&second=' + num + '">' + load_lang('compare') + '</a></li>'
-    elif (int(num) - 1) > 0:
-        data += '<li><a href="/revert/' + url_pas(name) + '?num=' + str(int(num) - 1) + '">' + load_lang('revert') + '</a></li>'
+    data += '<li><a href="/revert/' + url_pas(name) + '?num=' + num + '">' + load_lang('revert') + ' | r' + num + '</a></li>'
+    if rev - 1 > 0:
+        data += '<li><a href="/revert/' + url_pas(name) + '?num=' + str(rev - 1) + '">' + load_lang('revert') + ' | r' + str(rev - 1) + '</a></li>'
+    
+    if rev - 1 > 0:
+        data += '<li><a href="/diff/' + url_pas(name) + '?first=' + str(rev - 1) + '&second=' + num + '">' + load_lang('compare') + '</a></li>'
 
-    if flask.request.args.get('type', '') != 'history':
-        data += '<li><a href="/history/' + url_pas(name) + '">' + load_lang('history') + '</a></li>'
+    data += '<li><a href="/history/' + url_pas(name) + '">' + load_lang('history') + '</a></li>'
 
     if admin_check(6) == 1:
         curs.execute(db_change('' + \
             'select title from history ' + \
             'where title = ? and id = ? and hide = "O"' + \
         ''), [name, num])
-        hide = curs.fetchall()
-        data += '<li><a href="/hidden/' + url_pas(name) + '?num=' + num + '">' + (load_lang('hide_release') if hide else load_lang('hide')) + '</li>'
+        data += '<li><a href="/history/hidden/' + num + '/' + url_pas(name) + '">'
+        if curs.fetchall():
+            data += load_lang('hide_release') 
+        else:
+            data += load_lang('hide')
+            
+        data += '</li>'
 
     if admin_check() == 1:
-        data += '<li><a href="/history_delete/' + url_pas(name) + '?num=' + num + '">' + load_lang('history_delete') + '</li>'
+        data += '<li><a href="/history/delete/' + num + '/' + url_pas(name) + '">' + load_lang('history_delete') + '</li>'
 
     data += '</ul>'
 

+ 29 - 0
route/recent_record_reset.py

@@ -0,0 +1,29 @@
+from .tool.func import *
+
+def recent_record_reset_2(conn, name):
+    curs = conn.cursor()
+
+    num = str(int(number_check(flask.request.args.get('num', '1'))))
+
+    if admin_check() != 1:
+        return re_error('/error/3')
+
+    if flask.request.method == 'POST':
+        admin_check(None, 'history delete r' + num)
+
+        curs.execute(db_change("delete from history where id = ? and title = ?"), [num, name])
+        conn.commit()
+
+        return redirect('/history/' + url_pas(name))
+    else:
+        return easy_minify(flask.render_template(skin_check(),
+            imp = [name, wiki_set(), wiki_custom(), wiki_css(['(r' + num + ')', 0])],
+            data = '''
+                <form method="post">
+                    <span>''' + load_lang('history_delete_warning') + '''</span>
+                    <hr class="main_hr">
+                    <button type="submit">''' + load_lang('history_delete') + '''</button>
+                </form>
+            ''',
+            menu = [['history/' + url_pas(name), load_lang('return')]]
+        ))

+ 8 - 8
route/tool/func.py

@@ -451,15 +451,15 @@ def load_image_url():
     
     return image_where
 
-def http_warring():
+def http_warning():
     return '''
-        <div id="http_warring_text"></div>
+        <div id="http_warning_text"></div>
         <script>
             if(window.location.protocol !== 'https:') {
-                document.getElementById('http_warring_text').innerHTML = "''' + \
-                    load_lang('http_warring') + \
+                document.getElementById('http_warning_text').innerHTML = "''' + \
+                    load_lang('http_warning') + \
                 '''";
-                document.getElementById('http_warring_text').style.margin = "10px 0px 0px 0px";
+                document.getElementById('http_warning_text').style.margin = "10px 0px 0px 0px";
             }
         </script>
     '''
@@ -499,9 +499,9 @@ def edit_button():
     
     return data
 
-def ip_warring():
+def ip_warning():
     if ip_or_user() != 0:
-        curs.execute(db_change('select data from other where name = "no_login_warring"'))
+        curs.execute(db_change('select data from other where name = "no_login_warning"'))
         data = curs.fetchall()
         if data and data[0][0] != '':
             text_data = '' + \
@@ -510,7 +510,7 @@ def ip_warring():
             ''
         else:
             text_data = '' + \
-                '<span>' + load_lang('no_login_warring') + '</span>' + \
+                '<span>' + load_lang('no_login_warning') + '</span>' + \
                 '<hr class="main_hr">' + \
             ''
     else:

+ 1 - 1
route/topic.py

@@ -108,7 +108,7 @@ def topic_2(conn, topic_num):
                 <form style="''' + display + '''" method="post">
                     <textarea id="content" class="topic_content" placeholder="''' + load_lang('content') + '''" name="content"></textarea>
                     <hr class="main_hr">
-                    ''' + captcha_get() + (ip_warring() if display == '' else '') + '''
+                    ''' + captcha_get() + (ip_warning() if display == '' else '') + '''
                     <input style="display: none;" name="topic" value="''' + name + '''">
                     <input style="display: none;" name="title" value="''' + sub + '''">
                     <button id="save" type="submit">''' + load_lang('send') + '''</button>

+ 1 - 1
route/topic_close_list.py

@@ -41,7 +41,7 @@ def topic_close_list_2(conn, name):
                 <hr class="main_hr">
                 <textarea rows="10" id="content" placeholder="''' + load_lang('content') + '''" name="content"></textarea>
                 <hr class="main_hr">
-                ''' + captcha_get() + (ip_warring() if display == '' else '') + '''
+                ''' + captcha_get() + (ip_warning() if display == '' else '') + '''
                 <input style="display: none;" name="topic" value="''' + name + '''">
                 <button type="submit">''' + load_lang('send') + '''</button>
                 <button id="preview" type="button" onclick="load_preview(\'''' + url_pas(name) + '\')">' + load_lang('preview') + '''</button>

+ 1 - 1
route/user_custom_head_view.py

@@ -28,7 +28,7 @@ def user_custom_head_view_2(conn):
             data = head_data[0][0] if head_data else ''
         else:
             start = '' + \
-                '<span>' + load_lang('user_head_warring') + '</span>' + \
+                '<span>' + load_lang('user_head_warning') + '</span>' + \
                 '<hr class="main_hr">' + \
             ''
             data = flask.session['head'] if 'head' in flask.session else ''

+ 3 - 3
route/user_setting.py

@@ -96,7 +96,7 @@ def user_setting_2(conn, server_init):
                         </div>
                         <hr class="main_hr">
                         <button type="submit">''' + load_lang('save') + '''</button>
-                        ''' + http_warring() + '''
+                        ''' + http_warning() + '''
                         <script>do_twofa_check(1);</script>
                     </form>
                 ''',
@@ -142,9 +142,9 @@ def user_setting_2(conn, server_init):
                         <select name="lang">''' + div3 + '''</select>
                         <hr class="main_hr">
                         <button type="submit">''' + load_lang('save') + '''</button>
-                        ''' + http_warring() + '''
+                        ''' + http_warning() + '''
                         <hr class="main_hr">
-                        <span>''' + load_lang('user_head_warring') + '''</span>
+                        <span>''' + load_lang('user_head_warning') + '''</span>
                     </form>
                 ''',
                 menu = [['user', load_lang('return')]]

+ 1 - 0
route/user_setting_email.py

@@ -4,6 +4,7 @@ def user_setting_email_2(conn):
     curs = conn.cursor()
     
     if flask.request.method == 'POST':
+        # c_key 같은 이름 대신 한 기능에 고유 명칭 부여 필요
         re_set_list = ['c_key']
         flask.session['c_key'] = load_random_key(32)
 

+ 0 - 1
route/user_setting_email_check.py

@@ -18,7 +18,6 @@ def user_setting_email_check_2(conn):
             curs.execute(db_change('delete from user_set where name = "email" and id = ?'), [ip])
             curs.execute(db_change('insert into user_set (name, id, data) values ("email", ?, ?)'), [ip, flask.session['c_email']])
 
-
         for i in re_set_list:
             flask.session.pop(i, None)
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.0-stable-01b (beta-01b) (dev-21.08.13-01)",
+        "r_ver" : "v3.4.0-stable-01b (beta-01b) (dev-21.08.15-02)",
         "c_ver" : "3400101",
         "s_ver" : "12"
     }