Kaynağa Gözat

역사에선 해당 리비전으로 가도록

Surplus_Up (2DU) 6 yıl önce
ebeveyn
işleme
36dd9fc949
2 değiştirilmiş dosya ile 14 ekleme ve 1 silme
  1. 4 1
      route/recent_changes.py
  2. 10 0
      route/recent_history_tool.py

+ 4 - 1
route/recent_changes.py

@@ -119,7 +119,10 @@ def recent_changes_2(conn, name, tool):
                 leng = '<span style="color:gray;">(' + data[5] + ')</span>'
                 
             ip = ip_pas(data[3])
-            m_tool = '<a href="/history_tool/' + url_pas(data[1]) + '?num=' + data[0] + '">(' + load_lang('tool') + ')</a>'
+            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>'
             
             style = ['', '']
             date = data[2]

+ 10 - 0
route/recent_history_tool.py

@@ -18,6 +18,16 @@ def recent_history_tool_2(conn, name):
             <li>
                 <a href="/diff/''' + url_pas(name) + '?first=''' + str(int(num) - 1) + '&second=' + num + '">' + load_lang('compare') + '''</a>
             </li>
+        '''
+
+    if flask.request.args.get('type', '') == 'history':
+        data += '''
+            <li>
+                <a href="/revert/''' + url_pas(name) + '?num=' + num + '">' + load_lang('revert') + '''</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>