Skip to content

Commit c0c7c26

Browse files
authored
Merge branch 'master' into attrs-and-formsets
2 parents 0039c72 + 6116b51 commit c0c7c26

File tree

7 files changed

+202
-193
lines changed

7 files changed

+202
-193
lines changed

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

33
Copyright (c) 2015 Florent CLAPIÉ
4+
Copyright (c) 2018 Kal Walkden
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1823
Add to INSTALLED_APPS:
1924

20-
```
25+
```
2126
INSTALLED_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

2980
Use 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+

README.rst

Lines changed: 0 additions & 86 deletions
This file was deleted.

materializecssform/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from distutils.version import StrictVersion
22

33

4-
VERSION = StrictVersion('1.0.02')
4+
VERSION = StrictVersion('1.1.6')

0 commit comments

Comments
 (0)