Skip to content

Commit

Permalink
#103 closed: "Remove Superuser column from user list"
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatov committed Aug 3, 2011
1 parent 059d1fe commit f443ee6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/main/scala/scala/tools/colladoc/model/mapper/User.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,10 @@ class User extends ProtoUser[User] with OneToMany[Long, User] {
val row =
<row id={id.toString}>
<cell>{profileHyperlink.toString}</cell>
<cell><row:superuser /></cell>
<cell><row:banned /></cell>
</row>

bind("row", row,
"superuser" -> SHtml.ajaxCheckbox(
superUser, bool => {
superUser(bool)
save
Noop
}).toString,
"banned" -> SHtml.ajaxCheckbox(
banned, bool => {
banned(bool)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/scala/tools/colladoc/page/Profile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Profile(rootPack: Package) extends scala.tools.colladoc.page.Template(root
<div id="account_admin_tab">
<profile:change_password />
<profile:delete_profile />
<profile:superuser />
</div>
<div id="comments_tab">
<profile:comments />
Expand Down
14 changes: 14 additions & 0 deletions src/main/scala/scala/tools/colladoc/snippet/ProfileOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ class ProfileOps {
NodeSeq.Empty
}

def superuser(user: User) = {
<div id="superuser_wrapper">
<label for="superuser">Superuser</label>
{
SHtml.ajaxCheckbox(
user.superUser, bool => {
user.superUser(bool).save
Noop
}, ("id", "superuser"))
}
</div>
}

def body(xhtml: NodeSeq): NodeSeq = {
val user = getUser

Expand Down Expand Up @@ -265,6 +278,7 @@ class ProfileOps {
"form" -> { if (!public_?) userForm(user) else publicProfile(user) },
"change_password" -> { if (!public_?) changePasswordForm(user) else NodeSeq.Empty },
"delete_profile" -> { if (!public_?) deleteProfile(user) else NodeSeq.Empty },
"superuser" -> { if (User.validSuperUser_?) superuser(user) else NodeSeq.Empty },
"discussion_comments" -> { if (User.loggedIn_?) discussionComments else NodeSeq.Empty },
"fullname" -> Text(fullname),
"comments" -> comments
Expand Down
8 changes: 8 additions & 0 deletions src/main/webapp/coprofile.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,12 @@

#recover_account > a {
font-weight: bold;
}

#superuser_wrapper {
margin-top: 8px;
}

#superuser_wrapper > label {
font-weight: bold;
}
3 changes: 1 addition & 2 deletions src/main/webapp/scripts/cosettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ $(document).ready(function() {
$("#userlist").jqGrid({
url:'grid/users?',
datatype: "xml",
colNames:['Username', 'Superuser', 'Banned'],
colNames:['Username', 'Banned'],
colModel:[
{name: 'profile', index: 'profile'},
{name: 'superuser', index: 'superuser', width: 60},
{name: 'banned', index: 'banned', width: 60}
],
rowList:[5,10,20,30],
Expand Down

0 comments on commit f443ee6

Please sign in to comment.