Skip to content

Commit

Permalink
QI.9v5kfj4: link from the Members Tab to the Person record
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark "Justin du Coeur" Waks committed Aug 9, 2020
1 parent 62dc687 commit 52f0b5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class InvitationTab(
table(cls:="table table-hover",
tbody(
for (member <- invitees.sortBy(_.person.displayName))
yield new PersonDisplay("warning", member, roleMap, customMap, std)
yield new PersonDisplay("warning", member, roleMap, customMap, std, page)
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MembersTab(
tbody(
for {
member <- members
display = new PersonDisplay("info", member, roleMap, customMap, page.std)
display = new PersonDisplay("info", member, roleMap, customMap, page.std, page)
_ = personDisplays() = { personDisplays.now :+ display }
}
yield display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import org.scalajs.dom.html
import org.querki.jquery._
import scalatags.JsDom.all._
import rx._

import org.querki.gadgets._
import querki.api.StandardThings
import querki.display.QuerkiUIUtils
import querki.globals._
import querki.pages.Page
import querki.util.ScalatagUtils

class PersonDisplay(
showCls:String,
val person:PersonInfo,
roleInfo:RoleInfo,
customInfo:RoleInfo,
std: StandardThings)(implicit val ecology: Ecology, ctx:Ctx.Owner)
std: StandardThings,
page: Page)(implicit val ecology: Ecology, ctx:Ctx.Owner)
extends Gadget[html.TableRow] with QuerkiUIUtils
{
val customDisplay = GadgetRef.of[html.Div]
Expand All @@ -43,20 +44,22 @@ class PersonDisplay(
}
}.children().click { evt:JQueryEventObject =>
// Don't let child clicks propagate to the row itself:
false
evt.stopImmediatePropagation()
}
}
}

val check = GadgetRef.of[html.Span]

def doRender() = {
val personUrl = page.PageManager.pageUrl(person.person.urlName.underlying)
tr(cls:=showCls,
cell <= td(
check <= span(visibility := "hidden", icon("ok")),
" ",
MSeq(
person.person.displayName,
a(href := personUrl,
person.person.displayName),
s" (${person.person.oid2.underlying}) -- ",
new RolesDisplay(person.roles, person.person.oid, roleInfo, customInfo, customDisplay, std)
),
Expand Down

0 comments on commit 52f0b5a

Please sign in to comment.