瀏覽代碼

W3.5: restructured templates in preparation for routing.

Frederic G. MARAND 8 年之前
父節點
當前提交
46758d0f60
共有 4 個文件被更改,包括 89 次插入82 次删除
  1. 53 0
      client/docItem.html
  2. 5 0
      client/docList.html
  3. 31 0
      client/navbar.html
  4. 0 82
      client/textcircle.html

+ 53 - 0
client/docItem.html

@@ -0,0 +1,53 @@
+<template name="docItem">
+  <div class="container top-margin">
+    <div class="row">
+      <div class="col-md-12">
+        {{> docMeta }}
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-md-12">
+        {{> editingUsers }}
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-md-6">
+        {{> editor}}
+      </div>
+      <div class="col-md-6">
+        {{> viewer }}
+      </div>
+    </div>
+  </div>
+</template>
+
+<template name="editor">
+  <h2>doc id: {{ docid }}</h2>
+  {{> sharejsCM docid=docid onRender=config id="editor" mode="javascript" }}
+</template>
+
+<template name="viewer">
+  <iframe id="viewer_iframe">
+  </iframe>
+</template>
+
+<template name="docMeta">
+  {{#with document }}
+    <span class="h1">{{> editableText collection="documents" field="title" }}</span>
+    {{#if canEdit }}
+      <div class="checkbox">
+        <label>
+          <input type="checkbox" class="js-tog-private" checked="{{ isPrivate }}"/>Private
+        </label>
+      </div>
+    {{/if}}
+  {{/with}}
+</template>
+
+<template name="editingUsers">
+  Editors:
+  {{#each users }}
+    <span class="label label-success">{{firstname}}</span>
+
+  {{/each}}
+</template>

+ 5 - 0
client/docList.html

@@ -0,0 +1,5 @@
+<template name="docList">
+  {{#each documents }}
+    {{title}}
+  {{/each}}
+</template>

+ 31 - 0
client/navbar.html

@@ -0,0 +1,31 @@
+<template name="navbar">
+  <nav class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <a class="navbar-brand" href="#">TextCircle</a><!-- nav title -->
+      <ul class="nav navbar-nav">
+        <li>
+          <a href="#" class="js-add-doc">
+            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+            New document
+          </a>
+        </li>
+        <!-- drop down list -->
+        <li role="presentation" class="dropdown">
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
+            Documents <span class="caret"></span>
+          </a>
+          <ul class="dropdown-menu">
+            {{#each documents }}
+              <li><a href="#" class="js-load-doc">{{ title }}</a></li>
+            {{/each}}
+          </ul>
+        </li>
+        <!-- end drop down list -->
+      </ul>
+
+      <p class="navbar-text navbar-right">
+        {{> loginButtons align="right" }}
+      </p>
+    </div><!-- /nav container -->
+  </nav><!-- /nav -->
+</template>

+ 0 - 82
client/textcircle.html

@@ -4,87 +4,5 @@
 
 <body>
   {{> navbar }}
-  <div class="container top-margin">
-    <div class="row">
-      <div class="col-md-12">
-        {{> docMeta }}
-      </div>
-    </div>
-    <div class="row">
-      <div class="col-md-12">
-        {{> editingUsers }}
-      </div>
-    </div>
-    <div class="row">
-      <div class="col-md-6">
-        {{> editor}}
-      </div>
-      <div class="col-md-6">
-        {{> viewer }}
-      </div>
-    </div>
-  </div>
 </body>
 
-<template name="navbar">
-  <nav class="navbar navbar-default navbar-fixed-top">
-    <div class="container">
-      <a class="navbar-brand" href="#">TextCircle</a><!-- nav title -->
-      <ul class="nav navbar-nav">
-        <li>
-          <a href="#" class="js-add-doc">
-            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-            New document
-          </a>
-        </li>
-        <!-- drop down list -->
-        <li role="presentation" class="dropdown">
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
-            Documents <span class="caret"></span>
-          </a>
-          <ul class="dropdown-menu">
-            {{#each documents }}
-            <li><a href="#" class="js-load-doc">{{ title }}</a></li>
-            {{/each}}
-          </ul>
-        </li>
-        <!-- end drop down list -->
-      </ul>
-
-      <p class="navbar-text navbar-right">
-        {{> loginButtons align="right" }}
-      </p>
-    </div><!-- /nav container -->
-  </nav><!-- /nav -->
-</template>
-
-<template name="editor">
-  <h2>doc id: {{ docid }}</h2>
-  {{> sharejsCM docid=docid onRender=config id="editor" mode="javascript" }}
-</template>
-
-<template name="viewer">
-  <iframe id="viewer_iframe">
-  </iframe>
-</template>
-
-<template name="docMeta">
-  {{#with document }}
-    <span class="h1">{{> editableText collection="documents" field="title" }}</span>
-    {{#if canEdit }}
-      <div class="checkbox">
-        <label>
-          <input type="checkbox" class="js-tog-private" checked="{{ isPrivate }}"/>Private
-        </label>
-      </div>
-    {{/if}}
-  {{/with}}
-</template>
-
-<template name="editingUsers">
-  Editors:
-  {{#each users }}
-  <span class="label label-success">{{firstname}}</span>
-
-  {{/each}}
-</template>