From 2adeed3029bb223ea32c77f31da28bfe3dadcd3e Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Thu, 6 Sep 2007 11:09:12 -0700 Subject: Add search box in header. Change account status to use select list and 'active'/'inactive' values. Improve autosuggest to keep suggesting unless you overwrite a suggestion (if you correct the name, it will re-suggest). --- ipa-server/ipa-gui/ipagui/controllers.py | 8 +++++ ipa-server/ipa-gui/ipagui/forms/user.py | 5 ++- ipa-server/ipa-gui/ipagui/helpers/userhelper.py | 6 ++++ ipa-server/ipa-gui/ipagui/static/css/style.css | 23 +++++++++----- ipa-server/ipa-gui/ipagui/templates/master.kid | 36 +++++++++++++++++----- .../ipa-gui/ipagui/templates/usernewform.kid | 9 ++++-- ipa-server/ipa-gui/ipagui/templates/usershow.kid | 2 +- 7 files changed, 71 insertions(+), 18 deletions(-) (limited to 'ipa-server/ipa-gui') diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py index 73945fe4c..b984c2a05 100644 --- a/ipa-server/ipa-gui/ipagui/controllers.py +++ b/ipa-server/ipa-gui/ipagui/controllers.py @@ -48,6 +48,14 @@ class Root(controllers.RootController): def index(self): return dict() + @expose() + def topsearch(self, **kw): + if kw.get('searchtype') == "Users": + return self.userlist(uid=kw.get('searchvalue')) + else: + return self.index() + + ######## # User # diff --git a/ipa-server/ipa-gui/ipagui/forms/user.py b/ipa-server/ipa-gui/ipagui/forms/user.py index db4bd7d5b..859b3023d 100644 --- a/ipa-server/ipa-gui/ipagui/forms/user.py +++ b/ipa-server/ipa-gui/ipagui/forms/user.py @@ -10,7 +10,10 @@ class UserFields(): sn = widgets.TextField(name="sn", label="Last name") mail = widgets.TextField(name="mail", label="E-mail address") telephonenumber = widgets.TextField(name="telephonenumber", label="Phone") - nsAccountLock = widgets.CheckBox(name="nsAccountLock", label="Account Deactivated") + # nsAccountLock = widgets.CheckBox(name="nsAccountLock", label="Account Deactivated") + nsAccountLock = widgets.SingleSelectField(name="nsAccountLock", + label="Account Status", + options = [("", "active"), ("true", "inactive")]) uid.validator = validators.PlainText(not_empty=True) userpassword.validator = validators.String(not_empty=True) diff --git a/ipa-server/ipa-gui/ipagui/helpers/userhelper.py b/ipa-server/ipa-gui/ipagui/helpers/userhelper.py index 2a2571dbe..e1ade3a2c 100644 --- a/ipa-server/ipa-gui/ipagui/helpers/userhelper.py +++ b/ipa-server/ipa-gui/ipagui/helpers/userhelper.py @@ -21,3 +21,9 @@ def password_is_expired(days): def password_expires_soon(days): return (not password_is_expired(days)) and (days < 7) + +def account_status_display(status): + if status == "true": + return "inactive" + else: + return "active" diff --git a/ipa-server/ipa-gui/ipagui/static/css/style.css b/ipa-server/ipa-gui/ipagui/static/css/style.css index d64f6d559..5a38f3409 100644 --- a/ipa-server/ipa-gui/ipagui/static/css/style.css +++ b/ipa-server/ipa-gui/ipagui/static/css/style.css @@ -17,6 +17,7 @@ body { background:#ccc; /* should be same as #sidebar */ margin:0 auto; width:100%; + clear:both; } @@ -24,16 +25,25 @@ body { background:#fff; } -#header h1 { - padding:5px; - margin:0; +#header #logo { + float:left; } -#header #logo { +#header #headerinfo { + text-align:right; } -#header #login { - float:right; +#header #headerinfo #login { +} + +#header #headerinfo #topsearch { + padding-top: 15px; +} + +.searchtext { + background-color:#E5F1F4; + border:1px solid #8E8E8E; + color:#444444; } @@ -42,7 +52,6 @@ body { color:#fff; min-height:3px; max-height:3px; - clear:both; } #nav ul { diff --git a/ipa-server/ipa-gui/ipagui/templates/master.kid b/ipa-server/ipa-gui/ipagui/templates/master.kid index 71412eaa4..3be1f4c09 100644 --- a/ipa-server/ipa-gui/ipagui/templates/master.kid +++ b/ipa-server/ipa-gui/ipagui/templates/master.kid @@ -24,19 +24,41 @@ -
-