Răsfoiți Sursa

WIP: auto-template api ajax

sou 7 ani în urmă
părinte
comite
f5e5768a9f
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      lib/views/modal/create_page.html

+ 6 - 0
lib/views/modal/create_page.html

@@ -78,6 +78,12 @@
     $.get(`/_api/page.template?path=${pagePath}`)
     .then(templateInfo => {
       console.log('data', templateInfo);
+      // merge master and change variable name to childrenTemplateExists and decendantsTemplateExists
+      let buttonTextChildren = templateInfo.localTemplateExists ? 'Edit' : 'Create';
+      let buttonTextDecendants = templateInfo.globalTemplateExists ? 'Edit' : 'Create';
+      console.log(buttonTextChildren)
+      console.log(buttonTextDecendants)
+
     });
 
     $("#template-type").on("change", () => {