소스 검색

Templates: ejs and ES6 template strings, for comparison

Artur Paikin 9 년 전
부모
커밋
86c7fba977
2개의 변경된 파일36개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      src/templates/dragdrop.ejs
  2. 19 0
      src/templates/dragdrop.js

+ 17 - 0
src/templates/dragdrop.ejs

@@ -0,0 +1,17 @@
+<form class="UppyDragDrop-form"
+      method="post"
+      action="/"
+      enctype="multipart/form-data">
+    <img class="UppyDragDrop-puppy" src="/images/uppy.svg">
+    <input class="UppyDragDrop-input"
+           type="file"
+           name="files[]"
+           data-multiple-caption="{count} files selected"
+           multiple />
+    <label class="UppyDragDrop-label" for="UppyDragDrop-input">
+      <strong><%= chooseFile %></strong>
+      <span class="UppyDragDrop-dragText"><%= orDragDrop %></span>.
+    </label>
+    <button class="UppyDragDrop-btn" type="submit">Upload</button>
+  <div class="UppyDragDrop-status"></div>
+</form>

+ 19 - 0
src/templates/dragdrop.js

@@ -0,0 +1,19 @@
+export default function (strings) {
+  return `<form class="UppyDragDrop-form"
+        method="post"
+        action="/"
+        enctype="multipart/form-data">
+      <img class="UppyDragDrop-puppy" src="/images/uppy.svg">
+      <input class="UppyDragDrop-input"
+             type="file"
+             name="files[]"
+             data-multiple-caption="{count} files selected"
+             multiple />
+      <label class="UppyDragDrop-label" for="UppyDragDrop-input">
+        <strong>${strings.chooseFile}</strong>
+        <span class="UppyDragDrop-dragText">${strings.orDragDrop}</span>.
+      </label>
+      <button class="UppyDragDrop-btn" type="submit">Upload</button>
+    <div class="UppyDragDrop-status"></div>
+  </form>`
+}