feat(instance-info): show- egistration status

This commit is contained in:
FineFindus 2023-05-22 22:05:25 +02:00
parent 56835b4f2d
commit 4ff5136652
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
2 changed files with 21 additions and 3 deletions

View File

@ -286,25 +286,35 @@ public class InstanceInfoFragment extends LoaderFragment {
if (instance.contactAccount != null) { if (instance.contactAccount != null) {
AccountField admin = new AccountField(); AccountField admin = new AccountField();
admin.parsedName=admin.name= "Administered by"; admin.parsedName=admin.name=getContext().getString(R.string.mo_instance_admin);
admin.parsedValue=buildLinkText(instance.contactAccount.url, instance.contactAccount.getDisplayUsername() + "@" + instance.uri); admin.parsedValue=buildLinkText(instance.contactAccount.url, instance.contactAccount.getDisplayUsername() + "@" + instance.uri);
fields.add(admin); fields.add(admin);
} }
if (instance.email != null) { if (instance.email != null) {
AccountField contact = new AccountField(); AccountField contact = new AccountField();
contact.parsedName = contact.name = "Contact"; contact.parsedName=getContext().getString(R.string.mo_instance_contact);
contact.parsedValue=buildLinkText("mailto:" + instance.email, instance.email); contact.parsedValue=buildLinkText("mailto:" + instance.email, instance.email);
fields.add(contact); fields.add(contact);
} }
if (instance.stats != null) { if (instance.stats != null) {
AccountField activeUsers = new AccountField(); AccountField activeUsers = new AccountField();
activeUsers.parsedName = activeUsers.name = "users"; activeUsers.parsedName=getContext().getString(R.string.mo_instance_users);
activeUsers.parsedValue= NumberFormat.getInstance().format(instance.stats.userCount); activeUsers.parsedValue= NumberFormat.getInstance().format(instance.stats.userCount);
fields.add(activeUsers); fields.add(activeUsers);
AccountField statusCount = new AccountField();
statusCount.parsedName=getContext().getString(R.string.mo_instance_status);
statusCount.parsedValue= NumberFormat.getInstance().format(instance.stats.statusCount);
fields.add(statusCount);
} }
AccountField registration = new AccountField();
registration.parsedName=getContext().getString(R.string.mo_instance_registration);
registration.parsedValue=getContext().getString(instance.registrations ? instance.approvalRequired ? R.string.mo_instance_registration_approval : R.string.mo_instance_registration_open : R.string.instance_signup_closed);
fields.add(registration);
setFields(fields); setFields(fields);
} }

View File

@ -58,6 +58,14 @@
<string name="mo_confirm_unfollow_title">Unfollow Account</string> <string name="mo_confirm_unfollow_title">Unfollow Account</string>
<string name="mo_confirm_unfollow">Confirm to unfollow %s</string> <string name="mo_confirm_unfollow">Confirm to unfollow %s</string>
<string name="mo_instance_admin">Administered by</string>
<string name="mo_instance_contact">Contact</string>
<string name="mo_instance_users">Users</string>
<string name="mo_instance_status">Status</string>
<string name="mo_instance_registration">Registration</string>
<string name="mo_instance_registration_open">Open</string>
<string name="mo_instance_registration_approval">Approval required</string>
<string name="mo_instance_registration_closed">Closed</string>
<string name="mo_instance_info_open_timeline">Local timeline</string> <string name="mo_instance_info_open_timeline">Local timeline</string>
<string name="mo_instance_info_moderated_servers">Moderated servers</string> <string name="mo_instance_info_moderated_servers">Moderated servers</string>
<string name="mo_severity_silence">Silenced</string> <string name="mo_severity_silence">Silenced</string>