File tree Expand file tree Collapse file tree 9 files changed +41
-9
lines changed
Expand file tree Collapse file tree 9 files changed +41
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Simple terms and condition notify app
55
66## Install
77``` shell
8- $ pip install -e git+https://github.com/rouxcode/django-tac@0.0.6 #egg=django-tac
8+ $ pip install -e git+https://github.com/rouxcode/django-tac@0.0.7 #egg=django-tac
99```
1010
1111## Usage
@@ -39,6 +39,10 @@ use the template tag:
3939``` html
4040{% tac_popup %}
4141```
42+ or if rouxcode/django-text-ckeditor is not installed
43+ ``` html
44+ {% tac_popup_no_ckeditor %}
45+ ```
4246
4347### javascript
4448jquery needs to be loaded before:
Original file line number Diff line number Diff line change 11from __future__ import unicode_literals
22
33
4- __version__ = '0.0.6 '
4+ __version__ = '0.0.7 '
55default_app_config = 'tac.apps.TACConfig'
Original file line number Diff line number Diff line change 22
33from django .contrib import admin
44
5- from .link import PopupLink , PopupLinkAdmin
6- from .popup import PopupContent , PopupContentAdmin
7-
5+ try :
6+ from .link import PopupLink , PopupLinkAdmin
7+ admin .site .register (PopupLink , PopupLinkAdmin )
8+ except Exception :
9+ pass
810
11+ from .popup import PopupContent , PopupContentAdmin
912admin .site .register (PopupContent , PopupContentAdmin )
10- admin .site .register (PopupLink , PopupLinkAdmin )
Original file line number Diff line number Diff line change 33from django import forms
44from django .contrib import admin
55
6- from text_ckeditor .widgets import CKEditorWidget
6+ try :
7+ from text_ckeditor .widgets import CKEditorWidget
8+ except Exception :
9+ from .widgets import CKEditorWidget
710
811from .. import conf
912from ..models import PopupContent
Original file line number Diff line number Diff line change 1+ from __future__ import unicode_literals
2+
3+ from django import forms
4+
5+
6+ class CKEditorWidget (forms .Textarea ):
7+
8+ def __init__ (self , * args , ** kwargs ):
9+ try :
10+ kwargs .popu ('conf' )
11+ except Exception :
12+ pass
13+
14+ super (CKEditorWidget , self ).__init__ (* args , ** kwargs )
Original file line number Diff line number Diff line change 1+ {% if show %}< div class ="tac-popup tac-popup-no-ckeditor ">
2+ < div class ="tac-popup-text "> {{ object.text|safe }}</ div >
3+ < a class ="tac-popup-button " href ="{{ url }} " data-apiurl ="{{ apiurl }} "> {{ object.get_button_label }}</ a >
4+ </ div > {% endif %}
Original file line number Diff line number Diff line change @@ -35,3 +35,8 @@ def tac_popup(context):
3535 'url' : './?tac=accepted' ,
3636 'apiurl' : reverse ('tac-api-accept' ),
3737 }
38+
39+
40+ @register .inclusion_tag ('tac/tags/popup_no_ckeditor.html' , takes_context = True )
41+ def tac_popup_no_ckeditor (context ):
42+ return tac_popup (context )
Original file line number Diff line number Diff line change 4343 'testproject' ,
4444 'tac' ,
4545 'compressor' ,
46- 'text_ckeditor' ,
46+ # 'text_ckeditor',
4747
4848 'django.contrib.redirects' ,
4949 'django.contrib.admin' ,
Original file line number Diff line number Diff line change 1313 {% placeholder 'body' %}
1414 {% endblock %}
1515 </ div >
16- {% tac_popup %}
16+ {% tac_popup_no_ckeditor %}
1717 {% compress js %}
1818 < script src ="{{ STATIC_URL }}js/jquery.js "> </ script >
1919 < script src ="{{ STATIC_URL }}tac/js/tac.accept.js "> </ script >
You can’t perform that action at this time.
0 commit comments