Selaa lähdekoodia

편집 요약 괄호 제한 해제

https://github.com/openNAMU/openNAMU/issues/2071
잉여개발기 (SPDV) 2 vuotta sitten
vanhempi
sitoutus
cdad3d3c8c

+ 3 - 3
lang/en-US.json

@@ -206,8 +206,8 @@
         "old_page" : "Document(s) modified a long time ago",
         "skin_set" : "Skin setting(s)",
         "many_delete" : "Document bulk delete",
-        "edit_req" : "Edit request",
-        "edit_req_check" : "Check edit request",
+        "edit_request" : "Edit request",
+        "edit_request_check" : "Check edit request",
         "accept_edit_request" : "Accept edit request",
         "history_add" : "Add history",
         "all_register_num" : "The number of application forms",
@@ -554,7 +554,7 @@
                 "view_acl" : "Reading ACL",
                 "user_document_acl" : "User document ACL",
                 "upload_acl" : "Upload ACL",
-                "edit_req_acl" : "Edit request ACL",
+                "edit_request_acl" : "Edit request ACL",
                 "many_upload_acl" : "Upload multiple files ACL",
                 "vote_acl" : "Vote ACL",
         "_comment_2.7_" : "Application list",

+ 3 - 3
lang/ko-KR.json

@@ -301,8 +301,8 @@
     "content": "내용",
     "upload_acl": "파일 올리기 ACL",
     "topic_delete": "토론 삭제",
-    "edit_req": "편집 요청",
-    "edit_req_check": "편집 요청 검사",
+    "edit_request": "편집 요청",
+    "edit_request_check": "편집 요청 검사",
     "sqlite_only": "SQLite만",
     "off": "끄기",
     "slow_edit": "편집 속도 제한 시간",
@@ -311,7 +311,7 @@
     "public_key": "공개 키",
     "fast_edit_error": "편집 속도가 너무 빠릅니다. 제한 (초) : ",
     "main_acl_setting": "기본 ACL 설정",
-    "edit_req_acl": "편집 요청 ACL",
+    "edit_request_acl": "편집 요청 ACL",
     "application_list": "가입신청 목록",
     "application_time": "가입신청 일시",
     "answer": "답변",

+ 3 - 3
route/edit_move.py

@@ -84,7 +84,7 @@ def edit_move(name):
                         ip, 
                         send, 
                         '0',
-                        t_check = 'merge <a>' + name + '</a> - <a>' + move_title + '</a> move',
+                        t_check = '<a>' + name + '</a> ↔ <a>' + move_title + '</a>',
                         mode = 'move'
                     )
                 elif move_option == 'reverse':
@@ -120,7 +120,7 @@ def edit_move(name):
                             ip, 
                             send, 
                             '0',
-                            t_check = '<a>' + title_name[0] + '</a> - <a>' + title_name[1] + '</a> move',
+                            t_check = '<a>' + title_name[0] + '</a> → <a>' + title_name[1] + '</a>',
                             mode = 'move'
                         )
                 elif move_option != 'none':
@@ -153,7 +153,7 @@ def edit_move(name):
                     ip, 
                     send,
                     '0',
-                    t_check = '<a>' + name + '</a> - <a>' + move_title + '</a> move',
+                    t_check = '<a>' + name + '</a> → <a>' + move_title + '</a>',
                     mode = 'move'
                 )
 

+ 2 - 4
route/edit_request.py

@@ -60,7 +60,6 @@ def edit_request(name = 'Test', do_type = ''):
                     edit_request_user,
                     edit_request_send,
                     edit_request_leng,
-                    t_check = 'approve',
                     mode = 'edit_request'
                 )
                 
@@ -77,7 +76,6 @@ def edit_request(name = 'Test', do_type = ''):
                     edit_request_user,
                     edit_request_send,
                     '0',
-                    t_check = 'decline',
                     mode = 'edit_request'
                 )
                 
@@ -90,10 +88,10 @@ def edit_request(name = 'Test', do_type = ''):
             db_data = curs.fetchall()
             old_data = db_data[0][0] if db_data else ''
 
