2du 4 年 前
コミット
6f03693379
5 ファイル変更15 行追加7 行削除
  1. 2 2
      app.py
  2. 9 2
      route/edit.py
  3. 2 1
      route/main_tool_admin.py
  4. 1 1
      version.json
  5. 1 1
      views/main_css/js/render_onmark.js

+ 2 - 2
app.py

@@ -409,8 +409,8 @@ app.route('/random')(view_random)
 
 # Func-edit
 app.route('/edit/<everything:name>', methods = ['POST', 'GET'])(edit)
-app.route('/edit/<everything:name>/doc_from/<everything:name_load>', methods = ['POST', 'GET'])(edit)
-app.route('/edit/<everything:name>/doc_section/<int:section>', methods = ['POST', 'GET'])(edit)
+app.route('/edit_from/<everything:name>', methods = ['POST', 'GET'], defaults = { 'do_type' : 'load' })(edit)
+app.route('/edit_section/<int:section>/<everything:name>', methods = ['POST', 'GET'])(edit)
 
 app.route('/upload', methods = ['POST', 'GET'])(edit_upload)
 

+ 9 - 2
route/edit.py

@@ -1,6 +1,6 @@
 from .tool.func import *
 
-def edit(name = 'Test', name_load = 0, section = 0):
+def edit(name = 'Test', section = 0, do_type = ''):
     with get_db_connect() as conn:
         curs = conn.cursor()
     
@@ -91,7 +91,14 @@ def edit(name = 'Test', name_load = 0, section = 0):
         else:
             editor_top_text = ''
             if edit_repeat == 'get':
-                load_title = name_load
+                if do_type == 'load':
+                    if flask.session and 'edit_load_document' in flask.session:
+                        load_title = flask.session['edit_load_document']
+                    else:
+                        load_title = 0
+                else:
+                    load_title = 0
+                
                 if load_title == 0 and section == '':
                     load_title = name
                     editor_top_text += '<a href="/manager/15/' + url_pas(name) + '">(' + load_lang('load') + ')</a> '

+ 2 - 1
route/main_tool_admin.py

@@ -82,7 +82,8 @@ def main_tool_admin(num = 1, add_2 = ''):
         add_1 = flask.request.form.get('name', 'test')
         if flask.request.method == 'POST':
             if add_2 != '':
-                return redirect('/' + title_list[num][1] + '/' + url_pas(add_2) + '/doc_from/' + url_pas(add_1))
+                flask.session['edit_load_document'] = add_1
+                return redirect('/edit_from/' + url_pas(add_2))
             elif flask.request.form.get('regex', '') != '':
                 return redirect('/auth/give/ban_regex/' + url_pas(add_1))
             else:

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.5 (stable2) (beta3) (dev24)",
+        "r_ver" : "v3.4.5 (stable2) (beta3) (dev25)",
         "c_ver" : "3500112",
         "s_ver" : "3500110"
     }

+ 1 - 1
views/main_css/js/render_onmark.js

@@ -229,7 +229,7 @@ function do_onmark_heading_render(
                     '</span> ' +
                     '<a id="edit_load_' + String(toc_n) + '" ' +
                         'style="font-size: 70%;"' +
-                        'href="/edit/' + do_url_change(name_doc) + '/doc_section/' + String(toc_n) + '">✎</a> ' +
+                        'href="/edit_section/' + String(toc_n) + '/' + do_url_change(name_doc) + '">✎</a> ' +
                     '<a href="javascript:void(0);" ' +
                         'onclick="javascript:do_open_folding(\'' + name_include + 'in_data_' + String(toc_n) + '\', this);"' +
                         'style="font-size: 70%;">' + (heading_data[2] ? '⊕' : '⊖') + '</a>' +