Skip to content

Commit

Permalink
Merge branch 'ssbc:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rabble authored Sep 11, 2022
2 parents f2eb61f + c16fceb commit 4cf603d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/assets/style.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/handlers/admin/members_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ func TestMembersAdd(t *testing.T) {
}
checkInputsAreDisabled(false)

// verify that inputs are disabled for RoleMember
// verify that inputs are enabled for RoleMember
ts.User = roomdb.Member{
ID: 7331,
Role: roomdb.RoleMember,
}
checkInputsAreDisabled(true)
checkInputsAreDisabled(false)
}

func TestMembersDontAddInvalid(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion web/i18n/defaults/active.de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NavAdminInvites = "Einladungen"
NavAdminNotices = "Hinweise"

# Error messages
ErrorAuthBadLogin = "Die angegebenen Authentifizierungsdaten (Benutzername oder Passwort) sind falsch."
ErrorAuthBadLogin = "Die angegebenen Authentifizierungsdaten (SSB-ID oder Passwort) sind falsch."
ErrorNotFound = "Die Datenbank konnte den betreffenden Artikel nicht finden."
ErrorAlreadyAdded = "Der öffentliche Schlüssel <strong> {{.Key}} </ strong> ist bereits in der Liste enthalten."
ErrorPageNotFound = "Die angeforderte Seite <strong> ({{.Path}}) </ strong> ist nicht vorhanden."
Expand Down Expand Up @@ -186,6 +186,8 @@ InviteInsertWelcome = "Du kannst mit deine SSB-ID eine Einladung anfordern. Dana

InviteConsumedTitle = "Einladung angenommen!"
InviteConsumedWelcome = "Du bist jetzt Mitglied dieses Raums. Wenn du eine Multiserver-Adresse benötigst, kannst du die folgende kopieren und einfügen: "
InviteConsumedSetPassword = "Du kannst jetzt ein Fallback-Passwort für Ihr Konto erstellen:"
InviteConsumedSetPasswordButton = "Passwort erstellen"

# alias resolution
##################
Expand Down
4 changes: 3 additions & 1 deletion web/i18n/defaults/active.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NavAdminInvites = "Invites"
NavAdminNotices = "Notices"

# Error messages
ErrorAuthBadLogin = "The supplied authentication credentials (username or password) are incorrect."
ErrorAuthBadLogin = "The supplied authentication credentials (SSB-ID or password) are incorrect."
ErrorNotFound = "The database couldn't find the item in question."
ErrorAlreadyAdded = "The SSB-ID <strong>{{.Key}}</strong> already is on the list"
ErrorPageNotFound = "The requested page <strong>({{.Path}})</strong> is not there."
Expand Down Expand Up @@ -190,6 +190,8 @@ InviteInsertWelcome = "You can claim your invite by inserting your SSB ID below.

InviteConsumedTitle = "Invite accepted!"
InviteConsumedWelcome = "You are now a member of this room. If you need a multiserver address to connect to the room, you can copy-paste the one below:"
InviteConsumedSetPassword = "You can now create an account fallback password:"
InviteConsumedSetPasswordButton = "Create password"

# alias resolution
##################
Expand Down
7 changes: 2 additions & 5 deletions web/templates/admin/member-list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ SPDX-License-Identifier: CC-BY-4.0
<label class="block mt-6 mb-1 text-sm text-gray-500">{{ i18n "AdminAddNewMemberTitle" }}</label>
<div id="add-member-input-container" class="flex flex-row items-center justify-start mb-6">
<input
{{ if member_is_elevated }} {{ else }} disabled {{ end }}
type="text"
name="pub_key"
placeholder="{{i18n "PubKeyRefPlaceholder"}}"
class="w-8/12 self-stretch shadow rounded border border-transparent h-10 p-1 pl-4 font-mono truncate
class="w-8/12 self-stretch shadow rounded border border-transparent h-10 p-1 pl-4 font-mono truncate
text-purple-600 focus:outline-none focus:ring-2 focus:ring-purple-400 focus:border-transparent
{{ if member_is_elevated }} {{ else }} shadow ring-1 ring-gray-300 opacity-50 bg-gray-200 cursor-not-allowed {{ end }}
">
<button
{{ if member_is_elevated }} {{ else }} disabled {{ end }}
type="submit"
class="ml-4 h-10 shadow rounded px-6 text-purple-600 ring-1 bg-white focus:outline-none focus:ring-2 focus:ring-purple-400
{{ if member_is_elevated }} ring-purple-400 hover:bg-purple-600 hover:text-gray-100 {{ else }} opacity-50 ring-purple-300 bg-purple-200 cursor-not-allowed {{ end }}
ring-purple-400 hover:bg-purple-600 hover:text-gray-100
"
>{{i18n "AdminMembersAdd"}}</button>
</div>
Expand Down
13 changes: 12 additions & 1 deletion web/templates/invite/consumed.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,16 @@ SPDX-License-Identifier: CC-BY-4.0
<span
class="bg-gray-200 py-1 px-2 mb-8 w-64 font-mono break-all"
>{{.MultiserverAddress}}</span>

<span
class="text-center"
>{{i18n "InviteConsumedSetPassword" }}<br /></span>

<span
class="w-64 my-6 text-center"
><a
class="self-start shadow rounded h-8 flex flex-row justify-center items-center text-gray-100 bg-pink-600 hover:bg-pink-700 focus:outline-none focus:ring-2 focus:ring-pink-600 focus:ring-opacity-50"
href="{{urlTo "members:change-password"}}"
>{{i18n "InviteConsumedSetPasswordButton" }}</a></span>
</div>
{{end}}
{{end}}

0 comments on commit 4cf603d

Please sign in to comment.