Jelajahi Sumber

资料归集模板库,默认模板不可编辑

MaiXinRong 1 tahun lalu
induk
melakukan
d84a7a9f49
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      app/view/file/template.ejs

+ 3 - 1
app/view/file/template.ejs

@@ -34,10 +34,12 @@
                 </div>
                 <div class="col-9">
                     <div class="d-flex flex-row">
+                        <% if (template.ft_type !== FtType.org) { %>
                         <div class="p-2">
                             <a href="javascript: void(0);" class="btn btn-sm btn-light text-primary" id="add-slibing"><i class="fa fa-plus" aria-hidden="true"></i> 同层</a>
                             <a href="javascript: void(0);" class="btn btn-sm btn-light text-primary" id="add-child"><i class="fa fa-plus" aria-hidden="true"></i> 子项</a>
                         </div>
+                        <% } %>
                         <form class="ml-2 p-2" method="POST" action="/file/template/reset?id=<%- template.id %>">
                             <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
                             <button class="btn btn-sm btn-primary"><i class="fa fa-refresh" aria-hidden="true"></i> 初始化模板</button>
@@ -65,5 +67,5 @@
         if (e.target.tagName === 'A' || e.target.tagName === 'I' || e.target.tagName === 'INPUT') return;
         window.location.href = '/file/template/' +  this.getAttribute('tempId');
     });
-    const readOnly = <%- template.ftType === FtType.org %>;
+    const readOnly = <%- template.ft_type === FtType.org %>;
 </script>