From b9a1d1ec899becd1baf691d4ed3bdab756e0e16c Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 12 Jan 2012 23:55:59 +0530 Subject: [PATCH] erang comments csrf issue solved + some css --- itf/app/models.py | 6 ++- itf/insidepages/views.py | 6 ++- itf/static/css/modules/emailer.css | 45 ++++++++++++++++++- .../modules/emailer/emailerissue.html | 20 ++++++--- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index b5fee47..509a7d4 100755 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -9,6 +9,7 @@ from django.contrib.contenttypes.models import ContentType from insidepages.models import ModuleTab, ModelExtra from os.path import exists from sorl.thumbnail import get_thumbnail +from django.template import RequestContext def splitSearch(string): ret = [] @@ -123,9 +124,10 @@ class ItfModel(models.Model): def get_dict(self): return self.get(self._get_fields().keys()) - def insidepage_dict(self): + def insidepage_dict(self, request): + context = RequestContext(request, self.info_dict()) try: - html = render_to_string(self.get_template_path(), self.info_dict()) + html = render_to_string(self.get_template_path(), context) except: html = "Template path not found at : " + self.get_template_path() return { diff --git a/itf/insidepages/views.py b/itf/insidepages/views.py index c99750e..3cd37bb 100755 --- a/itf/insidepages/views.py +++ b/itf/insidepages/views.py @@ -68,11 +68,15 @@ def get_list(request): def get_details(request): +# import pdb tab_slug = request.GET.get("tab", '') tab = get_object_or_404(ModuleTab, slug=tab_slug) model_class = tab.model_class() object_id = request.GET.get("object_id", 0) obj = get_object_or_404(model_class, pk=object_id) - return render_to_json_response(obj.insidepage_dict()) + ret = obj.insidepage_dict(request) +# ret['csrf_token'] = c +# pdb.set_trace() + return render_to_json_response(ret) diff --git a/itf/static/css/modules/emailer.css b/itf/static/css/modules/emailer.css index 7bdf87a..a395d32 100755 --- a/itf/static/css/modules/emailer.css +++ b/itf/static/css/modules/emailer.css @@ -55,6 +55,36 @@ float:left; } +#subscribeForm { + display:none; + float:right; +} + +#subscribeBtn { +background-color: #F7BD00; +color: white; +font-size: 14px; +-moz-border-radius: 6px; +-webkit-border-radius: 6px; +border-radius: 6px; +padding: 2px 8px; +border: 1px solid transparent; +font-family: 'Century Gothic', Arial, 'DejaVu Sans', sans-serif; +cursor: pointer; +} + +#subscribeInput { + border: 1px solid #E3E3E3; + padding: 2px 2px 3px 4px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + -moz-box-shadow: inset 2px 2px 6px #d7d7d7; + -webkit-box-shadow: inset 2px 2px 6px #d7d7d7; + box-shadow: inset 2px 2px 6px #d7d7d7; + margin-bottom: 10px; +} + #navEmailer { font-family:"Century Gothic", Arial, Helvetica, sans-serif; float:right; @@ -186,7 +216,7 @@ padding:14px 14px 18px 14px; } .contentLinks p { - padding:8px 12px; + padding:0px 12px; } .contentLinks h2 { @@ -196,6 +226,19 @@ padding:14px 14px 18px 14px; line-height:20px; } +/* COMMENtS */ + +.comment { + margin-bottom:10px; +} + +.comment_user { + font-weight:bold; + color:#f7bd00; +} + +/* COMMENtS */ + /* CONTENT EMAILER CLOSING */ /* ------------------------------- */ diff --git a/itf/templates/modules/emailer/emailerissue.html b/itf/templates/modules/emailer/emailerissue.html index 4044a5b..b0f8d7c 100755 --- a/itf/templates/modules/emailer/emailerissue.html +++ b/itf/templates/modules/emailer/emailerissue.html @@ -20,8 +20,13 @@ - -
+ +
+
+ + +
+
@@ -71,7 +76,7 @@

WEB LINKS

{% for weblink in weblinks %}

{{ weblink.title }}

-

{{ weblink.text|markdown }}

+ {{ weblink.text|markdown }} {% endfor %} @@ -79,7 +84,7 @@

BULLETIN BOARD

{% for bbitem in bbitems %}

{{ bbitem.title }}

-

{{ bbitem.text|markdown }}

+ {{ bbitem.text|markdown }} {% endfor %} @@ -102,7 +107,7 @@ association of theatre people coming together in the larger interests of theatre - +