3 Commits

Author SHA1 Message Date
69f077a0f5 Merge pull request 'sort vehicles by last activity' (#12) from sort_vehicles_by_last_entry_2 into main
Reviewed-on: #12
2024-05-25 21:51:28 +02:00
dfb07ae7ee sort vehicles by last activity 2024-05-25 17:53:51 +02:00
208cb497aa remove the plan pitstop feature
Co-authored-by: Joachim Lusiardi <joachim@lusiardi.de>
Co-committed-by: Joachim Lusiardi <joachim@lusiardi.de>
2024-05-22 11:50:43 +02:00
16 changed files with 2 additions and 22 deletions

View File

@@ -164,7 +164,7 @@ class Consumable(db.Model):
name = db.Column(db.String(255), unique=True) name = db.Column(db.String(255), unique=True)
unit = db.Column(db.String(255)) unit = db.Column(db.String(255))
vehicles = db.relationship("Vehicle", secondary=vehicles_consumables) vehicles = db.relationship("Vehicle", secondary=vehicles_consumables, viewonly=True)
def __init__(self, name, unit): def __init__(self, name, unit):
self.name = name self.name = name

View File

@@ -138,24 +138,3 @@ def delete_account():
return render_template("deleteAccountForm.html", form=form) return render_template("deleteAccountForm.html", form=form)
@app.route("/account/home", methods=["GET"])
@login_required
def get_users_home():
return jsonify(
{
"lat": float(current_user.home_lat),
"long": float(current_user.home_long),
"zoom": current_user.home_zoom,
}
)
@app.route("/account/home", methods=["POST"])
@login_required
def set_users_home():
current_user.home_lat = request.json["lat"]
current_user.home_long = request.json["long"]
current_user.home_zoom = request.json["zoom"]
db.session.commit()
return jsonify({})

View File

@@ -226,5 +226,6 @@ def get_pit_stops():
"regulars": vehicle.regulars, "regulars": vehicle.regulars,
} }
user["vehicles"].append(v) user["vehicles"].append(v)
user["vehicles"].sort(key=lambda v: (v["data"][-1].date, v["data"][-1].odometer or 0 ), reverse=True)
return render_template("pitstops.html", user=user) return render_template("pitstops.html", user=user)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB