Skip to content

Commit 5f3915e

Browse files
committed
Linelinks use a kind of tabpanel
1 parent 5371635 commit 5f3915e

File tree

13 files changed

+160
-159
lines changed

13 files changed

+160
-159
lines changed

devel/manual/css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Generic values
4040
* Paper and review fields cannot follow that pattern
4141
* Paper and review fields also must not match JSON keys used for papers
4242
and reviews
43-
* `id^=t-` defines the page type; it is only set on the `<body>` element
43+
* `id^=m-` defines the page type; it is only set on the `<body>` element
4444
* `id^=p-` is for page-level elements
4545
* `#p-tracker` (optional)
4646
* `#p-page`

scripts/script.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,12 +4699,19 @@ push_history_state.ever = false;
46994699
// line links
47004700

47014701
handle_ui.on("lla", function () {
4702-
var e = this.closest(".linelink"),
4703-
f = e.closest(".linelinks");
4704-
$(f).find(".linelink").removeClass("active");
4705-
addClass(e, "active");
4706-
$(e).trigger($.Event("foldtoggle", {detail: {open: true}}));
4707-
focus_within(e, ".lld *");
4702+
const ll = this.closest(".linelink"),
4703+
lls = ll.closest(".linelinks"),
4704+
lla = lls.querySelector(".linelink.active");
4705+
if (lla) {
4706+
lla.querySelector(".lld").hidden = true;
4707+
lla.querySelector("[aria-selected]").ariaSelected = "false";
4708+
removeClass(lla, "active");
4709+
}
4710+
ll.querySelector(".lld").hidden = false;
4711+
this.ariaSelected = "true";
4712+
addClass(ll, "active");
4713+
$(ll).trigger($.Event("foldtoggle", {detail: {open: true}}));
4714+
focus_within(ll, ".lld *");
47084715
});
47094716

