Browse Source

토론 수정 중

Surplus_Up (2DU) 6 năm trước cách đây
mục cha
commit
eef3d6f3aa
5 tập tin đã thay đổi với 45 bổ sung22 xóa
  1. 2 0
      language/en-US.json
  2. 3 1
      language/ko-KR.json
  3. 13 14
      route/topic.py
  4. 3 3
      route/topic_close_list.py
  5. 24 4
      route/topic_stop.py

+ 2 - 0
language/en-US.json

@@ -166,6 +166,8 @@
         "acl_change" : "Change document ACL",
         "user_tool" : "User tool",
         "skin_info" : "Skin info",
+        "closed_discussion" : "Closed discussion",
+        "agreed_discussion" : "Agreed discussion",
         "_comment_2.1_" : "Filter",
             "_comment_2.1.1_" : "List",
                 "interwiki_list" : "Interwiki(s) list",

+ 3 - 1
language/ko-KR.json

@@ -291,5 +291,7 @@
     "error_401" : "ACL 보기 제한 문서 문구",
     "error_404" : "없는 문서 문구",
     "skin_info" : "스킨 정보",
-    "pinned" : "고정"
+    "pinned" : "고정",
+    "closed_discussion" : "닫힌 토론",
+    "agreed_discussion" : "합의된 토론"
 }

+ 13 - 14
route/topic.py

@@ -86,21 +86,20 @@ def topic_2(conn, name, sub):
         else:
             display = ''
 
-        if ban != 1 or admin == 1:
-            data += '''
-                <div id="top_topic"></div>
-                <div id="main_topic"></div>
-                <div id="plus_topic"></div>
-                <script>topic_top_load("''' + name + '''", "''' + sub + '''");</script>
-                <a id="reload" href="javascript:void(0);" onclick="topic_reload();">(''' + load_lang('reload') + ''')</a> <a href="/topic/''' + url_pas(name) + '''/sub/''' + url_pas(sub) + '''/tool">(''' + load_lang('topic_tool') + ''')</a>
+        data += '''
+            <div id="top_topic"></div>
+            <div id="main_topic"></div>
+            <div id="plus_topic"></div>
+            <script>topic_top_load("''' + name + '''", "''' + sub + '''");</script>
+            <a id="reload" href="javascript:void(0);" onclick="topic_reload();">(''' + load_lang('reload') + ''')</a> <a href="/topic/''' + url_pas(name) + '''/sub/''' + url_pas(sub) + '''/tool">(''' + load_lang('topic_tool') + ''')</a>
+            <hr class=\"main_hr\">
+            <form style="''' + display + '''" method="post">
+                <textarea style="height: 100px;" name="content"></textarea>
                 <hr class=\"main_hr\">
-                <form style="''' + display + '''" method="post">
-                    <textarea style="height: 100px;" name="content"></textarea>
-                    <hr class=\"main_hr\">
-                    ''' + captcha_get() + (ip_warring() if display == '' else '') + '''
-                    <button type="submit">''' + load_lang('send') + '''</button>
-                </form>
-            '''
+                ''' + captcha_get() + (ip_warring() if display == '' else '') + '''
+                <button type="submit">''' + load_lang('send') + '''</button>
+            </form>
+        '''
 
         return easy_minify(flask.render_template(skin_check(), 
             imp = [name, wiki_set(), custom(), other2([' (' + load_lang('discussion') + ')', 0])],

+ 3 - 3
route/topic_close_list.py

@@ -26,11 +26,11 @@ def topic_close_list_2(conn, name, tool):
         if tool == 'close':
             curs.execute("select sub from rd where title = ? and stop = 'O' order by sub asc", [name])
             
-            sub = load_lang('close')
+            sub = load_lang('closed_discussion')
         elif tool == 'agree':
             curs.execute("select sub from rd where title = ? and agree = 'O' order by sub asc", [name])
             
-            sub = load_lang('agreement')
+            sub = load_lang('agreed_discussion')
         else:
             curs.execute("select sub from rd where title = ? order by date desc", [name])
             
@@ -39,7 +39,7 @@ def topic_close_list_2(conn, name, tool):
             menu = [['w/' + url_pas(name), load_lang('document')]]
             
             plus =  '''
-                <a href="/topic/''' + url_pas(name) + '''/close">(''' + load_lang('close') + ''')</a> <a href="/topic/''' + url_pas(name) + '''/agree">(''' + load_lang('agreement') + ''')</a>
+                <a href="/topic/''' + url_pas(name) + '''/close">(''' + load_lang('closed_discussion') + ''')</a> <a href="/topic/''' + url_pas(name) + '''/agree">(''' + load_lang('agreed_discussion') + ''')</a>
                 <hr class=\"main_hr\">
                 <input placeholder="''' + load_lang('discussion_name') + '''" name="topic" type="text">
                 <hr class=\"main_hr\">

+ 24 - 4
route/topic_stop.py

@@ -22,6 +22,7 @@ def topic_stop_2(conn, name, sub, tool):
                     curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, 'break', ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, time, ip])
                     curs.execute("update rd set agree = 'O' where title = ? and sub = ?", [name, sub])
             else:
+                # 이 쪽 잘못 짜여 있음 내일 수정 필요
                 if tool == 'close':
                     why = flask.request.form.get('why', '')
                     set_list = [
@@ -31,16 +32,35 @@ def topic_stop_2(conn, name, sub, tool):
                         'open' + (('[br][br]why : ' + why) if why else '')
                     ]
                 elif tool == 'stop':
-                    set_list = ['', 'O', 'stop', 'restart']
+                    set_list = [
+                        '', 
+                        'O', 
+                        'stop', 
+                        'restart'
+                    ]
                 else:
                     return redirect('/topic/' + url_pas(name) + '/sub/' + url_pas(sub))
 
-                curs.execute("select title from rd where title = ? and sub = ? and stop = ?", [name, sub, set_list[0]])
+                curs.execute("select title from rd where title = ? and sub = ? and stop = ?", [name, sub, set_list[1]])
                 if curs.fetchall():
-                    curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[3], time, ip])
+                    curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [
+                        str(int(topic_check[0][0]) + 1),
+                        name, 
+                        sub, 
+                        set_list[3], 
+                        time, 
+                        ip
+                    ])
                     curs.execute("update rd set stop = '' where title = ? and sub = ?", [name, sub])
                 else:
-                    curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[2], time, ip])
+                    curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [
+                        str(int(topic_check[0][0]) + 1), 
+                        name, 
+                        sub, 
+                        set_list[2], 
+                        time, 
+                        ip
+                    ])
                     curs.execute("update rd set stop = ? where title = ? and sub = ?", [set_list[0], name, sub])
             
             rd_plus(name, sub, time)