Skip to content

Commit bb93703

Browse files
authored
Merge branch 'master' into scroll-to-selected-chapter
2 parents f08d656 + 4420972 commit bb93703

File tree

244 files changed

+3236
-1715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+3236
-1715
lines changed

.envrc

Whitespace-only changes.

.gitattributes

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/lila text eol=lf
22
/ui/build text eol=lf
3-
public/lifat/nnue/*.nnue filter=lfs diff=lfs merge=lfs -text
4-
public/lifat/vosk/*.tar.gz filter=lfs diff=lfs merge=lfs -text
5-
public/lifat/bots/net/*.pb filter=lfs diff=lfs merge=lfs -text
6-
public/lifat/bots/book/*.bin filter=lfs diff=lfs merge=lfs -text
7-
public/lifat/bots/book/*.png filter=lfs diff=lfs merge=lfs -text
8-
public/lifat/background/gallery/*.webp filter=lfs diff=lfs merge=lfs -text
3+
/public/lifat/nnue/*.nnue filter=lfs diff=lfs merge=lfs -text
4+
/public/lifat/vosk/*.tar.gz filter=lfs diff=lfs merge=lfs -text
5+
/public/lifat/bots/net/*.pb filter=lfs diff=lfs merge=lfs -text
6+
/public/lifat/bots/book/*.bin filter=lfs diff=lfs merge=lfs -text
7+
/public/lifat/bots/book/*.png filter=lfs diff=lfs merge=lfs -text
8+
/public/lifat/background/gallery/*.webp filter=lfs diff=lfs merge=lfs -text

.github/workflows/lint.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,35 @@ on:
88
paths-ignore:
99
- 'translation/dest/**'
1010

11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
1116
jobs:
1217
lint:
1318
runs-on: ubuntu-latest
14-
permissions:
15-
actions: read
16-
contents: read
17-
security-events: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
script:
23+
- lint
24+
- check-format
1825
steps:
1926
- uses: actions/checkout@v5
2027
- uses: pnpm/action-setup@v4
21-
with:
22-
run_install: false
2328
- uses: actions/setup-node@v5
2429
with:
2530
node-version-file: .node-version
26-
cache: 'pnpm'
31+
cache: pnpm
32+
- run: pnpm install
33+
- run: pnpm run ${{ matrix.script }}
34+
35+
codeql:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v5
2739
- uses: github/codeql-action/init@v3
2840
with:
2941
languages: javascript
3042
- uses: github/codeql-action/analyze@v3
31-
- run: pnpm install
32-
- run: pnpm run lint
33-
- run: pnpm run check-format

.lfsconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# git-lfs repo config
2+
#
3+
# The presence of this file speeds up git-lfs.

app/UiEnv.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ object UiEnv
2424

2525
def netConfig = env.net
2626
def picfitUrl = env.memo.picfitUrl
27+
def imageGetOrigin = env.memo.imageGetOrigin
2728

2829
given lila.core.config.NetDomain = env.net.domain
2930
given (using ctx: PageContext): Option[Nonce] = ctx.nonce

app/controllers/Clas.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ final class Clas(env: Env, authC: Auth) extends LilaController(env):
8989
WithClassAny(id)(
9090
forTeacher = WithClass(id): clas =>
9191
for
92-
_ <- env.msg.twoFactorReminder(me)
92+
_ <- env.msg.systemMsg.twoFactorReminder(me)
9393
students <- env.clas.api.student.activeWithUsers(clas)
9494
_ = preloadStudentUsers(students)
9595
students <- env.clas.api.student.withPerfs(students)

app/controllers/Coach.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class Coach(env: Env) extends LilaController(env):
4646

4747
def edit = Secure(_.Coach) { ctx ?=> me ?=>
4848
FoundPage(api.findOrInit): c =>
49-
env.msg.twoFactorReminder(me).inject(views.coach.edit(c, CoachProfileForm.edit(c.coach)))
49+
env.msg.systemMsg.twoFactorReminder(me).inject(views.coach.edit(c, CoachProfileForm.edit(c.coach)))
5050
.map(_.hasPersonalData)
5151
}
5252

app/controllers/Dev.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ final class Dev(env: Env) extends LilaController(env):
3636
env.relay.proxyDomainRegex,
3737
env.relay.proxyHostPort,
3838
env.relay.proxyCredentials,
39-
env.report.api.modelSetting,
40-
env.report.api.promptSetting,
41-
env.ublog.automod.modelSetting,
42-
env.ublog.automod.promptSetting
39+
env.report.automod.imageModelSetting,
40+
env.report.automod.imagePromptSetting,
41+
env.report.api.commsModelSetting,
42+
env.report.api.commsPromptSetting,
43+
env.ublog.ublogAutomod.modelSetting,
44+
env.ublog.ublogAutomod.promptSetting
4345
)
4446

4547
def settings = Secure(_.Settings) { _ ?=> _ ?=>

app/controllers/ForumTopic.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,15 @@ final class ForumTopic(env: Env) extends LilaController(env) with ForumControlle
9898
val slug = problemReportSlug(me.userId)
9999
bindForm(env.forum.forms.diagnostic)(
100100
err => jsonFormError(err),
101-
text =>
101+
data =>
102102
env.forum.topicRepo
103103
.existsByTree(diagnosticId, slug)
104104
.flatMap:
105-
if _ then showDiagnostic(slug, text)
105+
if _ then showDiagnostic(slug, data.text, ~data.plaintext)
106106
else
107107
FoundPage(env.forum.categRepo.byId(diagnosticId)): categ =>
108-
views.forum.topic.makeDiagnostic(categ, forms.topic(false), anyCaptcha, text)
108+
views.forum.topic
109+
.makeDiagnostic(categ, forms.topic(false), anyCaptcha, data.text, ~data.plaintext)
109110
)
110111
}
111112

@@ -114,7 +115,7 @@ final class ForumTopic(env: Env) extends LilaController(env) with ForumControlle
114115
else env.forum.topicApi.removeTopic(diagnosticId, slug).inject(Redirect(routes.ForumCateg.index))
115116
}
116117

117-
private def showDiagnostic(slug: ForumTopicSlug, formText: String)(using Context, Me) =
118+
private def showDiagnostic(slug: ForumTopicSlug, formText: String, plaintext: Boolean)(using Context, Me) =
118119
FoundPage(topicApi.showLastPage(diagnosticId, slug)): (categ, topic, posts) =>
119120
val form = forms.postWithCaptcha(false).some
120-
views.forum.topic.show(categ, topic, posts, form, None, true, formText.some)
121+
views.forum.topic.show(categ, topic, posts, form, None, true, formText.some, plaintext = plaintext)

app/controllers/JsBot.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class JsBot(env: Env) extends LilaController(env):
5252
.validate[JsObject]
5353
.fold(
5454
err => BadRequest(jsonError(err.toString)),
55-
bot => env.jsBot.repo.putBot(BotJson(bot), me.userId).map(JsonOk)
55+
bot => JsonOk(env.jsBot.api.put(BotJson(bot)))
5656
)
5757
}
5858

0 commit comments

Comments
 (0)