New project structure

Beta of extract.js for extracting english locale
This commit is contained in:
Tomas Bures 2018-11-18 15:38:52 +01:00
parent e18d2b2f84
commit 2edbd67205
247 changed files with 6405 additions and 4237 deletions

View file

@ -0,0 +1,154 @@
{{#each customFields}}
{{#if typeSubscriptionEmail}}
<div class="form-group email">
<label for="EMAIL">{{#translate}}Email Address{{/translate}}</label>
{{#if ../isManagePreferences}}
<div class="input-group">
<input type="email" name="EMAIL" id="email" placeholder="" value="{{../email}}" readonly>
<div class="input-group-addon"><a href="/subscription/{{../lcid}}/manage-address/{{../cid}}">{{#translate}}want to change it?{{/translate}}</a></div>
</div>
{{else}}
<input type="email" name="EMAIL" id="email" placeholder="" value="{{../email}}" required>
{{/if}}
</div>
{{/if}}
{{#if typeText}}
<div class="form-group text {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="text" name="{{key}}" value="{{value}}">
</div>
{{/if}}
{{#if typeNumber}}
<div class="form-group number {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="number" name="{{key}}" value="{{value}}">
</div>
{{/if}}
{{#if typeWebsite}}
<div class="form-group url {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="url" name="{{key}}" value="{{value}}">
</div>
{{/if}}
{{#if typeLongtext}}
<div class="form-group longtext {{key}}">
<label for="{{key}}">{{name}}</label>
<textarea rows="3" name="{{key}}">{{value}}</textarea>
</div>
{{/if}}
{{#if typeJson}}
<div class="form-group json {{key}}">
<label for="{{key}}">{{name}}</label>
<textarea class="gpg-text" rows="3" name="{{key}}" placeholder="{&quot;data&quot;:&quot;value&quot;}">{{value}}</textarea>
</div>
{{/if}}
{{#if typeGpg}}
<div class="form-group gpg {{key}}">
<label for="{{key}}">{{name}}</label>
{{#if ../hasPubkey}}
<button class="btn-download-pubkey" type="submit" form="download-pubkey">{{#translate}}Download signature verification key{{/translate}}</button>
{{/if}}
<textarea class="form-control gpg-text" rows="4" name="{{key}}" placeholder="{{#translate}}Begins with{{/translate}} &#39;-----BEGIN PGP PUBLIC KEY BLOCK-----&#39;">{{value}}</textarea>
<span class="help-block">
{{#translate}}Insert your GPG public key here to encrypt messages sent to your address{{/translate}} <em>({{#translate}}optional{{/translate}})</em>
</span>
</div>
{{/if}}
{{#if typeDateUs}}
<div class="form-group date fm-date-us {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="text" name="{{key}}" placeholder="MM/DD/YYYY" value="{{value}}">
</div>
{{/if}}
{{#if typeDateEur}}
<div class="form-group date fm-date-eur {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="text" name="{{key}}" placeholder="DD/MM/YYYY" value="{{value}}">
</div>
{{/if}}
{{#if typeBirthdayUs}}
<div class="form-group date fm-birthday-us {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="text" name="{{key}}" placeholder="MM/DD" value="{{value}}">
</div>
{{/if}}
{{#if typeBirthdayEur}}
<div class="form-group date fm-birthday-eur {{key}}">
<label for="{{key}}">{{name}}</label>
<input type="text" name="{{key}}" placeholder="DD/MM" value="{{value}}">
</div>
{{/if}}
{{#if typeDropdownGrouped }}
<div class="form-group dropdown {{key}}">
<label for="{{key}}">{{name}}</label>
<select name="{{key}}" class="form-control">
<option value="">
{{#translate}}Select{{/translate}}
</option>
{{#each options}}
<option value="{{key}}" {{#if value}} selected {{/if}}>{{name}}</option>
{{/each}}
</select>
</div>
{{/if}}
{{#if typeRadioGrouped}}
<div class="form-group radio {{key}}">
<label for="{{key}}">{{name}}</label>
{{#each options}}
<label class="label-radio">
<input type="radio" name="{{../key}}" value="{{key}}" {{#if value}} checked {{/if}}> {{name}}
</label>
{{/each}}
</div>
{{/if}}
{{#if typeCheckboxGrouped}}
<div class="form-group checkbox">
<label>{{name}}</label>
{{#each options}}
<label class="label-checkbox">
<input type="checkbox" name="{{key}}" value="1" {{#if value}} checked {{/if}}> {{name}}
</label>
{{/each}}
</div>
{{/if}}
{{#if typeDropdownEnum }}
<div class="form-group dropdown {{key}}">
<label for="{{key}}">{{name}}</label>
<select name="{{key}}" class="form-control">
<option value="">
{{#translate}}Select{{/translate}}
</option>
{{#each options}}
<option value="{{key}}" {{#if value}} selected {{/if}}>{{name}}</option>
{{/each}}
</select>
</div>
{{/if}}
{{#if typeRadioEnum}}
<div class="form-group radio {{key}}">
<label for="{{key}}">{{name}}</label>
{{#each options}}
<label class="label-radio">
<input type="radio" name="{{../key}}" value="{{key}}" {{#if value}} checked {{/if}}> {{name}}
</label>
{{/each}}
</div>
{{/if}}
{{/each}}

View file

@ -0,0 +1,14 @@
{{{flashMessages}}}
{{#if isConfirmNotice}}
<div class="alert alert-warning js-warning" role="alert">
<strong>{{#translate}}Warning!{{/translate}}</strong> {{#translate}}If JavaScript was not enabled then no confirmation message was sent{{/translate}}
</div>
{{/if}}
{{#if needsJsWarning}}
<div class="alert alert-danger js-warning" role="alert">
<strong>{{#translate}}Warning!{{/translate}}</strong>
{{#translate}}JavaScript must be enabled in order for this form to work{{/translate}}
</div>
{{/if}}

View file

@ -0,0 +1,61 @@
<script>
(function () {
var forEach = function (array, callback, scope) {
for (var i = 0; i < array.length; i++) {
callback.call(scope, i, array[i]);
}
};
forEach(document.querySelectorAll('.js-warning'), function(i, el) {
el.style.display = 'none';
});
forEach(document.querySelectorAll('a[href="#submit"]'), function(i, a) {
a.onclick = function() {
var form = document.getElementById('main-form');
form && form.submit();
return false;
};
});
if (typeof moment !== 'undefined' && moment.tz) {
forEach(document.querySelectorAll('.tz-detect'), function(i, el) {
el.value = moment.tz.guess() || '';
});
}
// Fixes MJML Button until they do ...
// https://github.com/mjmlio/mjml/issues/359
var btnBgColor = '{{btnBgColor}}';
var btnBgColorHover = '{{btnBgColorHover}}';
if (btnBgColor) {
var s = document.createElement('style');
var c = document.createTextNode(
'.td-btn:hover { background-color: ' + btnBgColorHover + '; }' +
'.td-btn { cursor: pointer !important; }' +
'.a-btn { background-color: transparent !important; }'
);
s.appendChild(c);
document.getElementsByTagName('head')[0].appendChild(s);
forEach(document.querySelectorAll('a'), function(i, a) {
if (a.parentNode.getAttribute('bgcolor') === btnBgColor) {
a.target = '_self';
a.className += 'a-btn';
a.parentNode.className += 'td-btn';
a.parentNode.onclick = function() {
a.click();
};
}
});
}
})();
</script>
<!-- custom scripts from config -->
{{#each customSubscriptionScripts}}
<script src="{{this}}"></script>
{{/each}}
{{> tracking_scripts}}

View file

@ -0,0 +1,22 @@
<form id="main-form" method="post" action="/subscription/{{lcid}}/manage-address">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="cid" value="{{cid}}">
<div class="form-group email">
<label for="EMAIL">{{#translate}}Existing Email Address{{/translate}}</label>
<input type="email" name="EMAIL" id="email" placeholder="" value="{{email}}" readonly>
</div>
<div class="form-group email">
<label for="EMAIL_NEW">{{#translate}}New Email Address{{/translate}}</label>
<input type="email" name="EMAIL_NEW" id="email-new" placeholder="{{#translate}}Your new email address{{/translate}}" value="{{email}}">
</div>
<p>
{{#translate}}You will receive a confirmation request to your new email address that you need to accept before your email is actually changed{{/translate}}
</p>
<button type="submit" style="position: absolute; top: -9999px; left: -9999px;">{{#translate}}Update Email Address{{/translate}}</button>
</form>

View file

@ -0,0 +1,19 @@
{{#if hasPubkey}}
<form method="post" id="download-pubkey" action="/subscription/publickey" style="display: none;">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="cid" value="{{cid}}">
</form>
{{/if}}
<form id="main-form" method="post" action="/subscription/{{lcid}}/manage">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="cid" value="{{cid}}">
<input type="hidden" class="tz-detect" name="tz" id="tz" value="{{tz}}">
{{> subscription_custom_fields}}
<button type="submit" style="position: absolute; top: -9999px; left: -9999px;">{{#translate}}Update Profile{{/translate}}</button>
</form>
<script src="/moment/moment.min.js"></script>
<script src="/moment/moment-timezone-with-data.min.js"></script>

View file

@ -0,0 +1,25 @@
{{#if hasPubkey}}
<form method="post" id="download-pubkey" action="/subscription/publickey" style="display: none;">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="cid" value="{{cid}}">
</form>
{{/if}}
<form id="main-form" method="post" action="/subscription/{{cid}}/subscribe">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" class="tz-detect" name="tz" id="tz" value="{{tz}}">
<input type="hidden" name="address" value="">
<input type="hidden" name="sub" id="sub" value="">
<input type="hidden" name="ucid" value="{{ucid}}">
{{> subscription_custom_fields}}
<button type="submit" style="position: absolute; top: -9999px; left: -9999px;">{{#translate}}Subscribe to list{{/translate}}</button>
</form>
<script>
document.getElementById('sub').value = new Date().getTime();
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.3/moment-timezone-with-data.min.js"></script>

View file

@ -0,0 +1,13 @@
<form method="post" id="main-form" action="/subscription/{{lcid}}/unsubscribe">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<input type="hidden" name="campaign" value="{{campaign}}">
<input type="hidden" name="ucid" value="{{ucid}}">
<div class="form-group">
<label for="email">{{#translate}}Email address{{/translate}}</label>
<input type="email" name="email" id="email" placeholder="" value="{{email}}" readonly>
</div>
<button type="submit" style="position: absolute; top: -9999px; left: -9999px;">{{#translate}}Unsubscribe{{/translate}}</button>
</form>