Moving widgets out of an app to close #416
authorBryan <btbonval@gmail.com>
Fri, 27 Feb 2015 04:26:38 +0000 (23:26 -0500)
committerBryan <btbonval@gmail.com>
Fri, 27 Feb 2015 04:26:38 +0000 (23:26 -0500)
karmaworld/apps/notes/forms.py
karmaworld/apps/wysihtml5/widgets.py [deleted file]
karmaworld/utils/widgets.py [new file with mode: 0644]

index a6a92f639625db4d8d7e1eedf4b1fc8ba1a72a54..60c441e9a3600d548d2e4d22cb69e1713992b736 100644 (file)
@@ -5,7 +5,7 @@ from django.forms import ModelForm, IntegerField, HiddenInput, Form, CharField,
 from django.forms import TextInput
 from django_filepicker.widgets import FPFileWidget
 from django.template.loader import render_to_string
-from wysihtml5.widgets import RichTextEditor
+from karmaworld.utils.widgets import RichTextEditor
 
 from karmaworld.apps.notes.models import Note, NoteMarkdown
 
diff --git a/karmaworld/apps/wysihtml5/widgets.py b/karmaworld/apps/wysihtml5/widgets.py
deleted file mode 100644 (file)
index d96948c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-from django import forms
-from django.conf import settings
-from django.utils.safestring import mark_safe
-from django.template.loader import render_to_string
-
-class RichTextEditor(forms.Textarea):
-    def render(self, name, value, attrs=None):
-        return mark_safe(render_to_string("wysihtml5/widget.html", {
-            "name": name,
-            "value": value,
-            "attrs": attrs,
-        }))
-
-    class Media:
-        css = {'all': (settings.STATIC_URL + "wysihtml5/toolbar.css",)}
-        js = (
-            settings.STATIC_URL + "wysihtml5/wysihtml-0.4.17/dist/wysihtml5x-toolbar.min.js",
-            settings.STATIC_URL + "wysihtml5/wysihtml-0.4.17/parser_rules/advanced_and_extended.js",
-            settings.STATIC_URL + "wysihtml5/init.js",
-        )
-           
-
diff --git a/karmaworld/utils/widgets.py b/karmaworld/utils/widgets.py
new file mode 100644 (file)
index 0000000..d96948c
--- /dev/null
@@ -0,0 +1,22 @@
+from django import forms
+from django.conf import settings
+from django.utils.safestring import mark_safe
+from django.template.loader import render_to_string
+
+class RichTextEditor(forms.Textarea):
+    def render(self, name, value, attrs=None):
+        return mark_safe(render_to_string("wysihtml5/widget.html", {
+            "name": name,
+            "value": value,
+            "attrs": attrs,
+        }))
+
+    class Media:
+        css = {'all': (settings.STATIC_URL + "wysihtml5/toolbar.css",)}
+        js = (
+            settings.STATIC_URL + "wysihtml5/wysihtml-0.4.17/dist/wysihtml5x-toolbar.min.js",
+            settings.STATIC_URL + "wysihtml5/wysihtml-0.4.17/parser_rules/advanced_and_extended.js",
+            settings.STATIC_URL + "wysihtml5/init.js",
+        )
+           
+