Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions modules/clas/src/main/ui/DashboardUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ final class DashboardUi(helpers: Helpers, ui: ClasUi)(using NetDomain):
val doubleHelp: Tag =
div(cls := "clas-show__bulk__helps form-group")(
div(cls := "clas-show__bulk__help")(
strong("Important! Make sure you understand how this works:"),
strong(trans.clas.bulkActionDisclaimer()),
p(
"Edit the list above to keep some students selected for a bulk action.",
trans.clas.bulkActionHelpLine1(),
br,
"All the students remaining in the list will be affected by the action.",
trans.clas.bulkActionHelpLine2(),
br,
"The students you removed from the list will remain in the class, unchanged."
trans.clas.bulkActionHelpLine3()
)
),
div(cls := "clas-show__bulk__help")(
Expand All @@ -145,50 +145,55 @@ final class DashboardUi(helpers: Helpers, ui: ClasUi)(using NetDomain):
TeacherPage(c, all.filter(_.student.isActive), "students")():
div(cls := "clas-show__body clas-show__bulk")(
postForm(cls := "form3", action := routes.Clas.bulkActionsPost(c.id))(
form3.fieldset("Active students", toggle = true.some)(cls := "box-pad")(
form3.fieldset(trans.clas.activeStudents.txt(), toggle = true.some)(cls := "box-pad")(
form3.group(
form("activeStudents"),
frag("Active students")
frag(trans.clas.activeStudents())
)(form3.textarea(_)(rows := 12)),
doubleHelp,
div(cls := "form-group")(
form3.submit("Archive", icon = none, ("action", "archive").some)(
form3.submit(trans.clas.archiveAction.txt(), icon = none, ("action", "archive").some)(
cls := "yes-no-confirm button-blue button-empty"
),
br,
classButtons
)
),
form3.fieldset("Archived students", toggle = all.exists(_.student.isArchived).some)(
form3.fieldset(trans.clas.archivedStudents.txt(), toggle = all.exists(_.student.isArchived).some)(
cls := "box-pad"
)(
form3.group(
form("archivedStudents"),
frag("Archived students")
frag(trans.clas.archivedStudents())
)(form3.textarea(_)(rows := 7)),
doubleHelp(
"BEWARE: removing a student with managed account will close the account permanently."
trans.clas.removeActionWarning()
),
div(cls := "form-group")(
form3.submit("Restore", icon = none, ("action", "restore").some)(
form3.submit(trans.clas.restoreAction.txt(), icon = none, ("action", "restore").some)(
cls := "yes-no-confirm button-blue button-empty"
),
form3.submit("Remove", icon = Icon.Trash.some, ("action", "remove").some)(
cls := "yes-no-confirm button-red button-empty"
)
form3
.submit(trans.clas.removeAction.txt(), icon = Icon.Trash.some, ("action", "remove").some)(
cls := "yes-no-confirm button-red button-empty"
)
)
),
form3.fieldset("Pending invites", toggle = form("invites").value.exists(_.nonEmpty).some)(
form3.fieldset(
trans.clas.pendingInvites.txt(),
toggle = form("invites").value.exists(_.nonEmpty).some
)(
cls := "box-pad"
)(
form3.group(
form("invites"),
frag("Invites")
frag(trans.clas.pendingInvites())
)(form3.textarea(_)(rows := 7)),
div(cls := "form-group")(
form3.submit("Delete", icon = Icon.Trash.some, ("action", "delete-invites").some)(
cls := "yes-no-confirm button-red button-empty"
)
form3
.submit(trans.site.delete.txt(), icon = Icon.Trash.some, ("action", "delete-invites").some)(
cls := "yes-no-confirm button-red button-empty"
)
)
)
),
Expand Down Expand Up @@ -219,7 +224,7 @@ final class DashboardUi(helpers: Helpers, ui: ClasUi)(using NetDomain):
href := routes.Clas.bulkActions(c.id),
cls := "button button-clas text",
dataIcon := Icon.Tools
)("Bulk actions"),
)(trans.clas.bulkActions()),
postForm(action := routes.Clas.loginCreate(c.id))(
submitButton(cls := "button button-clas text", dataIcon := Icon.Group)(
trans.clas.quickLoginCodes()
Expand Down
13 changes: 13 additions & 0 deletions modules/coreI18n/src/main/key.scala
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,19 @@ object I18nKey:
val `quickLoginCodesDesc1`: I18nKey = "class:quickLoginCodesDesc1"
val `quickLoginCodesDesc2`: I18nKey = "class:quickLoginCodesDesc2"
val `expirationInMomentFromNow`: I18nKey = "class:expirationInMomentFromNow"
val `bulkActions`: I18nKey = "class:bulkActions"
val `activeStudents`: I18nKey = "class:activeStudents"
val `archivedStudents`: I18nKey = "class:archivedStudents"
val `pendingInvites`: I18nKey = "class:pendingInvites"
val `archiveAction`: I18nKey = "class:archiveAction"
val `restoreAction`: I18nKey = "class:restoreAction"
val `removeAction`: I18nKey = "class:removeAction"
val `bulkActionDisclaimer`: I18nKey = "class:bulkActionDisclaimer"
val `bulkActionHelpLine1`: I18nKey = "class:bulkActionHelpLine1"
val `bulkActionHelpLine2`: I18nKey = "class:bulkActionHelpLine2"
val `bulkActionHelpLine3`: I18nKey = "class:bulkActionHelpLine3"
val `bulkActionInstruction`: I18nKey = "class:bulkActionInstruction"
val `removeActionWarning`: I18nKey = "class:removeActionWarning"
val `nbPendingInvitations`: I18nKey = "class:nbPendingInvitations"
val `nbTeachers`: I18nKey = "class:nbTeachers"
val `nbStudents`: I18nKey = "class:nbStudents"
Expand Down
13 changes: 13 additions & 0 deletions translation/source/class.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,17 @@ It will display a horizontal line.</string>
<string name="quickLoginCodesDesc1" comment="String is a URL">Use these codes on %s to log your students into Lichess.</string>
<string name="quickLoginCodesDesc2">When the codes expire, your students will remain logged in, until they manually log out.</string>
<string name="expirationInMomentFromNow" comment="String is the translation of, for example, 'in 2 hours'">Expiration %s</string>
<string name="bulkActions" comment="Text of a button that gives access to actions on a list of students">Bulk actions</string>
<string name="activeStudents" comment="List of students who can enter the class">Active students</string>
<string name="archivedStudents" comment="List of students who cannot enter the class but are still managed by the teacher">Archived students</string>
<string name="pendingInvites" comment="List of invitations to join the class waiting for an anwser">Pending invites</string>
<string name="archiveAction" comment="Action to move selected students to the archived student list">Archive</string>
<string name="restoreAction" comment="Action to move selected students back to the active student list">Restore</string>
<string name="removeAction" comment="Action to completely remove selected students">Remove</string>
<string name="bulkActionDisclaimer">Important! Make sure you understand how this works:</string>
<string name="bulkActionHelpLine1">Edit the list above to keep some students selected for a bulk action.</string>
<string name="bulkActionHelpLine2">All the students remaining in the list will be affected by the action.</string>
<string name="bulkActionHelpLine3">The students you removed from the list will remain in the class, unchanged.</string>
<string name="bulkActionInstruction">Choose the action to perform on the students listed above:</string>
<string name="removeActionWarning">BEWARE: removing a student with managed account will close the account permanently.</string>
</resources>
26 changes: 26 additions & 0 deletions ui/@types/lichess/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ interface I18n {
yourXRatingIsTooFarFromY: I18nFormat;
};
class: {
/** Active students */
activeStudents: string;
/** Add Lichess usernames to invite them as teachers. One per line. */
addLichessUsernames: string;
/** Add student */
Expand All @@ -449,6 +451,22 @@ interface I18n {
anInvitationHasBeenSentToX: I18nFormat;
/** Apply to be a Lichess Teacher */
applyToBeLichessTeacher: string;
/** Archive */
archiveAction: string;
/** Archived students */
archivedStudents: string;
/** Important! Make sure you understand how this works: */
bulkActionDisclaimer: string;
/** Edit the list above to keep some students selected for a bulk action. */
bulkActionHelpLine1: string;
/** All the students remaining in the list will be affected by the action. */
bulkActionHelpLine2: string;
/** The students you removed from the list will remain in the class, unchanged. */
bulkActionHelpLine3: string;
/** Choose the action to perform on the students listed above: */
bulkActionInstruction: string;
/** Bulk actions */
bulkActions: string;
/** Class description */
classDescription: string;
/** Class name */
Expand Down Expand Up @@ -577,6 +595,8 @@ interface I18n {
passwordX: I18nFormat;
/** Pending */
pending: string;
/** Pending invites */
pendingInvites: string;
/** Private. Will never be shown outside the class. Helps you remember who the student is. */
privateWillNeverBeShown: string;
/** Progress */
Expand All @@ -603,6 +623,10 @@ interface I18n {
releaseDesc2: string;
/** Graduate the account so the student can manage it autonomously. */
releaseTheAccount: string;
/** Remove */
removeAction: string;
/** BEWARE: removing a student with managed account will close the account permanently. */
removeActionWarning: string;
/** Removed by %s */
removedByX: I18nFormat;
/** Removed */
Expand All @@ -613,6 +637,8 @@ interface I18n {
reopen: string;
/** Reset password */
resetPassword: string;
/** Restore */
restoreAction: string;
/** Send a message to all students. */
sendAMessage: string;
/** Student: %1$s */
Expand Down
Loading