47104717
$(function () {
@@ -13911,8 +13918,9 @@ handle_ui.on("js-tag-list-action", function (evt) {
1391113918
});
1391213919

1391313920
handle_ui.on("js-assign-list-action", function (evt) {
13914-
if (evt.type === "foldtoggle" && !evt.detail.open)
13921+
if (evt.type === "foldtoggle" && !evt.detail.open) {
1391513922
return;
13923+
}
1391613924
var self = this;
1391713925
removeClass(self, "js-assign-list-action");
1391813926
$(self).find("select[name=markpc]").each(populate_pcselector);

src/conference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5206,7 +5206,7 @@ function print_body_entry($qreq, $title, $id, $extra = []) {
52065206
$user = $qreq->user();
52075207
echo "<body";
52085208
if ($id) {
5209-
echo ' id="t-', $id, '"';
5209+
echo ' id="m-', $id, '"';
52105210
}
52115211
$class = $extra["body_class"] ?? "";
52125212
$this->_mx_auto = strpos($class, "error") !== false;

src/contactlist.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,23 +1073,25 @@ function footer($ncol, $hascolors) {
10731073
if ($this->count === 0) {
10741074
return "";
10751075
}
1076-
$lllgroups = [];
1076+
$plfts = [];
10771077

10781078
// Begin linelinks
1079+
$plft = PaperList::make_tab("get", "Download");
10791080
$types = ["nameemail" => "Names and emails"];
10801081
if ($this->user->privChair) {
10811082
$types["pcinfo"] = "PC info";
10821083
}
1083-
$lllgroups[] = ["", "Download",
1084-
Ht::select("getfn", $types, null, ["class" => "want-focus"])
1085-
. Ht::submit("fn", "Go", ["value" => "get", "class" => "uic js-submit-list ml-2 can-submit-all"])];
1084+
$plft->content = Ht::select("getfn", $types, null, ["class" => "want-focus"])
1085+
. Ht::submit("fn", "Go", ["value" => "get", "class" => "uic js-submit-list ml-2 can-submit-all"]);
1086+
$plfts[] = $plft;
10861087

10871088
if ($this->user->privChair) {
1088-
$lllgroups[] = ["", "Tag",
1089-
Ht::select("tagfn", ["a" => "Add", "d" => "Remove", "s" => "Define"], $this->qreq->tagfn)
1089+
$plft = PaperList::make_tab("tag", "Tag");
1090+
$plft->content =Ht::select("tagfn", ["a" => "Add", "d" => "Remove", "s" => "Define"], $this->qreq->tagfn)
10901091
. ' &nbsp;tag(s) &nbsp;'
10911092
. Ht::entry("tag", $this->qreq->tag, ["size" => 15, "class" => "want-focus js-autosubmit", "data-submit-fn" => "tag"])
1092-
. Ht::submit("fn", "Go", ["value" => "tag", "class" => "uic js-submit-list ml-2"])];
1093+
. Ht::submit("fn", "Go", ["value" => "tag", "class" => "uic js-submit-list ml-2"]);
1094+
$plfts[] = $plft;
10931095

10941096
$mods = [
10951097
"disableaccount" => "Disable",
@@ -1106,15 +1108,16 @@ function footer($ncol, $hascolors) {
11061108
if ($this->has("pc")) {
11071109
$mods["remove_pc"] = "Remove from PC";
11081110
}
1109-
$lllgroups[] = ["", "Modify",
1110-
Ht::select("modifyfn", $mods, null, ["class" => "want-focus"])
1111-
. Ht::submit("fn", "Go", ["value" => "modify", "class" => "uic js-submit-list ml-2"])];
1111+
$plft = PaperList::make_tab("modify", "Modify");
1112+
$plft->content = Ht::select("modifyfn", $mods, null, ["class" => "want-focus"])
1113+
. Ht::submit("fn", "Go", ["value" => "modify", "class" => "uic js-submit-list ml-2"]);
1114+
$plfts[] = $plft;
11121115
}
11131116

11141117
return " <tfoot class=\"pltable-tfoot" . ($hascolors ? " pltable-colored" : "")
11151118
. "\">" . PaperList::render_footer_row(1, $ncol - 1,
11161119
"<b>Select people</b> (or <a class=\"ui js-select-all\" href=\"\">select all {$this->count}</a>), then&nbsp; ",
1117-
$lllgroups)
1120+
$plfts)
11181121
. "</tfoot>\n";
11191122
}
11201123

src/listactions/la_assign.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ class Assign_ListAction extends ListAction {
66
function allow(Contact $user, Qrequest $qreq) {
77
return $user->privChair && $qreq->page() !== "reviewprefs";
88
}
9-
static function render(PaperList $pl, Qrequest $qreq) {
10-
return [
11-
Ht::select("assignfn", [
9+
static function render(PaperList $pl, Qrequest $qreq, $plft) {
10+
$plft->tab_attr["class"] = "has-fold foldc ui-fold js-assign-list-action";
11+
return Ht::select("assignfn", [
1212
"auto" => "Automatic assignments",
1313
"zzz1" => null,
1414
"conflict" => "Conflict",
@@ -24,9 +24,7 @@ static function render(PaperList $pl, Qrequest $qreq) {
2424
], $qreq->assignfn, ["class" => "want-focus js-submit-action-info-assign"])
2525
. '<span class="fx"> &nbsp;<span class="js-assign-for">for</span> &nbsp;'
2626
. Ht::select("markpc", [], 0, ["data-pcselector-selected" => $qreq->markpc])
27-
. "</span>" . $pl->action_submit("assign"),
28-
["linelink-class" => "has-fold foldc ui-fold js-assign-list-action"]
29-
];
27+
. "</span>" . $pl->action_submit("assign");
3028
}
3129
function run(Contact $user, Qrequest $qreq, SearchSelection $ssel) {
3230
$mt = $qreq->assignfn;

src/listactions/la_decide.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ static function render(PaperList $pl, Qrequest $qreq) {
1111
foreach ($pl->conf->decision_set() as $dec) {
1212
$opts[$dec->id] = $dec->name_as(5);
1313
}
14-
return ["Set to &nbsp;"
15-
. Ht::select("decision", $opts, "", ["class" => "want-focus js-submit-action-info-decide"])
16-
. $pl->action_submit("decide")];
14+
return "Set to &nbsp;"
15+
. Ht::select("decision", $opts, "", ["class" => "want-focus js-submit-action-info-decide"])
16+
. $pl->action_submit("decide");
1717
}
1818
function run(Contact $user, Qrequest $qreq, SearchSelection $ssel) {
1919
$did = $qreq->decision;

src/listactions/la_get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Copyright (c) 2006-2024 Eddie Kohler; see LICENSE.
44

55
class Get_ListAction {
6-
static function render(PaperList $pl, Qrequest $qreq, ComponentSet $gex) {
6+
static function render(PaperList $pl, Qrequest $qreq, $plft, ComponentSet $gex) {
77
$sel_opt = ListAction::members_selector_options($gex, "get");
88
if (empty($sel_opt)) {
99
return null;

src/listactions/la_mail.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ function __construct(Conf $conf, $uf) {
1212
function allow(Contact $user, Qrequest $qreq) {
1313
return $user->is_manager() && $qreq->page() !== "reviewprefs";
1414
}
15-
static function render(PaperList $pl, Qrequest $qreq, ComponentSet $gex) {
15+
static function render(PaperList $pl, Qrequest $qreq, $plft, ComponentSet $gex) {
1616
$sel_opt = ListAction::members_selector_options($gex, "mail");
17-
if (!empty($sel_opt)) {
18-
return Ht::select("mailfn", $sel_opt, $qreq->mailfn,
19-
["class" => "want-focus js-submit-action-info-mail ignore-diff"])
20-
. $pl->action_submit("mail", ["class" => "can-submit-all", "formmethod" => "get"]);
21-
} else {
17+
if (empty($sel_opt)) {
2218
return null;
2319
}
20+
return Ht::select("mailfn", $sel_opt, $qreq->mailfn,
21+
["class" => "want-focus js-submit-action-info-mail ignore-diff"])
22+
. $pl->action_submit("mail", ["class" => "can-submit-all", "formmethod" => "get"]);
2423
}
2524
function run(Contact $user, Qrequest $qreq, SearchSelection $ssel) {
2625
$args = [];

src/listactions/la_revpref.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ function __construct($conf, $fj) {
1111
function allow(Contact $user, Qrequest $qreq) {
1212
return $user->isPC;
1313
}
14-
static function render_upload(PaperList $pl) {
15-
return ["<b>&nbsp;preference file:</b> &nbsp;"
16-
. "<input class=\"want-focus js-autosubmit\" type=\"file\" name=\"preffile\" accept=\"text/plain,text/csv\" size=\"20\" data-submit-fn=\"tryuploadpref\" />"
17-
. $pl->action_submit("tryuploadpref", ["class" => "can-submit-all"])];
14+
static function render_upload(PaperList $pl, Qrequest $qreq, $plft) {
15+
$plft->label_expansion = " preference file:";
16+
return "<input class=\"want-focus js-autosubmit\" type=\"file\" name=\"preffile\" accept=\"text/plain,text/csv\" size=\"20\" data-submit-fn=\"tryuploadpref\" />"
17+
. $pl->action_submit("tryuploadpref", ["class" => "can-submit-all"]);
1818
}
19-
static function render_set(PaperList $pl) {
20-
return ["<b> preferences:</b> &nbsp;"
21-
. Ht::entry("pref", "", ["class" => "want-focus js-autosubmit", "size" => 4, "data-submit-fn" => "setpref"])
22-
. $pl->action_submit("setpref")];
19+
static function render_set(PaperList $pl, Qrequest $qreq, $plft) {
20+
$plft->label_expansion = " preferences:";
21+
return Ht::entry("pref", "", ["class" => "want-focus js-autosubmit", "size" => 4, "data-submit-fn" => "setpref"])
22+
. $pl->action_submit("setpref");
2323
}
2424
/** @param ?string $reviewer
2525
* @return ?Contact */

src/listactions/la_tag.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function __construct(Conf $conf, $uf) {
1212
}
1313
}
1414

15-
static function render(PaperList $pl, Qrequest $qreq) {
15+
static function render(PaperList $pl, Qrequest $qreq, $plft) {
1616
// tagtype cell
1717
$tagopt = ["a" => "Add", "d" => "Remove", "s" => "Define", "xxxa" => null, "ao" => "Add to order", "aos" => "Add to gapless order", "so" => "Define order", "sos" => "Define gapless order", "sor" => "Define random order"];
1818
$tagextra = ["class" => "js-submit-action-info-tag"];
@@ -43,8 +43,8 @@ static function render(PaperList $pl, Qrequest $qreq) {
4343
. "</div></div>";
4444
}
4545

46-
return [Ht::select("tagfn", $tagopt, $qreq->tagfn, $tagextra) . " &nbsp;",
47-
["linelink-class" => "has-fold fold98c fold99c ui-fold js-tag-list-action", "content" => $t]];
46+
$plft->tab_attr["class"] = "has-fold fold98c fold99c ui-fold js-tag-list-action";
47+
$plft->content = Ht::select("tagfn", $tagopt, $qreq->tagfn, $tagextra) . " " . $t;
4848
}
4949
function allow(Contact $user, Qrequest $qreq) {
5050
return $user->can_edit_some_tag();

0 commit comments

Comments
 (0)