A Python content management system designed for kirsle.net featuring a blog, comments and photo albums. https://rophako.kirsle.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.2 KiB

{% extends "layout.html" %}
{% block title %}Upload a Photo{% endblock %}
{% block content %}
<h1>Upload a Photo</h1>
You can upload a photo from your computer or by pasting in the URL to a photo
somewhere else on the Internet.
<form id="upload-form" action="{{ url_for('photo.upload') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<legend>Where is your picture located?</legend>
<input type="radio" class="location" name="location" value="pc" checked> On my computer
<input type="radio" class="location" name="location" value="www"> On the web
<div id="pic-pc" class="location-div">
<strong>Upload a picture from my computer</strong><br>
<input type="file" size="30" name="file" id="file-picker" accept="image/*" multiple><p>
<strong>Or, drag images here:</strong><br>
<div id="dropbox" class="photo-upload-dropbox">Drag and drop images into this box</div>
<div id="pic-www" class="location-div">
<strong>Upload a picture from the Internet</strong><br>
<input type="text" size="40" name="url" placeholder="http://" autocomplete="off">
Only jpeg, gif and png images are supported. There is no maximum file size
limit, but be reasonable.
<legend>Photo Options</legend>
<strong>Photo album:</strong><br>
<select id="album" name="album">
<optgroup label="Albums">
{% for album in album_list %}
<option value="{{ album }}"{% if album == selected %} selected{% endif %}>{{ album }}</option>
{% endfor %}
<option value="">Create a new album</option>
<blockquote id="create-album">
<strong>New album:</strong><br>
<input type="text" size="20" id="new-album" name="new-album">
<input type="text" size="40" name="caption">
<fieldset id="upload-progress" style="display: none">
<legend>Upload Progress</legend>
<div class="upload-trough">
<div id="upload-progress-bar" class="upload-progress-bar"></div>
<button type="submit" id="upload-button">Upload Picture</button>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="/rophako/multiupload.js"></script>
$(document).ready(function() {
$(".location").change(function() {
$("#pic-" + $(this).val()).show();
$("#album").change(function() {
if ($(this).val() === "") {
else {
{% endblock %}