diff --git a/edbob/pyramid/grids/alchemy.py b/edbob/pyramid/grids/alchemy.py index 4507b3f..be84d0a 100644 --- a/edbob/pyramid/grids/alchemy.py +++ b/edbob/pyramid/grids/alchemy.py @@ -59,6 +59,9 @@ class AlchemyGrid(Grid): def checkbox(self, row): return tags.checkbox('check-'+row.uuid) + def click_route_kwargs(self, row): + return {'uuid': row.uuid} + def column_header(self, field): cls = '' label = field.label() @@ -71,6 +74,9 @@ class AlchemyGrid(Grid): cls = ' class="%s"' % cls return literal('' % (cls, field.key)) + label + literal('') + def delete_route_kwargs(self, row): + return {'uuid': row.uuid} + def iter_fields(self): return self._formalchemy_grid.render_fields.itervalues() diff --git a/edbob/pyramid/static/css/edbob.css b/edbob/pyramid/static/css/edbob.css index dbaa538..154bf05 100644 --- a/edbob/pyramid/static/css/edbob.css +++ b/edbob/pyramid/static/css/edbob.css @@ -9,6 +9,7 @@ html, body { font-family: sans-serif; + font-size: 11pt; } a { @@ -19,12 +20,21 @@ a:hover { text-decoration: underline; } +h1 { + margin-bottom: 15px; +} + +h2 { + font-size: 12pt; + margin: 20px auto 10px auto; +} + li { line-height: 2em; } -.wrapper { - overflow: auto; +p { + margin-bottom: 5px; } .left { @@ -37,27 +47,70 @@ li { text-align: right; } -td.right { - float: none; +.wrapper { + overflow: auto; } -table.wrapper td.right { - vertical-align: bottom; +div.buttons { + clear: both; + margin-top: 10px; } +/* div.controls { */ +/* font-weight: bold; */ +/* margin: 10px auto; */ +/* } */ + +/* div.controls div { */ +/* margin: 5px; */ +/* } */ + +/* div.controls label { */ +/* display: block; */ +/* float: left; */ +/* width: 120px; */ +/* } */ + +div.dialog { + display: none; +} + +div.flash-message { + background-color: #dddddd; + margin-bottom: 8px; + padding: 3px; +} + +div.error { + color: #dd6666; + font-weight: bold; + margin-bottom: 10px; +} + +/* td.right { */ +/* float: none; */ +/* } */ + +/* table.wrapper td.right { */ +/* vertical-align: bottom; */ +/* } */ + /****************************** * Main Layout ******************************/ -#main-wrapper { - padding: 5px; - text-align: center; +html, body, #container { + height: 100%; } -#main { - margin: auto; - text-align: left; +body > #container { + height: auto; + min-height: 100%; +} + +#container { + margin: 0 auto; width: 800px; } @@ -66,6 +119,21 @@ table.wrapper td.right { overflow: auto; } +#body { + padding-top: 15px; + padding-bottom: 5em; +} + +#footer { + margin-top: -4em; + text-align: center; +} + + +/****************************** + * Header + ******************************/ + #header h1 { margin: 0px 5px 10px 5px; } @@ -97,81 +165,3 @@ table.wrapper td.right { display: inline; margin-right: 15px; } - -ul.sub-menu { - border-top: 1px solid black; -} - -ul.sub-menu li { - display: inline; - margin-right: 15px; -} - -#footer { - clear: both; - margin-top: 40px; - text-align: center; -} - -#body { - padding-top: 15px; -} - -h1 { - margin-bottom: 15px; -} - -h2 { - font-size: 12pt; - margin: 20px auto 10px auto; -} - -p { - margin-bottom: 5px; -} - -div.flash-message { - background-color: #dddddd; - margin-bottom: 8px; - padding: 3px; -} - -div.error { - color: #dd6666; - font-weight: bold; - margin-bottom: 10px; -} - -div.buttons { - clear: both; - margin-top: 10px; -} - -div.controls { - font-weight: bold; - margin: 10px auto; -} - -div.controls div { - margin: 5px; -} - -div.controls label { - display: block; - float: left; - width: 120px; -} - - -/****************************** - * Dialogs - ******************************/ - -div.dialog { - display: none; -} - -/* #feedback-dialog textarea { */ -/* height: 180px; */ -/* width: 500px; */ -/* } */ diff --git a/edbob/pyramid/static/css/forms.css b/edbob/pyramid/static/css/forms.css index 67b0eb9..5843669 100644 --- a/edbob/pyramid/static/css/forms.css +++ b/edbob/pyramid/static/css/forms.css @@ -15,7 +15,9 @@ div.form-wrapper ul.context-menu { * Forms ******************************/ -div.fieldset-form { +div.form, +div.fieldset-form, +div.fieldset { float: left; margin-left: 50px; margin-top: 10px; @@ -41,11 +43,11 @@ div.field-wrapper label { white-space: nowrap; } -/* div.field-couple div.field-error { */ -/* clear: both; */ -/* color: #dd6666; */ -/* font-weight: bold; */ -/* } */ +div.field-wrapper div.field-error { + /* clear: both; */ + color: #dd6666; + font-weight: bold; +} div.field-wrapper div.field { display: block; diff --git a/edbob/pyramid/static/css/grids.css b/edbob/pyramid/static/css/grids.css index 2f9eba4..209c55f 100644 --- a/edbob/pyramid/static/css/grids.css +++ b/edbob/pyramid/static/css/grids.css @@ -99,13 +99,12 @@ div.grid table tr.odd { /* width: 15px; */ /* } */ -div.grid table td.delete { - text-align: center; - width: 18px; +div.grid table tbody td.delete { background-image: url(../img/delete.png); background-repeat: no-repeat; background-position: center; cursor: pointer; + min-width: 18px; } div.grid table tbody tr.hovering { diff --git a/edbob/pyramid/static/css/login.css b/edbob/pyramid/static/css/login.css index a3e513f..5d0fa5e 100644 --- a/edbob/pyramid/static/css/login.css +++ b/edbob/pyramid/static/css/login.css @@ -1,27 +1,29 @@ - -/****************************** - * login.css - ******************************/ - -div.fieldset { - text-align: center; -} - -div.field-couple { - margin: 10px auto; - width: 300px; -} - -div.field-couple label { - margin: 0px; - text-align: right; - width: 100px; -} - -div.field-couple input { - width: 150px; -} - -div.buttons input { - margin: auto 5px; -} + +/****************************** + * login.css + ******************************/ + +div.form { + margin: auto; + float: none; + text-align: center; +} + +div.field-wrapper { + margin: 10px auto; + width: 300px; +} + +div.field-wrapper label { + margin: 0px; + text-align: right; + width: 100px; +} + +div.field-wrapper input { + width: 150px; +} + +div.buttons input { + margin: auto 5px; +} diff --git a/edbob/pyramid/static/js/edbob.js b/edbob/pyramid/static/js/edbob.js index d36fc3e..63ed842 100644 --- a/edbob/pyramid/static/js/edbob.js +++ b/edbob/pyramid/static/js/edbob.js @@ -306,10 +306,13 @@ $(function() { div.load(url); }); - $('button.autocomplete-change').live('click', function() { - var container = $(this).parents('div.autocomplete-container:first'); - container.find('div.autocomplete-display').hide(); + $('div.autocomplete-container div.autocomplete-display button.autocomplete-change').live('click', function() { + var container = $(this).parents('div.autocomplete-container'); + var display = $(this).parents('div.autocomplete-display'); var textbox = container.find('input.autocomplete-textbox'); + var hidden = container.find('input[type=hidden]'); + display.hide(); + hidden.val(''); textbox.show(); textbox.select(); textbox.focus(); diff --git a/edbob/pyramid/templates/edbob/base.mako b/edbob/pyramid/templates/edbob/base.mako index b8f3279..f3af0bf 100644 --- a/edbob/pyramid/templates/edbob/base.mako +++ b/edbob/pyramid/templates/edbob/base.mako @@ -29,45 +29,45 @@ -
-
- +
-
- % if request.session.peek_flash('error'): -
- % for error in request.session.pop_flash('error'): -
${error}
- % endfor -
+ + +
+ % if request.session.peek_flash('error'): +
+ % for error in request.session.pop_flash('error'): +
${error}
+ % endfor +
+ % endif + % if request.session.peek_flash(): +
+ % for msg in request.session.pop_flash(): +
${msg|n}
+ % endfor +
+ % endif + ${self.body()} +
+ +
+ + -
-
diff --git a/edbob/pyramid/templates/edbob/login.mako b/edbob/pyramid/templates/edbob/login.mako index b1bd5ed..16724b6 100644 --- a/edbob/pyramid/templates/edbob/login.mako +++ b/edbob/pyramid/templates/edbob/login.mako @@ -23,7 +23,7 @@ -
+
${h.form('')} ## @@ -32,12 +32,12 @@
${error}
% endif -
+
-
+