From 19246ddf93be71df8f54f737227a248928d02280 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 25 Jan 2012 10:38:07 +0530 Subject: [PATCH] fixes to login css, added explicit characterset utf8 in create table --- css/legacy/body.css | 2 +- css/legacy/default.css | 23 +++++++----- css/legacy/sidebar.css | 21 +++++++---- js/legacy/wn/widgets/page_sidebar.js | 2 +- js/legacy/wnf.compressed.js | 2 +- py/core/doctype/page/page.txt | 50 ++++++++++++++++++------- py/core/page/login_page/login_page.css | 5 +++ py/core/page/login_page/login_page.html | 1 - py/core/page/login_page/login_page.js | 14 +++---- py/webnotes/model/db_schema.py | 4 +- py/webnotes/modules/patch_handler.py | 7 +++- 11 files changed, 86 insertions(+), 45 deletions(-) diff --git a/css/legacy/body.css b/css/legacy/body.css index 0f1b831708..7650104b50 100644 --- a/css/legacy/body.css +++ b/css/legacy/body.css @@ -58,7 +58,7 @@ div.comment { color: #444; } div#body_div { position: relative; display: none; - margin-top: 48px; + margin-top: 56px; } div.no_script { diff --git a/css/legacy/default.css b/css/legacy/default.css index 5da88c30d6..f8eb5b2816 100644 --- a/css/legacy/default.css +++ b/css/legacy/default.css @@ -62,7 +62,7 @@ div.comment { color: #444; } div#body_div { position: relative; display: none; - margin-top: 48px; + margin-top: 56px; } div.no_script { @@ -1586,18 +1586,23 @@ div.psidebar-head { } div.psidebar-section { - background-color: #f7f7f5; - border: 2px solid #b2b2b7; + background-color: #fff; + border: 1px solid #b2b2b7; margin-bottom: 11px; + overflow: hidden; } div.psidebar-section-head { - font-weight: bold; - font-size: 13px; - color: #222; - background-color: #d8d8d4; - margin-bottom: 7px; - padding: 3px 11px; + font-size: 12px; + padding: 5px 11px; + background: #eeeeee; /* Old browsers */ + background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ + background: linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */ } div.psidebar-section-body { diff --git a/css/legacy/sidebar.css b/css/legacy/sidebar.css index 493935d8f0..36a72cdee8 100644 --- a/css/legacy/sidebar.css +++ b/css/legacy/sidebar.css @@ -10,18 +10,23 @@ div.psidebar-head { } div.psidebar-section { - background-color: #f7f7f5; - border: 2px solid #b2b2b7; + background-color: #fff; + border: 1px solid #b2b2b7; margin-bottom: 11px; + overflow: hidden; } div.psidebar-section-head { - font-weight: bold; - font-size: 13px; - color: #222; - background-color: #d8d8d4; - margin-bottom: 7px; - padding: 3px 11px; + font-size: 12px; + padding: 5px 11px; + background: #eeeeee; /* Old browsers */ + background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ + background: linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */ } div.psidebar-section-body { diff --git a/js/legacy/wn/widgets/page_sidebar.js b/js/legacy/wn/widgets/page_sidebar.js index bb04958096..770a680977 100644 --- a/js/legacy/wn/widgets/page_sidebar.js +++ b/js/legacy/wn/widgets/page_sidebar.js @@ -49,7 +49,7 @@ wn.widgets.PageSidebarSection = function(sidebar, opts) { this.wrapper = $a(sidebar.wrapper, 'div', 'psidebar-section'); this.head = $a(this.wrapper, 'div', 'psidebar-section-head', '', opts.title); this.body = $a(this.wrapper, 'div', 'psidebar-section-body'); - $br(this.wrapper, '3px'); + $br(this.wrapper, '5px'); this.opts = opts; diff --git a/js/legacy/wnf.compressed.js b/js/legacy/wnf.compressed.js index c731fa2ad6..292a52a8ea 100644 --- a/js/legacy/wnf.compressed.js +++ b/js/legacy/wnf.compressed.js @@ -853,7 +853,7 @@ this.make_head();for(var i=0;iTo add images, use $image(filename)
Where file name is the ID or Name of the File record' + 'options': '
To add images, use $image(filename)
Where file name is the ID or Name of the File record
' }, # DocField { 'doctype': 'DocField', 'fieldname': 'content', - 'fieldtype': 'Text Editor', + 'fieldtype': 'Code', 'hidden': 0, - 'idx': 6, 'label': 'Content', 'oldfieldname': 'content', 'oldfieldtype': 'Text Editor', 'reqd': 0, 'search_index': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Permissions', + 'oldfieldtype': 'Section Break' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'roles', + 'fieldtype': 'Table', + 'hidden': 0, + 'label': 'Roles', + 'oldfieldname': 'roles', + 'oldfieldtype': 'Table', + 'options': 'Page Role', + 'reqd': 0, + 'search_index': 0 } ] \ No newline at end of file diff --git a/py/core/page/login_page/login_page.css b/py/core/page/login_page/login_page.css index a4e9f7558e..57a2592f2f 100644 --- a/py/core/page/login_page/login_page.css +++ b/py/core/page/login_page/login_page.css @@ -1,3 +1,8 @@ +#login_wrapper { + width: 300px !important; + margin: 20px auto; +} + .login-banner { margin-bottom: 20px; } \ No newline at end of file diff --git a/py/core/page/login_page/login_page.html b/py/core/page/login_page/login_page.html index 7015a51900..7034436c31 100644 --- a/py/core/page/login_page/login_page.html +++ b/py/core/page/login_page/login_page.html @@ -1,5 +1,4 @@
-

