Skip to content

Commit

Permalink
#1 - Prepopulated slug only on create
Browse files Browse the repository at this point in the history
  • Loading branch information
Natim committed Nov 24, 2012
1 parent 46ca025 commit e923561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ionyweb/templates/floppyforms/slug.html
@@ -1,7 +1,8 @@
{% include "floppyforms/input.html" %}
<script type="text/javascript">
var slug_state = document.getElementById("id_{{ name }}").value == '';
document.getElementById("{{ field_id }}").onkeyup = function() {
var e = document.getElementById("id_slug");
if (!e._changed) { e.value = URLify(document.getElementById("{{ field_id }}").value, 50); }
var e = document.getElementById("id_{{ name }}");
if (slug_state) { e.value = URLify(document.getElementById("{{ field_id }}").value, 100); }
}
</script>
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -18,7 +18,7 @@ def read_relative_file(filename):
REQUIRES = ['django>=1.4', 'Jinja2', 'MySQL-python', 'PIL', 'PyYAML', 'South',
'django-floppyforms', 'django-mptt', 'django-tinymce==1.5.1b2',
'djangorestframework==0.4.0', 'dnspython', 'python-magic', 'requests',
'django-less', 'django-sekizai', 'django-grappelli']
'django-less', 'django-sekizai', 'django-grappelli==2.3.8']


setup(name=NAME,
Expand Down

0 comments on commit e923561

Please sign in to comment.