From 8e85ace60d18c6b1a5bd65566f4cd4f4f10d2b6e Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 4 Dec 2011 15:59:13 +0000 Subject: [PATCH] Move the useful formfield tools out into a app to reuse elsewhere --- app/conf/common.py | 1 + app/eve_api/templates/eve_api/add.html | 6 +++--- app/eve_api/templates/eve_api/update.html | 6 +++--- app/formtools/__init__.py | 0 .../templates/formtools}/formfield.html | 0 app/formtools/templatetags/__init__.py | 0 app/{eve_api => formtools}/templatetags/add_class.py | 0 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 app/formtools/__init__.py rename app/{eve_api/templates/eve_api => formtools/templates/formtools}/formfield.html (100%) create mode 100644 app/formtools/templatetags/__init__.py rename app/{eve_api => formtools}/templatetags/add_class.py (100%) diff --git a/app/conf/common.py b/app/conf/common.py index d9b543c..30556a4 100644 --- a/app/conf/common.py +++ b/app/conf/common.py @@ -72,6 +72,7 @@ INSTALLED_APPS = ( 'djcelery', 'registration', 'pagination', + 'formtools', 'eve_proxy', 'eve_api', 'reddit', diff --git a/app/eve_api/templates/eve_api/add.html b/app/eve_api/templates/eve_api/add.html index 6fe300e..6faa219 100644 --- a/app/eve_api/templates/eve_api/add.html +++ b/app/eve_api/templates/eve_api/add.html @@ -13,9 +13,9 @@ - {% include "eve_api/formfield.html" with field=form.api_user_id %} - {% include "eve_api/formfield.html" with field=form.api_key class="xxlarge"%} - + {% include "formtools/formfield.html" with field=form.api_user_id %} + {% include "formtools/formfield.html" with field=form.api_key class="xxlarge"%} + {% csrf_token %} diff --git a/app/eve_api/templates/eve_api/update.html b/app/eve_api/templates/eve_api/update.html index f2c8801..671b8eb 100644 --- a/app/eve_api/templates/eve_api/update.html +++ b/app/eve_api/templates/eve_api/update.html @@ -12,9 +12,9 @@
- {% include "eve_api/formfield.html" with field=form.api_user_id %} - {% include "eve_api/formfield.html" with field=form.api_key class="xxlarge" %} - {% include "eve_api/formfield.html" with field=form.description class="xxlarge" %} + {% include "formtools/formfield.html" with field=form.api_user_id %} + {% include "formtools/formfield.html" with field=form.api_key class="xxlarge" %} + {% include "formtools/formfield.html" with field=form.description class="xxlarge" %} {% csrf_token %} diff --git a/app/formtools/__init__.py b/app/formtools/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/eve_api/templates/eve_api/formfield.html b/app/formtools/templates/formtools/formfield.html similarity index 100% rename from app/eve_api/templates/eve_api/formfield.html rename to app/formtools/templates/formtools/formfield.html diff --git a/app/formtools/templatetags/__init__.py b/app/formtools/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/eve_api/templatetags/add_class.py b/app/formtools/templatetags/add_class.py similarity index 100% rename from app/eve_api/templatetags/add_class.py rename to app/formtools/templatetags/add_class.py