added char_xml download

fix bad call in luclient.get_lot_name
Don't show rank for rank 0
fixes
This commit is contained in:
Aaron Kimbre 2022-02-02 21:18:21 -06:00
parent 3df9f143ed
commit 0066e0ea2d
6 changed files with 46 additions and 8 deletions

1
.gitattributes vendored
View File

@ -1,4 +1,3 @@
app/static/bootstrap-4.2.1/* linguist-vendored=true app/static/bootstrap-4.2.1/* linguist-vendored=true
app/static/bootswatch-master/* linguist-vendored=true
app/static/datatables/* linguist-vendored=true app/static/datatables/* linguist-vendored=true
app/static/font-awesome/* linguist-vendored=true app/static/font-awesome/* linguist-vendored=true

View File

@ -33,7 +33,7 @@ docker run -d \
* /app/luclient must be mapped to the location of an unpacked client * /app/luclient must be mapped to the location of an unpacked client
* you only need `res/` and `locale/` from the client, but dropping the whole cleint in there won't hurt * you only need `res/` and `locale/` from the client, but dropping the whole cleint in there won't hurt
* Use `fdb_to_sqlite.py` in lcdr's utilities on `res/cdclient.fdb` in the unpacked client to convert the client database to `cdclient.sqlite` * Use `fdb_to_sqlite.py` in lcdr's utilities on `res/cdclient.fdb` in the unpacked client to convert the client database to `cdclient.sqlite`
* Put teh resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite` * Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
* unzip `res/brickdb.zip` in-place * unzip `res/brickdb.zip` in-place
* **Docker will do this for you** * **Docker will do this for you**
* you should have new folders and files in the following places: * you should have new folders and files in the following places:

View File

@ -1,4 +1,4 @@
from flask import render_template, Blueprint, redirect, url_for, request, abort, flash from flask import render_template, Blueprint, redirect, url_for, request, abort, flash, make_response
from flask_user import login_required, current_user from flask_user import login_required, current_user
import json import json
from datatables import ColumnDT, DataTables from datatables import ColumnDT, DataTables
@ -87,6 +87,47 @@ def view(id):
) )
@character_blueprint.route('/view_xml/<id>', methods=['GET'])
@login_required
def view_xml(id):
character_data = CharacterInfo.query.filter(CharacterInfo.id == id).first()
if character_data == {}:
abort(404)
return
character_xml = CharacterXML.query.filter(
CharacterXML.id==id
).first().xml_data
response = make_response(character_xml)
response.headers.set('Content-Type', 'text/xml')
return response
@character_blueprint.route('/get_xml/<id>', methods=['GET'])
@login_required
def get_xml(id):
character_data = CharacterInfo.query.filter(CharacterInfo.id == id).first()
if character_data == {}:
abort(404)
return
character_xml = CharacterXML.query.filter(
CharacterXML.id==id
).first().xml_data
response = make_response(character_xml)
response.headers.set('Content-Type', 'attachment/xml')
response.headers.set(
'Content-Disposition',
'attachment',
filename=f"{character_data.name}.xml"
)
return response
@character_blueprint.route('/restrict/<bit>/<id>', methods=['GET']) @character_blueprint.route('/restrict/<bit>/<id>', methods=['GET'])
@login_required @login_required
@gm_level(3) @gm_level(3)

View File

@ -233,7 +233,7 @@ def register_luclient_jinja_helpers(app):
@app.template_filter('get_lot_name') @app.template_filter('get_lot_name')
def get_lot_name(lot_id): def get_lot_name(lot_id):
name = translate_from_locale(f'Objects_{lot_id}_name') name = translate_from_locale(f'Objects_{lot_id}_name')
if name == translate_from_locale(f'Objects_{lot_id}_name'): if name == f'Objects_{lot_id}_name':
intermed = query_cdclient( intermed = query_cdclient(
'select * from Objects where id = ?', 'select * from Objects where id = ?',
[lot_id], [lot_id],

View File

@ -747,11 +747,8 @@
// let vnh = new VertexNormalsHelper( mesh, 5 ); // let vnh = new VertexNormalsHelper( mesh, 5 );
// scene.add( vnh ); // scene.add( vnh );
} }
} }
} }
} }
} }

View File

@ -8,7 +8,8 @@
<br/> <br/>
-------------------------------- --------------------------------
<br/> <br/>
{{ ("ItemSets_" ~ item_set[0] ~ "_kitName")|lu_translate }}: Rank {{ item_set[4] }}<br/>
{{ ("ItemSets_" ~ item_set[0] ~ "_kitName")|lu_translate }}{% if item_set[4]|int > 0%}: Rank {{ item_set[4] }}{% endif %}<br/>
{% if item_set[5] %} {% if item_set[5] %}
<img src='/luclient/get_icon_iconid/{{item_set[5]}}' <img src='/luclient/get_icon_iconid/{{item_set[5]}}'
alt='Kit Image' alt='Kit Image'