-            result = view_diff_do(old_data, edit_request_data, 'r' + doc_ver, load_lang('edit_req'))
+            result = view_diff_do(old_data, edit_request_data, 'r' + doc_ver, load_lang('edit_request'))
 
             return easy_minify(flask.render_template(skin_check(), 
-                imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('edit_req_check') + ')', 0])],
+                imp = [name, wiki_set(), wiki_custom(), wiki_css(['(' + load_lang('edit_request_check') + ')', 0])],
                 data = '''
                     <div id="opennamu_get_user_info">''' + html.escape(edit_request_user) + '''</div>
                     <hr class="main_hr">

+ 0 - 1
route/edit_upload.py

@@ -105,7 +105,6 @@ def edit_upload():
                     ip,
                     '',
                     '0',
-                    t_check = 'upload',
                     mode = 'upload'
                 )
 

+ 16 - 7
route/recent_change.py

@@ -65,9 +65,9 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
 
                 set_type = '' if set_type == 'edit' else set_type
                 if set_type != 'normal':
-                    curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where title = ? and type = ? order by id + 0 desc limit ?, 50'), [name, set_type, sql_num])
+                    curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where title = ? and type = ? order by id + 0 desc limit ?, 50'), [name, set_type, sql_num])
                 else:
-                    curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where title = ? order by id + 0 desc limit ?, 50'), [name, sql_num])
+                    curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where title = ? order by id + 0 desc limit ?, 50'), [name, sql_num])
 
                 data_list = curs.fetchall()
             elif tool == 'record':
@@ -80,9 +80,9 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
                 set_type = '' if set_type == 'edit' else set_type
 
                 if set_type != 'normal':
-                    curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where ip = ? and type = ? order by date desc limit ?, 50'), [name, set_type, sql_num])
+                    curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where ip = ? and type = ? order by date desc limit ?, 50'), [name, set_type, sql_num])
                 else:
-                    curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where ip = ? order by date desc limit ?, 50'), [name, sql_num])
+                    curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where ip = ? order by date desc limit ?, 50'), [name, sql_num])
                 
                 data_list = curs.fetchall()
             else:
@@ -99,13 +99,13 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
                 if num == 1 or all_admin != 1:
                     curs.execute(db_change('select title, id from rc where type = ? order by date desc limit 50'), [set_type])
                     for for_a in curs.fetchall():
-                        curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where title = ? and id = ?'), for_a)
+                        curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where title = ? and id = ?'), for_a)
                         data_list += curs.fetchall()
                 else:
                     if set_type != 'normal':
-                        curs.execute(db_change('select id, title, date, ip, send, leng, hide from history where type = ? order by date desc limit ?, 50'), [set_type, sql_num])
+                        curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history where type = ? order by date desc limit ?, 50'), [set_type, sql_num])
                     else:
-                        curs.execute(db_change('select id, title, date, ip, send, leng, hide from history order by date desc limit ?, 50'), [sql_num])
+                        curs.execute(db_change('select id, title, date, ip, send, leng, hide, type from history order by date desc limit ?, 50'), [sql_num])
 
                     data_list = curs.fetchall()
 
@@ -129,6 +129,15 @@ def recent_change(name = '', tool = '', num = 1, set_type = 'normal'):
                 style = ['', '']
                 date = data[2]
 
+                type_data = ''
+                if data[7] != '':
+                    if data[7] == 'r1':
+                        type_data = ' (' + data[7] + ')'
+                    else:
+                        type_data = ' (' + load_lang(data[7]) + ')'
+
+                send += type_data
+
                 if data[6] == 'O':
                     if admin == 1:
                         style[0] = 'class="opennamu_history_blind"'

+ 0 - 1
route/recent_history_add.py

@@ -24,7 +24,6 @@ def recent_history_add(name = 'Test', do_type = ''):
                 'Add:' + flask.request.form.get('get_ip', ''),
                 flask.request.form.get('send', ''),
                 leng,
-                t_check = 'add',
                 mode = 'add'
             )
 

+ 2 - 2
route/tool/func.py

@@ -2492,7 +2492,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
             mode = 'r1' if id_data == '1' else mode
             mode = mode if not re.search('^user:', title) else 'user'
 
-        send = re.sub(r'\(|\)|<|>', '', send)
+        send = re.sub(r'<|>', '', send)
         send = send[:512] if len(send) > 512 else send
         send = send + ' (' + t_check + ')' if t_check != '' else send
 
@@ -2504,7 +2504,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
             history_plus_rc_max(curs, mode)
             curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, ?)"), [id_data, title, date, mode])
 
-            data_set_exist = '' if t_check != 'delete' else 'not_exist'
+            data_set_exist = '' if mode != 'delete' else 'not_exist'
 
             curs.execute(db_change('delete from data_set where doc_name = ? and set_name = "last_edit"'), [title])
             curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, '', 'last_edit', ?)"), [title, date])