Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 27, 2024
2 parents 7aa1f46 + 240a9f8 commit 34a856f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/forum/src/main/ForumForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final private[forum] class ForumForm(
single("categ" -> nonEmptyText.into[ForumCategId])

private def userTextMapping(inOwnTeam: Boolean, previousText: Option[String] = None)(using me: Me) =
cleanText(minLength = 3, 10_000)
cleanText(minLength = 3, 15_000)
.verifying(
"You have reached the daily maximum for links in forum posts.",
t => inOwnTeam || promotion.test(me, t, previousText)
Expand Down
6 changes: 4 additions & 2 deletions modules/relay/src/main/ui/RelayTourUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ final class RelayTourUi(helpers: Helpers, ui: RelayUi):
a(href := routes.RelayTour.calendar, cls := menu.activeO("calendar"))(trans.site.tournamentCalendar()),
a(href := routes.RelayTour.help, cls := menu.activeO("help"))(trans.broadcast.aboutBroadcasts()),
div(cls := "sep"),
a(cls := menu.active("players"), href := routes.Fide.index(1))("FIDE players"),
a(cls := menu.active("federations"), href := routes.Fide.federations(1))("FIDE federations")
a(cls := menu.active("players"), href := routes.Fide.index(1))(trans.broadcast.fidePlayers()),
a(cls := menu.active("federations"), href := routes.Fide.federations(1))(
trans.broadcast.fideFederations()
)
)

private object card:
Expand Down
19 changes: 16 additions & 3 deletions ui/challenge/css/_challenge.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#challenge-app {
@extend %box-radius-left, %dropdown-shadow;
overflow: hidden;
width: 270px;
width: 300px;
text-align: center;

.empty {
Expand Down Expand Up @@ -32,7 +32,7 @@

.buttons {
@extend %flex-between-nowrap;

align-items: stretch;
@media (hover: hover) {
display: none;
}
Expand All @@ -47,7 +47,17 @@
width: 33%;
}

a.view {
font-size: 1.5rem;
color: $c-primary;
&:hover {
background: $c-primary;
color: $c-over;
}
}

button {
border-radius: 0;
cursor: pointer;
color: $c-good;
width: 100%;
Expand Down Expand Up @@ -88,7 +98,8 @@
}
}

button::before {
button::before,
a.view::before {
line-height: 3rem;
}

Expand Down Expand Up @@ -126,9 +137,11 @@
display: block;
font-weight: bold;
margin-bottom: 0.1em;

.user-link {
margin-inline-start: -5px;
}

signal {
margin-inline-start: 5px;
}
Expand Down
1 change: 1 addition & 0 deletions ui/challenge/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface Challenge {
status: ChallengeStatus;
challenger?: ChallengeUser;
destUser?: ChallengeUser;
rules?: unknown[];
variant: Variant;
initialFen: FEN;
rated: boolean;
Expand Down
12 changes: 10 additions & 2 deletions ui/challenge/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function challenge(ctrl: ChallengeCtrl, dir: ChallengeDirection) {
}

function inButtons(ctrl: ChallengeCtrl, c: Challenge): VNode[] {
return [
const viewInsteadOfAccept = (c.rules?.length ?? 0) > 0;
const acceptElement = () =>
h('form', { attrs: { method: 'post', action: `/challenge/${c.id}/accept` } }, [
h('button.button.accept', {
attrs: {
Expand All @@ -85,7 +86,14 @@ function inButtons(ctrl: ChallengeCtrl, c: Challenge): VNode[] {
},
hook: onClick(ctrl.onRedirect),
}),
]),
]);
const viewElement = () =>
h('a.view', {
attrs: { 'data-icon': licon.Eye, href: '/' + c.id, title: ctrl.trans('viewInFullSize') },
});

return [
viewInsteadOfAccept ? viewElement() : acceptElement(),
h('button.button.decline', {
attrs: { type: 'submit', 'data-icon': licon.X, title: ctrl.trans('decline') },
hook: onClick(() => ctrl.decline(c.id, 'generic')),
Expand Down

0 comments on commit 34a856f

Please sign in to comment.