Login

diff --git a/py/core/page/login_page/login_page.js b/py/core/page/login_page/login_page.js index b4f63ee85e..ea4761318b 100644 --- a/py/core/page/login_page/login_page.js +++ b/py/core/page/login_page/login_page.js @@ -1,21 +1,19 @@ pscript['onload_Login Page'] = function(){ - var lw = $i('login_wrapper'); $bs(lw, '1px 1px 3px #888'); $bg(document.getElementsByTagName('body')[0], '#DDD'); - pscript.login_btn = $btn('login_btn', 'Login', pscript.doLogin) + pscript.login_btn = $btn('login_btn', 'Login', pscript.doLogin); + $(pscript.login_btn).addClass('primary'); - keypress_observers.push(new function() { - this.notify_keypress = function(kc) { if(kc==13 && $i("password").value) pscript.doLogin(); } - } - ); + $('#login_wrapper').keyup(function(ev){ + if(ev.which==13 && $('#password').value) + pscript.doLogin(); + }) } pscript['onshow_Login Page'] = function() { // set banner - var bannerhtml = wn.control_panel.client_name; - if(bannerhtml) $('.login-banner').html(bannerhtml); } // Login Callback diff --git a/py/webnotes/model/db_schema.py b/py/webnotes/model/db_schema.py index 71f40b4751..dd5661e971 100644 --- a/py/webnotes/model/db_schema.py +++ b/py/webnotes/model/db_schema.py @@ -79,7 +79,9 @@ class DbTable: parentfield varchar(120), parenttype varchar(120), idx int(8), - %sindex parent(parent)) ENGINE=InnoDB""" % (self.name, add_text)) + %sindex parent(parent)) + ENGINE=InnoDB + CHARACTER SET=utf8""" % (self.name, add_text)) def get_columns_from_docfields(self): fl = webnotes.conn.sql("SELECT * FROM tabDocField WHERE parent = '%s'" % self.doctype, as_dict = 1) diff --git a/py/webnotes/modules/patch_handler.py b/py/webnotes/modules/patch_handler.py index eba4207f34..822671e22c 100644 --- a/py/webnotes/modules/patch_handler.py +++ b/py/webnotes/modules/patch_handler.py @@ -71,7 +71,10 @@ def update_patch_log(patchmodule): def executed(patchmodule): """return True if is executed""" - return webnotes.conn.sql("""select patch from __PatchLog where patch=%s""", patchmodule) + done = webnotes.conn.sql("""select patch from __PatchLog where patch=%s""", patchmodule) + if done: + print "Patch %s executed in %s" % (patchmodule, webnotes.conn.cur_db_name) + return done def block_user(block): """stop/start execution till patch is run""" @@ -83,7 +86,7 @@ def block_user(block): def setup(): webnotes.conn.sql("""CREATE TABLE IF NOT EXISTS `__PatchLog` ( - patch TEXT, applied_on DATETIME)""") + patch TEXT, applied_on DATETIME) engine=InnoDB""") log_list = [] has_errors = False