This repository has been archived on 2026-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cardmaker/resources/cards/svg.vm
T
pederbs b771cf5343 Make card template and svg browser get colored SVGs instead of filtering them
This fixes the issue of SVGs being rasterized to 72DPI when printing
2017-11-16 21:54:06 +01:00

83 lines
2.2 KiB
Plaintext

<!DOCTYPE html>
<title>SVG list</title>
<link rel="stylesheet" href="svg.css">
#macro(upload_svgs_form)
<form action="svg" method="post" enctype="multipart/form-data">
<h3>Upload SVG:</h3>
<p>
<input type="file" name="file" accept="image/svg+xml"><br/>
<input type="text" name="name" placeholder="name">
<input type="submit">
#if($uploaded)
<i>Upload was successfull!</i>
#end
</p>
</form>
#end
#macro(filter_and_collection_forms)
<form method="get" action="svg">
<h3>Filter svgs:</h3>
<input type="text" name="filter" value="$escape_html($filter)">
#if($current_collection)
<input type="hidden" name="collection" value="$escape_html($current_collection)">
#end
<input type="submit">
<center>
<h4>Collections:</h4>
<a href="svg">No collection</a>
#foreach($collection in $collections)
- <a href="svg?collection=$escape_html($collection)">$escape_html($collection)</a>
#end
</center>
</form>
#end
#macro(pagination)
#if($has_next || $page>1)
<center>
#set($self = "svg?")
#if($current_collection)
#set($self = "${self}collection=$escape_html($current_collection)&amp;")
#end
#if($filter)
#set($self = "${self}filter=$escape_html($filter)&amp;")
#end
#if($page>1)<a href="${self}page=$page.__sub__(1)">Previous page</a> - #end
<b>Page $page</b>
#if($has_next)
- <a href="${self}page=$page.__add__(1)">Next page</a>
#end
</center>
#end
#end
<a href="../" style="opacity:0.6;">Return to cardlist</a>
<div class="vsplit">
#upload_svgs_form()
#filter_and_collection_forms()
</div>
<h1>Available SVGs:</h1>
#pagination()
<ul>
#foreach($name in $svgs)
<li>
<h1>$escape_html($name)</h1>
<img src="/svg/${escape_html($name)}.svg?color=333">
</li>
#end
</ul>
#pagination()
<div class="vsplit">
#upload_svgs_form()
#filter_and_collection_forms()
</div>
<a href="../" style="opacity:0.6;">Return to cardlist</a>