UNPKG

casbah

Version:

Contract Administration Site * Be Architecural Heroes *

200 lines (173 loc) 5.81 kB
<!doctype html> <style> .picBox{ max-height:400px; max-width:100%;} .columns2{column-count:2;} .columns4{column-count:4;} .checklistArch{column-count:4; line-height: 120%;font-size:10pt;} .topMarginZero{margin-top:0;} @media print { div.panel, div.panel-default { page-break-after: always !important; } } .segoe, h1, h2, h3, h4{font-family:segoe UI, sans-serif;} </style> <script type='text/javascript'> casbah.project.check(); var deficiency_sheets={}; deficiency_sheets.checklist=$("#deficiency_sheets_checklist").html(); deficiency_sheets.comments=$("#deficiency_sheets_comments").html(); deficiency_sheets.refresh=function(){ //get images for deficiency sheets then refresh with success function()... $.ajax({ contentType: "application/x-www-form-urlencoded; charset=UTF-8", data: $.param({ action:"RDS-IMAGES", extension:".PNG .jpg", project_id:localStorage.getItem("project_id"), rdss_id:localStorage.getItem("rdss_id") }), error:function(err){console.log("Error:", err.message);}, success:function(result){ //console.log("result,", JSON.stringify(result)); var html=deficiency_sheets.template(result); $("#deficiency_sheets_placeholder").html(html); }, type: "POST", url:"/uploads" }); }; deficiency_sheets.tblock=$("#deficiency_sheets_tblock").html(); deficiency_sheets.tools=$("#deficiency_sheets_tools").html(); deficiency_sheets.template=Handlebars.compile($("#deficiency_sheets").html()); deficiency_sheets.colcount=0; Handlebars.registerHelper("deficiency_sheets_checklist", function(str, options){ return deficiency_sheets.checklist; }); Handlebars.registerHelper("deficiency_sheets_comments", function(str, options){ return deficiency_sheets.comments; }); Handlebars.registerHelper("deficiency_sheets_tblock", function(str, options){ return deficiency_sheets.tblock; }); Handlebars.registerHelper("deficiency_sheets_tools", function(str, options){ return deficiency_sheets.tools; }); Handlebars.registerHelper("chop_extension", function(str, options){ str=str.substring(0,str.indexOf(".")); str=str.substring(str.lastIndexOf("\\")+1); return str; }); Handlebars.registerHelper("columnize", function(str, options){ var len=30; str=str.substring(0,str.indexOf(".")); str=str.substring(str.lastIndexOf("\\")+1); if (str.length>len) {var cont="...";} else {var cont="";} str="<span class='col-xs-4'>"+str.substring(0,len)+cont+"</span>"; deficiency_sheets.colcount+=1; //end row and start next row for every 6 columns if (deficiency_sheets.colcount % 3 == 0) {str+="</div><div class='row'>";} return str; }); ////////////////////////////////////////// deficiency_sheets.refresh(); </script> <div id="deficiency_sheets_placeholder"></div> <template id='deficiency_sheets' type="text/x-handlebars-template"> <div class="container"> <!-- title page --> <div class="panel panel-default page"> <div class="panel-heading" onclick="casbah.view('deficiency_sheets_log.html');" ><h4>DEFICIENCY SHEETS</h4></div> <div class="panel-body"><br> <div class="row"> <span class="col-xs-2">Title:</span> <span class="col-xs-2">{{subfolder}}</span> </div> <div class="row"> <span class="col-xs-2">Project number:</span> <span class="col-xs-2">{{project_id}}</span> </div> <div class="row"><span class="col-xs-2">Rooms:</span></div><br> <div class="row"> {{#each images}}{{{columnize this }}}{{/each}} </div> </div> </div> {{#each images}} <!-- head --> <div class="row"> <div class="col-xs-9"><img src="/uploads/{{../project_number}}/logo.png"></div> <div class="col-xs-3" onclick="casbah.view('deficiency_sheets_log.html');"><h2 class="topMarginZero segoe" >DEFICIENCIES</h2></div> </div> <!-- end of head --> <div class="panel panel-default page"> <div class="panel-heading"><h4>{{{chop_extension this}}}</h4></div> <div class="panel-body"> {{{deficiency_sheets_tblock}}} {{{deficiency_sheets_checklist}}} {{{deficiency_sheets_comments}}} <h3 class="topMarginZero">Plan</h3> <div class="col-xs-10"><img class="picBox" src="{{this}}" ></img></div> </div> <!-- div class="panel-footer"></div--> </div> {{/each}} </div> </template> <template id='deficiency_sheets_checklist' type="text/x-handlebars-template"> <h3 class="topMarginZero">Checklist</h3> <div class="checklistArch"> [ ] construction clean<BR> [ ] flooring<BR> [ ] baseboard<BR> [ ] gypsum finish paint<BR> [ ] wall protection<BR> [ ] wall pannelling<br> [ ] rails BR CR HR<br> [ ] frames<BR> [ ] glass<BR> [ ] caulking<BR> [ ] door leaf<BR> [ ] door HW<BR> [ ] WR accessories<br> [ ] WR drain<br> [ ] WR grab-bars<br> [ ] WR sink<BR> [ ] WR toilet<BR> [ ] WR tile<br> [ ] headwall<br> [ ] ceiling tiles<BR> [ ] lights<BR> [ ] exit-signs strobes<BR> [ ] sprinklers<br> </div> </template> <template id='deficiency_sheets_tblock' type="text/x-handlebars-template"> <div class="row"> <span class="col-xs-3">Arch:</span> <span class="col-xs-3">GC:</span> <span class="col-xs-3">Owner:</span> <span class="col-xs-3">Date:</span> </div> </template> <template id='deficiency_sheets_comments' type="text/x-handlebars-template"> <h3 class="topMarginZero">Comments</h3> <hr> <hr> <hr> <hr> <hr> <hr> <hr> <hr> </template> <template id='deficiency_sheets_tools' type="text/x-handlebars-template"> <div class="btn-group" role="group" aria-label="..."> <button type="label" class="btn btn-default" aria-label="Left Align" onclick="casbah.view('deficiency_sheets_log.html');"> <span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"> </span></button> </div> </template>