misc image uploads for use in custom sections, blog posts, or wherever you want!!!!!
This commit is contained in:
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
|
||||||
|
|||||||
@@ -771,6 +771,11 @@ 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
|
||||||
|
file.save(os.path.join(current_app.config["MISC_UPLOAD_FOLDER"], filename))
|
||||||
|
|
||||||
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"])
|
||||||
|
|
||||||
@@ -793,8 +798,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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user