tweaked autocomplete, styles

This commit is contained in:
Lance Edgar 2012-08-02 10:41:31 -07:00
parent ba339b4dd8
commit 1166bc28cc
6 changed files with 329 additions and 184 deletions

View file

@ -0,0 +1,24 @@
/******************************
* Autocomplete
******************************/
div.autocomplete {
border: 1px solid #000000;
margin-top: 5px;
}
div.autocomplete div {
background-color: #dddddd;
margin: 0px;
padding: 2px 5px;
}
div.autocomplete strong {
margin: 0px 1px;
}
div.autocomplete .selected {
cursor: pointer;
background-color: #aaaaaa;
}

View file

@ -30,40 +30,34 @@ div.crud #context-menu {
* Fieldsets * Fieldsets
******************************/ ******************************/
div.crud div.field-couple { /* div.crud div.field-couple { */
clear: both;
overflow: auto;
min-height: 30px;
}
/* div.crud div.field-couple div.label, */
div.crud div.field-couple label {
display: block;
float: left;
width: 140px;
font-weight: bold;
margin-top: 2px;
white-space: nowrap;
}
/* div.crud div.field-couple div.field-error { */
/* clear: both; */ /* clear: both; */
/* color: #dd6666; */ /* overflow: auto; */
/* font-weight: bold; */ /* min-height: 30px; */
/* } */ /* } */
div.crud div.field-couple div.field { /* /\* div.crud div.field-couple div.label, *\/ */
display: block; /* div.crud div.field-couple label { */
float: left; /* display: block; */
margin-bottom: 5px; /* float: left; */
line-height: 25px; /* width: 140px; */
} /* font-weight: bold; */
/* margin-top: 2px; */
/* white-space: nowrap; */
/* } */
div.crud div.field-couple div.field input[type=text], /* div.crud div.field-couple div.field { */
div.crud div.field-couple div.field input[type=password], /* display: block; */
div.crud div.field-couple div.field select { /* float: left; */
width: 320px; /* margin-bottom: 5px; */
} /* line-height: 25px; */
/* } */
/* div.crud div.field-couple div.field input[type=text], */
/* div.crud div.field-couple div.field input[type=password], */
/* div.crud div.field-couple div.field select { */
/* width: 320px; */
/* } */
/* unbound checkbox field, e.g. 'add another' */ /* unbound checkbox field, e.g. 'add another' */
div.crud div.checkbox { div.crud div.checkbox {
@ -71,14 +65,14 @@ div.crud div.checkbox {
padding-left: 3px; padding-left: 3px;
} }
div.crud div.buttons { /* div.crud div.buttons { */
clear: both; /* clear: both; */
margin-top: 10px; /* margin-top: 10px; */
} /* } */
div.crud div.buttons * { /* div.crud div.buttons * { */
margin-right: 8px; /* margin-right: 8px; */
} /* } */
/* div.crud table.fieldset tbody tr { */ /* div.crud table.fieldset tbody tr { */
/* vertical-align: top; */ /* vertical-align: top; */
@ -102,30 +96,3 @@ div.crud div.buttons * {
/* line-height: 1em; */ /* line-height: 1em; */
/* margin-bottom: 4px; */ /* margin-bottom: 4px; */
/* } */ /* } */
/******************************
* Autocomplete
******************************/
/* Note that these are not prefixed with 'div.crud '. */
div.autocomplete {
border: 1px solid #000000;
margin-top: 5px;
}
div.autocomplete div {
background-color: #dddddd;
margin: 0px;
padding: 2px 5px;
}
div.autocomplete strong {
margin: 0px 1px;
}
div.autocomplete .selected {
cursor: pointer;
background-color: #aaaaaa;
}

View file

@ -180,6 +180,121 @@ div.dialog {
width: 500px; width: 500px;
} }
/******************************
* Grids
******************************/
div.grid {
clear: both;
}
div.grid table {
border-top: 1px solid black;
border-left: 1px solid black;
border-collapse: collapse;
font-size: 9pt;
line-height: normal;
white-space: nowrap;
/* width: 100%; */
}
div.grid table th,
div.grid table td {
border-right: 1px solid black;
border-bottom: 1px solid black;
padding: 2px 3px;
}
div.grid table th.sortable a {
display: block;
padding-right: 18px;
}
div.grid table th.sorted {
background-position: right center;
background-repeat: no-repeat;
}
div.grid table th.sorted.asc {
background-image: url(../img/sort_arrow_up.png);
}
div.grid table th.sorted.desc {
background-image: url(../img/sort_arrow_down.png);
}
div.grid table tbody td {
text-align: left;
}
div.grid table tr.even {
background-color: #e0e0e0;
}
/* div.grid table thead th.checkbox, */
/* div.grid table tbody td.checkbox { */
/* text-align: center; */
/* vertical-align: middle; */
/* width: 15px; */
/* } */
/* div.grid table td.action { */
/* cursor: default; */
/* } */
div.grid table td.delete {
text-align: center;
width: 18px;
background-image: url(../img/delete.png);
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
}
div.grid table tbody tr.hovering {
background-color: #bbbbbb;
}
div.grid table.hoverable tbody tr {
cursor: default;
}
div.grid.clickable table tbody tr,
div.grid table.selectable tbody tr,
div.grid table.checkable tbody tr {
cursor: pointer;
}
/* div.grid table.selectable tbody tr.selected, */
/* div.grid table.checkable tbody tr.selected { */
/* background-color: #666666; */
/* color: white; */
/* } */
div.pager {
margin-top: 5px;
}
div.pager p {
font-size: 10pt;
margin: 0px;
}
div.pager p.showing {
float: left;
}
div.pager #grid-page-count {
font-size: 8pt;
height: 21px;
}
div.pager p.page-links {
float: right;
}
/* /\****************************** */ /* /\****************************** */
/* * Sub-Grids */ /* * Sub-Grids */
/* ******************************\/ */ /* ******************************\/ */
@ -194,3 +309,52 @@ div.dialog {
/* float: left; */ /* float: left; */
/* margin-bottom: 5px; */ /* margin-bottom: 5px; */
/* } */ /* } */
/******************************
* Fieldsets
******************************/
div.field-couple {
clear: both;
overflow: auto;
min-height: 30px;
}
/* div.field-couple div.label, */
div.field-couple label {
display: block;
float: left;
width: 140px;
font-weight: bold;
margin-top: 2px;
white-space: nowrap;
}
/* div.field-couple div.field-error { */
/* clear: both; */
/* color: #dd6666; */
/* font-weight: bold; */
/* } */
div.field-couple div.field {
display: block;
float: left;
margin-bottom: 5px;
line-height: 25px;
}
div.field-couple div.field input[type=text],
div.field-couple div.field input[type=password],
div.field-couple div.field select {
width: 320px;
}
div.buttons {
clear: both;
margin-top: 10px;
}
div.buttons * {
margin-right: 8px;
}

View file

@ -66,86 +66,75 @@ div.object-index table.header td.tools {
* Grids * Grids
******************************/ ******************************/
div.object-index div.grid { /* div.object-index div.grid { */
clear: both; /* clear: both; */
} /* } */
div.object-index div.grid table { div.object-index div.grid table {
border-top: 1px solid black; /* border-top: 1px solid black; */
border-left: 1px solid black; /* border-left: 1px solid black; */
border-collapse: collapse; /* border-collapse: collapse; */
font-size: 9pt; /* font-size: 9pt; */
line-height: normal; /* line-height: normal; */
white-space: nowrap; /* white-space: nowrap; */
width: 100%; width: 100%;
} }
div.object-index div.grid table th, /* div.object-index div.grid table th, */
div.object-index div.grid table td { /* div.object-index div.grid table td { */
border-right: 1px solid black; /* border-right: 1px solid black; */
border-bottom: 1px solid black; /* border-bottom: 1px solid black; */
padding: 2px 3px; /* padding: 2px 3px; */
}
div.object-index div.grid table th.sortable a {
display: block;
padding-right: 18px;
}
div.object-index div.grid table th.sorted {
background-position: right center;
background-repeat: no-repeat;
}
div.object-index div.grid table th.sorted.asc {
background-image: url(../img/sort_arrow_up.png);
}
div.object-index div.grid table th.sorted.desc {
background-image: url(../img/sort_arrow_down.png);
}
div.object-index div.grid table tbody td {
text-align: left;
}
div.object-index div.grid table tr.even {
background-color: #e0e0e0;
}
/* div.grid table thead th.checkbox, */
/* div.grid table tbody td.checkbox { */
/* text-align: center; */
/* vertical-align: middle; */
/* width: 15px; */
/* } */ /* } */
/* div.grid table td.action { */ /* div.object-index div.grid table th.sortable a { */
/* display: block; */
/* padding-right: 18px; */
/* } */
/* div.object-index div.grid table th.sorted { */
/* background-position: right center; */
/* background-repeat: no-repeat; */
/* } */
/* div.object-index div.grid table th.sorted.asc { */
/* background-image: url(../img/sort_arrow_up.png); */
/* } */
/* div.object-index div.grid table th.sorted.desc { */
/* background-image: url(../img/sort_arrow_down.png); */
/* } */
/* div.object-index div.grid table tbody td { */
/* text-align: left; */
/* } */
/* div.object-index div.grid table tr.even { */
/* background-color: #e0e0e0; */
/* } */
/* div.object-index div.grid table td.delete { */
/* text-align: center; */
/* width: 18px; */
/* background-image: url(../img/delete.png); */
/* background-repeat: no-repeat; */
/* background-position: center; */
/* cursor: pointer; */
/* } */
/* div.object-index div.grid table tbody tr.hovering { */
/* background-color: #bbbbbb; */
/* } */
/* div.object-index div.grid table.hoverable tbody tr { */
/* cursor: default; */ /* cursor: default; */
/* } */ /* } */
div.object-index div.grid table td.delete { /* div.object-index div.grid.clickable table tbody tr, */
text-align: center; /* div.object-index div.grid table.selectable tbody tr, */
width: 18px; /* div.object-index div.grid table.checkable tbody tr { */
background-image: url(../img/delete.png); /* cursor: pointer; */
background-repeat: no-repeat; /* } */
background-position: center;
cursor: pointer;
}
div.object-index div.grid table tbody tr.hovering {
background-color: #bbbbbb;
}
div.object-index div.grid table.hoverable tbody tr {
cursor: default;
}
div.object-index div.grid.clickable table tbody tr,
div.object-index div.grid table.selectable tbody tr,
div.object-index div.grid table.checkable tbody tr {
cursor: pointer;
}
/* div.grid table.selectable tbody tr.selected, */ /* div.grid table.selectable tbody tr.selected, */
/* div.grid table.checkable tbody tr.selected { */ /* div.grid table.checkable tbody tr.selected { */
@ -153,24 +142,24 @@ div.object-index div.grid table.checkable tbody tr {
/* color: white; */ /* color: white; */
/* } */ /* } */
div.object-index div.pager { /* div.object-index div.pager { */
margin-top: 5px; /* margin-top: 5px; */
} /* } */
div.object-index div.pager p { /* div.object-index div.pager p { */
font-size: 10pt; /* font-size: 10pt; */
margin: 0px; /* margin: 0px; */
} /* } */
div.object-index div.pager p.showing { /* div.object-index div.pager p.showing { */
float: left; /* float: left; */
} /* } */
div.object-index div.pager #grid-page-count { /* div.object-index div.pager #grid-page-count { */
font-size: 8pt; /* font-size: 8pt; */
height: 21px; /* height: 21px; */
} /* } */
div.object-index div.pager p.page-links { /* div.object-index div.pager p.page-links { */
float: right; /* float: right; */
} /* } */

View file

@ -20,6 +20,7 @@
${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/smoothness/jquery-ui-1.8.2.custom.css'))} ${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/smoothness/jquery-ui-1.8.2.custom.css'))}
${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/edbob.css'))} ${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/edbob.css'))}
${h.stylesheet_link(request.static_url('edbob.pyramid:static/css/autocomplete.css'))}
${self.head_tags()} ${self.head_tags()}
</head> </head>
@ -28,40 +29,40 @@
<div id="main-wrapper"> <div id="main-wrapper">
<div id="main"> <div id="main">
<div id="header"> <div id="header">
${self.home_link()} ${self.home_link()}
<h1 class="left">${self.title()}</h1> <h1 class="left">${self.title()}</h1>
<div id="login" class="right"> <div id="login" class="right">
% if request.user: % if request.user:
logged in as <strong>${request.user.display_name}</strong> logged in as <strong>${request.user.display_name}</strong>
(${h.link_to("logout", url('logout'))}) (${h.link_to("logout", url('logout'))})
% else: % else:
${h.link_to("login", url('login'))} ${h.link_to("login", url('login'))}
% endif % endif
</div> </div>
</div><!-- header --> </div><!-- header -->
<div id="body"> <div id="body">
## % if request.session.peek_flash('error'): ## % if request.session.peek_flash('error'):
## <div id="error-messages"> ## <div id="error-messages">
## % for error in request.session.pop_flash('error'): ## % for error in request.session.pop_flash('error'):
## <div class="error">${error}</div> ## <div class="error">${error}</div>
## % endfor ## % endfor
## </div> ## </div>
## % endif ## % endif
% if request.session.peek_flash(): % if request.session.peek_flash():
<div id="flash-messages"> <div id="flash-messages">
% for msg in request.session.pop_flash(): % for msg in request.session.pop_flash():
<div class="flash-message">${msg|n}</div> <div class="flash-message">${msg|n}</div>
% endfor % endfor
</div> </div>
% endif % endif
${self.body()} ${self.body()}
</div><!-- body --> </div><!-- body -->
<div id="footer"> <div id="footer">
${self.footer()} ${self.footer()}
</div> </div>
</div><!-- main --> </div><!-- main -->
</div><!-- main-wrapper --> </div><!-- main-wrapper -->

View file

@ -33,10 +33,10 @@ from edbob.pyramid.forms.formalchemy import AutocompleteFieldRenderer
from edbob.util import requires_impl from edbob.util import requires_impl
__all__ = ['Autocomplete'] __all__ = ['AutocompleteView']
class Autocomplete(object): class AutocompleteView(object):
route = None route = None
url = None url = None