Merge pull request #65 from MrPetovan/task/36-display-registration-policy

Display registration policy in server panel
This commit is contained in:
Michael Vogel 2020-09-27 18:03:12 +02:00 committed by GitHub
commit 4205323d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 7 deletions

View file

@ -175,15 +175,15 @@ msgstr ""
msgid "Outdated Version"
msgstr ""
#: src\templates\sub\server.phtml:55
#: src\templates\sub\server.phtml:72
msgid "Admin"
msgstr ""
#: src\templates\sub\server.phtml:62
#: src\templates\sub\server.phtml:79
msgid "No description provided"
msgstr ""
#: src\templates\sub\server.phtml:65
#: src\templates\sub\server.phtml:82
msgid "Visit Server"
msgstr ""
@ -220,7 +220,7 @@ msgid_plural "People (%d)"
msgstr[0] ""
msgstr[1] ""
#: src\classes\Views\Widget\AccountTypeTabs.php:57
#: src\classes\Views\Widget\AccountTypeTabs.php:59
msgctxt "account-type"
msgid "Forum (%d)"
msgid_plural "Forums (%d)"
@ -303,3 +303,44 @@ msgstr ""
#: src\templates\statistics.phtml:39
msgid "<strong>%s public servers (%s)</strong> currently open for registration. <a href=\"%s\">Check them out!</a>"
msgstr ""
#: src\classes\Views\Widget\AccountTypeTabs.php:57
msgctxt "account-type"
msgid "News (%d)"
msgid_plural "News (%d)"
msgstr[0] ""
msgstr[1] ""
#: src\classes\Views\Widget\AccountTypeTabs.php:58
msgctxt "account-type"
msgid "Organization (%d)"
msgid_plural "Organizations (%d)"
msgstr[0] ""
msgstr[1] ""
#: src\templates\sub\server.phtml:40
msgid "Health Score"
msgstr ""
#: src\templates\sub\server.phtml:52
msgid "%s User"
msgid_plural "%s Users"
msgstr[0] ""
msgstr[1] ""
#: src\templates\sub\server.phtml:54
msgid "None"
msgstr ""
#: src\templates\sub\server.phtml:59
#: src\templates\sub\server.phtml:63
msgid "Registration Policy"
msgstr ""
#: src\templates\sub\server.phtml:60
msgid "By Approval"
msgstr ""
#: src\templates\sub\server.phtml:64
msgid "Open"
msgstr ""

View file

@ -37,7 +37,7 @@ $base_url_display = substr($base_url, strpos($base_url, '/') + 2);
<a href="<?php echo $this->escapeHtmlAttr($this->u($base_url)); ?>"><?php echo $this->e($base_url_display); ?></a>
</h6>
<p class="card-text">
<span class="badge <?php echo $badge_class ?>">
<span class="badge <?php echo $badge_class ?>" title="<?php echo $this->__('Health Score')?>">
<i class="fa fa-heartbeat"></i> <?php echo $server['health_score'] ?>
</span>
<?php if ($server['language']):?>
@ -46,9 +46,23 @@ $base_url_display = substr($base_url, strpos($base_url, '/') + 2);
<?php echo $this->e(Friendica\Directory\Utils\L10n::localeToLanguageString($server['language'])) ?>
</span>
<?php endif;?>
<span class="badge badge-secondary" title="<?php echo $this->__('Known Users')?>">
<i class="fa fa-user"></i> <?php echo $this->e($server['user_count'] ?: '~'); ?> Users
<span class="badge badge-secondary" title="<?php echo $this->__('Known Users')?>">
<i class="fa fa-user"></i>
<?php if ($server['user_count']):?>
<?php echo $this->n__('%s User', '%s Users', $server['user_count'])?>
<?php else: ?>
<?php echo $this->__('None');?>
<?php endif; ?>
</span>
<?php if ($server['reg_policy'] == 'REGISTER_APPROVE'):?>
<span class="badge badge-primary" title="<?php echo $this->__('Registration Policy')?>">
<i class="fa fa-dungeon"></i> <?php echo $this->__('By Approval')?>
</span>
<?php else:?>
<span class="badge badge-success" title="<?php echo $this->__('Registration Policy')?>">
<i class="fa fa-door-open"></i> <?php echo $this->__('Open')?>
</span>
<?php endif;?>
<?php echo $version_badge; ?>
<?php if ($server['admin_profile'] && $server['admin_name']): ?>
<a href="<?php echo $this->escapeHtmlAttr($this->u($server['admin_profile'])); ?>" class="badge badge-primary">