@@ -9,34 +9,85 @@ A simple Django template tag to work with [Materializecss](http://materializecss
99
1010## Install
1111
12+
1213```
13- pip install django-materializecss-form
14+ pip install django-materializecss-form
15+
1416```
1517
18+
19+
1620[ on pypi] ( https://pypi.python.org/pypi/django-materializecss-form )
21+ [ on GitHub] ( https://github.com/kalwalkden/django-materializecss-form )
1722
1823Add to INSTALLED_APPS:
1924
20- ```
25+ ```
2126INSTALLED_APPS = (
2227 'materializecssform',
2328 ...
2429 )
2530```
2631
32+ Add Materializecss to your project:
33+
34+ In your base.html:
35+
36+ ```
37+ <head>
38+
39+ {% block css %}
40+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.1/css/materialize.min.css" integrity="sha256-qj3p6P1fJIV+Ndv7RW1ovZI2UhOuboj9GcODzcNFIN8=" crossorigin="anonymous" />
41+ {% endblock css %}
42+
43+ </head>
44+ ```
45+
46+ ```
47+
48+ <body >
49+
50+ {% block javascript %}
51+ <script
52+ src="https://code.jquery.com/jquery-3.3.1.min.js"
53+ integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
54+ crossorigin="anonymous"></script>
55+
56+ <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.1/js/materialize.min.js" integrity="sha256-SrBfGi+Zp2LhAvy9M1bWOCXztRU9Ztztxmu5BcYPcPE=" crossorigin="anonymous"></script>
57+
58+ <script>
59+ $(document).ready(function(){
60+
61+ // Initialize materialize data picker
62+ $('.datepicker').datepicker({'format': 'yyyy-mm-dd'});
63+ $('select').formSelect();
64+
65+ });
66+
67+ </script>
68+
69+ {% endblock javascript %}
70+
71+
72+
73+ ...
74+
75+ </body>
76+ ```
77+
2778## Usage
2879
2980Use it like this, simple.
3081
3182{% load materializecss %}
3283
33- ### All the form
84+ ### All the form
3485
3586{{ form|materializecss }}
3687
3788### Individual field
3889
39- {{ form.<field name >| materializecss }}
90+ {{ form.<< field name >> | materializecss }}
4091
4192
4293### Custom size (default is 's12')
@@ -58,15 +109,24 @@ Use it like this, simple.
58109
59110- TextInput
60111- Textarea
61- - Select
112+ - CheckboxInput
113+ - RadioSelect
114+ - Select
115+ - SelectMultiple
116+ - CheckboxSelectMultiple
62117- Filefield
63118- DateField
119+ - DateTimeField (doesn't show time yet)
64120
65- ### TODO
66- - Multiple select
67121
68122
69123## Inspired by
70124
71125[ django-bootstrap-form] ( https://github.com/tzangms/django-bootstrap-form )
72126
127+ ## Originally Built By
128+
129+ Florent CLAPIÉ
130+
131+ [ https://pypi.org/user/florent1933/ ] https://pypi.org/user/florent1933/
132+
0 commit comments