Skip to content

Commit 8df1dd4

Browse files
authored
Merge pull request #3787 from TIM-JYU/feature-tableform-useradd-simple
Feature tableform useradd simple
2 parents b5d81a7 + c0b122b commit 8df1dd4

File tree

10 files changed

+546
-26
lines changed

10 files changed

+546
-26
lines changed

timApp/defaultconfig.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,3 +591,58 @@
591591
"""
592592
Maximum amount of memory that can be used by a single LaTeX process to typeset PDFs.
593593
"""
594+
595+
# Group addition settings
596+
597+
GROUPS_MISSING_USER_CREATE_ALLOW = False
598+
"""
599+
If True, yet non-existing users can be added to groups.
600+
In that case, a new user account is created with the email address of the user.
601+
"""
602+
603+
GROUPS_EXISTING_USER_ADD_NOTIFY_EXISTING_HEAD = (
604+
"TIM: You’ve Been Added to '{{group_name}}'"
605+
)
606+
"""
607+
When notifying existing users about being added to the group,
608+
this will be the subject of the email.
609+
"""
610+
GROUPS_EXISTING_USER_ADD_NOTIFY_EXISTING_BODY = """
611+
Hi!
612+
613+
You’ve been added to the TIM group '{{group_name}}'.
614+
As a member, you now have access to all group resources available at <{{host}}>.
615+
616+
If you have any questions, please contact {{support_contact}}.
617+
"""
618+
"""
619+
When notifying existing users about being added to the group,
620+
this will be the body of the email.
621+
"""
622+
623+
GROUPS_MISSING_USER_ADD_NOTIFY_HEAD = (
624+
"TIM: You have been added to group '{{group_name}}' – Complete Your Sign-Up"
625+
)
626+
"""
627+
When notifying new users about being added to the group,
628+
this will be the subject of the email.
629+
"""
630+
GROUPS_MISSING_USER_ADD_NOTIFY_BODY = """
631+
Hi!
632+
633+
You’ve been added to the TIM group '{{group_name}}' using this email address.
634+
An account has been created for you, but a password was not set during the process.
635+
636+
To complete your sign-up and access your account:
637+
1. Visit <{{host}}> and click Log in on the top of the page.
638+
2. Use email login with this email and use the "Forgot password" option to set your password.
639+
640+
Once your password is set, you’ll have full access to the group’s resources.
641+
642+
If you do not recognize this email, please ignore it.
643+
If you have any questions or need assistance, feel free to contact {{support_contact}}.
644+
"""
645+
"""
646+
When notifying new users about being added to the group,
647+
this will be the body of the email.
648+
"""

timApp/i18n/messages.fi.xlf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10505,6 +10505,80 @@ Ole hyvä ja luo ensin kirjautumiskoodit.</target>
1050510505
<context context-type="linenumber">41</context>
1050610506
</context-group>
1050710507
</trans-unit>
10508+
<trans-unit id="6082636692959910230" datatype="html">
10509+
<source>Add users</source>
10510+
<target state="translated">Lisää käyttäjä</target>
10511+
<context-group purpose="location">
10512+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10513+
<context context-type="linenumber">1577,1576</context>
10514+
</context-group>
10515+
</trans-unit>
10516+
<trans-unit id="494185651714406389" datatype="html">
10517+
<source>There are not groups defined in this table.</source>
10518+
<target state="translated">Ei ryhmiä määriteltynä tässä taulukossa.</target>
10519+
<context-group purpose="location">
10520+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10521+
<context context-type="linenumber">1592</context>
10522+
</context-group>
10523+
</trans-unit>
10524+
<trans-unit id="5791799200547215180" datatype="html">
10525+
<source>Updated group.</source>
10526+
<target state="translated">Ryhmä päivitetty.</target>
10527+
<context-group purpose="location">
10528+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10529+
<context context-type="linenumber">1631</context>
10530+
</context-group>
10531+
</trans-unit>
10532+
<trans-unit id="6129598176641143387" datatype="html">
10533+
<source>New members will be notified by email.</source>
10534+
<target state="translated">Uusille jäsenille on lähetetään ilmoitus sähköpostitse.</target>
10535+
<context-group purpose="location">
10536+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10537+
<context context-type="linenumber">1638,1636</context>
10538+
</context-group>
10539+
</trans-unit>
10540+
<trans-unit id="8143693159335456296" datatype="html">
10541+
<source>Please provide email addresses or usernames.
10542+
Separate multiple addresses with commas or write each address on a new line.</source>
10543+
<target state="translated">Anna ryhmään lisättävät sähköpostiosoitteet tai käyttäjätunnukset.
10544+
Syötä useiden käyttäjien osoitteet allekkain tai pilkulla erotettuina.</target>
10545+
<context-group purpose="location">
10546+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10547+
<context context-type="linenumber">1577</context>
10548+
</context-group>
10549+
</trans-unit>
10550+
<trans-unit id="1454510249537401836" datatype="html">
10551+
<source>If the address does not have a TIM account, a new account will be created for them.</source>
10552+
<target state="translated">Jos osoitetta ei löydy järjestelmästä, sille luodaan uusi käyttäjätunnus.</target>
10553+
<context-group purpose="location">
10554+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10555+
<context context-type="linenumber">1583,1581</context>
10556+
</context-group>
10557+
</trans-unit>
10558+
<trans-unit id="6785769560062512577" datatype="html">
10559+
<source>Added <x id="PH" equiv-text="result.added.length"/> users:</source>
10560+
<target state="translated">Lisätty <x id="PH" equiv-text="result.added.length"/> käyttäjää:</target>
10561+
<context-group purpose="location">
10562+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10563+
<context context-type="linenumber">1634</context>
10564+
</context-group>
10565+
</trans-unit>
10566+
<trans-unit id="116165617457296609" datatype="html">
10567+
<source>Users already in group:</source>
10568+
<target state="translated">Käyttäjät jo ryhmässä:</target>
10569+
<context-group purpose="location">
10570+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10571+
<context context-type="linenumber">1646</context>
10572+
</context-group>
10573+
</trans-unit>
10574+
<trans-unit id="4576508930871695312" datatype="html">
10575+
<source>Users not found in TIM or address was wrong:</source>
10576+
<target state="translated">TIM-käyttäjiä ei löydy tai annettu osoite on väärin:</target>
10577+
<context-group purpose="location">
10578+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10579+
<context context-type="linenumber">1653</context>
10580+
</context-group>
10581+
</trans-unit>
1050810582
<trans-unit id="8149301268971106238" datatype="html">
1050910583
<source>My TIM settings</source>
1051010584
<target state="translated">Omat TIM asetukset</target>

