Commit 5c6150e7 authored by Dave Kliczbor's avatar Dave Kliczbor

Added SVG upload support

parent dda922f7
......@@ -171,11 +171,12 @@ def index(**kwargs):
def edit(**kwargs):
data = defaultdict(str)
data.update(**kwargs)
imagelist = glob.glob(config.imagedir + '/*.png')
imagelist = sorted(glob.glob(config.imagedir + '/*.png'))
data['images'] = [os.path.basename(f) for f in imagelist]
templatelist = glob.glob(config.textemplatedir + '/*.tex')
data['templates'] = [unicode(os.path.basename(f))
for f in sorted(templatelist)]
data['imageextensions'] = config.allowed_extensions
return render_response('edit.html', data)
......
......@@ -141,6 +141,10 @@ label {
height: initial;
float: right;
}
.box.imageselect {
max-height: 30em;
overflow-y: auto;
}
.collapsed input, .collapsed input+label {
opacity: 0.2;
transform: scale(0.01);
......
......@@ -39,7 +39,7 @@
</select>
<textarea name="text" id="form:text" cols="35" rows="5"><py:if test="defined('form')">${form.text}</py:if></textarea>
</div><br/>
<div class="box">
<div class="box imageselect">
<label for="form:img">Wähle ein Bild (falls auf Vorlage anwendbar):</label>
<ul>
<li>
......@@ -49,7 +49,7 @@
<li>
<input type="radio" name="img" id="img--upload" value="__upload"/>
<input type="file" name="imgupload"/>
<label for="img--upload">Bild hochladen</label>
<label for="img--upload">Bild hochladen (${', '.join(imageextensions)})</label>
</li>
</ul>
<ul py:attrs="{'class':'collapsed'} if defined('form') else {}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment