Closed Pitoche closed 9 hours ago
I would like to increase the time before logging out. Maybe adding a field for that? We can set the default to 5 minutes?
Using bootstrap we should be easily able to add a toggle light and dark mode. By adding an if statement to base.html it should be as simple as swapping "dark" and "light" in the tag
<html lang="en" data-bs-theme="dark">
<html lang="en" data-bs-theme="light">
I added some fields back on the 4th JUNNE but now I am not getting anything
So the blueprint for /settings needed to be added to create_app().
Yeah, are you looking to use flask-login? Was that from you or @Rachie94 ?
Mine was just a page with 2 fields as I had little time. but right now I am getting an error
This wasn't you?
login_manager = LoginManager()
login_manager.init_app(app)
bp = Blueprint("settings", __name__, url_prefix="/setting", template_folder="templates")
@bp.route("/", methods=["GET", "POST"])
@login_required
def settings():
if request.method == "POST":
vault_timeout = request.form.get("vaultTimeout", default="00:05:00")
theme_id = request.form.get("themeId", default="light")
settings_html = request.form.get(
"settingsHtml", default=""
) # Get HTML content from the form
try:
conn = get_db()
cursor = conn.cursor()
cursor.execute(
"REPLACE INTO preferences (user_id, vault_timeout, theme_id, settings_html) VALUES (?, ?, ?, ?)",
(
current_user.id,
vault_timeout,
theme_id,
settings_html,
), # Use current_user.id to get user_id
)
conn.commit()
cursor.close()
conn.close()
flash("Preferences saved successfully", "success")
except Exception as e:
flash(f"Failed to save preferences: {str(e)}", "danger")
return redirect(url_for("settings.settings"))
return render_template("settings.html")```
I think so..
Think its fixed now. Try git fetch on development branch. I've commented out flask-login. Its a great module but would require a large refactoring if we are going to use it fully.
I now have 2 "settings" links and both work Not sure where the "other" is coming from
I updated to use { URL_for('settings.settings')}
and forgot to remove the old link.
Ill remove in next push
12 Jun 2024 21:23:29 Angel De Luis @.***>:
I now have 2 "settings" links and both work Not sure where the "other" is coming from
— Reply to this email directly, view it on GitHub[https://github.com/quinone/password-manager/issues/42#issuecomment-2163834718], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AG7KV6HJ4YDVMRM27YGGC43ZHCU4DAVCNFSM6AAAAABI2GLM36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTHAZTINZRHA]. You are receiving this because you commented. [Tracking image][https://github.com/notifications/beacon/AG7KV6GLYTKCT4QRWMY43GDZHCU4DA5CNFSM6AAAAABI2GLM36WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUA7F7V4.gif]
Add Preference pages and link fields to DB