Skip to content

Commit

Permalink
#75 fixed: "Clean user grid in the settings page"
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatov committed Jul 15, 2011
1 parent 6ff3314 commit 9dd47d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
22 changes: 1 addition & 21 deletions src/main/scala/scala/tools/colladoc/model/mapper/User.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,13 @@ class User extends ProtoUser[User] with OneToMany[Long, User] {

/** Grid entry. */
def toGridRow = {
def ajaxField(field: MappedString[User], attrs: (String, String)*) = {
SHtml.ajaxText(field,
ColladocConfirm("Update user details?"),
(t: String) => {
field(t)
validate match {
case Nil =>
S.notice("Data successfully saved")
save()
case n =>
S.error(n)
}
Noop},
(attrs: Seq[ElemAttr]) :_*
).toString
}

val link = <a target="template" href={"/profile/" + urlEncode(userName)}>{userName}</a>

val row =
<row id={id.toString}>
<cell>{ajaxField(userName)}</cell>
<cell>{ajaxField(email)}</cell>
<cell>{ajaxField(openId, ("class", "openid_input"))}</cell>
<cell>{link.toString}</cell>
<cell><row:superuser /></cell>
<cell><row:delete /></cell>
<cell>{link.toString}</cell>
</row>

bind("row", row,
Expand Down
11 changes: 4 additions & 7 deletions src/main/webapp/scripts/cosettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ $(document).ready(function() {
$("#userlist").jqGrid({
url:'grid/users?',
datatype: "xml",
colNames:['Username', 'Email', 'OpenID', 'Superuser', '', 'Profile'],
colNames:['Username', 'Superuser', ''],
colModel:[
{name:'name',index:'name'},
{name:'email',index:'email'},
{name:'openid',index:'openid', width:350},
{name:'superuser',index:'superuser', width: 60},
{name:'delete', index:'delete', width: 18},
{name:'profile', index:'profile', width:100}
{name: 'profile', index: 'profile'},
{name: 'superuser', index: 'superuser', width: 60},
{name: 'delete', index: 'delete', width: 18}
],
rowList:[5,10,20,30],
pager: '#userpager',
Expand Down

0 comments on commit 9dd47d1

Please sign in to comment.