Skip to content
Snippets Groups Projects
Commit 693a88a8 authored by Dave Kliczbor's avatar Dave Kliczbor
Browse files

changed conditional markup on edit template. so much shorter now...

parent b48f7a7a
No related branches found
No related tags found
No related merge requests found
...@@ -26,21 +26,7 @@ ...@@ -26,21 +26,7 @@
<label for="form:template">Wähle eine TeX-Vorlage:</label> <label for="form:template">Wähle eine TeX-Vorlage:</label>
<ul> <ul>
<li py:for="textemplate in templates"> <li py:for="textemplate in templates">
<py:choose> <input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}" py:attrs="{'checked':'checked'} if defined('form') and textemplate == form.textemplate else {}"/>
<py:when test="defined('form')">
<py:choose>
<py:when test="textemplate == form.textemplate">
<input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}" checked="True"/>
</py:when>
<py:otherwise>
<input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}"/>
</py:otherwise>
</py:choose>
</py:when>
<py:otherwise>
<input type="radio" name="textemplate" id="tpl:${textemplate}" value="${textemplate}"/>
</py:otherwise>
</py:choose>
<label for="tpl:${textemplate}"><img src="${ url_for('tplthumbnail', tplname=textemplate, maxgeometry=72) }" alt="${textemplate}" title="${textemplate}"/></label> <label for="tpl:${textemplate}"><img src="${ url_for('tplthumbnail', tplname=textemplate, maxgeometry=72) }" alt="${textemplate}" title="${textemplate}"/></label>
</li> </li>
</ul> </ul>
...@@ -52,16 +38,8 @@ ...@@ -52,16 +38,8 @@
<div class="box"> <div class="box">
<label for="form:text">Text</label> <label for="form:text">Text</label>
<select name="markup"> <select name="markup">
<py:choose> <option value="latex" py:attrs="{'selected':'True'} if not defined('form') or form.markup == 'rst' or form.markup == '' else {}">LaTeX</option>
<py:when test="not defined('form') or form.markup == 'rst' or form.markup == ''"> <option value="rst" py:attrs="{'selected':'True'} if defined('form') and form.markup == 'latex' else {}">Wiki (reStructuredText)</option>
<option value="latex">LaTeX</option>
<option value="rst" selected="True">Wiki (reStructuredText)</option>
</py:when>
<py:when test="defined('form') and form.markup == 'latex'">
<option value="latex" selected="True">LaTeX</option>
<option value="rst">Wiki (reStructuredText)</option>
</py:when>
</py:choose>
</select> </select>
<textarea name="text" id="form:text" cols="35" rows="5"><py:if test="defined('form')">${form.text}</py:if></textarea> <textarea name="text" id="form:text" cols="35" rows="5"><py:if test="defined('form')">${form.text}</py:if></textarea>
</div><br/> </div><br/>
...@@ -72,14 +50,7 @@ ...@@ -72,14 +50,7 @@
<label for="form:img">Wähle ein Bild (falls auf Vorlage anwendbar):</label> <label for="form:img">Wähle ein Bild (falls auf Vorlage anwendbar):</label>
<ul> <ul>
<li> <li>
<py:choose> <input type="radio" name="img" id="img--none" value="__none" py:attrs="{'checked':'checked'} if defined('form') and form.img == '__none' else {}"/>
<py:when test="defined('form')">
<input type="radio" name="img" id="img--none" value="__none" checked="${form.img == '__none'}"/>
</py:when>
<py:otherwise>
<input type="radio" name="img" id="img--none" value="__none" checked="checked" />
</py:otherwise>
</py:choose>
<label for="img--none">Kein Bild</label> <label for="img--none">Kein Bild</label>
</li> </li>
<li> <li>
...@@ -90,21 +61,7 @@ ...@@ -90,21 +61,7 @@
</ul> </ul>
<ul> <ul>
<li py:for="img in images"> <li py:for="img in images">
<py:choose> <input type="radio" name="img" id="img:${img}" value="${img}" py:attrs="{'checked':'checked'} if defined('form') and form.img == img else {}"/>
<py:when test="defined('form')">
<py:choose>
<py:when test="img == form.img">
<input type="radio" name="img" id="img:${img}" value="${img}" checked="True"/>
</py:when>
<py:otherwise>
<input type="radio" name="img" id="img:${img}" value="${img}"/>
</py:otherwise>
</py:choose>
</py:when>
<py:otherwise>
<input type="radio" name="img" id="img:${img}" value="${img}"/>
</py:otherwise>
</py:choose>
<label for="img:${img}"><img src="${ url_for('thumbnail', imgname=img, maxgeometry=100) }" alt="${img}" title="${img}"/></label> <label for="img:${img}"><img src="${ url_for('thumbnail', imgname=img, maxgeometry=100) }" alt="${img}" title="${img}"/></label>
</li> </li>
</ul> </ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment