Преглед изворни кода

각 기능별 문구 설정 기능 추가

https://github.com/openNAMU/openNAMU/issues/2353
잉여개발기 пре 1 година
родитељ
комит
305ddbcfe6

+ 6 - 0
lang/en-US.json

@@ -56,6 +56,12 @@
     "login_able_and_regsiter_disable": "Login-able and Registration-disable",
     "private": "Private",
     "upvote": "Upvote",
+    "template_var" : "Template variable",
+    "edit_only_bottom_text" : "Editing only textarea bottom notice",
+    "move_bottom_text" : "Move textarea bottom notice",
+    "delete_bottom_text" : "Delete textarea bottom notice",
+    "revert_bottom_text" : "Revert textarea bottom notice",
+
 
     "_comment_": "Common",
     "data": "Data",

+ 6 - 1
lang/ko-KR.json

@@ -703,5 +703,10 @@
     "login_able_and_regsiter_disable": "로그인 허용 및 회원가입 비허용",
     "private": "비공개",
     "password_same_as_id_error": "비밀번호는 사용자 ID와 같을 수 없습니다.",
-    "upvote": "추천"
+    "upvote": "추천",
+    "template_var" : "템플릿 변수",
+    "edit_only_bottom_text" : "편집 전용 하단 문구",
+    "move_bottom_text" : "이동 하단 문구",
+    "delete_bottom_text" : "삭제 하단 문구",
+    "revert_bottom_text" : "되돌리기 하단 문구"
 }

+ 1 - 1
route/edit.py

@@ -373,7 +373,7 @@ def edit(name = 'Test', section = 0, do_type = ''):
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send">
                         <hr class="main_hr">
                         
-                        ''' + edit_editor(conn, ip, data_section, addon = get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn) , name = name) + '''
+                        ''' + edit_editor(conn, ip, data_section, addon = get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'edit') , name = name) + '''
                     </form>
                 ''',
                 menu = [

+ 1 - 1
route/edit_delete.py

@@ -59,7 +59,7 @@ def edit_delete(name):
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'delete')  + '''
                         <button type="submit">''' + get_lang(conn, 'delete') + '''</button>
                     </form>
                 ''',

+ 1 - 1
route/edit_delete_multiple.py

@@ -31,7 +31,7 @@ def edit_delete_multiple():
                         <hr class="main_hr">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send" type="text">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'edit')  + '''
                         <button type="submit">''' + get_lang(conn, 'delete') + '''</button>
                     </form>
                 ''',

+ 1 - 1
route/edit_move.py

@@ -256,7 +256,7 @@ def edit_move(name):
                             '''
                         ) if owner_auth == 1 else '') + '''
 
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'move')  + '''
                         
                         <button type="submit">''' + get_lang(conn, 'move') + '''</button>
                     </form>

+ 1 - 1
route/edit_revert.py

@@ -80,7 +80,7 @@ def edit_revert(name, num):
                     <form method="post">
                         <input placeholder="''' + get_lang(conn, 'why') + '''" name="send" type="text">
                         <hr class="main_hr">
-                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn)  + '''
+                        ''' + captcha_get(conn) + ip_warning(conn) + get_edit_text_bottom_check_box(conn) + get_edit_text_bottom(conn, 'revert')  + '''
                         <button type="submit">''' + get_lang(conn, 'revert') + '''</button>
                     </form>
                 ''' + preview,

+ 5 - 5
route/main_setting_phrase.py

@@ -157,19 +157,19 @@ def main_setting_phrase():
                         <h3>''' + get_lang(conn, 'template_var_3') + ''' (''' + get_lang(conn, 'default') + ''' : ''' + get_lang(conn, 'bottom') + ''') (HTML)</h3>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[29] + '''">''' + html.escape(d_list[29]) + '''</textarea>
 
-                        <h3>''' + get_lang(conn, 'edit_bottom_text') + ''' (HTML)</h3>
+                        <h2>''' + get_lang(conn, 'edit_bottom_text') + ''' (HTML)</h2>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[2] + '''">''' + html.escape(d_list[2]) + '''</textarea>
 
-                        <h2>''' + get_lang(conn, 'edit_only_bottom_text') + ''' (HTML)</h2>
+                        <h3>''' + get_lang(conn, 'edit_only_bottom_text') + ''' (HTML)</h3>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[30] + '''">''' + html.escape(d_list[30]) + '''</textarea>
 
-                        <h3>''' + get_lang(conn, 'edit_bottom_text') + ''' (HTML)</h3>
+                        <h3>''' + get_lang(conn, 'move_bottom_text') + ''' (HTML)</h3>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[31] + '''">''' + html.escape(d_list[31]) + '''</textarea>
 
-                        <h3>''' + get_lang(conn, 'edit_bottom_text') + ''' (HTML)</h3>
+                        <h3>''' + get_lang(conn, 'delete_bottom_text') + ''' (HTML)</h3>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[32] + '''">''' + html.escape(d_list[32]) + '''</textarea>
 
-                        <h3>''' + get_lang(conn, 'edit_bottom_text') + ''' (HTML)</h3>
+                        <h3>''' + get_lang(conn, 'revert_bottom_text') + ''' (HTML)</h3>
                         <textarea class="opennamu_textarea_100" name="''' + i_list[33] + '''">''' + html.escape(d_list[33]) + '''</textarea>
 
                         <hr class="main_hr">

+ 17 - 6
route/tool/func.py

@@ -1982,18 +1982,29 @@ def ip_pas(raw_ip):
     return data["data"][raw_ip] if return_data == 1 else data["data"]
         
 # Func-edit
-def get_edit_text_bottom(conn) :
+def get_edit_text_bottom(conn, tool = '') :
     curs = conn.cursor()
     
     b_text = ''
     
     curs.execute(db_change('select data from other where name = "edit_bottom_text"'))
-    db_data= curs.fetchall()
+    db_data = curs.fetchall()
     if db_data and db_data[0][0] != '':
-        b_text = '' + \
-            db_data[0][0] + \
-            '<hr class="main_hr">' + \
-        ''
+        b_text = db_data[0][0] + '<hr class="main_hr">'
+
+    if tool != '':
+        if tool == 'edit':
+            curs.execute(db_change('select data from other where name = "edit_only_bottom_text"'))
+        elif tool == 'move':
+            curs.execute(db_change('select data from other where name = "move_bottom_text"'))
+        elif tool == 'delete':
+            curs.execute(db_change('select data from other where name = "delete_bottom_text"'))
+        else:
+            curs.execute(db_change('select data from other where name = "revert_bottom_text"'))
+
+        db_data = curs.fetchall()
+        if db_data and db_data[0][0] != '':
+            b_text = db_data[0][0] + '<hr class="main_hr">'
 
     return b_text