FIX: Display empty message when no groups can be shown.

This commit is contained in:
Guo Xiang Tan
2016-12-20 14:47:39 +08:00
parent 502e114c60
commit c15bf62b43
5 changed files with 63 additions and 57 deletions

View File

@ -1,6 +1,6 @@
export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.index');
return I18n.t('groups.index.title');
},
model(params) {

View File

@ -1,5 +1,5 @@
<div class="container group">
{{#link-to "groups" class='group-breadcrumb'}}{{fa-icon 'arrow-left'}} {{i18n 'groups.index'}}{{/link-to}}
{{#link-to "groups" class='group-breadcrumb'}}{{fa-icon 'arrow-left'}} {{i18n 'groups.index.title'}}{{/link-to}}
<div class='group-details-container'>
<div class='group-info'>

View File

@ -1,7 +1,8 @@
{{#d-section pageClass="groups"}}
{{#load-more selector=".groups-table .groups-table-row" action="loadMore"}}
<h1>{{i18n "groups.index"}}</h1>
<h1>{{i18n "groups.index.title"}}</h1>
{{#if groups}}
{{#load-more selector=".groups-table .groups-table-row" action="loadMore"}}
<div class='container'>
<table class="groups-table">
<thead>
@ -58,4 +59,7 @@
{{/load-more}}
{{conditional-loading-spinner condition=groups.loadingMore}}
{{else}}
<p>{{i18n "groups.index.empty"}}</p>
{{/if}}
{{/d-section}}

View File

@ -103,7 +103,7 @@ export default createWidget('hamburger-menu', {
links.push({ route: 'users', className: 'user-directory-link', label: 'directory.title' });
}
links.push({ route: 'groups', className: 'groups-link', label: 'groups.index' });
links.push({ route: 'groups', className: 'groups-link', label: 'groups.index.title' });
if (this.siteSettings.tagging_enabled) {
links.push({ route: 'tags', label: 'tagging.tags' });

View File

@ -425,7 +425,9 @@ en:
selector_placeholder: "Add members"
owner: "owner"
visible: "Group is visible to all users"
index: "Groups"
index:
title: "Groups"
empty: "There are no visible groups."
title:
one: "group"
other: "groups"