|
@@ -309,6 +309,8 @@ col1: "{}"\n\
|
|
|
col2: "{}"\n\
|
|
|
introduction: "{}"\n\
|
|
|
question_box_intro: "{}"\n\
|
|
|
+readmore_ttl: ["","","","",""]\n\
|
|
|
+readmore_lnk: ["","","","",""]\n\
|
|
|
---'''.format(form.title.data, "", form.title.data,
|
|
|
get_now_time(),
|
|
|
'true',
|
|
@@ -339,27 +341,53 @@ def edit_blog_getfurther():
|
|
|
#sortedData = sorted(sortedData, key=lambda x: x['type'])
|
|
|
return {"data": data}
|
|
|
|
|
|
+@blogs_app.route('/backstage/getarticle', methods=['GET'])
|
|
|
+def article():
|
|
|
+ try:
|
|
|
+ response = requests.get('{}contents?url={}'.format(PORTAL_SERVER, "/blog/check_in/"))
|
|
|
+ #print('{}contents?url=/blog'.format(PORTAL_SERVER))
|
|
|
+ x = response.json()
|
|
|
+ return x[0]['title']
|
|
|
+ except:
|
|
|
+ return "undefined article"
|
|
|
+
|
|
|
@blogs_app.route('/backstage/edit_blog_editfurther', methods=['GET'])
|
|
|
def edit_blog_editfurther():
|
|
|
txt = ""
|
|
|
data=[]
|
|
|
- data.append([request.args.get('data00', type=str), request.args.get('data01', type=str)])
|
|
|
- data.append([request.args.get('data10', type=str), request.args.get('data11', type=str)])
|
|
|
- data.append([request.args.get('data20', type=str), request.args.get('data21', type=str)])
|
|
|
- data.append([request.args.get('data30', type=str), request.args.get('data31', type=str)])
|
|
|
- data.append([request.args.get('data40', type=str), request.args.get('data41', type=str)])
|
|
|
+ data.append(request.args.get('data01', type=str))
|
|
|
+ data.append(request.args.get('data11', type=str))
|
|
|
+ data.append(request.args.get('data21', type=str))
|
|
|
+ data.append(request.args.get('data31', type=str))
|
|
|
+ data.append(request.args.get('data41', type=str))
|
|
|
|
|
|
print(data)
|
|
|
-
|
|
|
- datapath = BHOUSE_WEB_DIR + "/themes/hugo-universal-theme-master/layouts/partials/further.html"
|
|
|
|
|
|
- with open(datapath, 'w' , encoding="utf-8") as inf:
|
|
|
- for d in data:
|
|
|
- if d[1]!='':
|
|
|
- inf.write('<li><a href="' + d[0] + '">' + d[1] + '</a></li>\n')
|
|
|
+ res=[]
|
|
|
+
|
|
|
+ for d in data:
|
|
|
+ if d!='':
|
|
|
+ try:
|
|
|
+ link=d.split("1313")[1]
|
|
|
+ if link[-1] == "/":
|
|
|
+ link = link[:-1]
|
|
|
+ d = d[:-1]
|
|
|
+ print(link)
|
|
|
+ response = requests.get('{}contents?url={}'.format(PORTAL_SERVER, link))
|
|
|
+ x = response.json()
|
|
|
+ #print('{}contents?url=/blog'.format(PORTAL_SERVER))
|
|
|
+ resp = x[0]['title']
|
|
|
+ print(resp)
|
|
|
+ res.append([resp, d])
|
|
|
+ except:
|
|
|
+ res.append(["undefined_article", d])
|
|
|
+ else:
|
|
|
+ res.append(["", ""])
|
|
|
+
|
|
|
+ print(res)
|
|
|
|
|
|
#sortedData = sorted(sortedData, key=lambda x: x['type'])
|
|
|
- return "{success: Success}"
|
|
|
+ return {"data": res}
|
|
|
|
|
|
@blogs_app.route('/backstage/blog/createCat/', methods=['GET'])
|
|
|
def createCat():
|