educaweb2/shortcodes/button.tmpl

30 lines
760 B
Cheetah

<%doc>
Return render button
Template engine: Mako
Usage:
{{% button link=<link> [img=<img>] [width=<width>] <text> %}}
where <link> is the destination of the button, <img> is a link to an optionma image to put inside the button, <width> is the optional width of the button and <text> is the text inside the button.
</%doc>
<% s = "" %>
% if img is not UNDEFINED:
<% s += "height:49px;position:relative;padding-left:47px;padding-right:37px;" %>
% endif
% if width is not UNDEFINED:
<% s += "width:" + width + ";" %>
% endif
<a href="${link}" class="btn btn-primary" style="${s}">
% if img is not UNDEFINED:
<span>
<img src="${img}" width="35" height="35" class="d-inline-block align-center">
</span>
% endif
${_args[0]}
</a>