timApp/i18n/messages.sv.xlf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10418,6 +10418,80 @@ Please generate login codes first.</target>
1041810418
<context context-type="linenumber">47,49</context>
1041910419
</context-group>
1042010420
</trans-unit>
10421+
<trans-unit id="6082636692959910230" datatype="html">
10422+
<source>Add users</source>
10423+
<target state="new">Add users</target>
10424+
<context-group purpose="location">
10425+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10426+
<context context-type="linenumber">1577,1576</context>
10427+
</context-group>
10428+
</trans-unit>
10429+
<trans-unit id="494185651714406389" datatype="html">
10430+
<source>There are not groups defined in this table.</source>
10431+
<target state="new">There are not groups defined in this table.</target>
10432+
<context-group purpose="location">
10433+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10434+
<context context-type="linenumber">1592</context>
10435+
</context-group>
10436+
</trans-unit>
10437+
<trans-unit id="5791799200547215180" datatype="html">
10438+
<source>Updated group.</source>
10439+
<target state="new">Updated group.</target>
10440+
<context-group purpose="location">
10441+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10442+
<context context-type="linenumber">1631</context>
10443+
</context-group>
10444+
</trans-unit>
10445+
<trans-unit id="6129598176641143387" datatype="html">
10446+
<source>New members will be notified by email.</source>
10447+
<target state="new">New members will be notified by email.</target>
10448+
<context-group purpose="location">
10449+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10450+
<context context-type="linenumber">1638,1636</context>
10451+
</context-group>
10452+
</trans-unit>
10453+
<trans-unit id="8143693159335456296" datatype="html">
10454+
<source>Please provide email addresses or usernames.
10455+
Separate multiple addresses with commas or write each address on a new line.</source>
10456+
<target state="new">Please provide email addresses or usernames.
10457+
Separate multiple addresses with commas or write each address on a new line.</target>
10458+
<context-group purpose="location">
10459+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10460+
<context context-type="linenumber">1577</context>
10461+
</context-group>
10462+
</trans-unit>
10463+
<trans-unit id="1454510249537401836" datatype="html">
10464+
<source>If the address does not have a TIM account, a new account will be created for them.</source>
10465+
<target state="new">If the address does not have a TIM account, a new account will be created for them.</target>
10466+
<context-group purpose="location">
10467+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10468+
<context context-type="linenumber">1583,1581</context>
10469+
</context-group>
10470+
</trans-unit>
10471+
<trans-unit id="6785769560062512577" datatype="html">
10472+
<source>Added <x id="PH" equiv-text="result.added.length"/> users:</source>
10473+
<target state="new">Added <x id="PH" equiv-text="result.added.length"/> users:</target>
10474+
<context-group purpose="location">
10475+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10476+
<context context-type="linenumber">1634</context>
10477+
</context-group>
10478+
</trans-unit>
10479+
<trans-unit id="116165617457296609" datatype="html">
10480+
<source>Users already in group:</source>
10481+
<target state="new">Users already in group:</target>
10482+
<context-group purpose="location">
10483+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10484+
<context context-type="linenumber">1646</context>
10485+
</context-group>
10486+
</trans-unit>
10487+
<trans-unit id="4576508930871695312" datatype="html">
10488+
<source>Users not found in TIM or address was wrong:</source>
10489+
<target state="new">Users not found in TIM or address was wrong:</target>
10490+
<context-group purpose="location">
10491+
<context context-type="sourcefile">static/scripts/tim/plugin/tableForm/table-form.component.ts</context>
10492+
<context context-type="linenumber">1653</context>
10493+
</context-group>
10494+
</trans-unit>
1042110495
</body>
1042210496
</file>
1042310497
</xliff>

timApp/plugin/tableform/tableForm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ class TableFormMarkupModel(GenericMarkupModel):
158158
usernames: bool | Missing = missing
159159
dataView: DataViewSettingsModel | Missing | None = missing
160160
replyToEmail: str | Missing | None = missing
161+
addUsersButton: str | Missing | None = missing
162+
notifyOnAdd: bool | Missing = False
163+
createMissingUsers: bool | Missing = False
161164

162165

163166
TableFormMarkupSchema = class_schema(TableFormMarkupModel)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.action-info-content {
2+
white-space: pre;
3+
text-wrap-mode: wrap;
4+
font-size: 0.8em;
5+
}

0 commit comments

Comments
 (0)