fix import issues and start work on custom urls for member pages
This commit is contained in:
@@ -82,6 +82,14 @@ def edit(mid):
|
|||||||
|
|
||||||
edit_location = "details"
|
edit_location = "details"
|
||||||
|
|
||||||
|
if "custom_url" in request.form:
|
||||||
|
custom_url = request.form["custom_url"]
|
||||||
|
|
||||||
|
db.execute("UPDATE member SET custom_url=(?) WHERE id=(?)",(custom_url, mid))
|
||||||
|
db.commit()
|
||||||
|
|
||||||
|
edit_location="custom_url"
|
||||||
|
|
||||||
if "page_settings" in request.form:
|
if "page_settings" in request.form:
|
||||||
show_groups = "show_groups" in request.form
|
show_groups = "show_groups" in request.form
|
||||||
show_blog = "show_blog" in request.form
|
show_blog = "show_blog" in request.form
|
||||||
@@ -388,9 +396,9 @@ def import_member(member):
|
|||||||
description = member["description"]
|
description = member["description"]
|
||||||
|
|
||||||
if member["privacy"] == "public":
|
if member["privacy"] == "public":
|
||||||
privacy = 1
|
m_privacy = 1
|
||||||
else:
|
else:
|
||||||
privacy = 0
|
m_privacy = 0
|
||||||
|
|
||||||
theme = member["theme"]
|
theme = member["theme"]
|
||||||
homepage = member["homepage-pin"]
|
homepage = member["homepage-pin"]
|
||||||
@@ -462,7 +470,7 @@ def import_member(member):
|
|||||||
name,
|
name,
|
||||||
subtitle,
|
subtitle,
|
||||||
description,
|
description,
|
||||||
privacy,
|
m_privacy,
|
||||||
theme,
|
theme,
|
||||||
homepage,
|
homepage,
|
||||||
main_icon_id,
|
main_icon_id,
|
||||||
@@ -950,9 +958,14 @@ def assets():
|
|||||||
for f in zipf.namelist():
|
for f in zipf.namelist():
|
||||||
zipf.extract(f)
|
zipf.extract(f)
|
||||||
|
|
||||||
|
# Get icon names from the database and icon files from the disk
|
||||||
icons = db.execute("SELECT * FROM icons").fetchall()
|
icons = db.execute("SELECT * FROM icons").fetchall()
|
||||||
icon_storage = os.listdir(current_app.config["ICON_UPLOAD_FOLDER"])
|
icon_storage = os.listdir(current_app.config["ICON_UPLOAD_FOLDER"])
|
||||||
|
|
||||||
|
# Do the same for stamps and blinkies now that I'm organizing these too
|
||||||
|
blinkies = db.execute("SELECT * FROM blinkies").fetchall()
|
||||||
|
blinkie_storage = os.listdir(current_app.config["BLINKIES_UPLOAD_FOLDER"])
|
||||||
|
|
||||||
i_storage = []
|
i_storage = []
|
||||||
for icon in icon_storage:
|
for icon in icon_storage:
|
||||||
in_database = False
|
in_database = False
|
||||||
@@ -970,11 +983,11 @@ def assets():
|
|||||||
if not in_storage:
|
if not in_storage:
|
||||||
unlinked_icons.append(i)
|
unlinked_icons.append(i)
|
||||||
|
|
||||||
blinkies = os.listdir(current_app.config["BLINKIES_UPLOAD_FOLDER"])
|
#blinkies = os.listdir(current_app.config["BLINKIES_UPLOAD_FOLDER"])
|
||||||
stamps = os.listdir(current_app.config["STAMPS_UPLOAD_FOLDER"])
|
#stamps = os.listdir(current_app.config["STAMPS_UPLOAD_FOLDER"])
|
||||||
images = os.listdir(current_app.config["MISC_UPLOAD_FOLDER"])
|
images = os.listdir(current_app.config["MISC_UPLOAD_FOLDER"])
|
||||||
|
|
||||||
return render_template("manage/assets.html", icons=unlinked_icons, icon_storage=i_storage, blinkies=blinkies, stamps=stamps, images=images)
|
return render_template("manage/assets.html", icons=unlinked_icons, icon_storage=i_storage, images=images)
|
||||||
|
|
||||||
@bp.route("/delete_idb")
|
@bp.route("/delete_idb")
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ CREATE TABLE member (
|
|||||||
blinkies_title TEXT DEFAULT "Blinkies",
|
blinkies_title TEXT DEFAULT "Blinkies",
|
||||||
stamps_title TEXT DEFAULT "Stamps",
|
stamps_title TEXT DEFAULT "Stamps",
|
||||||
groups_title TEXT DEFAULT "Groups",
|
groups_title TEXT DEFAULT "Groups",
|
||||||
|
public_page BOOLEAN NOT NULL DEFAULT 1,
|
||||||
|
custom_url TEXT UNIQUE,
|
||||||
FOREIGN KEY (user_id) REFERENCES user (id),
|
FOREIGN KEY (user_id) REFERENCES user (id),
|
||||||
FOREIGN KEY (main_icon) REFERENCES icons (id)
|
FOREIGN KEY (main_icon) REFERENCES icons (id)
|
||||||
);
|
);
|
||||||
@@ -110,7 +112,8 @@ CREATE TABLE pages (
|
|||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
title TEXT,
|
title TEXT,
|
||||||
content TEXT,
|
content TEXT,
|
||||||
position INTEGER
|
position INTEGER,
|
||||||
|
public BOOLEAN NOT NULL DEFAULT 1
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE custom_urls (
|
CREATE TABLE custom_urls (
|
||||||
|
|||||||
@@ -34,6 +34,15 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="heading">Public Page Settings</div>
|
<div class="heading">Public Page Settings</div>
|
||||||
|
<p>Set a custom URL for your page</p>
|
||||||
|
<form method="post" id="custom_url">
|
||||||
|
<label for="custom_url">Custom URL</label>
|
||||||
|
<input name="custom_url" id="custom_url" value="{{ member[22] }}" required><br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<p>Select which sections to show on this member's public page</p>
|
<p>Select which sections to show on this member's public page</p>
|
||||||
<form method="post" id="page_settings">
|
<form method="post" id="page_settings">
|
||||||
<input type="checkbox" id="show_groups" name="show_groups" {% if member[15] %}checked{% endif %}>
|
<input type="checkbox" id="show_groups" name="show_groups" {% if member[15] %}checked{% endif %}>
|
||||||
|
|||||||
Reference in New Issue
Block a user