|
@@ -38,6 +38,7 @@ def collection_list():
|
|
@collections_app.route('/backstage/collection/create', methods=['POST'])
|
|
@collections_app.route('/backstage/collection/create', methods=['POST'])
|
|
def create():
|
|
def create():
|
|
form = CollectionCreateForm()
|
|
form = CollectionCreateForm()
|
|
|
|
+ eng_name = get_trans_title_url_name(form.title.data)
|
|
front_matter = '''---
|
|
front_matter = '''---
|
|
title: "{}"\n\
|
|
title: "{}"\n\
|
|
date: {}\n\
|
|
date: {}\n\
|
|
@@ -50,11 +51,11 @@ description: "{}"\n\
|
|
get_now_time(),
|
|
get_now_time(),
|
|
'false',
|
|
'false',
|
|
'collection',
|
|
'collection',
|
|
- '/collection/{}'.format(get_trans_title_url_name(form.title.data)),
|
|
|
|
|
|
+ '/collection/{}'.format(eng_name),
|
|
form.image.data.filename,
|
|
form.image.data.filename,
|
|
form.description.data)
|
|
form.description.data)
|
|
data = {'frontMatter': front_matter,
|
|
data = {'frontMatter': front_matter,
|
|
- 'name': request.form['title'],
|
|
|
|
|
|
+ 'name': eng_name,
|
|
'type': 'collection'}
|
|
'type': 'collection'}
|
|
return create_content(data, form.image.data)
|
|
return create_content(data, form.image.data)
|
|
|
|
|