Added order
This commit is contained in:
parent
a46df4f7ad
commit
80d76d2127
5 changed files with 76 additions and 2 deletions
|
|
@ -625,18 +625,35 @@ def pastafari2_edit_update():
|
|||
|
||||
update_server.enctype=True
|
||||
|
||||
update_server.fields['file'].yes_prefix=False
|
||||
|
||||
server=ServerDbTask(db)
|
||||
|
||||
url=url_for('.pastafari2_edit_update', server_id=server_id)
|
||||
|
||||
arr_server=server.select_a_row(server_id)
|
||||
|
||||
update_server.set_conditions('WHERE server_id=%s', [server_id])
|
||||
|
||||
admin=GenerateAdminClass(update_server, url, t)
|
||||
|
||||
admin.list.fields_showed=['name', 'file']
|
||||
admin.list.fields_showed=['name', 'file', 'position']
|
||||
|
||||
admin.list.yes_search=False
|
||||
|
||||
#admin.list.table_div=True
|
||||
|
||||
admin.list.order_field='position'
|
||||
|
||||
"""
|
||||
self.arr_extra_fields=[I18n.lang('common', 'options', 'Options')]
|
||||
|
||||
self.arr_extra_options=[SimpleList.standard_options]
|
||||
"""
|
||||
|
||||
#admin.list.arr_extra_fields.insert(0, I18n.lang('pastafari2', 'position', 'Position'))
|
||||
#admin.list.arr_extra_options.insert(0, field_position)
|
||||
|
||||
form_admin=admin.show()
|
||||
|
||||
if type(form_admin).__name__=='str':
|
||||
|
|
@ -645,3 +662,29 @@ def pastafari2_edit_update():
|
|||
|
||||
else:
|
||||
return form_admin
|
||||
|
||||
@admin_app.route('/pastafari2/change_order_scripts/', methods=['POST', 'GET'])
|
||||
def pastafari2_change_order_scripts():
|
||||
|
||||
db=g.connection
|
||||
|
||||
server_id=request.args.get('server_id', '0')
|
||||
|
||||
update_server=UpdateServerScripts(db)
|
||||
|
||||
server=ServerDbTask(db)
|
||||
|
||||
arr_server=server.select_a_row(server_id)
|
||||
|
||||
update_server.set_conditions('WHERE server_id=%s', [server_id])
|
||||
|
||||
arr_update_server=update_server.select_to_array()
|
||||
|
||||
return t.load_template('change_order_scripts.phtml', title=I18n.lang('pastafari2', 'edit_update', 'Edit update'), path_module='admin_app.pastafari2_change_order_scripts', server_data=arr_server, scripts=arr_update_server)
|
||||
|
||||
"""
|
||||
def field_position(url, row_id, arr_row):
|
||||
|
||||
return '<input type="number" name="position_'+row_id+'" value="'+arr_row['position']+'"/>'
|
||||
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue