Commit bf20d7fc authored by Marco Kellershoff's avatar Marco Kellershoff
Browse files

Ported Onmeda.de Template to new templating engine.

parent db511611
......@@ -2,6 +2,7 @@
var _APP = null;
var _OUTPUT = null;
var _INPUTCOUNTER = 0;
var _HTML_TEMPLATE_FILE = '';
var query = function(sel) {
return document.querySelector(sel);
};
......@@ -100,6 +101,7 @@
var app_container = query('#app');
app_container.innerHTML = '';
var dataCallback = function(json) {
_HTML_TEMPLATE_FILE = json.html_template_file;
var elementsCallback = function(el_data) {
var node = createTemplateEl(el_data);
_APP.appendChild(node);
......@@ -139,7 +141,7 @@
var mode = evt.target.value;
var values = getValues();
var template = null;
getData('./templates/gofeminin.html', function(html){
var getDataCallback = function(html) {
template = ejs.render(html, values);
if (mode === 'show') {
_OUTPUT.style.border = '1px solid #000';
......@@ -148,7 +150,9 @@
} else {
download('signature.html', template);
}
}, {dataType: 'text'});
};
getData('./templates/' + _HTML_TEMPLATE_FILE, getDataCallback,
{dataType: 'text'});
};
var renderPortalSelection = function() {
var portals = [createEl('option', '', [['value', '']])];
......
{
"success": true,
"html_template_file": "gofeminin.html",
"data": [
{
"type": "input",
......
{
"moo": "foo"
"success": true,
"html_template_file": "onmeda.de.html",
"data": [
{
"type": "input",
"name": "firstname",
"label": "Vorname",
"value": "",
"placeholder": ""
},
{
"type": "input",
"name": "lastname",
"label": "Nachname",
"value": "",
"placeholder": ""
},
{
"type": "input",
"name": "email",
"label": "E-Mail",
"value": "vorname.nachname@onmeda.de",
"placeholder": ""
},
{
"type": "input",
"name": "jobtitle",
"label": "Jobtitel",
"value": "",
"placeholder": ""
},
{
"type": "input",
"name": "telephone",
"label": "Telefon",
"value": "+49 (0) 22 1 / 28 325-",
"placeholder": ""
},
{
"type": "input",
"name": "mobile",
"label": "Dienstliche Handynummer",
"value": "",
"placeholder": "+49 175 1337 187"
},
{
"type": "input",
"name": "fax",
"label": "Fax",
"value": "+49 (0) 22 1 / 28 325-555",
"placeholder": ""
},
{
"type": "button",
"id": "btn_gen_show",
"text": "Signatur anzeigen",
"value": "show"
},
{
"type": "button",
"id": "btn_gen_download",
"text": "Signatur herunterladen",
"value": "dl"
}
]
}
......@@ -15,8 +15,8 @@
<br>
<font color="#68696b">Tel. <%= telephone %></font>
<br>
<% if (mobile) { %>
<font color="#68696b"><%= mobile %></font>
<% if (mobile) { -%>
<font color="#68696b">Mobil <%= mobile %></font>
<% } -%>
<font color="#68696b">Fax <%= fax %></font>
</font>
......
......@@ -4,25 +4,27 @@
<td width="100%" align="left">
<font face="Arial, Verdana, sans-serif" size="2" style="font-size:13px;">
<font color="#951F60">
<strong>{{firstname}} {{lastname}}</strong>
<strong><%= firstname %> <%= lastname %></strong>
</font>
<br>
<font color="#68696b">{{jobtitle}}</font>
<font color="#68696b"><%= jobtitle %></font>
<br>
<a style="text-decoration:none;" href="mailto:{{email}}">
<font color="#68696b" style="text-decoration:none;">{{email}}</font>
<a style="text-decoration:none;" href="mailto:<%= email %>">
<font color="#68696b" style="text-decoration:none;"><%= email %></font>
</a>
<br>
<font color="#68696b">Tel. {{telephone}}</font>
<font color="#68696b">Tel. <%= telephone %></font>
<br>
<font color="#68696b">{{corp_telephone}}</font>
<font color="#68696b">Fax {{fax}}</font>
<% if (mobile) { -%>
<font color="#68696b">Mobil <%= mobile %></font>
<% } -%>
<font color="#68696b">Fax <%= fax %></font>
</font>
</td>
</tr>
<tr>
<td align="left">
<img width="600" vspace="10" height="130" alt="onmeda.de" src="http://i.onmeda.de/signature_koeln_onmeda_2016.gif" />
<img width="600" vspace="10" height="130" alt="gofeminin.de" src="http://i.onmeda.de/signature_koeln_2016.gif" />
</td>
</tr>
<tr>
......@@ -32,17 +34,17 @@
<tr>
<td>
<a target="_blank" href="https://www.facebook.com/onmeda">
<img width="30" height="30" border="0" alt="Facebook" src="http://i.onmeda.de/onmeda-signature-facebook.png" />
<img width="30" height="30" border="0" alt="Facebook" src="http://www.gofeminin.de/mailing/signature-af/facebook.png" />
</a>
</td>
<td>
<a target="_blank" href="https://instagram.com/onmeda.de/">
<img width="30" height="30" border="0" alt="Instagram" src="http://i.onmeda.de/onmeda-signature-instagram.png">
<img width="30" height="30" border="0" alt="Instagram" src="http://www.gofeminin.de/mailing/signature-af/instagram.png">
</a>
</td>
<td>
<a target="_blank" href="https://de.pinterest.com/onmeda_de/">
<img width="30" height="30" border="0" alt="Pinterest" src="http://i.onmeda.de/onmeda-signature-pinterest.png">
<img width="30" height="30" border="0" alt="Pinterest" src="http://www.gofeminin.de/mailing/signature-af/pinterest.png">
</a>
</td>
</tr>
......
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