Przeglądaj źródła

add 顯示field and show the index for collection html page

weichen 4 lat temu
rodzic
commit
ef8907abaf
1 zmienionych plików z 7 dodań i 5 usunięć
  1. 7 5
      backstage/templates/collections.html

+ 7 - 5
backstage/templates/collections.html

@@ -1,27 +1,29 @@
 {% extends "layout.html" %}
 {% block main %}
-<h1>規劃作品</h1>
+<h1>{{ title }}</h1>
 <table id="example" class="table table-striped table-bordered" cellspacing="0" width="60%">
   <thead>
     <tr>
       <th>數量</th>
       <th>標題</th>
       <th>順序</th>
+      <th>顯示</th>
       <th style="text-align:center;width:100px;">新增 <button type="button" data-func="dt-add" class="btn btn-success btn-xs dt-add">
           <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
         </button></th>
     </tr>
   </thead>
-  {% for collection in collections %}
+  {% for idx in range(0, length) %}
     <tbody>
       <tr>
         <td>1</td>
-        <td>{{ collection.title }}</td>
+        <td>{{ collections[idx].title }}</td>
         <td>1</td>
+        <td>on</td>
         <td>
           <div>
-            <a class="btn btn-secondary btn-sm m-1" href="{{ url_for('editor.editor', url=collection.url) }}">編輯</a>
-            <form action="{{ url_for('editor.remove', url=collection.url) }}" method="POST">
+            <a class="btn btn-secondary btn-sm m-1" href="{{ url_for('editor.editor', url=collections[idx].url) }}">編輯</a>
+            <form action="{{ url_for('editor.remove', url=collections[idx].url) }}" method="POST">
               <input class="btn btn-danger" type="submit" value="Delete">
             </form>
           </div>