Sfoglia il codice sorgente

layout: course list

Prach Pongpanich 2 anni fa
parent
commit
b9b4305295
2 ha cambiato i file con 50 aggiunte e 1 eliminazioni
  1. 5 0
      app/course/models.py
  2. 45 1
      app/templates/course/list.html

+ 5 - 0
app/course/models.py

@@ -1,3 +1,8 @@
1 1
 from django.db import models
2 2
 
3 3
 # Create your models here.
4
+
5
+class Course(models.Model):
6
+    name        = models.CharField(max_length=255, blank=True, null=True)
7
+    description = models.TextField(null=True)
8
+

+ 45 - 1
app/templates/course/list.html

@@ -2,7 +2,51 @@
2 2
 {% load static %}
3 3
 {% block content %}
4 4
 
5
-<div class="text-xl font-semibold inline-block">title</div>
5
+<div class="text-xl font-semibold inline-block">title
6
+  <div class="inline-block float-right">
7
+    <div class="inline-block float-right">
8
+    <button class="btn px-6 btn-sm normal-case btn-primary">Add New</button>
9
+    </div>
10
+  </div>
11
+</div>
6 12
 <div class="divider mt-2"></div>
13
+<div class="h-full w-full pb-6 bg-base-100">
14
+  <div class="overflow-x-auto">
15
+    <table class="table w-full">
16
+      <!-- head -->
17
+      <thead>
18
+        <tr>
19
+          <th></th>
20
+          <th>Name</th>
21
+          <th>Job</th>
22
+          <th>Favorite Color</th>
23
+        </tr>
24
+      </thead>
25
+      <tbody>
26
+        <!-- row 1 -->
27
+        <tr>
28
+          <th>1</th>
29
+          <td>Cy Ganderton</td>
30
+          <td>Quality Control Specialist</td>
31
+          <td>Blue</td>
32
+        </tr>
33
+        <!-- row 2 -->
34
+        <tr>
35
+          <th>2</th>
36
+          <td>Hart Hagerty</td>
37
+          <td>Desktop Support Technician</td>
38
+          <td>Purple</td>
39
+        </tr>
40
+        <!-- row 3 -->
41
+        <tr>
42
+          <th>3</th>
43
+          <td>Brice Swyre</td>
44
+          <td>Tax Accountant</td>
45
+          <td>Red</td>
46
+        </tr>
47
+      </tbody>
48
+    </table>
49
+  </div>
50
+</div>
7 51
 
8 52
 {% endblock %}