summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-09-06 11:09:12 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-09-06 11:09:12 -0700
commit2adeed3029bb223ea32c77f31da28bfe3dadcd3e (patch)
tree813b4bab1b29046f24226d5a75ebd5d1b4eb294d
parent268dd829df41199c23b9b740bbc9bad2164b22d6 (diff)
downloadfreeipa-2adeed3029bb223ea32c77f31da28bfe3dadcd3e.tar.gz
freeipa-2adeed3029bb223ea32c77f31da28bfe3dadcd3e.tar.xz
freeipa-2adeed3029bb223ea32c77f31da28bfe3dadcd3e.zip
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).
-rw-r--r--ipa-server/ipa-gui/ipagui/controllers.py8
-rw-r--r--ipa-server/ipa-gui/ipagui/forms/user.py5
-rw-r--r--ipa-server/ipa-gui/ipagui/helpers/userhelper.py6
-rw-r--r--ipa-server/ipa-gui/ipagui/static/css/style.css23
-rw-r--r--ipa-server/ipa-gui/ipagui/templates/master.kid36
-rw-r--r--ipa-server/ipa-gui/ipagui/templates/usernewform.kid9
-rw-r--r--ipa-server/ipa-gui/ipagui/templates/usershow.kid2
7 files changed, 71 insertions, 18 deletions
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 @@
</span>
</div>
- <div id="page">
- <div id="header">
+ <div id="header">
+ <div id="logo">
+ <a href="${tg.url('/')}"><img
+ src="${tg.url('/static/images/logo.png')}"
+ border="0"
+ /></a>
+ </div>
+ <div id="headerinfo">
<div id="login">
Logged in as: ace
</div>
- <div id="logo">
- <a href="${tg.url('/')}"><img
- src="${tg.url('/static/images/logo.png')}"
- border="0"
- /></a>
+ <div id="topsearch">
+ <form action="${tg.url('/topsearch')}" method="post">
+ <select name="searchtype">
+ <option>Users</option>
+ <option>Groups</option>
+ </select>
+ <input class="searchtext" id="topsearchbox" type="text"
+ name="searchvalue"
+ value="Type search terms here."
+ onfocus="clearsearch()" />
+ <input type="submit" value="Search"/>
+ </form>
+ <script type="text/javascript">
+ function clearsearch() {
+ topsearchbox = document.getElementById('topsearchbox');
+ topsearchbox.onfocus = null;
+ topsearchbox.value = "";
+ }
+ </script>
</div>
</div>
+ </div>
+ <div id="page">
<div id="nav"><!--
This used to have links. Keeping around in case we move them back...
--></div>
diff --git a/ipa-server/ipa-gui/ipagui/templates/usernewform.kid b/ipa-server/ipa-gui/ipagui/templates/usernewform.kid
index 5f21bde41..884483447 100644
--- a/ipa-server/ipa-gui/ipagui/templates/usernewform.kid
+++ b/ipa-server/ipa-gui/ipagui/templates/usernewform.kid
@@ -27,6 +27,9 @@
<span py:if="tg.errors.get('sn')" class="fielderror"
py:content="tg.errors.get('sn')" />
<script type="text/javascript">
+ var uid_suggest = ""
+ var mail_suggest = ""
+
function autofill(self) {
givenname = document.getElementById('form_givenname');
sn = document.getElementById('form_sn');
@@ -35,22 +38,24 @@
}
uid = document.getElementById('form_uid');
mail = document.getElementById('form_mail');
- if (uid.value == "") {
+ if ((uid.value == "") || (uid.value == uid_suggest)) {
new Ajax.Request('${tg.url('/suggest_uid')}', {
method: 'get',
parameters: {'givenname': givenname.value, 'sn': sn.value},
onSuccess: function(transport) {
uid.value = transport.responseText;
+ uid_suggest = uid.value;
new Effect.Highlight(uid);
}
});
}
- if (mail.value == "") {
+ if ((mail.value == "") || (mail.value == mail_suggest)) {
new Ajax.Request('${tg.url('/suggest_email')}', {
method: 'get',
parameters: {'givenname': givenname.value, 'sn': sn.value},
onSuccess: function(transport) {
mail.value = transport.responseText;
+ mail_suggest = mail.value;
new Effect.Highlight(mail);
}
});
diff --git a/ipa-server/ipa-gui/ipagui/templates/usershow.kid b/ipa-server/ipa-gui/ipagui/templates/usershow.kid
index b4ec46634..aff400c54 100644
--- a/ipa-server/ipa-gui/ipagui/templates/usershow.kid
+++ b/ipa-server/ipa-gui/ipagui/templates/usershow.kid
@@ -86,7 +86,7 @@ else:
<th>
<label class="fieldlabel" py:content="fields.nsAccountLock.label" />:
</th>
- <td>${user.get("nsAccountLock")}</td>
+ <td>${userhelper.account_status_display(user.get("nsAccountLock"))}</td>
</tr>
</table>