3
0

import some basic types

This commit is contained in:
Tit Petric 2018-07-01 02:02:31 +02:00
parent a21de65eb4
commit 2132db1709
10 changed files with 46 additions and 0 deletions

4
crm/types/bool.ejs Normal file
View File

@ -0,0 +1,4 @@
<div class="form-check form-check-inline">
<label class="form-check-label"><input class="form-check-input" type="radio" name="{name}" value="1" {if value==1}checked="checked"{/if}/> Yes</label>
<label class="form-check-label"><input class="form-check-input" type="radio" name="{name}" value="0" {if value!=1}checked="checked"{/if}/> No</label>
</div>

3
crm/types/bool.json Normal file
View File

@ -0,0 +1,3 @@
{
"name": "Boolean value (yes/no)"
}

3
crm/types/bool_multi.ejs Normal file
View File

@ -0,0 +1,3 @@
{foreach values as key => val}
<input type="checkbox" name="{name}[]" value="{key}" {if jQuery.inArray(key, value) >= 0} checked="checked"{/if}> {val}
{/foreach}

View File

@ -0,0 +1,3 @@
{
"name": "Boolean value (multiple checkboxes)"
}

7
crm/types/enum.ejs Normal file
View File

@ -0,0 +1,7 @@
<select name="{name}" class="form-control form-control-sm">
<% for (var key in values) {
var val = values[key];
%>
<option value="{key}"{if value == key} selected="selected"{/if}>{val}</option>
<% } %>
</select>

3
crm/types/enum.json Normal file
View File

@ -0,0 +1,3 @@
{
"name": "ENUM (single option)"
}

1
crm/types/input.ejs Normal file
View File

@ -0,0 +1 @@
<input type="{type}" id="{name}" name="{name}" value="{value}" class="form-control form-control-sm" placeholder="{title}" autocomplete="off"/>

9
crm/types/input.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "Text input",
"options": {
"type": {
"title": "Input type",
"values": ["hidden", "text", "password", "email"]
}
}
}

10
crm/types/stamp.ejs Normal file
View File

@ -0,0 +1,10 @@
<div class="form-group">
<div class="input-group input-group-sm">
<input type="text" name="{name}" value="{value}" id="{name}" class="form-control tac"/>
<div class="input-group-addon">
<i class="fa fa-calendar-plus-o" aria-hidden="true" onClick="return showCalendar('{name}', '%Y-%m-%d %H:%M:%S',true,true);"></i>
&nbsp;
<i class="fa fa-clock-o hand" aria-hidden="true" onClick="var xx=new Date; $('#{name}').val(xx.toISOString().replace('T', ' ').split('.')[0]); return false;"></i>
</div>
</div>
</div>

3
crm/types/stamp.json Normal file
View File

@ -0,0 +1,3 @@
{
"name": "Date/time input field"
}