Compare commits
14 Commits
7e6043891d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23b0819079 | ||
|
|
9fcaf72457 | ||
|
|
0df4bf926b | ||
|
|
fe26621221 | ||
|
|
b47fdac633 | ||
|
|
b18c83a8ca | ||
|
|
a21dc5f73f | ||
|
|
0d4eec9c80 | ||
|
|
8db34a6d74 | ||
|
|
a79dc7742b | ||
|
|
76b5ebb53d | ||
|
|
ab2d4b04ad | ||
|
|
63895052f0 | ||
|
|
6fce468dc0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,3 +17,4 @@ build/
|
|||||||
/myriad/static/blinkies
|
/myriad/static/blinkies
|
||||||
/myriad/static/stamps
|
/myriad/static/stamps
|
||||||
myriad/static/tmp
|
myriad/static/tmp
|
||||||
|
myriad/static/misc
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import os, datetime
|
import os, datetime
|
||||||
|
|
||||||
from flask import Flask
|
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
|
from myriad.db import get_db
|
||||||
|
|
||||||
|
|
||||||
@@ -45,6 +45,6 @@ def create_app():
|
|||||||
return member
|
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
|
return app
|
||||||
|
|||||||
@@ -70,12 +70,13 @@ def page(mid):
|
|||||||
blinkies = db.execute("SELECT blinkie_location FROM blinkies WHERE member_id=(?)",(mid,)).fetchall()
|
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()
|
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()
|
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
|
blog_public_show = False
|
||||||
if len(blog_public) > 0:
|
if len(blog_public) > 0:
|
||||||
blog_public_show = True
|
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")
|
@bp.route("/groups")
|
||||||
def groups():
|
def groups():
|
||||||
|
|||||||
@@ -150,11 +150,32 @@ def edit(mid):
|
|||||||
|
|
||||||
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()
|
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
|
||||||
icons = db.execute("SELECT * FROM icons WHERE member_id=(?)",(mid,)).fetchall()
|
icons = db.execute("SELECT * FROM icons WHERE member_id=(?)",(mid,)).fetchall()
|
||||||
blinkies = db.execute("SELECT * FROM blinkies 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()
|
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()
|
groups = db.execute("SELECT * FROM groups").fetchall()
|
||||||
member_groups = db.execute("SELECT * FROM group_members WHERE member_id=(?)",(mid,)).fetchall()
|
member_groups = db.execute("SELECT * FROM group_members WHERE member_id=(?)",(mid,)).fetchall()
|
||||||
@@ -174,7 +195,18 @@ def edit(mid):
|
|||||||
|
|
||||||
themes = os.listdir(current_app.config["THEMES_FOLDER"])
|
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>")
|
@bp.route("/set_main_icon/<mid>/<icon_id>")
|
||||||
@login_required
|
@login_required
|
||||||
@@ -231,6 +263,8 @@ def add_to_front(mid,location):
|
|||||||
|
|
||||||
if location == "home":
|
if location == "home":
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
elif location == "mid":
|
||||||
|
return redirect(url_for('home.page', mid=mid))
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('home.full_list'))
|
return redirect(url_for('home.full_list'))
|
||||||
|
|
||||||
@@ -248,6 +282,8 @@ def remove_front(mid, location):
|
|||||||
|
|
||||||
if location == "home":
|
if location == "home":
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
elif location == "mid":
|
||||||
|
return redirect(url_for('home.page', mid=mid))
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('home.full_list'))
|
return redirect(url_for('home.full_list'))
|
||||||
|
|
||||||
@@ -270,6 +306,8 @@ def add_to_home(mid, location):
|
|||||||
|
|
||||||
if location == "home":
|
if location == "home":
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
elif location == "mid":
|
||||||
|
return redirect(url_for('home.page', mid=mid))
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('home.full_list'))
|
return redirect(url_for('home.full_list'))
|
||||||
|
|
||||||
@@ -282,6 +320,8 @@ def remove_home(mid,location):
|
|||||||
|
|
||||||
if location == "home":
|
if location == "home":
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
elif location == "mid":
|
||||||
|
return redirect(url_for('home.page', mid=mid))
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('home.full_list'))
|
return redirect(url_for('home.full_list'))
|
||||||
|
|
||||||
@@ -731,6 +771,22 @@ def assets():
|
|||||||
filename = file.filename
|
filename = file.filename
|
||||||
file.save(os.path.join(current_app.config["STAMPS_UPLOAD_FOLDER"], 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()
|
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"])
|
||||||
|
|
||||||
@@ -753,8 +809,9 @@ def assets():
|
|||||||
|
|
||||||
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"])
|
||||||
|
|
||||||
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")
|
@bp.route("/delete_idb")
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
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;
|
height:100px;
|
||||||
float:left;
|
float:left;
|
||||||
}
|
}
|
||||||
|
.manage_images_3{
|
||||||
|
display:block;
|
||||||
|
width:180px;
|
||||||
|
height:100px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -108,6 +114,14 @@ form textarea{
|
|||||||
height:56px;
|
height:56px;
|
||||||
width:auto;
|
width:auto;
|
||||||
}
|
}
|
||||||
|
.mng_img
|
||||||
|
{
|
||||||
|
height:56px;
|
||||||
|
width:auto;
|
||||||
|
object-fit:scale-down;
|
||||||
|
max-width:180px;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -148,9 +162,9 @@ form textarea{
|
|||||||
|
|
||||||
.title{
|
.title{
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
|
display:block;
|
||||||
margin-top:20px;
|
margin-top:20px;
|
||||||
margin-bottom:20px;
|
margin-bottom:20px;
|
||||||
display:block;
|
|
||||||
}
|
}
|
||||||
.heading.big{
|
.heading.big{
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
@@ -166,6 +180,17 @@ form textarea{
|
|||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lock{
|
||||||
|
float:left;
|
||||||
|
margin-right:10px;
|
||||||
|
}
|
||||||
|
.minilock{
|
||||||
|
width:16px;
|
||||||
|
height:auto;
|
||||||
|
float:left;
|
||||||
|
margin-right:10px;
|
||||||
|
}
|
||||||
|
|
||||||
#blog{
|
#blog{
|
||||||
max-height:300px;
|
max-height:300px;
|
||||||
overflow-y:scroll;
|
overflow-y:scroll;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.pink{
|
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;
|
scrollbar-color:#a414da #d991f4;
|
||||||
}
|
}
|
||||||
.pink .container, .pink #mobile-nav{
|
.pink .container, .pink #mobile-nav{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
{% for member in memberlist %}
|
{% for member in memberlist %}
|
||||||
{% if not g.user and member[9]==0 %}
|
{% if not g.user and member[9]==0 %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="#m{{ member[0] }}">{{ member[3] }}</a> |
|
<a href="#m{{ member[0] }}">{{ member[3]|safe }}</a> |
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="profile {{member[10]}}" id="m{{ member[0] }}">
|
<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]] %}
|
{% if icons[member[0]] %}
|
||||||
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{% for member in group_members[group[0]] %}
|
{% for member in group_members[group[0]] %}
|
||||||
{% if not g.user and member[9]==0 %}
|
{% if not g.user and member[9]==0 %}
|
||||||
{% else %}
|
{% else %}
|
||||||
✰ <a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3] }}</a> <br>
|
✰ <a href="{{ url_for('home.page', mid=member[0]) }}">{{ member[3]|safe }}</a> <br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<div id="frontbanner" class="heading">
|
<div id="frontbanner" class="heading">
|
||||||
{% if front_list|length > 0 %}
|
{% 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 %}
|
{% else %}
|
||||||
<i><sub>There are currently no members listed as fronting</sub></i>
|
<i><sub>There are currently no members listed as fronting</sub></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="profile {{member[10]}}" id="m{{ member[0] }}">
|
<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]] %}
|
{% if icons[member[0]] %}
|
||||||
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
<img src="{{ url_for('static', filename='icons/'+icons[member[0]]) }}" class="icon">
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<div class="maintext">Front change history</div>
|
<div class="maintext">Front change history</div>
|
||||||
<div class="log">
|
<div class="log">
|
||||||
{% for front in front_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 %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,44 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="heading big">Blinkies</div>
|
<div class="heading big">Blinkies</div>
|
||||||
|
<p>Not implemented yet (sorry!)</p>
|
||||||
|
|
||||||
<div class="heading big">Stamps</div>
|
<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>
|
</div>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block header %}
|
{% 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 %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<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" />
|
<br class="clear" />
|
||||||
|
|
||||||
<div class="heading">Edit Details</div>
|
<div class="heading">Edit Details</div>
|
||||||
@@ -147,6 +147,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<div class="heading">Manage Member Data</div>
|
||||||
<a href="{{ url_for('manage.export_fields', mid=member[0]) }}">Export Fields</a><br>
|
<a href="{{ url_for('manage.export_fields', mid=member[0]) }}">Export Fields</a><br>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block title %}{{ member[3] }}{% endblock %}
|
{% block title %}{{ remove_html(member[3]) }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
@@ -12,16 +12,18 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% if g.user %}
|
{% if g.user %}
|
||||||
<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='home') }}">Add to Front</a>{% else %}<a href="{{ url_for('manage.remove_front', mid=member[0],location='home') }}">Remove from Front</a>{% endif %} ☆ {% if member[7]==0 %}<a href="{{ url_for('manage.add_to_home', mid=member[0],location='home') }}">Pin to Homepage</a>{% else %}<a href="{{ url_for('manage.remove_home', mid=member[0],location='home') }}">Unpin from Homepage</a>{% endif %}
|
<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" />
|
<br class="clear" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if member[8]==1 %}<div class="heading"><i>Currently Fronting</i></div>{% endif %}
|
||||||
|
|
||||||
{% if icon %}
|
{% if icon %}
|
||||||
<img class="icon" src="{{ url_for('static', filename='icons/'+icon[0]) }}">
|
<img class="icon" src="{{ url_for('static', filename='icons/'+icon[0]) }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="icon" src="{{ url_for('static', filename='any.jpg') }}">
|
<img class="icon" src="{{ url_for('static', filename='any.jpg') }}">
|
||||||
{% endif %}
|
{% 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">
|
<div class="maintext">
|
||||||
{{member[5].replace('\n', '<br>')|safe}}
|
{{member[5].replace('\n', '<br>')|safe}}
|
||||||
</div>
|
</div>
|
||||||
@@ -51,6 +53,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% 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 %}
|
<!-- {% if groups|length > 0 %}
|
||||||
<div class="heading big">{{ member[20] }}</div>
|
<div class="heading big">{{ member[20] }}</div>
|
||||||
{% for group in groups %}
|
{% for group in groups %}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import datetime
|
import datetime, re
|
||||||
|
|
||||||
def server_time():
|
def server_time():
|
||||||
raw = datetime.datetime.now()
|
raw = datetime.datetime.now()
|
||||||
@@ -18,4 +18,8 @@ def get_datetime_obj(dt_string):
|
|||||||
return dt_obj
|
return dt_obj
|
||||||
|
|
||||||
def get_datetime_str(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