changes to form styling
This commit is contained in:
parent
6572afb7c8
commit
9d962cedd3
|
@ -1,75 +1,76 @@
|
||||||
from models import Module, ModuleTab
|
from models import Module, ModuleTab
|
||||||
from django.shortcuts import render_to_response, get_object_or_404
|
from django.shortcuts import render_to_response, get_object_or_404
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from ox.django.shortcuts import render_to_json_response
|
from ox.django.shortcuts import render_to_json_response
|
||||||
|
|
||||||
|
|
||||||
def main(request, module_slug):
|
def main(request, module_slug):
|
||||||
m = get_object_or_404(Module, slug=module_slug)
|
m = get_object_or_404(Module, slug=module_slug)
|
||||||
tabs = m.moduletab_set.all()
|
tabs = m.moduletab_set.all()
|
||||||
default_tab = tabs[0]
|
default_tab = tabs[0]
|
||||||
try:
|
try:
|
||||||
formStr = default_tab.model_class().add_form
|
formStr = default_tab.model_class().add_form
|
||||||
has_add = True
|
has_add = True
|
||||||
add_form = default_tab.model_class().get_add_form()
|
add_form_class = default_tab.model_class().get_add_form()
|
||||||
except:
|
add_form = add_form_class()
|
||||||
add_form = None
|
except:
|
||||||
has_add = False
|
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)
|
list_options = {} #get some options as GET params, etc. to potentially pass to get_list
|
||||||
context = RequestContext(request, {
|
default_tab_list = default_tab.model_class().get_list(list_options)
|
||||||
'title': m.title,
|
context = RequestContext(request, {
|
||||||
'about': m.about,
|
'title': m.title,
|
||||||
'has_add': has_add,
|
'about': m.about,
|
||||||
'add_form': add_form(),
|
'has_add': has_add,
|
||||||
'default_tab': tabs[0],
|
'add_form': add_form,
|
||||||
'default_list': default_tab_list,
|
'default_tab': tabs[0],
|
||||||
'default_sorts': default_tab.get_dict()['sorts'],
|
'default_list': default_tab_list,
|
||||||
'tabs': tabs[1:]
|
'default_sorts': default_tab.get_dict()['sorts'],
|
||||||
})
|
'tabs': tabs[1:]
|
||||||
return render_to_response("noel/insidepage.html", context)
|
})
|
||||||
|
return render_to_response("noel/insidepage.html", context)
|
||||||
|
|
||||||
def get_tab(request):
|
|
||||||
tab_slug = request.GET.get("tab", "")
|
def get_tab(request):
|
||||||
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
tab_slug = request.GET.get("tab", "")
|
||||||
return render_to_json_response(tab.get_dict())
|
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", "")
|
def get_list(request):
|
||||||
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
tab_slug = request.GET.get("tab", "")
|
||||||
object_id = request.GET.get("object_id", False)
|
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
||||||
sortString = request.GET.get("sort", "")
|
object_id = request.GET.get("object_id", False)
|
||||||
if sortString == "" or sortString == 'null':
|
sortString = request.GET.get("sort", "")
|
||||||
sortArray = []
|
if sortString == "" or sortString == 'null':
|
||||||
else:
|
sortArray = []
|
||||||
sortOperator = sortString[0]
|
else:
|
||||||
sortField = sortString[1:]
|
sortOperator = sortString[0]
|
||||||
sortArray = [{
|
sortField = sortString[1:]
|
||||||
'operator': sortOperator,
|
sortArray = [{
|
||||||
'key': sortField
|
'operator': sortOperator,
|
||||||
}]
|
'key': sortField
|
||||||
|
}]
|
||||||
list_options = {
|
|
||||||
'search': request.GET.get("search", ""),
|
list_options = {
|
||||||
'sort': sortArray,
|
'search': request.GET.get("search", ""),
|
||||||
'page': request.GET.get("page", 1),
|
'sort': sortArray,
|
||||||
'object_id': object_id,
|
'page': request.GET.get("page", 1),
|
||||||
'count': request.GET.get("count", 15) #FIXME: make list_length either in settings.py or config per model
|
'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)
|
object_list = tab.get_list(list_options)
|
||||||
|
return render_to_json_response(object_list)
|
||||||
|
|
||||||
def get_details(request):
|
|
||||||
tab_slug = request.GET.get("tab", '')
|
def get_details(request):
|
||||||
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
tab_slug = request.GET.get("tab", '')
|
||||||
model_class = tab.model_class()
|
tab = get_object_or_404(ModuleTab, slug=tab_slug)
|
||||||
object_id = request.GET.get("object_id", 0)
|
model_class = tab.model_class()
|
||||||
obj = get_object_or_404(model_class, pk=object_id)
|
object_id = request.GET.get("object_id", 0)
|
||||||
return render_to_json_response(obj.insidepage_dict())
|
obj = get_object_or_404(model_class, pk=object_id)
|
||||||
|
return render_to_json_response(obj.insidepage_dict())
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#bottomRight
|
#bottomRight
|
||||||
{width:570px;
|
{width:570px;
|
||||||
height:100%; /*IS THIS REQUIRED??*/
|
min-height:300px; /*IS THIS REQUIRED??*/
|
||||||
background-color:#FFF;
|
background-color:#FFF;
|
||||||
color:#3b3b39; /*was originally f7bd00*/
|
color:#3b3b39; /*was originally f7bd00*/
|
||||||
font-family:'Arial Regular', Arial, Helvetica, sans-serif;
|
font-family:'Arial Regular', Arial, Helvetica, sans-serif;
|
||||||
|
|
|
@ -40,12 +40,9 @@ padding-left:16px;}
|
||||||
#topTextSpan
|
#topTextSpan
|
||||||
{font-weight:bold;}
|
{font-weight:bold;}
|
||||||
|
|
||||||
#plus
|
.plus
|
||||||
{font-size:24px;
|
{font-size:24px;
|
||||||
color:#ffb400;
|
color:#ffb400;
|
||||||
position:absolute;
|
|
||||||
right:42px;
|
|
||||||
top:6px;
|
|
||||||
cursor:pointer;}
|
cursor:pointer;}
|
||||||
|
|
||||||
#plusTooltip /*SANJ, this is the basic CSS for your javascript tooltip; no element exists in the HTML doc*/
|
#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
|
.searchInnerField:focus
|
||||||
{border:1px solid #999; }
|
{border:none; }
|
||||||
|
|
||||||
#tabsInner /*tabs not touching because i would prefer not to give fixed width, shadow, etc.*/
|
#tabsInner /*tabs not touching because i would prefer not to give fixed width, shadow, etc.*/
|
||||||
{font-size:14px;
|
{font-size:14px;
|
||||||
|
@ -399,7 +396,6 @@ position:fixed;
|
||||||
top:0px;
|
top:0px;
|
||||||
left:0px;
|
left:0px;
|
||||||
bottom:0px;
|
bottom:0px;
|
||||||
|
|
||||||
right:0px;
|
right:0px;
|
||||||
width:100%;
|
width:100%;
|
||||||
height:100%;
|
height:100%;
|
||||||
|
@ -408,14 +404,58 @@ z-index:1000;} /*everything except the lightbox panel should be below this z-ind
|
||||||
#lightboxPanel {
|
#lightboxPanel {
|
||||||
display:none;
|
display:none;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
top:200px;
|
top:140px;
|
||||||
left:0;
|
left:0;
|
||||||
right:0;
|
right:0;
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
width:400px;
|
width:600px;
|
||||||
|
max-height:500px; /*SANJ, PLEASE DO THE RESIZE IN JS*/
|
||||||
|
overflow-y:auto;
|
||||||
background-color:#FFF;
|
background-color:#FFF;
|
||||||
padding:15px;
|
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 {
|
#searchContainer {
|
||||||
width:960px;
|
width:960px;
|
||||||
|
|
|
@ -183,7 +183,7 @@ background-color:#ff8400;}
|
||||||
{color:#FFF;}
|
{color:#FFF;}
|
||||||
|
|
||||||
#woodPng
|
#woodPng
|
||||||
{width:40%;
|
{width:30%;
|
||||||
height:30%;
|
height:30%;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
left:0;
|
left:0;
|
||||||
|
|
|
@ -79,7 +79,6 @@ margin-bottom:10px;}
|
||||||
|
|
||||||
#formItf textarea{
|
#formItf textarea{
|
||||||
vertical-align:text-top;
|
vertical-align:text-top;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#formItf input:focus
|
#formItf input:focus
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
<title>{% block title %} {% endblock %}</title>
|
<title>{% block title %} {% endblock %}</title>
|
||||||
<link rel="stylesheet" href="/static/css/reset.css" type="text/css" />
|
<link rel="stylesheet" href="/static/css/reset.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="/static/css/noel/main.css" type="text/css" />
|
<link rel="stylesheet" href="/static/css/noel/main.css" type="text/css" />
|
||||||
|
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
<script type="text/javascript" src="/static/js/jquery.js"></script>
|
<script type="text/javascript" src="/static/js/jquery.js"></script>
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,14 @@
|
||||||
<form id="addForm" action="" method="POST" data-id="{{ default_tab.id }}">
|
<form id="addForm" action="" method="POST" data-id="{{ default_tab.id }}">
|
||||||
<table>
|
<table>
|
||||||
{{ add_form.as_table }}
|
{{ add_form.as_table }}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="submit" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,10 +53,11 @@
|
||||||
<h3 id="topText">{{ title|format_title|safe }}</h3>
|
<h3 id="topText">{{ title|format_title|safe }}</h3>
|
||||||
|
|
||||||
<div id="searchInnerDiv">
|
<div id="searchInnerDiv">
|
||||||
<img src="/static/images/noel/search-inner.png" width="22" height="18" alt="search" class="searchInner">
|
<!--<img src="/static/images/noel/search-inner.png" width="22" height="18" alt="search" class="searchInner">-->
|
||||||
<img src="/static/images/noel/search-inner.png" width="22" height="18" id="aboutBtn" alt="About" class="searchInner">
|
<img src="/static/images/noel/aboutus.gif" width="20" height="20" id="aboutBtn" alt="About">
|
||||||
{% if has_add %}
|
{% if has_add %}
|
||||||
<img src="/static/images/noel/search-inner.png" width="22" height="18" id="addBtn" alt="Add" class="searchInner">
|
<span class="plus" id="addBtn">+</span>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
Loading…
Reference in New Issue
Block a user