edit.html 4.28 KB
Newer Older
Dave Kliczbor's avatar
Dave Kliczbor committed
1
2
3
4
<!DOCTYPE html>
<!-- <html xmlns="http://www.w3.org/1999/xhtml" > -->
<html xmlns:py="http://genshi.edgewall.org/">
<head>
5
6
7
    <link rel='stylesheet' type='text/css' href="${ url_for('static', filename='main.css') }"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>Schildergenerator</title>
Dave Kliczbor's avatar
Dave Kliczbor committed
8
9
</head>
<body>
10
11
12
13
14
15
16
17
18
19
    <py:with vars="messages = get_flashed_messages(with_categories=True)">
        <ul class="flashes" py:if="messages">
            <li class="${ category }" py:for="category,message in messages" tabindex="0">${ message }</li>
        </ul>
    </py:with>
    <a href="${ url_for('index') }">Liste der fertigen Schilder</a>
    
    <form method="post" action="${ url_for('create') }" enctype="multipart/form-data">
        <div class="box">
           <label for="form:template">Wähle eine TeX-Vorlage:</label>
20
           <ul py:attrs="{'class':'collapsed'} if defined('form') else {}">
21
                <li py:for="textemplate in templates">
22
                    <input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}" py:attrs="{'checked':'checked', 'onfocus':'this.parentElement.parentElement.className=\'\';'} if defined('form') and textemplate == form.textemplate else {}"/>
Dave Kliczbor's avatar
Dave Kliczbor committed
23
                    <label for="tpl:${textemplate}"><img src="${ url_for('tplthumbnail', tplname=textemplate, maxgeometry=80) }" alt="${textemplate}" title="${textemplate}"/></label>
24
                </li>
25
26
27
                <li class="onlywhencollapsed">
                    <button onclick="this.parentElement.parentElement.className=''; return false;" >Auswahl anzeigen</button>
                </li>
28
29
30
31
32
33
34
35
           </ul>
        </div><br/>
        <div class="box">
            <label for="form:headline">Überschrift</label>
            <textarea name="headline" id="form:headline" cols="35" rows="5"><py:if test="defined('form')">${form.headline}</py:if></textarea>
        </div>
        <div class="box">
           <label for="form:text">Text</label>
36
           <select name="markup">
37
38
                <option value="latex" py:attrs="{'selected':'True'} if defined('form') and form.markup == 'latex' else {}">LaTeX</option>
                <option value="rst" py:attrs="{'selected':'True'} if not defined('form') or form.markup == 'rst' or form.markup == '' else {}">Wiki (reStructuredText)</option>
39
           </select>
40
41
42
43
44
45
           <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">
        <label for="form:img">Wähle ein Bild (falls auf Vorlage anwendbar):</label>
        <ul>
            <li>
46
                <input type="radio" name="img" id="img--none" value="__none" py:attrs="{'checked':'checked'} if defined('form') and form.img == '__none' else {}"/>
47
48
49
50
51
52
53
54
                <label for="img--none">Kein Bild</label>
            </li>
            <li>
                <input type="radio" name="img" id="img--upload" value="__upload"/>
                <input type="file" name="imgupload"/>
                <label for="img--upload">Bild hochladen</label>
            </li>
        </ul>
55
        <ul py:attrs="{'class':'collapsed'} if defined('form') else {}">
56
            <li py:for="img in images">
57
                <input type="radio" name="img" id="img:${img}" value="${img}" py:attrs="{'checked':'checked', 'onfocus':'this.parentElement.parentElement.className=\'\';'} if defined('form') and form.img == img else {}"/>
58
59
                <label for="img:${img}"><img src="${ url_for('thumbnail', imgname=img, maxgeometry=100) }" alt="${img}" title="${img}"/></label>
            </li>
60
61
62
            <li class="onlywhencollapsed">
                <button onclick="this.parentElement.parentElement.className=''; return false;" >Auswahl anzeigen</button>
            </li>
63
64
        </ul>
        </div>
65
        <br/>
Dave Kliczbor's avatar
Dave Kliczbor committed
66
        <div class="box">
67
68
69
        <py:if test="defined('form') and len(form.filename) > 5">
            <input type="hidden" name="filename" value="${form.filename}"/>
                <input id="form:reusefilename" type="checkbox" name="reusefilename"/>
Dave Kliczbor's avatar
Dave Kliczbor committed
70
                <label for="form:reusefilename">Überschreibe bisherige Version von ${form.filename}.</label>
71
72
            <br/>
        </py:if>
73
74
75
        <input type="submit" value="Schild erstellen"/>
        </div>
    </form>
Dave Kliczbor's avatar
Dave Kliczbor committed
76
77
</body>
</html>