Commit afeb03c9 by Kunto

masih forms

1 parent 7bf0e174
...@@ -16198,3 +16198,15 @@ html[dir=rtl] .toast-onload { ...@@ -16198,3 +16198,15 @@ html[dir=rtl] .toast-onload {
width: calc(100% - 270px) width: calc(100% - 270px)
} }
} }
.form-control-static {
display: block;
height: 36px;
font-size: var(--text-sm);
line-height: var(--tw-leading, var(--text-sm--line-height));
padding: calc(var(--spacing) * 2.5);
border-color: var(--color-gray-200);
border-radius: var(--radius-md);
background-color: var(--color-gray-200);
--tw-shadow: 0 0 #0000;
}
\ No newline at end of file \ No newline at end of file
document.addEventListener("DOMContentLoaded", function () {
setTimeout(() => {
if (document.getElementById("dismiss-toast")) {
document.getElementById("dismiss-toast").classList.add("hs-removing");
document.getElementById("dismiss-toast").classList.remove("show-toast");
setTimeout(() => {
document.getElementById("dismiss-toast").remove();
}, 300);
} else {
}
}, 5000);
setTimeout(() => {
document.getElementById("dismiss-toast").classList.add("show-toast");
}, 1000);
});
<span tal:define="name name|field.name; <img
class="block items-center justify-center mb-1 border-1 border-gray-200 rounded-md"
src="${cstruct}"
style="height: 82px !important"
/>
<span class="block mb-4 font-light text-xs text-gray-400"
><em
>Masukkan text yang ditampilkan di atas pada input Captcha di bawah ini</em
></span
>
<block
tal:define="name name|field.name;
css_class css_class|field.widget.css_class; css_class css_class|field.widget.css_class;
oid oid|field.oid; oid oid|field.oid;
style style|field.widget.style; style style|field.widget.style;
" tal:omit-tag=""> "
<img style="height:30px; width:auto; margin-bottom:5px;" src="${cstruct}"> tal:omit-tag=""
<input type="text" name="${name}" value="" tal:attributes="class string: form-control ${css_class or ''}; >
style style; <div class="relative mb-2">
attributes|field.widget.attributes|{};" id="${oid}" /> <input
type="text"
name="${name}"
value=""
id="${oid}"
placeholder="Captcha"
class="peer p-2.5 block w-full border-gray-200 rounded-md text-sm placeholder:text-transparent focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-transparent dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600 focus:pt-6 focus:pb-2 [&:not(:placeholder-shown)]:pt-6 [&:not(:placeholder-shown)]:pb-2 autofill:pt-6 autofill:pb-2 ${css_class}"
/>
<label
for="${oid}"
class="absolute top-0 start-0 p-2.5 h-full text-sm truncate pointer-events-none transition ease-in-out duration-100 border border-transparent dark:text-white peer-disabled:opacity-50 peer-disabled:pointer-events-none peer-focus:text-xs peer-focus:-translate-y-1.5 peer-focus:text-gray-500 peer-[:not(:placeholder-shown)]:text-xs peer-[:not(:placeholder-shown)]:-translate-y-1.5 peer-[:not(:placeholder-shown)]:text-gray-500"
id="req-${oid}"
>Captcha
</label>
<script lang="javascript"> <script lang="javascript">
// Convert input to uppercase // Convert input to uppercase
deform.addCallback( deform.addCallback(
...@@ -19,5 +43,5 @@ ...@@ -19,5 +43,5 @@
}); });
}); });
</script> </script>
</span>
\ No newline at end of file \ No newline at end of file
</div>
</block>
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
delete cstruct.get('delete')|''; delete cstruct.get('delete')|'';
maxsize field.widget.size|5242880; maxsize field.widget.size|5242880;
img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd']; img ['jpg', 'jpeg', 'gif', 'png', 'svg', 'eps', 'psd'];
video ['avi', 'mov', 'mp4'] video ['avi', 'mov', 'mp4'];
title title|field.title;
"> ">
${field.start_mapping()} ${field.start_mapping()}
<div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'"> <div class="thumbnail" tal:condition="ext in img or ext in video or ext=='pdf'">
...@@ -28,10 +29,19 @@ ...@@ -28,10 +29,19 @@
<a tal:condition="ext" class="label label-default" href="${preview_url}" target="_blank" id="a-preview-${oid}"><i <a tal:condition="ext" class="label label-default" href="${preview_url}" target="_blank" id="a-preview-${oid}"><i
class="fa fa-search"></i> View</a> class="fa fa-search"></i> View</a>
<input type="file" name="upload" id="${oid}" tal:attributes="style style; <div class="flex items-center justify-center w-full">
accept accept|field.widget.accept; <label for="dropzone-file" class="flex flex-col items-center justify-center w-full h-80 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-gray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600">
data-filename fname; <div class="flex flex-col items-center justify-center pt-5 pb-6">
attributes|field.widget.attributes|{};" /> <svg class="w-8 h-8 mb-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 16">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"/>
</svg>
<p class="font-bold mb-2">Unggah ${title}</p>
<p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Klik untuk mengunggah</span> atau seret dan jatuhkan file</p>
<p class="text-xs text-gray-500 dark:text-gray-400">${img}</p>
</div>
<input id="dropzone-file" type="file" class="hidden" />
</label>
</div>
<input tal:define="uid cstruct.get('uid')" tal:condition="uid" type="hidden" name="uid" value="${uid}" /> <input tal:define="uid cstruct.get('uid')" tal:condition="uid" type="hidden" name="uid" value="${uid}" />
${field.end_mapping()} ${field.end_mapping()}
<script type="text/javascript"> <script type="text/javascript">
......
<form <form
tal:define=" tal:define="style style|field.widget.style;
css_class css_class|string:${field.widget.css_class or field.css_class or ''};
item_template item_template|field.widget.item_template; item_template item_template|field.widget.item_template;
autocomplete autocomplete|field.autocomplete; autocomplete autocomplete|field.autocomplete;
title title|field.title; title title|field.title;
...@@ -12,6 +13,8 @@ ...@@ -12,6 +13,8 @@
action action|field.action or None; action action|field.action or None;
method method|field.method;" method method|field.method;"
tal:attributes="autocomplete autocomplete; tal:attributes="autocomplete autocomplete;
style style;
class css_class;
action action; action action;
attributes|field.widget.attributes|{};" attributes|field.widget.attributes|{};"
id="${formid}" id="${formid}"
...@@ -25,32 +28,42 @@ ...@@ -25,32 +28,42 @@
<div class="grid grid-cols-12 gap-y-6 md:gap-6"> <div class="grid grid-cols-12 gap-y-6 md:gap-6">
<input type="hidden" name="_charset_" /> <input type="hidden" name="_charset_" />
<input type="hidden" name="__formid__" value="${formid}" /> <input type="hidden" name="__formid__" value="${formid}" />
<div class="alert alert-danger" tal:condition="field.error"> <div
<div class="error-msg-lbl" i18n:translate=""> tal:condition="field.error"
There was a problem with your submission id="dismiss-toast"
class="toast-onload bg-lighterror border border-lighterror text-sm text-erroremphasis rounded-md dark:bg-darkerror dark:border-darkerror dark:text-error hs-removing:translate-x-3 hs-removing:opacity-0 transition duration-300"
role="alert"
>
<div class="flex gap-2 p-3">
<i class="ti ti-alert-circle text-red text-3xl"></i>
<div>
<span class="font-semibold"
>Terdapat kesalahan pada pengisian form!
</span>
<p class="text-xs text-red">${field.errormsg}</p>
</div>
<div class="ms-auto">
<button type="button" data-hs-remove-element="#dismiss-toast">
<i class="ti ti-x text-lg text-red opacity-70 leading-none"></i>
</button>
</div> </div>
<div class="error-msg-detail" i18n:translate="">
Errors have been highlighted below
</div> </div>
<p class="error-msg">${field.errormsg}</p>
</div> </div>
<p class="section first" tal:condition="description">${description}</p>
<div <div
tal:repeat="child field" tal:repeat="child field"
tal:replace="structure child.render_template(item_template)" tal:replace="structure child.render_template(item_template)"
/> />
<div class="row"> <div class="col-span-12 md:col-span-4 md:col-start-2 gap-6">
<div class="form-group deform-form-buttons">
<tal:loop tal:repeat="button buttons"> <tal:loop tal:repeat="button buttons">
<button <button
tal:define="btn_disposition repeat.button.start and 'btn-primary' or 'btn-default';" tal:define="btn_disposition repeat.button.start and 'btn-primary' or 'btn-default'; btn_class button.name == 'cancel' and 'btn-light-error' or '';"
tal:attributes="disabled button.disabled if button.disabled else None; tal:attributes="disabled button.disabled if button.disabled else None;
attributes|button.attributes|{};" attributes|button.attributes|{};"
id="${formid+button.name}" id="${formid+button.name}"
name="${button.name}" name="${button.name}"
type="${button.type}" type="${button.type}"
class="btn ${button.css_class or btn_disposition}" class="btn btn-md me-3 ${btn_class}"
value="${button.value}" value="${button.value}"
tal:condition="button.type != 'link'" tal:condition="button.type != 'link'"
> >
...@@ -77,7 +90,6 @@ ...@@ -77,7 +90,6 @@
</tal:loop> </tal:loop>
</div> </div>
</div> </div>
</div>
<script type="text/javascript" tal:condition="use_ajax"> <script type="text/javascript" tal:condition="use_ajax">
deform.addCallback( deform.addCallback(
......
<div <block
tal:define="error_class error_class|field.widget.error_class; tal:define="error_class error_class|field.widget.error_class;
description description|field.description; description description|field.description;
title title|field.title; title title|field.title;
...@@ -14,24 +14,16 @@ ...@@ -14,24 +14,16 @@
tal:omit-tag="structural" tal:omit-tag="structural"
i18n:domain="deform" i18n:domain="deform"
> >
<!-- <div class="row"> <span tal:condition="not field.children">
<div class="col-md-12 col-lg-12 col-sm-12"> --> <span tal:replace="structure field.serialize(cstruct).strip()" />
<div tal:condition="not field.children" class="relative mb-2">
<div <div
tal:define="input_prepend field.widget.input_prepend | None; tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
input_append field.widget.input_append | None" class="absolute inset-y-0 end-0 flex items-center pointer-events-none pe-3"
tal:omit-tag="not (input_prepend or input_append)"
> >
<span tal:condition="input_prepend">${input_prepend}</span> <i
<span tal:replace="structure field.serialize(cstruct).strip()" /> class="ti ti-alert-circle text-lg leading-tight font-medium text-error"
<span tal:condition="input_append">${input_append}</span> ></i>
<label
for="${oid}"
class="absolute top-0 start-0 p-2.5 h-full text-sm truncate pointer-events-none transition ease-in-out duration-100 border border-transparent dark:text-white peer-disabled:opacity-50 peer-disabled:pointer-events-none peer-focus:text-xs peer-focus:-translate-y-1.5 peer-focus:text-gray-500 peer-[:not(:placeholder-shown)]:text-xs peer-[:not(:placeholder-shown)]:-translate-y-1.5 peer-[:not(:placeholder-shown)]:text-gray-500"
tal:condition="not structural"
id="req-${oid}"
>${title}
</label>
</div> </div>
<p <p
...@@ -41,6 +33,7 @@ ...@@ -41,6 +33,7 @@
tal:attributes="id repeat.msg.index==0 and errstr or tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))" ('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'" tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
class="text-sm text-error mt-2"
> >
${msg} ${msg}
</p> </p>
...@@ -48,8 +41,9 @@ ...@@ -48,8 +41,9 @@
<p tal:condition="field.description and not field.widget.hidden"> <p tal:condition="field.description and not field.widget.hidden">
${field.description} ${field.description}
</p> </p>
</div> </span>
<div tal:condition="field.children">
<span tal:condition="field.children">
<div <div
tal:define="input_prepend field.widget.input_prepend | None; tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None" input_append field.widget.input_append | None"
...@@ -74,7 +68,5 @@ ...@@ -74,7 +68,5 @@
<p tal:condition="field.description and not field.widget.hidden"> <p tal:condition="field.description and not field.widget.hidden">
${field.description} ${field.description}
</p> </p>
</div> </span>
</div> </block>
<!-- </div>
</div> -->
...@@ -9,15 +9,23 @@ ...@@ -9,15 +9,23 @@
" "
tal:omit-tag="" tal:omit-tag=""
> >
<div class="relative mb-2">
<input <input
type="text" type="text"
id="${oid}" id="${oid}"
class="peer p-2.5 block w-full border-gray-200 rounded-md text-sm placeholder:text-transparent focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-transparent dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600 focus:pt-6 focus:pb-2 [&:not(:placeholder-shown)]:pt-6 [&:not(:placeholder-shown)]:pb-2 autofill:pt-6 autofill:pb-2" class="peer p-2.5 block w-full border-gray-200 rounded-md text-sm placeholder:text-transparent focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-transparent dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600 focus:pt-6 focus:pb-2 [&:not(:placeholder-shown)]:pt-6 [&:not(:placeholder-shown)]:pb-2 autofill:pt-6 autofill:pb-2 bg-slate-200"
placeholder="${title}" placeholder="${title}"
/> />
<label
for="${oid}"
class="absolute top-0 start-0 p-2.5 h-full text-sm truncate pointer-events-none transition ease-in-out duration-100 border border-transparent dark:text-white peer-disabled:opacity-50 peer-disabled:pointer-events-none peer-focus:text-xs peer-focus:-translate-y-1.5 peer-focus:text-gray-500 peer-[:not(:placeholder-shown)]:text-xs peer-[:not(:placeholder-shown)]:-translate-y-1.5 peer-[:not(:placeholder-shown)]:text-gray-500"
id="req-${oid}"
>${title}
</label>
<script tal:condition="mask" type="text/javascript"> <script tal:condition="mask" type="text/javascript">
deform.addCallback("${oid}", function (oid) { deform.addCallback("${oid}", function (oid) {
$("#" + oid).mask("${mask}", { placeholder: "${mask_placeholder}" }); $("#" + oid).mask("${mask}", { placeholder: "${mask_placeholder}" });
}); });
</script> </script>
</div>
</div> </div>
<div tal:define="style style|field.widget.style; <div
tal:define="style style|field.widget.style;
css_class css_class|string:${field.widget.css_class or field.css_class or 'jarviswidget jarviswidget-color-blueLight'}; css_class css_class|string:${field.widget.css_class or field.css_class or 'jarviswidget jarviswidget-color-blueLight'};
item_template item_template|field.widget.item_template; item_template item_template|field.widget.item_template;
title title|field.title; title title|field.title;
...@@ -27,10 +28,18 @@ ...@@ -27,10 +28,18 @@
filter_scripts filter_scripts|field.filter_scripts; filter_scripts filter_scripts|field.filter_scripts;
filter_form filter_form|field.filter_form; filter_form filter_form|field.filter_form;
edit_buttons edit_buttons|field.edit_buttons; edit_buttons edit_buttons|field.edit_buttons;
" tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};" i18n:domain="detable"> "
tal:attributes="style style; class css_class; attributes|field.widget.attributes|{};"
i18n:domain="detable"
>
<header role="heading" class="txt-color-grayDark"> <header role="heading" class="txt-color-grayDark">
<h2 tal:condition="title"><i class="fa fa-fw fa-table"></i>${title}</h2> <h2 tal:condition="title"><i class="fa fa-fw fa-table"></i>${title}</h2>
<div class="alert alert-danger " role="alert" id="emptyID" style="opacity:0.7;display: none;"> <div
class="alert alert-danger"
role="alert"
id="emptyID"
style="opacity: 0.7; display: none"
>
<strong>Pilih data terlebih dahulu!!</strong> <strong>Pilih data terlebih dahulu!!</strong>
<!--? <button type="button" class="close" data-dismiss="alert" aria-label="Close">--> <!--? <button type="button" class="close" data-dismiss="alert" aria-label="Close">-->
<!--? <span aria-hidden="true">&times;</span>--> <!--? <span aria-hidden="true">&times;</span>-->
...@@ -55,9 +64,8 @@ ...@@ -55,9 +64,8 @@
</div> </div>
</div> --> </div> -->
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$(document).on("click", '.${tableid}checkAll', function () { $(document).on("click", ".${tableid}checkAll", function () {
if (this.checked) { if (this.checked) {
$(".${tableid}_check").prop("checked", true); $(".${tableid}_check").prop("checked", true);
} else { } else {
...@@ -67,21 +75,25 @@ ...@@ -67,21 +75,25 @@
}); });
</script> </script>
</div> </div>
<table id="${tableid}" class="table table-bordered table-hover table-condensed dataTable no-footer"> <table
id="${tableid}"
class="table table-bordered table-hover table-condensed dataTable no-footer"
>
<thead> <thead>
<tr> <tr></tr>
<tr> <tr>
<tal:block tal:repeat="child field"> <tal:block tal:repeat="child field">
<tal:block
<tal:block tal:condition="python:not hasattr(child, 'visible') or getattr(child, 'visible')==True"> tal:condition="python:not hasattr(child, 'visible') or getattr(child, 'visible')==True"
>
<th <th
tal:condition="python:hasattr(child, 'action') and not getattr(child.condition)==False and False or True"> tal:condition="python:hasattr(child, 'action') and not getattr(child.condition)==False and False or True"
${child.title} </th> >
${child.title}
</th>
</tal:block> </tal:block>
</tal:block> </tal:block>
</tr> </tr>
</thead> </thead>
<tbody></tbody> <tbody></tbody>
</table> </table>
......
<html metal:use-macro="load: ./base.pt"> <html metal:use-macro="load: ./base.pt">
<div metal:fill-slot="content"> <div metal:fill-slot="content">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-fw fa-plus"></i>&nbsp;${request.title}</h3>
</div>
<div class="panel-body"> <div class="panel-body">
<div tal:content="structure form"></div> <div tal:content="structure form"></div>
</div> </div>
</div> </div>
</div> </div>
<script metal:fill-slot="scripts"> <!-- <script
type="text/javascript"
src="${home}/static/admin/js/datatables/dataTables.tailwindcss.js"
></script>
<script>
new DataTable("#example", {
scrollX: true,
});
</script> -->
<script metal:fill-slot="scripts">
$(document).ready(function () { $(document).ready(function () {
${ structure: scripts } ${ structure: scripts }
}); });
</script> </script>
</html> </html>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="card bg-lightprimary dark:bg-darkprimary mb-0 overflow-hidden"> <div class="card bg-lightprimary dark:bg-darkprimary mb-0 overflow-hidden">
<div class="card-body pb-12 pt-8"> <div class="card-body pb-12 pt-8">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div class="lg:col-span-7 md:col-span-6 sm:col-span-12 col-span-12"> <div class="lg:col-span-8 md:col-span-6 sm:col-span-12 col-span-12">
<div class="flex gap-3 items-center mb-7"> <div class="flex gap-3 items-center mb-7">
<div class="rounded-full overflow-hidden"> <div class="rounded-full overflow-hidden">
<img <img
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<div class="gap-6 items-center grid grid-cols-12"> <div class="gap-6 items-center grid grid-cols-12">
<div <div
class="pe-6 md:border-e md:border-[#adb0bb] md:border-opacity-10 dark:md:border-darkborder col-span-12 md:col-span-6 lg:col-span-7" class="pe-6 md:border-e md:border-[#adb0bb] md:border-opacity-10 dark:md:border-darkborder col-span-12 md:col-span-6 lg:col-span-8"
> >
<h3 class="flex items-start mb-0 text-xl">Fitur Modul:</h3> <h3 class="flex items-start mb-0 text-xl">Fitur Modul:</h3>
<ul class="list-group mt-4"> <ul class="list-group mt-4">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</ul> </ul>
</div> </div>
<div class="col-span-12 md:col-span-6 lg:col-span-5"> <div class="col-span-12 md:col-span-6 lg:col-span-4">
<div class="lg:col-span-4 md:col-span-6 col-span-12"> <div class="lg:col-span-4 md:col-span-6 col-span-12">
<a href="${home}/pbb/esppt/unduh/add"> <a href="${home}/pbb/esppt/unduh/add">
<div class="card animate-card overflow-hidden"> <div class="card animate-card overflow-hidden">
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="lg:col-span-5 md:col-span-6 sm:col-span-12 col-span-12"> <div class="lg:col-span-4 md:col-span-6 sm:col-span-12 col-span-12">
<div <div
class="sm:absolute relative right-0 rtl:right-auto rtl:left-0 -bottom-8" class="sm:absolute relative right-0 rtl:right-auto rtl:left-0 -bottom-8"
> >
......
<html metal:use-macro="load: ../base.pt"> <html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content"> <div metal:fill-slot="content">
<script src="${home}/deform_static/scripts/deform.js"></script> <script src="${home}/deform_static/scripts/deform.js"></script>
<script> <script>
/** /**
...@@ -8,81 +8,83 @@ ...@@ -8,81 +8,83 @@
* http://www.abeautifulsite.net/blog/2013/08/whipping-file-inputs-into-shape-with-bootstrap-3/ * http://www.abeautifulsite.net/blog/2013/08/whipping-file-inputs-into-shape-with-bootstrap-3/
*/ */
(function ($) { (function ($) {
var Upload = function (element, options) { var Upload = function (element, options) {
this.$element = $(element); this.$element = $(element);
this.options = $.extend({}, Upload.DEFAULTS, this.options = $.extend(
{},
Upload.DEFAULTS,
this.$element.data(), this.$element.data(),
options); options
);
this.orig_style = this.$element.attr('style'); this.orig_style = this.$element.attr("style");
this.$input_group = $(this.options.template) this.$input_group = $(this.options.template)
.replaceAll(this.$element) .replaceAll(this.$element)
.attr('style', this.orig_style) .attr("style", this.orig_style)
.css({position: 'relative', overflow: 'hidden'}); .css({ position: "relative", overflow: "hidden" });
this.$input_group.find(':text').before(this.$element); this.$input_group.find(":text").before(this.$element);
this.$element this.$element
.on('change.deform.upload', $.proxy(this, 'update')) .on("change.deform.upload", $.proxy(this, "update"))
.css(this.options.element_style); .css(this.options.element_style);
this.update(); this.update();
}; };
Upload.DEFAULTS = { Upload.DEFAULTS = {
filename: null, filename: null,
selectfile: 'Ganti file…', selectfile: "Ganti file…",
changefile: 'Unggah file…', changefile: "Unggah file…",
template: '<div>' template:
+ '<div class="input-group">' "<div>" +
+ '<span class="input-group-btn">' '<div class="input-group">' +
+ '<span class="btn btn-default btn-file"></span>' '<span class="input-group-btn">' +
+ '</span>' '<span class="btn btn-default btn-file"></span>' +
+ '<input type="text" readonly=""' "</span>" +
+ ' class="form-control upload-filename"/>' '<input type="text" readonly=""' +
+ '</div>' ' class="form-control upload-filename"/>' +
+ '</div>', "</div>" +
"</div>",
element_style: { element_style: {
position: 'absolute', position: "absolute",
/* Older FF (3.5) seems to put a margin on the bottom of /* Older FF (3.5) seems to put a margin on the bottom of
* the file input (the margin is proportional to * the file input (the margin is proportional to
* font-size, so in this case it's significant.) Shift * font-size, so in this case it's significant.) Shift
* bottom a bit to allow for some slop. * bottom a bit to allow for some slop.
*/ */
//bottom: '0', //bottom: '0',
bottom: '-40px', bottom: "-40px",
right: '0', right: "0",
minWidth: '100%', minWidth: "100%",
minHeight: '100%', minHeight: "100%",
fontSize: '999px', fontSize: "999px",
textAlign: 'right', textAlign: "right",
filter: 'alpha(opacity=0)', filter: "alpha(opacity=0)",
opacity: '0', opacity: "0",
background: 'red', background: "red",
cursor: 'inherit', cursor: "inherit",
display: 'block' display: "block",
} },
}; };
Upload.prototype.update = function () { Upload.prototype.update = function () {
var selected_filename = this.$element.val().replace(/.*[\\\/]/, ''), var selected_filename = this.$element.val().replace(/.*[\\\/]/, ""),
options = this.options, options = this.options,
filename = selected_filename || options.filename; filename = selected_filename || options.filename;
this.$input_group.find(':text') this.$input_group.find(":text").val(filename);
.val(filename); this.$input_group
this.$input_group.find('.btn-file') .find(".btn-file")
.text(filename ? options.changefile : options.selectfile); .text(filename ? options.changefile : options.selectfile);
}; };
Upload.prototype.destroy = function () { Upload.prototype.destroy = function () {
this.$element this.$element
.off('.deform.upload') .off(".deform.upload")
.attr('style', this.orig_style || null) .attr("style", this.orig_style || null)
.replaceAll(this.$input_group) .replaceAll(this.$input_group)
.removeData('deform.upload'); .removeData("deform.upload");
}; };
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// plugin definition // plugin definition
...@@ -91,13 +93,13 @@ ...@@ -91,13 +93,13 @@
$.fn.upload = function (option) { $.fn.upload = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this), var $this = $(this),
data = $this.data('deform.upload'); data = $this.data("deform.upload");
if (!data) { if (!data) {
var options = typeof option == 'object' && option; var options = typeof option == "object" && option;
data = new Upload(this, options); data = new Upload(this, options);
$this.data('deform.upload', data); $this.data("deform.upload", data);
} }
if (typeof option == 'string') { if (typeof option == "string") {
data[option](); data[option]();
} }
}); });
...@@ -109,32 +111,58 @@ ...@@ -109,32 +111,58 @@
$.fn.upload = old; $.fn.upload = old;
return this; return this;
}; };
})(window.jQuery); })(window.jQuery);
</script> </script>
<div class="row"> <div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2"> <div
class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2"
>
<div class="well"> <div class="well">
<form id="upload_sppt" action="" method="POST" enctype="multipart/form-data" accept-charset="utf-8" class="form-horizontal"> <form
<div class="form-group" tal:define="field form_upload['upload']" id="form-${field.oid}"> id="upload_sppt"
<label for="${field.oid}" class="${field.required and 'required' or ''} control-label col-md-3" id="req-${field.oid}"> action=""
${field.title}</label> method="POST"
enctype="multipart/form-data"
accept-charset="utf-8"
class="form-horizontal"
>
<div
class="form-group"
tal:define="field form_upload['upload']"
id="form-${field.oid}"
>
<label
for="${field.oid}"
class="${field.required and 'required' or ''} control-label col-md-3"
id="req-${field.oid}"
>
${field.title}</label
>
<div class="col-md-4"> <div class="col-md-4">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-primary">Import</button> <button type="submit" class="btn btn-primary">Import</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Tutup</button> <button
type="button"
class="btn btn-default"
data-dismiss="modal"
>
Tutup
</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</html> </html>
...@@ -91,7 +91,7 @@ class ListSchema(colander.Schema): ...@@ -91,7 +91,7 @@ class ListSchema(colander.Schema):
idcard = colander.SchemaNode( idcard = colander.SchemaNode(
FileData(), FileData(),
widget=widget.FileUploadWidget(mem_tmp_store, css_class="col-span-12"), widget=widget.FileUploadWidget(mem_tmp_store, css_class="col-span-12 md:col-start-2 md:col-span-5", no_label="true"),
title="Identitas", title="Identitas",
validator=image_validator, validator=image_validator,
visible=False visible=False
...@@ -108,7 +108,7 @@ class AddSchema(ListSchema): ...@@ -108,7 +108,7 @@ class AddSchema(ListSchema):
request = kw.get("request") request = kw.get("request")
schema['captcha'] = colander.SchemaNode( schema['captcha'] = colander.SchemaNode(
colander.String(), colander.String(),
widget=widget_os.CaptchaWidget( widget=widget_os.CaptchaWidget(css_class="col-span-12 md:col-span-5 ",
request=request, request=request,
url=request.static_url(BASE_CLASS.captcha_files)), url=request.static_url(BASE_CLASS.captcha_files)),
oid="captcha", title="Captcha") oid="captcha", title="Captcha")
......
<html metal:use-macro="load: ../base.pt"> <html metal:use-macro="load: ../base.pt">
<div metal:fill-slot="content"> <!-- metal:content --> <div metal:fill-slot="content">
<!-- metal:content -->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-fw fa-plus"></i>&nbsp;${request.title}</h3> <h3 class="panel-title">
<i class="fa fa-fw fa-plus"></i>&nbsp;${request.title}
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<form
id="cariform"
<form id="cariform" method="POST" enctype="multipart/form-data" accept-charset="utf-8" class="form-horizontal"> method="POST"
enctype="multipart/form-data"
<div class="alert alert-warning" tal:condition="form and form.error and True or False"> accept-charset="utf-8"
class="form-horizontal"
>
<div
class="alert alert-warning"
tal:condition="form and form.error and True or False"
>
<div class="error-msg-lbl">Kesalahan Pengisian Form</div> <div class="error-msg-lbl">Kesalahan Pengisian Form</div>
<p class="error-msg">${form.errormsg}</p> <p class="error-msg">${form.errormsg}</p>
</div> </div>
<table class="dataTables_filter" width="100%" style="margin: 15px 0 25px 0;"> <table
class="dataTables_filter"
width="100%"
style="margin: 15px 0 25px 0"
>
<tbody> <tbody>
<tr> <tr>
<td valign="top" class="input-group-addon" style="width: 50px;">NOP</td> <td
valign="top"
class="input-group-addon"
style="width: 50px"
>
NOP
</td>
<td valign="top" tal:define="field form['nop_pemda']" > <td valign="top" tal:define="field form['nop_pemda']">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" tal:define="field form['nop_desa']"> <td valign="top" tal:define="field form['nop_desa']">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" tal:define="field form['nop_blok']"> <td valign="top" tal:define="field form['nop_blok']">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" tal:define="field form['nop_urut']"> <td valign="top" tal:define="field form['nop_urut']">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" tal:define="field form['nop_jenis']"> <td valign="top" tal:define="field form['nop_jenis']">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" <p
tal:repeat="error field.error.messages()"> id="error-${field.oid}"
${error}</p> class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" tal:define="field form['tahun']"> <td valign="top" tal:define="field form['tahun']">
<input id="tahun" class=" form-control " type="text" value="${request.session['tahun']}" name="tahun"> <input
<p id="error-${field.oid}" class="help-block txt-color-red" tal:condition="field.error" id="tahun"
tal:repeat="error field.error.messages()"> class="form-control"
${error}</p> type="text"
value="${request.session['tahun']}"
name="tahun"
/>
<p
id="error-${field.oid}"
class="help-block txt-color-red"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</td> </td>
<td valign="top" width="600px"> <!-- button group --> <td valign="top" width="600px">
<button type="submit" class="btn btn-primary" id="btn-cari" name="cari"><i class="fa fa-fw fa-search"></i>&nbsp;Cari</button> <!-- button group -->
<button type="submit" class="btn btn-danger" id="btn-save" name="simpan"><i class="fa fa-fw fa-money"></i>&nbsp;Bayar</button> <button
type="submit"
class="btn btn-primary"
id="btn-cari"
name="cari"
>
<i class="fa fa-fw fa-search"></i>&nbsp;Cari
</button>
<button
type="submit"
class="btn btn-danger"
id="btn-save"
name="simpan"
>
<i class="fa fa-fw fa-money"></i>&nbsp;Bayar
</button>
<!-- <button type="button" class="btn btn-success" id="btn-draft" name="btn-cetak">Draft</button> --> <!-- <button type="button" class="btn btn-success" id="btn-draft" name="btn-cetak">Draft</button> -->
<button type="button" class="btn btn-primary" id="btn-pdf" name="btn-pdf"><i class="fa fa-fw fa-file"></i>&nbsp;Cetak</button> <button
<button type="submit" class="btn btn-warning" id="btn-batal" name="batal"><i class="fa fa-fw fa-undo"></i>&nbsp;Tutup</button> type="button"
class="btn btn-primary"
id="btn-pdf"
name="btn-pdf"
>
<i class="fa fa-fw fa-file"></i>&nbsp;Cetak
</button>
<button
type="submit"
class="btn btn-warning"
id="btn-batal"
name="batal"
>
<i class="fa fa-fw fa-undo"></i>&nbsp;Tutup
</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="panel panel-default" title="tagihan"><!-- panel tagihan --> <div class="panel panel-default" title="tagihan">
<!-- panel tagihan -->
<div class="panel-heading">Tagihan</div> <div class="panel-heading">Tagihan</div>
<div class="panel-body"> <div class="panel-body">
<div tal:define="field form['pokok']"> <div tal:define="field form['pokok']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
...@@ -93,8 +182,12 @@ ...@@ -93,8 +182,12 @@
<div tal:define="field form['denda']"> <div tal:define="field form['denda']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
...@@ -103,32 +196,49 @@ ...@@ -103,32 +196,49 @@
<div tal:define="field form['jumlah']"> <div tal:define="field form['jumlah']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
</div> </div>
</div> </div>
<div tal:define="field form['pembayaran_ke']" style="display:none;"> <div
tal:define="field form['pembayaran_ke']"
style="display: none"
>
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- /panel tagihan --> </div>
<!-- /panel tagihan -->
<div class="panel panel-default" title="lokasi"> <!-- panel lokasi --> <div class="panel panel-default" title="lokasi">
<!-- panel lokasi -->
<div class="panel-heading">Lokasi OP</div> <div class="panel-heading">Lokasi OP</div>
<div class="panel-body"> <div class="panel-body">
<div tal:define="field form['kecamatan']"> <div tal:define="field form['kecamatan']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
...@@ -136,23 +246,33 @@ ...@@ -136,23 +246,33 @@
</div> </div>
<div tal:define="field form['kelurahan']"> <div tal:define="field form['kelurahan']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- /panel lokasi --> </div>
<!-- /panel lokasi -->
<div class="panel panel-default" title="wajib pajak"> <!-- panel wajib pajak --> <div class="panel panel-default" title="wajib pajak">
<!-- panel wajib pajak -->
<div class="panel-heading">Wajib Pajak</div> <div class="panel-heading">Wajib Pajak</div>
<div class="panel-body"> <div class="panel-body">
<div tal:define="field form['nm_wp_sppt']"> <div tal:define="field form['nm_wp_sppt']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
...@@ -161,20 +281,34 @@ ...@@ -161,20 +281,34 @@
<div tal:define="field form['jln_wp_sppt']"> <div tal:define="field form['jln_wp_sppt']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error" <p
tal:repeat="error field.error.messages()">${error}</p> id="error-${field.oid}"
class="help-block"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
</div> </div>
</div> </div>
</div> </div>
<div tal:define="field form['kelurahan_wp_sppt']"> <div tal:define="field form['kelurahan_wp_sppt']">
<div class="form-group" title="" id="item-${field.oid}"> <div class="form-group" title="" id="item-${field.oid}">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
<div class="input-group"> <div class="input-group">
${structure:field.serialize()} ${structure:field.serialize()}
...@@ -193,13 +327,23 @@ ...@@ -193,13 +327,23 @@
<div tal:define="field form['kelurahan_wp_sppt']"> <div tal:define="field form['kelurahan_wp_sppt']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
<div class="input-group"> <div class="input-group">
${structure:field.serialize()} ${structure:field.serialize()}
<p id="error-${field.oid}" class="help-block" tal:condition="field.error" <p
tal:repeat="error field.error.messages()">${error}</p> id="error-${field.oid}"
class="help-block"
tal:condition="field.error"
tal:repeat="error field.error.messages()"
>
${error}
</p>
<span class="input-group-addon">Kota</span> <span class="input-group-addon">Kota</span>
<div tal:define="field form['kota_wp_sppt']"> <div tal:define="field form['kota_wp_sppt']">
${structure:field.serialize()} ${structure:field.serialize()}
...@@ -211,8 +355,12 @@ ...@@ -211,8 +355,12 @@
<div tal:define="field form['kd_pos_wp_sppt']"> <div tal:define="field form['kd_pos_wp_sppt']">
<div class="form-group"> <div class="form-group">
<label for="${field.oid}" class="control-label col-md-2" <label
id="req-${field.oid}">${field.title}</label> for="${field.oid}"
class="control-label col-md-2"
id="req-${field.oid}"
>${field.title}</label
>
<div class="col-md-10"> <div class="col-md-10">
<div class="input-group"> <div class="input-group">
${structure:field.serialize()} ${structure:field.serialize()}
...@@ -225,44 +373,57 @@ ...@@ -225,44 +373,57 @@
</div> </div>
</div> </div>
</div> </div>
</div> <!-- /panel wajib pajak --> </div>
<!-- /panel wajib pajak -->
</form> </form>
</div> <!--panel-body--> </div>
</div> <!--panel-body-->
</div> </div>
</div> </div>
</div>
</div><!-- /metal:content --> </div>
<!-- /metal:content -->
<div metal:fill-slot="scripts"> <!-- metal:script --> <div metal:fill-slot="scripts">
<!-- metal:script -->
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var oUrl = '/pbbm/dph'; var oUrl = "/pbbm/dph";
$('#pokok, #denda, #jumlah, #ke').prop('readonly',true); $("#pokok, #denda, #jumlah, #ke").prop("readonly", true);
$('#kecamatan, #kelurahan, #nop_pemda').prop('readonly',true); $("#kecamatan, #kelurahan, #nop_pemda").prop("readonly", true);
$('#nm_wp_sppt, #jln_wp_sppt, #blok_kav_no_wp_sppt').prop('readonly',true); $("#nm_wp_sppt, #jln_wp_sppt, #blok_kav_no_wp_sppt").prop(
$('#rt_wp_sppt, #rw_wp_sppt, #kelurahan_wp_sppt ').prop('readonly',true); "readonly",
$('#kota_wp_sppt, #npwp_sppt, #kd_pos_wp_sppt').prop('readonly',true); true
);
$("#rt_wp_sppt, #rw_wp_sppt, #kelurahan_wp_sppt ").prop(
"readonly",
true
);
$("#kota_wp_sppt, #npwp_sppt, #kd_pos_wp_sppt").prop("readonly", true);
$('#btn-draft').click(function(){ $("#btn-draft").click(function () {
console.log('cari'); console.log("cari");
}); });
$("#btn-pdf").click(function () { $("#btn-pdf").click(function () {
mID = $("#nop_pemda").val()+$("#nop_desa").val()+$("#nop_blok").val()+ mID =
$("#nop_urut").val()+$("#nop_jenis").val(); $("#nop_pemda").val() +
$("#nop_desa").val() +
$("#nop_blok").val() +
$("#nop_urut").val() +
$("#nop_jenis").val();
mThn = $("#tahun").val(); mThn = $("#tahun").val();
// mKe = $("#ke").val(); // mKe = $("#ke").val();
url = "/pbbm/dph/stts/rpt?&nop="+mID+"&tahun="+mThn+"&ke="+1; url =
"/pbbm/dph/stts/rpt?&nop=" + mID + "&tahun=" + mThn + "&ke=" + 1;
window.open(url); window.open(url);
}); });
$('#btn-batal').click(function(){ $("#btn-batal").click(function () {
location.replace(oUrl); location.replace(oUrl);
}); });
}); });
</script> </script>
</div> <!-- /metal:script --> </div>
<!-- /metal:script -->
</html> </html>
<div tal:define="error_class error_class|field.widget.error_class; <div
tal:define="error_class error_class|field.widget.error_class;
description description|field.description; description description|field.description;
field_title field_title|field.title; field_title field_title|field.title;
oid oid|field.oid; oid oid|field.oid;
...@@ -8,77 +9,105 @@ ...@@ -8,77 +9,105 @@
required required|field.required; required required|field.required;
field_readonly field_readonly|field.widget.readonly; field_readonly field_readonly|field.widget.readonly;
form_readonly readonly|readonly" form_readonly readonly|readonly"
class="form-group ${field.error and 'has-error' or ''} ${field.widget.item_css_class or ''} ${field.default_item_css_class()}" class="form-group ${field.error and 'has-error' or ''} ${field.widget.item_css_class or ''} ${field.default_item_css_class()}"
title="${description}" title="${description}"
id="item-${oid}" id="item-${oid}"
tal:omit-tag="structural" tal:omit-tag="structural"
i18n:domain="deform"> i18n:domain="deform"
>
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-12 col-sm-12"> <div class="col-md-12 col-lg-12 col-sm-12">
<label for="${oid}" <label
for="${oid}"
class="control-label col-sm-3 col-md-2 col-lg-2 ${required and 'required' or ''}" class="control-label col-sm-3 col-md-2 col-lg-2 ${required and 'required' or ''}"
tal:condition="not structural" tal:condition="not structural"
id="req-${oid}" id="req-${oid}"
>${field_title} >${field_title}
</label> </label>
<div class="col-sm-9 col-md-10 col-lg-10" tal:condition="not field.children"> <div
<div tal:define="input_prepend field.widget.input_prepend | None; class="col-sm-9 col-md-10 col-lg-10"
tal:condition="not field.children"
>
<div
tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None" input_append field.widget.input_append | None"
tal:omit-tag="not (input_prepend or input_append)" tal:omit-tag="not (input_prepend or input_append)"
class="input-group"> class="input-group"
<span class="input-group-addon" >
tal:condition="input_prepend">${input_prepend}</span> <span class="input-group-addon" tal:condition="input_prepend"
<span tal:condition="python:readonly or field_readonly" >${input_prepend}</span
tal:replace="structure field.serialize(readonly=True).strip()"/> >
<span tal:condition="python: not readonly and not field_readonly" <span
tal:replace="structure field.serialize().strip()"/> tal:condition="python:readonly or field_readonly"
<span class="input-group-addon" tal:replace="structure field.serialize(readonly=True).strip()"
tal:condition="input_append">${input_append}</span> />
<span
tal:condition="python: not readonly and not field_readonly"
tal:replace="structure field.serialize().strip()"
/>
<span class="input-group-addon" tal:condition="input_append"
>${input_append}</span
>
</div> </div>
<p class="help-block" <p
class="help-block"
tal:define="errstr 'error-%s' % field.oid" tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()" tal:repeat="msg field.error.messages()"
i18n:translate="" i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))" ('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"> tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
>
${msg} ${msg}
</p> </p>
<p tal:condition="field.description and not field.widget.hidden" <p
class="help-block"> tal:condition="field.description and not field.widget.hidden"
class="help-block"
>
${field.description} ${field.description}
</p> </p>
</div> </div>
<div class="col-sm-12 col-md-12 col-lg-12" tal:condition="field.children"> <div class="col-sm-12 col-md-12 col-lg-12" tal:condition="field.children">
<div tal:define="input_prepend field.widget.input_prepend | None; <div
tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None" input_append field.widget.input_append | None"
tal:omit-tag="not (input_prepend or input_append)" tal:omit-tag="not (input_prepend or input_append)"
class="input-group"> class="input-group"
<span class="input-group-addon" >
tal:condition="input_prepend">${input_prepend}</span> <span class="input-group-addon" tal:condition="input_prepend"
<span tal:condition="python:readonly or field_readonly" >${input_prepend}</span
tal:replace="structure field.serialize(readonly=True).strip()"/> >
<span tal:condition="python: not readonly and not field_readonly" <span
tal:replace="structure field.serialize().strip()"/> tal:condition="python:readonly or field_readonly"
<span class="input-group-addon" tal:replace="structure field.serialize(readonly=True).strip()"
tal:condition="input_append">${input_append}</span> />
<span
tal:condition="python: not readonly and not field_readonly"
tal:replace="structure field.serialize().strip()"
/>
<span class="input-group-addon" tal:condition="input_append"
>${input_append}</span
>
</div> </div>
<p class="help-block" <p
class="help-block"
tal:define="errstr 'error-%s' % field.oid" tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()" tal:repeat="msg field.error.messages()"
i18n:translate="" i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))" ('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"> tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
>
${msg} ${msg}
</p> </p>
<p tal:condition="field.description and not field.widget.hidden" <p
class="help-block"> tal:condition="field.description and not field.widget.hidden"
class="help-block"
>
${field.description} ${field.description}
</p> </p>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!