Pārlūkot izejas kodu

Add mark-up guide for forms

master
David Winterbottom 13 gadus atpakaļ
vecāks
revīzija
df5fb3938f
1 mainītis faili ar 34 papildinājumiem un 0 dzēšanām
  1. 34
    0
      oscar/templates/README.rst

+ 34
- 0
oscar/templates/README.rst Parādīt failu

@@ -0,0 +1,34 @@
1
+Mark-up guide
2
+=============
3
+
4
+Forms
5
+-----
6
+
7
+Forms should be marked-up as::
8
+
9
+    <form method="post" action="." class="form-horizontal">
10
+        {% csrf_token %}
11
+        {% include 'partials/form_fields.html' %}
12
+        <div class="form-actions">
13
+            <button class="btn btn-large btn-primary" type="submit">Save</button>
14
+            or <a href="{{ some_url }}">cancel</a>
15
+        </div>
16
+    </form>
17
+
18
+The ``.form-actions`` class aligns the buttons with the fields and adds a gray
19
+background.
20
+
21
+Alternatively, use::
22
+    
23
+    <form method="post" action="." class="form-horizontal">
24
+        {% csrf_token %}
25
+        {% include 'partials/form_fields.html' %}
26
+        <div class="control-group">
27
+            <div class="controls">
28
+                <button class="btn btn-large btn-primary" type="submit">Save</button>
29
+                or <a href="{{ some_url }}">cancel</a>
30
+            </div>
31
+        </div>
32
+    </form>
33
+
34
+The ``.control-group`` class aligns the buttons with the fields.

Notiek ielāde…
Atcelt
Saglabāt