Skip to content

Commit

Permalink
Improve styling of PC conflict selectors.
Browse files Browse the repository at this point in the history
Firefox floats behave different.
  • Loading branch information
kohler committed Nov 30, 2023
1 parent 9ed6452 commit db4240c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
52 changes: 23 additions & 29 deletions src/options/o_pcconflicts.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,73 +243,67 @@ function print_web_edit(PaperTable $pt, $ov, $reqov) {
foreach ($pcm as $id => $p) {
$pct = $ctmaps[0][$p->contactId] ?? 0;
$ct = $ctmaps[1][$p->contactId] ?? 0;

$name = $pt->user->reviewer_html_for($p);
$potconf = null;
if ($ov->prow->paperId && $pct < CONFLICT_AUTHOR) {
$potconf = $ov->prow->potential_conflict_html($p, $pct <= 0);
}

$label = $pt->user->reviewer_html_for($p);
if ($p->affiliation) {
$label .= '<span class="pcconfaff">' . htmlspecialchars(UnicodeHelper::utf8_abbreviate($p->affiliation, 60)) . '</span>';
}

echo '<li class="ctelt"><div class="ctelti';
if (!$this->selectors) {
echo ' checki';
}
echo ' clearfix';
if (Conflict::is_conflicted($pct)) {
echo ' tag-bold';
}
echo '<li class="ctelt"><div class="ctelti clearfix',
$this->selectors ? "" : " checki",
Conflict::is_conflicted($pct) ? " tag-bold" : "";
if ($potconf) {
echo ' need-tooltip" data-tooltip-class="gray" data-tooltip="', str_replace('"', '&quot;', PaperInfo::potential_conflict_tooltip_html($potconf));
}
echo '"><label>';
echo '">';

$js = ["id" => "pcconf:{$id}"];
$hidden = "";
if (Conflict::is_author($pct)
|| (!$admin && Conflict::is_pinned($pct))) {
if ($this->selectors) {
echo '<span class="pcconf-editselector"><strong>';
if (Conflict::is_author($pct)) {
echo "Author";
$confx = "<strong>Author</strong>";
} else if (Conflict::is_conflicted($pct)) {
echo "Conflict"; // XXX conflict type?
$confx = "<strong>Conflict</strong>"; // XXX conflict type?
} else {
echo "No conflict";
$confx = "<strong>No conflict</strong>";
}
echo '</strong></span>';
} else {
echo '<span class="checkc">', Ht::checkbox(null, 1, Conflict::is_conflicted($pct), ["disabled" => true]), '</span>';
$confx = Ht::checkbox(null, 1, Conflict::is_conflicted($pct), ["disabled" => true]);
}
echo Ht::hidden("pcconf:{$id}", $pct, ["class" => "conflict-entry", "disabled" => true]);
$hidden = Ht::hidden("pcconf:{$id}", $pct, ["class" => "conflict-entry", "disabled" => true]);
} else if ($this->selectors) {
$xctypes = $ctypes;
if (!isset($xctypes[$ct])) {
$xctypes[$ct] = $confset->unparse_selector_text($ct);
}
$js["class"] = "conflict-entry";
$js["data-default-value"] = $pct;
echo '<span class="pcconf-editselector">',
Ht::select("pcconf:{$id}", $xctypes, $ct, $js),
'</span>';
$confx = Ht::select("pcconf:{$id}", $xctypes, $ct, $js);
} else {
$js["data-default-checked"] = Conflict::is_conflicted($pct);
$js["data-range-type"] = "pcconf";
$js["class"] = "uic js-range-click conflict-entry";
$checked = Conflict::is_conflicted($ct);
echo '<span class="checkc">',
Ht::checkbox("pcconf:{$id}", $checked ? $ct : Conflict::GENERAL, $checked, $js),
'</span>';
$confx = Ht::checkbox("pcconf:{$id}", $checked ? $ct : Conflict::GENERAL, $checked, $js);
$hidden = Ht::hidden("has_pcconf:{$id}", 1);
}

echo $label, "</label>", $hidden;
if ($this->selectors) {
echo "<label for=\"pcconf:{$id}\">", $name, "</label>",
'<span class="pcconf-editselector">', $confx, '</span>';
} else {
echo "<label><span class=\"checkc\">", $confx, "</span>", $name, "</label>";
}
if ($p->affiliation) {
echo '<span class="pcconfaff">' . htmlspecialchars(UnicodeHelper::utf8_abbreviate($p->affiliation, 60)) . '</span>';
}
if ($potconf) {
echo $potconf->announce;
}
echo "</div></li>";
echo $hidden, "</div></li>";
}

if (empty($pcm)) { // only in settings mode
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2713,7 +2713,7 @@ pre.email {

.pcconf-editselector {
float: right;
padding: 1px 2px 0 8px;
padding: 0 2px 4px 8px;
font-size: smaller;
white-space: nowrap;
display: block;
Expand Down

0 comments on commit db4240c

Please sign in to comment.