Compare commits
23 Commits
d76a02ed26
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23b0819079 | ||
|
|
9fcaf72457 | ||
|
|
0df4bf926b | ||
|
|
fe26621221 | ||
|
|
b47fdac633 | ||
|
|
b18c83a8ca | ||
|
|
a21dc5f73f | ||
|
|
0d4eec9c80 | ||
|
|
8db34a6d74 | ||
|
|
a79dc7742b | ||
|
|
76b5ebb53d | ||
|
|
ab2d4b04ad | ||
|
|
63895052f0 | ||
|
|
6fce468dc0 | ||
|
|
7e6043891d | ||
|
|
c500214da0 | ||
|
|
6ebc172aac | ||
|
|
2b8ce9c4c8 | ||
|
|
0fcb5e9b7b | ||
|
|
b40cb00d4d | ||
|
|
567f736d0d | ||
|
|
a2f47b4730 | ||
|
|
1df0feeea0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,3 +17,4 @@ build/
|
||||
/myriad/static/blinkies
|
||||
/myriad/static/stamps
|
||||
myriad/static/tmp
|
||||
myriad/static/misc
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import os, datetime
|
||||
|
||||
from flask import Flask
|
||||
from myriad.utilities import server_time, get_datetime_str
|
||||
from myriad.utilities import server_time, get_datetime_str, remove_html
|
||||
from myriad.db import get_db
|
||||
|
||||
|
||||
@@ -45,6 +45,6 @@ def create_app():
|
||||
return member
|
||||
|
||||
|
||||
return dict(get_themes=get_themes, server_time=w_server_time, get_datetime_str=w_get_datetime_str, get_member=get_member)
|
||||
return dict(get_themes=get_themes, server_time=w_server_time, get_datetime_str=w_get_datetime_str, get_member=get_member, remove_html=remove_html)
|
||||
|
||||
return app
|
||||
|
||||
@@ -70,12 +70,13 @@ def page(mid):
|
||||
blinkies = db.execute("SELECT blinkie_location FROM blinkies WHERE member_id=(?)",(mid,)).fetchall()
|
||||
stamps = db.execute("SELECT stamp_location FROM stamps WHERE member_id=(?)",(mid,)).fetchall()
|
||||
blog_public = db.execute("SELECT * FROM blog WHERE member_id=(?) AND public=(?)",(mid,1)).fetchall()
|
||||
sections = db.execute("SELECT * FROM sections WHERE member_id=(?) ORDER BY position ASC",(mid,)).fetchall()
|
||||
|
||||
blog_public_show = False
|
||||
if len(blog_public) > 0:
|
||||
blog_public_show = True
|
||||
|
||||
return render_template('page.html', member=member, blog=blog, icon=icon, all_icons=all_icons, blinkies=blinkies, stamps=stamps, blog_public_show=blog_public_show)
|
||||
return render_template('page.html', member=member, blog=blog, icon=icon, all_icons=all_icons, blinkies=blinkies, stamps=stamps, blog_public_show=blog_public_show, sections=sections)
|
||||
|
||||
@bp.route("/groups")
|
||||
def groups():
|
||||
|
||||
139
myriad/manage.py
139
myriad/manage.py
@@ -19,12 +19,17 @@ def new():
|
||||
bio = request.form['bio']
|
||||
user_id = g.user[0]
|
||||
date_created = get_datetime_obj(server_time())
|
||||
privacy = request.form["privacy"]
|
||||
|
||||
db = get_db()
|
||||
|
||||
db.execute("INSERT INTO member (user_id, member_name, bio, subtitle, created) VALUES (?, ?, ?, ?, ?)",(user_id, name, bio, subtitle, date_created))
|
||||
db.execute("INSERT INTO member (user_id, member_name, bio, subtitle, created, public) VALUES (?, ?, ?, ?, ?, ?)",(user_id, name, bio, subtitle, date_created, privacy))
|
||||
db.commit()
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
last = db.execute('SELECT last_insert_rowid()').fetchone()
|
||||
new_mid = last[0]
|
||||
|
||||
return redirect(url_for('manage.edit', mid=new_mid))
|
||||
|
||||
return render_template('manage/new.html')
|
||||
|
||||
@@ -75,7 +80,31 @@ def edit(mid):
|
||||
db.execute("UPDATE member SET member_name=(?), bio=(?), subtitle=(?), public=(?), theme=(?) WHERE id=(?)",(name, bio, subtitle, privacy, theme, mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="details"
|
||||
edit_location = "details"
|
||||
|
||||
if "page_settings" in request.form:
|
||||
show_groups = "show_groups" in request.form
|
||||
show_blog = "show_blog" in request.form
|
||||
show_icons = "show_icons" in request.form
|
||||
show_blinkies = "show_blinkies" in request.form
|
||||
show_stamps = "show_stamps" in request.form
|
||||
|
||||
db.execute("UPDATE member SET show_groups=(?), show_blog=(?), show_icons=(?), show_blinkies=(?), show_stamps=(?) WHERE id=(?)",(show_groups, show_blog, show_icons, show_blinkies, show_stamps, mid))
|
||||
db.commit()
|
||||
|
||||
edit_location = "page_settings"
|
||||
|
||||
if "section_titles" in request.form:
|
||||
groups_title = request.form["groups_title"]
|
||||
blog_title = request.form["blog_title"]
|
||||
icons_title = request.form["icons_title"]
|
||||
blinkies_title = request.form["blinkies_title"]
|
||||
stamps_title = request.form["stamps_title"]
|
||||
|
||||
db.execute("UPDATE member SET groups_title=(?), blog_title=(?), icons_title=(?), blinkies_title=(?), stamps_title=(?) WHERE id=(?)",(groups_title, blog_title, icons_title, blinkies_title, stamps_title, mid))
|
||||
db.commit()
|
||||
|
||||
edit_location = "page_settings"
|
||||
|
||||
if "file" in request.files:
|
||||
# here we are just saving the uploaded file to the icons folder.
|
||||
@@ -87,21 +116,21 @@ def edit(mid):
|
||||
db.execute("INSERT INTO icons (member_id, icon_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="icons"
|
||||
edit_location = "icons"
|
||||
|
||||
if "gid_add" in request.form:
|
||||
gid = request.form["gid_add"]
|
||||
db.execute("INSERT INTO group_members (group_id,member_id) VALUES (?,?)",(gid,mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="groups"
|
||||
edit_location = "groups"
|
||||
|
||||
elif "gid_remove" in request.form:
|
||||
gid = request.form["gid_remove"]
|
||||
db.execute("DELETE FROM group_members WHERE group_id=(?) AND member_id=(?)",(gid,mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="groups"
|
||||
edit_location = "groups"
|
||||
|
||||
if "blinkie" in request.files:
|
||||
file = request.files["blinkie"]
|
||||
@@ -110,7 +139,7 @@ def edit(mid):
|
||||
db.execute("INSERT INTO blinkies (member_id, blinkie_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="blinkies"
|
||||
edit_location = "blinkies"
|
||||
|
||||
if "stamp" in request.files:
|
||||
file = request.files["stamp"]
|
||||
@@ -119,13 +148,34 @@ def edit(mid):
|
||||
db.execute("INSERT INTO stamps (member_id, stamp_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="stamps"
|
||||
edit_location = "stamps"
|
||||
|
||||
if "new_section" in request.form:
|
||||
section_title = request.form["section_title"]
|
||||
section_content = request.form["section_content"]
|
||||
|
||||
db.execute("INSERT INTO sections (member_id, title, content) VALUES (?, ?, ?)", (mid, section_title, section_content))
|
||||
db.commit()
|
||||
|
||||
edit_location = "sections"
|
||||
|
||||
if "update_section" in request.form:
|
||||
section_id = request.form["section_id"]
|
||||
section_title = request.form["section_title"]
|
||||
section_content = request.form["section_content"]
|
||||
section_position = request.form["section_pos"]
|
||||
|
||||
db.execute("UPDATE sections SET title=(?), content=(?), position=(?) WHERE id=(?)",(section_title, section_content, section_position, section_id))
|
||||
db.commit()
|
||||
|
||||
edit_location = "sections"
|
||||
|
||||
|
||||
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
|
||||
icons = db.execute("SELECT * FROM icons WHERE member_id=(?)",(mid,)).fetchall()
|
||||
blinkies = db.execute("SELECT * FROM blinkies WHERE member_id=(?)",(mid,)).fetchall()
|
||||
stamps = db.execute("SELECT * FROM stamps WHERE member_id=(?)",(mid,)).fetchall()
|
||||
sections = db.execute("SELECT * FROM sections WHERE member_id=(?)",(mid,)).fetchall()
|
||||
|
||||
groups = db.execute("SELECT * FROM groups").fetchall()
|
||||
member_groups = db.execute("SELECT * FROM group_members WHERE member_id=(?)",(mid,)).fetchall()
|
||||
@@ -145,7 +195,18 @@ def edit(mid):
|
||||
|
||||
themes = os.listdir(current_app.config["THEMES_FOLDER"])
|
||||
|
||||
return render_template("manage/edit.html", member=member, icons=icons, unjoined_groups=unjoined_groups, joined_groups=joined_groups, themes=themes, edit_location=edit_location, blinkies=blinkies, stamps=stamps)
|
||||
return render_template("manage/edit.html", member=member, icons=icons, unjoined_groups=unjoined_groups, joined_groups=joined_groups, themes=themes, edit_location=edit_location, blinkies=blinkies, stamps=stamps, sections=sections)
|
||||
|
||||
|
||||
@bp.route("/delete_section/<sid>")
|
||||
@login_required
|
||||
def delete_section(sid):
|
||||
db = get_db()
|
||||
mid = db.execute("SELECT member_id FROM sections WHERE id=(?)",(sid,)).fetchone()[0]
|
||||
db.execute("DELETE FROM sections WHERE id=(?)",(sid,))
|
||||
db.commit()
|
||||
|
||||
return redirect(url_for("manage.edit", mid=mid))
|
||||
|
||||
@bp.route("/set_main_icon/<mid>/<icon_id>")
|
||||
@login_required
|
||||
@@ -202,6 +263,8 @@ def add_to_front(mid,location):
|
||||
|
||||
if location == "home":
|
||||
return redirect(url_for('index'))
|
||||
elif location == "mid":
|
||||
return redirect(url_for('home.page', mid=mid))
|
||||
else:
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
@@ -219,6 +282,8 @@ def remove_front(mid, location):
|
||||
|
||||
if location == "home":
|
||||
return redirect(url_for('index'))
|
||||
elif location == "mid":
|
||||
return redirect(url_for('home.page', mid=mid))
|
||||
else:
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
@@ -241,6 +306,8 @@ def add_to_home(mid, location):
|
||||
|
||||
if location == "home":
|
||||
return redirect(url_for('index'))
|
||||
elif location == "mid":
|
||||
return redirect(url_for('home.page', mid=mid))
|
||||
else:
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
@@ -253,6 +320,8 @@ def remove_home(mid,location):
|
||||
|
||||
if location == "home":
|
||||
return redirect(url_for('index'))
|
||||
elif location == "mid":
|
||||
return redirect(url_for('home.page', mid=mid))
|
||||
else:
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
@@ -332,7 +401,20 @@ def import_member(member):
|
||||
db.execute("INSERT INTO stamps (member_id, stamp_location) VALUES (?, ?)",(mid, stamp))
|
||||
db.commit()
|
||||
|
||||
db.execute("INSERT INTO member (id,created,user_id, member_name,subtitle, bio,public,theme,homepage,main_icon) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",(mid, date_created_obj, user_id, name, subtitle, description,privacy, theme, homepage, main_icon_id))
|
||||
show_blog = member["show-blog"]
|
||||
show_icons = member["show-icons"]
|
||||
show_blinkies = member["show-blinkies"]
|
||||
show_stamps = member["show-stamps"]
|
||||
show_groups = member["show-groups"]
|
||||
|
||||
blog_title = member["blog-title"]
|
||||
icons_title = member["icons-title"]
|
||||
blinkies_title = member["blinkies-title"]
|
||||
stamps_title = member["stamps-title"]
|
||||
groups_title = member["groups-title"]
|
||||
|
||||
db.execute("INSERT INTO member (id,created,user_id, member_name,subtitle, bio,public,theme,homepage,main_icon,show_blog,show_icons,show_blinkies,show_stamps,show_groups,blog_title,icons_title,blinkies_title,stamps_title,groups_title) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
(mid, date_created_obj, user_id, name, subtitle, description,privacy, theme, homepage, main_icon_id, show_blog, show_icons, show_blinkies, show_stamps, show_groups, blog_title, icons_title, blinkies_title, stamps_title, groups_title))
|
||||
db.commit()
|
||||
|
||||
|
||||
@@ -403,9 +485,9 @@ def generate_json(mid):
|
||||
stamps_r = db.execute("SELECT stamp_location FROM stamps WHERE member_id=(?)",(mid,)).fetchall()
|
||||
|
||||
if member[9] == 1:
|
||||
privacy = "public"
|
||||
member_privacy = "public"
|
||||
else:
|
||||
privacy = "private"
|
||||
member_privacy = "private"
|
||||
|
||||
date_created = get_datetime_str(member[2])
|
||||
|
||||
@@ -458,14 +540,24 @@ def generate_json(mid):
|
||||
"name":member[3],
|
||||
"subtitle":member[4],
|
||||
"description":member[5],
|
||||
"privacy":privacy,
|
||||
"privacy":member_privacy,
|
||||
"theme":member[10],
|
||||
"groups":groups,
|
||||
"blog":blog,
|
||||
"icons":icons,
|
||||
"blinkies":blinkies,
|
||||
"stamps":stamps,
|
||||
"homepage-pin":homepage
|
||||
"homepage-pin":homepage,
|
||||
"show-blog":member[11],
|
||||
"show-icons":member[12],
|
||||
"show-blinkies":member[13],
|
||||
"show-stamps":member[14],
|
||||
"show-groups":member[15],
|
||||
"blog-title":member[16],
|
||||
"icons-title":member[17],
|
||||
"blinkies-title":member[18],
|
||||
"stamps-title":member[19],
|
||||
"groups-title":member[20]
|
||||
}
|
||||
if main_icon:
|
||||
data["main-icon"] = main_icon[0]
|
||||
@@ -679,6 +771,22 @@ def assets():
|
||||
filename = file.filename
|
||||
file.save(os.path.join(current_app.config["STAMPS_UPLOAD_FOLDER"], filename))
|
||||
|
||||
if "image" in request.files:
|
||||
file = request.files["image"]
|
||||
filename = file.filename
|
||||
fname, ftype = filename.split(".")
|
||||
|
||||
i = 0
|
||||
if os.path.exists(os.path.join(current_app.config["MISC_UPLOAD_FOLDER"], filename)):
|
||||
i = 2
|
||||
while os.path.exists(os.path.join(current_app.config["MISC_UPLOAD_FOLDER"], fname+str(i)+"."+ftype)):
|
||||
i += 1
|
||||
|
||||
if i == 0:
|
||||
file.save(os.path.join(current_app.config["MISC_UPLOAD_FOLDER"], filename))
|
||||
else:
|
||||
file.save(os.path.join(current_app.config["MISC_UPLOAD_FOLDER"], fname+str(i)+"."+ftype))
|
||||
|
||||
icons = db.execute("SELECT * FROM icons").fetchall()
|
||||
icon_storage = os.listdir(current_app.config["ICON_UPLOAD_FOLDER"])
|
||||
|
||||
@@ -701,8 +809,9 @@ def assets():
|
||||
|
||||
blinkies = os.listdir(current_app.config["BLINKIES_UPLOAD_FOLDER"])
|
||||
stamps = os.listdir(current_app.config["STAMPS_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)
|
||||
return render_template("manage/assets.html", icons=unlinked_icons, icon_storage=i_storage, blinkies=blinkies, stamps=stamps, images=images)
|
||||
|
||||
@bp.route("/delete_idb")
|
||||
@login_required
|
||||
|
||||
@@ -8,6 +8,7 @@ DROP TABLE IF EXISTS blinkies;
|
||||
DROP TABLE IF EXISTS stamps;
|
||||
DROP TABLE IF EXISTS front_log;
|
||||
DROP TABLE IF EXISTS sections;
|
||||
DROP TABLE IF EXISTS pages;
|
||||
|
||||
CREATE TABLE user (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
@@ -27,6 +28,16 @@ CREATE TABLE member (
|
||||
front BOOLEAN NOT NULL DEFAULT 0,
|
||||
public BOOLEAN NOT NULL DEFAULT 1,
|
||||
theme TEXT NOT NULL DEFAULT 'default',
|
||||
show_blog BOOLEAN NOT NULL DEFAULT 1,
|
||||
show_icons BOOLEAN NOT NULL DEFAULT 1,
|
||||
show_blinkies BOOLEAN NOT NULL DEFAULT 1,
|
||||
show_stamps BOOLEAN NOT NULL DEFAULT 1,
|
||||
show_groups BOOLEAN NOT NULL DEFAULT 1,
|
||||
blog_title TEXT DEFAULT "Blog",
|
||||
icons_title TEXT DEFAULT "Icons",
|
||||
blinkies_title TEXT DEFAULT "Blinkies",
|
||||
stamps_title TEXT DEFAULT "Stamps",
|
||||
groups_title TEXT DEFAULT "Groups",
|
||||
FOREIGN KEY (user_id) REFERENCES user (id),
|
||||
FOREIGN KEY (main_icon) REFERENCES icons (id)
|
||||
);
|
||||
|
||||
BIN
myriad/static/lock.png
Normal file
BIN
myriad/static/lock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 264 B |
@@ -95,6 +95,12 @@ form textarea{
|
||||
height:100px;
|
||||
float:left;
|
||||
}
|
||||
.manage_images_3{
|
||||
display:block;
|
||||
width:180px;
|
||||
height:100px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +114,14 @@ form textarea{
|
||||
height:56px;
|
||||
width:auto;
|
||||
}
|
||||
.mng_img
|
||||
{
|
||||
height:56px;
|
||||
width:auto;
|
||||
object-fit:scale-down;
|
||||
max-width:180px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -148,9 +162,9 @@ form textarea{
|
||||
|
||||
.title{
|
||||
font-size:20px;
|
||||
display:block;
|
||||
margin-top:20px;
|
||||
margin-bottom:20px;
|
||||
display:block;
|
||||
}
|
||||
.heading.big{
|
||||
font-size:20px;
|
||||
@@ -166,6 +180,17 @@ form textarea{
|
||||
display:block;
|
||||
}
|
||||
|
||||
.lock{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
}
|
||||
.minilock{
|
||||
width:16px;
|
||||
height:auto;
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
#blog{
|
||||
max-height:300px;
|
||||
overflow-y:scroll;
|
||||
@@ -213,7 +238,10 @@ form textarea{
|
||||
max-height:300px;
|
||||
overflow-y:scroll;
|
||||
}
|
||||
|
||||
.image-sections{
|
||||
margin-top:20px;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
|
||||
#mobile-nav{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
body.pink{
|
||||
background: linear-gradient(90deg, #f8a1e5 0%, #d55ff3 50%, #f5c35e 100%);
|
||||
background: linear-gradient(90deg, rgba(235, 202, 202, 1) 0%, rgba(201, 77, 255, 1) 50%, rgba(242, 234, 124, 1) 100%);
|
||||
scrollbar-color:#a414da #d991f4;
|
||||
}
|
||||
.pink .container, .pink #mobile-nav{
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{% for member in memberlist %}
|
||||
{% if not g.user and member[9]==0 %}
|
||||
{% else %}
|
||||
<a href="#m{{ member[0] }}">{{ member[3] }}</a> |
|
||||
<a href="#m{{ member[0] }}">{{ member[3]|safe }}</a> |
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
{% else %}
|
||||
<div class="profile {{member[10]}}" id="m{{ member[0] }}">
|
||||
<div class="heading"><b>{{ member[3]|safe }}</b> {{ member[4]|safe }}</div>
|
||||
<div class="heading">{% if member[9]==0 %}<img class="minilock" src="{{ url_for('static', filename='lock.png') }}">{% endif %}<b>{{ member[3]|safe }}</b> {{ member[4]|safe }}</div>
|
||||
{% if icons[member[0]] %}
|
||||
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
||||
{% else %}
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
{{group[2]}}<br><br>
|
||||
{% if group[0] in group_members %}
|
||||
{% for member in group_members[group[0]] %}
|
||||
✰ <a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3] }}</a> <br>
|
||||
{% if not g.user and member[9]==0 %}
|
||||
{% else %}
|
||||
✰ <a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3]|safe }}</a> <br>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<div id="frontbanner" class="heading">
|
||||
{% if front_list|length > 0 %}
|
||||
<b>currently fronting: </b> {% for member in front_list %}{% if not g.user and member[9]==0 %}{% else %}<a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3] }}</a> {% if front_list.index(member) != front_list|length -1 %}&{% endif %}{% endif %} {% endfor %}
|
||||
<b>currently fronting: </b> {% for member in front_list %}{% if not g.user and member[9]==0 %}{% else %}<a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3]|safe }}</a> {% if front_list.index(member) != front_list|length -1 %}&{% endif %}{% endif %} {% endfor %}
|
||||
{% else %}
|
||||
<i><sub>There are currently no members listed as fronting</sub></i>
|
||||
{% endif %}
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
<div class="profile {{member[10]}}" id="m{{ member[0] }}">
|
||||
<div class="heading"><b>{{ member[3]|safe }}</b> {{ member[4]|safe }}</div>
|
||||
<div class="heading">{% if member[9]==0 %}<img class="minilock" src="{{ url_for('static', filename='lock.png') }}">{% endif %}<b>{{ member[3]|safe }}</b> {{ member[4]|safe }}</div>
|
||||
{% if icons[member[0]] %}
|
||||
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
||||
{% else %}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="maintext">Front change history</div>
|
||||
<div class="log">
|
||||
{% for front in front_log %}
|
||||
<p><b>{{ get_datetime_str(front[2]) }}</b> - {{ get_member(front[1])[3] }}{% if front[3] %} <i>(ended: {{ get_datetime_str(front[3]) }})</i> | <a class="danger" href="{{ url_for('manage.delete_front_log', fid=front[0]) }}">delete</a>{% endif %}</p>
|
||||
<p><b>{{ get_datetime_str(front[2]) }}</b> - {{ get_member(front[1])[3]|safe }}{% if front[3] %} <i>(ended: {{ get_datetime_str(front[3]) }})</i> | <a class="danger" href="{{ url_for('manage.delete_front_log', fid=front[0]) }}">delete</a>{% endif %}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,9 +36,44 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="heading big">Blinkies</div>
|
||||
|
||||
<p>Not implemented yet (sorry!)</p>
|
||||
|
||||
<div class="heading big">Stamps</div>
|
||||
<p>Not implemented yet (sorry!)</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="heading big">Upload Images</div>
|
||||
<p>Upload images for use in pages and custom sections.
|
||||
Just right click, copy image URL, then use it in the HTML
|
||||
however you like. You can use style tags to customize how the
|
||||
images look/behave on your page, just be careful not to use class or
|
||||
id selectors that already exist (or do, if you are wanting to overwrite
|
||||
their behaviour!). We will make a list of in-use class and ids here, soon.
|
||||
</p>
|
||||
<form method="post" enctype="multipart/form-data" id="image">
|
||||
<input type="file" name="image" class="mobile-edit">
|
||||
<input type="submit" value="Upload to Site">
|
||||
</form>
|
||||
|
||||
<div class="manage_images">
|
||||
<div class="manage_images_2">
|
||||
{% for image in images %}
|
||||
<div class="manage_images_3">
|
||||
<img class="mng_img" src="{{ url_for('static', filename='misc/'+image) }}">
|
||||
<br class="clear" />
|
||||
{% set imgurl = url_for('static', filename='misc/'+image) %}
|
||||
<a href="" onclick="copyURL('{{imgurl}}')">Copy Image URL</a> ☆ <a href="">Delete</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function copyURL(a) {
|
||||
navigator.clipboard.writeText(a);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block header %}
|
||||
<div class="title">{% block title %}Edit {{ member[3] }}{% endblock %}</div>
|
||||
<div class="title">{% block title %}Edit {{ remove_html(member[3]) }}{% endblock %}</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<a href="{{url_for('home.page', mid=member[0])}}">View {{member[3]}}'s page</a>
|
||||
<a href="{{url_for('home.page', mid=member[0])}}">View {{member[3]|safe}}'s page</a>
|
||||
<br class="clear" />
|
||||
|
||||
<div class="heading">Edit Details</div>
|
||||
@@ -33,6 +33,39 @@
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
<div class="heading">Public Page Settings</div>
|
||||
<p>Select which sections to show on this member's public page</p>
|
||||
<form method="post" id="page_settings">
|
||||
<input type="checkbox" id="show_groups" name="show_groups" {% if member[15] %}checked{% endif %}>
|
||||
<label for="show_groups">Groups</label><br>
|
||||
<input type="checkbox" id="show_blog" name="show_blog" {% if member[11] %}checked{% endif %}>
|
||||
<label for="show_blog">Blog</label><br>
|
||||
<input type="checkbox" id="show_icons" name="show_icons" {% if member[12] %}checked{% endif %}>
|
||||
<label for="show_icons">Icons</label><br>
|
||||
<input type="checkbox" id="show_blinkies" name="show_blinkies" {% if member[13] %}checked{% endif %}>
|
||||
<label for="show_blinkies">Blinkies</label><br>
|
||||
<input type="checkbox" id="show_stamps" name="show_stamps" {% if member[14] %}checked{% endif %}>
|
||||
<label for="show_stamps">Stamps</label><br>
|
||||
<input type="submit" name="page_settings" value="Submit">
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>Customize section titles. Leave blank to hide the heading bar for that section altogether.</p>
|
||||
<form method="post">
|
||||
<label for="groups_title">Groups</label>
|
||||
<input name="groups_title" id="groups_title" value="{{ member[20] }}"><br>
|
||||
<label for="blog_title">Blog</label>
|
||||
<input name="blog_title" id="blog_title" value="{{ member[16] }}"><br>
|
||||
<label for="icons_title">Icons</label>
|
||||
<input name="icons_title" id="icons_title" value="{{ member[17] }}"><br>
|
||||
<label for="blinkies_title">Blinkies</label>
|
||||
<input name="blinkies_title" id="blinkies_title" value="{{ member[18] }}"><br>
|
||||
<label for="stamps_title">Stamps</label>
|
||||
<input name="stamps_title" id="stamps_title" value="{{ member[19] }}"><br>
|
||||
<input type="submit" name="section_titles" value="Submit">
|
||||
</form>
|
||||
|
||||
{% if unjoined_groups or joined_groups %}
|
||||
<div class="heading">Manage groups</div>
|
||||
|
||||
@@ -114,6 +147,36 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="heading">Custom Page Sections</div>
|
||||
<p>Here you can make sections for your page, embed whatever you like</p>
|
||||
<form method="post" id="sections">
|
||||
<label for="section_title">Section Title</label>
|
||||
<input name="section_title" id="section_title"><br>
|
||||
<label for="section_content">Section Content</label>
|
||||
<textarea name="section_content" id="section_content">Hello World!</textarea><br><br>
|
||||
<input type="submit" name="new_section" value="Create New Section">
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
{% for section in sections %}
|
||||
<form method="post">
|
||||
<label for="section_pos">Position</label>
|
||||
<input name="section_pos" id="section_pos" value="{{section[4]}}"><br>
|
||||
<label for="section_title">Section Title</label>
|
||||
<input name="section_title" id="section_title" value="{{section[2]}}"><br>
|
||||
<label for="section_content">Section Content</label>
|
||||
<textarea name="section_content" id="section_content">{{section[3]}}</textarea><br><br>
|
||||
<input type="hidden" id="section_id" name="section_id" value="{{section[0]}}">
|
||||
<input type="submit" name="update_section" value="Update Section">
|
||||
</form>
|
||||
|
||||
<a href="{{ url_for('manage.delete_section', sid=section[0]) }}">Delete section</a>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<div class="heading">Manage Member Data</div>
|
||||
<a href="{{ url_for('manage.export_fields', mid=member[0]) }}">Export Fields</a><br>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
<input name="subtitle" id="subtitle"><br>
|
||||
<label for="bio">Description</label>
|
||||
<textarea name="bio" id="bio"></textarea><br>
|
||||
<input type="radio" id="public" name="privacy" value=1 checked>
|
||||
<label for="public">Public</label><br>
|
||||
<input type="radio" id="private" name="privacy" value=0>
|
||||
<label for="private">Private</label><br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}{{ member[3] }}{% endblock %}
|
||||
{% block title %}{{ remove_html(member[3]) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@@ -12,64 +12,92 @@
|
||||
{% else %}
|
||||
|
||||
{% if g.user %}
|
||||
<a href="{{url_for('manage.edit', mid=member[0])}}">Edit member</a>
|
||||
<a href="{{url_for('manage.edit', mid=member[0])}}">Edit member</a> ☆ {% if member[8]==0 %}<a href="{{ url_for('manage.add_to_front', mid=member[0],location='mid') }}">Add to Front</a>{% else %}<a href="{{ url_for('manage.remove_front', mid=member[0],location='mid') }}">Remove from Front</a>{% endif %} ☆ {% if member[7]==0 %}<a href="{{ url_for('manage.add_to_home', mid=member[0],location='mid') }}">Pin to Homepage</a>{% else %}<a href="{{ url_for('manage.remove_home', mid=member[0],location='mid') }}">Unpin from Homepage</a>{% endif %}
|
||||
<br class="clear" />
|
||||
{% endif %}
|
||||
|
||||
{% if member[8]==1 %}<div class="heading"><i>Currently Fronting</i></div>{% endif %}
|
||||
|
||||
{% if icon %}
|
||||
<img class="icon" src="{{ url_for('static', filename='icons/'+icon[0]) }}">
|
||||
{% else %}
|
||||
<img class="icon" src="{{ url_for('static', filename='any.jpg') }}">
|
||||
{% endif %}
|
||||
<div class="title">{{member[3]}}</div>
|
||||
<div class="title">{% if member[9]==0 %}<img class="lock" src="{{ url_for('static', filename='lock.png') }}">{% endif %}{{member[3]|safe}}</div>
|
||||
<div class="maintext">
|
||||
{{member[5].replace('\n', '<br>')|safe}}
|
||||
</div>
|
||||
<br class="clear" />
|
||||
|
||||
{% if blog|length > 0 %}
|
||||
{% if not g.user and not blog_public_show %}
|
||||
{% else %}
|
||||
<div class="heading big">{{member[3]}}'s blog</div>
|
||||
{% endif %}
|
||||
<div id="blog">
|
||||
{% for post in blog %}
|
||||
{% if not g.user and post[5]==0 %}
|
||||
|
||||
{% if member[11] %}
|
||||
{% if blog|length > 0 %}
|
||||
{% if not g.user and not blog_public_show %}
|
||||
{% else %}
|
||||
<div class="post">
|
||||
<div class="title">{{post[3]|safe}}</div>
|
||||
<div class="timestamp">{{post[2]}} {% if g.user %}{% if post[5]==0 %}(Private){% else %}(Public){% endif %}{% endif %}</div>
|
||||
<div class="content">
|
||||
{{post[4].replace('\n', '<br>')|safe}}
|
||||
</div>
|
||||
{% if g.user %}<a href="{{url_for('blog.toggle',pid=post[0], location=member[0])}}">Toggle privacy</a> | <a href="{{url_for('blog.edit',pid=post[0],location=member[0])}}">Edit Post</a> | <a href="{{url_for('blog.delete', pid=post[0], location=member[0])}}" class="danger">Delete post</a>{% endif %}
|
||||
</div>
|
||||
{% if member[16] %}<div class="heading big">{{ member[16] }}</div>{% endif %}
|
||||
{% endif %}
|
||||
<div id="blog">
|
||||
{% for post in blog %}
|
||||
{% if not g.user and post[5]==0 %}
|
||||
{% else %}
|
||||
<div class="post">
|
||||
<div class="title">{{post[3]|safe}}</div>
|
||||
<div class="timestamp">{{post[2]}} {% if g.user %}{% if post[5]==0 %}(Private){% else %}(Public){% endif %}{% endif %}</div>
|
||||
<div class="content">
|
||||
{{post[4].replace('\n', '<br>')|safe}}
|
||||
</div>
|
||||
{% if g.user %}<a href="{{url_for('blog.toggle',pid=post[0], location=member[0])}}">Toggle privacy</a> | <a href="{{url_for('blog.edit',pid=post[0],location=member[0])}}">Edit Post</a> | <a href="{{url_for('blog.delete', pid=post[0], location=member[0])}}" class="danger">Delete post</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% for section in sections %}
|
||||
{% if section[2] %}<div class="heading big">{{ section[2] }}</div>{% endif %}
|
||||
{{ section[3]|safe }}
|
||||
{% endfor %}
|
||||
|
||||
<!-- {% if groups|length > 0 %}
|
||||
<div class="heading big">{{ member[20] }}</div>
|
||||
{% for group in groups %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %} -->
|
||||
|
||||
{% if member[13] %}
|
||||
{% if blinkies|length > 0 %}
|
||||
{% if member[18] %}<div class="heading big">{{ member[18] }}</div>{% endif %}
|
||||
<div class="image-section">
|
||||
{% for blinkie in blinkies %}
|
||||
<img class="blinkie" src="{{ url_for('static', filename='blinkies/'+blinkie[0]) }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if blinkies|length > 0 %}
|
||||
<div class="heading big">Blinkies</div>
|
||||
{% for blinkie in blinkies %}
|
||||
<img class="blinkie" src="{{ url_for('static', filename='blinkies/'+blinkie[0]) }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<br class="clear" />
|
||||
|
||||
{% if stamps|length > 0 %}
|
||||
<div class="heading big">Stamps</div>
|
||||
{% for stamp in stamps %}
|
||||
<img class="stamp" src="{{ url_for('static', filename='stamps/'+stamp[0]) }}">
|
||||
{% endfor %}
|
||||
{% if member[14] %}
|
||||
{% if stamps|length > 0 %}
|
||||
{% if member[19] %}<div class="heading big">{{ member[19] }}</div>{% endif %}
|
||||
<div class="image-section">
|
||||
{% for stamp in stamps %}
|
||||
<img class="stamp" src="{{ url_for('static', filename='stamps/'+stamp[0]) }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<br class="clear" />
|
||||
|
||||
{% if all_icons|length > 1 %}
|
||||
<div class="heading big">Icons</div>
|
||||
{% for i in all_icons %}
|
||||
<img class="icon" src="{{ url_for('static', filename='icons/'+i[0]) }}">
|
||||
{% endfor %}
|
||||
{% if member[12] %}
|
||||
{% if all_icons|length > 1 %}
|
||||
{% if member[17] %}<div class="heading big">{{ member[17] }}</div>{% endif %}
|
||||
<div class="image-section">
|
||||
{% for i in all_icons %}
|
||||
<img class="icon" src="{{ url_for('static', filename='icons/'+i[0]) }}">
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<br class="clear" />
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import datetime
|
||||
import datetime, re
|
||||
|
||||
def server_time():
|
||||
raw = datetime.datetime.now()
|
||||
@@ -18,4 +18,8 @@ def get_datetime_obj(dt_string):
|
||||
return dt_obj
|
||||
|
||||
def get_datetime_str(dt_obj):
|
||||
return dt_obj.strftime("%d/%m/%Y, %H:%M:%S")
|
||||
return dt_obj.strftime("%d/%m/%Y, %H:%M:%S")
|
||||
|
||||
def remove_html(mystring):
|
||||
newstring = re.sub('<[^<]+?>', '', mystring)
|
||||
return newstring
|
||||
Reference in New Issue
Block a user