From 9d962cedd3bdf03fe9f7d51e7d570ecee1f367ce Mon Sep 17 00:00:00 2001 From: Karen Date: Fri, 14 Oct 2011 01:05:45 +0530 Subject: [PATCH] changes to form styling --- itf/insidepages/views.py | 151 +++++++++++++------------- itf/static/css/noel/inner-details.css | 2 +- itf/static/css/noel/inner.css | 58 ++++++++-- itf/static/css/noel/main.css | 2 +- itf/static/css/register.css | 1 - itf/templates/noel/base.html | 5 + itf/templates/noel/insidepage.html | 15 ++- 7 files changed, 144 insertions(+), 90 deletions(-) diff --git a/itf/insidepages/views.py b/itf/insidepages/views.py index 5f0239a..1da8708 100755 --- a/itf/insidepages/views.py +++ b/itf/insidepages/views.py @@ -1,75 +1,76 @@ -from models import Module, ModuleTab -from django.shortcuts import render_to_response, get_object_or_404 -from django.template import RequestContext -from ox.django.shortcuts import render_to_json_response - - -def main(request, module_slug): - m = get_object_or_404(Module, slug=module_slug) - tabs = m.moduletab_set.all() - default_tab = tabs[0] - try: - formStr = default_tab.model_class().add_form - has_add = True - add_form = default_tab.model_class().get_add_form() - except: - add_form = None - has_add = False - - list_options = {} #get some options as GET params, etc. to potentially pass to get_list - default_tab_list = default_tab.model_class().get_list(list_options) - context = RequestContext(request, { - 'title': m.title, - 'about': m.about, - 'has_add': has_add, - 'add_form': add_form(), - 'default_tab': tabs[0], - 'default_list': default_tab_list, - 'default_sorts': default_tab.get_dict()['sorts'], - 'tabs': tabs[1:] - }) - return render_to_response("noel/insidepage.html", context) - - -def get_tab(request): - tab_slug = request.GET.get("tab", "") - tab = get_object_or_404(ModuleTab, slug=tab_slug) - return render_to_json_response(tab.get_dict()) - - - -def get_list(request): - tab_slug = request.GET.get("tab", "") - tab = get_object_or_404(ModuleTab, slug=tab_slug) - object_id = request.GET.get("object_id", False) - sortString = request.GET.get("sort", "") - if sortString == "" or sortString == 'null': - sortArray = [] - else: - sortOperator = sortString[0] - sortField = sortString[1:] - sortArray = [{ - 'operator': sortOperator, - 'key': sortField - }] - - list_options = { - 'search': request.GET.get("search", ""), - 'sort': sortArray, - 'page': request.GET.get("page", 1), - 'object_id': object_id, - 'count': request.GET.get("count", 15) #FIXME: make list_length either in settings.py or config per model - } - object_list = tab.get_list(list_options) - return render_to_json_response(object_list) - - -def get_details(request): - 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()) - - +from models import Module, ModuleTab +from django.shortcuts import render_to_response, get_object_or_404 +from django.template import RequestContext +from ox.django.shortcuts import render_to_json_response + + +def main(request, module_slug): + m = get_object_or_404(Module, slug=module_slug) + tabs = m.moduletab_set.all() + default_tab = tabs[0] + try: + formStr = default_tab.model_class().add_form + has_add = True + add_form_class = default_tab.model_class().get_add_form() + add_form = add_form_class() + except: + add_form = None + has_add = False + + list_options = {} #get some options as GET params, etc. to potentially pass to get_list + default_tab_list = default_tab.model_class().get_list(list_options) + context = RequestContext(request, { + 'title': m.title, + 'about': m.about, + 'has_add': has_add, + 'add_form': add_form, + 'default_tab': tabs[0], + 'default_list': default_tab_list, + 'default_sorts': default_tab.get_dict()['sorts'], + 'tabs': tabs[1:] + }) + return render_to_response("noel/insidepage.html", context) + + +def get_tab(request): + tab_slug = request.GET.get("tab", "") + tab = get_object_or_404(ModuleTab, slug=tab_slug) + return render_to_json_response(tab.get_dict()) + + + +def get_list(request): + tab_slug = request.GET.get("tab", "") + tab = get_object_or_404(ModuleTab, slug=tab_slug) + object_id = request.GET.get("object_id", False) + sortString = request.GET.get("sort", "") + if sortString == "" or sortString == 'null': + sortArray = [] + else: + sortOperator = sortString[0] + sortField = sortString[1:] + sortArray = [{ + 'operator': sortOperator, + 'key': sortField + }] + + list_options = { + 'search': request.GET.get("search", ""), + 'sort': sortArray, + 'page': request.GET.get("page", 1), + 'object_id': object_id, + 'count': request.GET.get("count", 15) #FIXME: make list_length either in settings.py or config per model + } + object_list = tab.get_list(list_options) + return render_to_json_response(object_list) + + +def get_details(request): + 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()) + + diff --git a/itf/static/css/noel/inner-details.css b/itf/static/css/noel/inner-details.css index def5c91..d4506da 100755 --- a/itf/static/css/noel/inner-details.css +++ b/itf/static/css/noel/inner-details.css @@ -1,6 +1,6 @@ #bottomRight {width:570px; -height:100%; /*IS THIS REQUIRED??*/ +min-height:300px; /*IS THIS REQUIRED??*/ background-color:#FFF; color:#3b3b39; /*was originally f7bd00*/ font-family:'Arial Regular', Arial, Helvetica, sans-serif; diff --git a/itf/static/css/noel/inner.css b/itf/static/css/noel/inner.css index 1d7ee03..67a2faa 100755 --- a/itf/static/css/noel/inner.css +++ b/itf/static/css/noel/inner.css @@ -40,12 +40,9 @@ padding-left:16px;} #topTextSpan {font-weight:bold;} -#plus +.plus {font-size:24px; color:#ffb400; -position:absolute; -right:42px; -top:6px; cursor:pointer;} #plusTooltip /*SANJ, this is the basic CSS for your javascript tooltip; no element exists in the HTML doc*/ @@ -86,7 +83,7 @@ outline:none; .searchInnerField:focus -{border:1px solid #999; } +{border:none; } #tabsInner /*tabs not touching because i would prefer not to give fixed width, shadow, etc.*/ {font-size:14px; @@ -399,7 +396,6 @@ position:fixed; top:0px; left:0px; bottom:0px; - right:0px; width:100%; height:100%; @@ -408,14 +404,58 @@ z-index:1000;} /*everything except the lightbox panel should be below this z-ind #lightboxPanel { display:none; position:fixed; -top:200px; +top:140px; left:0; right:0; margin:0 auto; -width:400px; +width:600px; +max-height:500px; /*SANJ, PLEASE DO THE RESIZE IN JS*/ +overflow-y:auto; background-color:#FFF; padding:15px; -z-index:1001;} /*must have the highest z-index, just more than the lightbox*/ +z-index:1001; +color:#737373; +-moz-border-radius:12px; +-webkit-border-radius:12px; +border-radius:12px;} /*must have the highest z-index, just more than the lightbox*/ + +#addForm input, #addForm textarea { +border:1px solid #e3e3e3; +padding:2px 2px 2px 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; +vertical-align:text-top;} + +#addForm input:focus, #addForm textarea:focus +{outline:none; +border:1px solid #999;} + +#addForm label +{font-weight:bold;} + +#addForm input[type=submit] +{background-color:#f7bd00; +color:#FFF; +font-size:14px; +-moz-border-radius:6px; +-webkit-border-radius:6px; +border-radius:6px; +padding:3px 10px; +border:1px solid transparent; +margin-top:10px;} + +input#id_law_image +{border:none; +box-shadow:1px 1px 1px transparent;} + +input#id_law_image:focus +{outline + #searchContainer { width:960px; diff --git a/itf/static/css/noel/main.css b/itf/static/css/noel/main.css index ecac815..26dec2d 100755 --- a/itf/static/css/noel/main.css +++ b/itf/static/css/noel/main.css @@ -183,7 +183,7 @@ background-color:#ff8400;} {color:#FFF;} #woodPng -{width:40%; +{width:30%; height:30%; position:absolute; left:0; diff --git a/itf/static/css/register.css b/itf/static/css/register.css index 0be3e42..e7d16b0 100755 --- a/itf/static/css/register.css +++ b/itf/static/css/register.css @@ -79,7 +79,6 @@ margin-bottom:10px;} #formItf textarea{ vertical-align:text-top; - } #formItf input:focus diff --git a/itf/templates/noel/base.html b/itf/templates/noel/base.html index 1ccb2a0..5c9ca54 100755 --- a/itf/templates/noel/base.html +++ b/itf/templates/noel/base.html @@ -5,6 +5,11 @@ {% block title %} {% endblock %} + + + {% block extra_head %} diff --git a/itf/templates/noel/insidepage.html b/itf/templates/noel/insidepage.html index d7b17bd..605f54a 100755 --- a/itf/templates/noel/insidepage.html +++ b/itf/templates/noel/insidepage.html @@ -28,6 +28,14 @@
{{ add_form.as_table }} + + + +
+ + + +
@@ -45,10 +53,11 @@

{{ title|format_title|safe }}

- search - About + + About {% if has_add %} - Add + + + {% endif %}