Skip to content

Commit c730b20

Browse files
committed
[4.0] com_users notes blank state
See #33264 for instructions but this time for user notes and not content This PR requires the code from #33264 to be merged first - specifically the change in libraries/src/MVC/Model/ListModel.php
1 parent a340698 commit c730b20

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

administrator/components/com_users/src/View/Notes/HtmlView.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ public function display($tpl = null)
9595
$this->filterForm = $this->get('FilterForm');
9696
$this->activeFilters = $this->get('ActiveFilters');
9797

98+
if (!count($this->items) && $this->get('IsBlankSlate'))
99+
{
100+
$this->setLayout('blankstate');
101+
}
102+
98103
// Check for errors.
99104
if (count($errors = $this->get('Errors')))
100105
{
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* @package Joomla.Administrator
4+
* @subpackage com_users
5+
*
6+
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
10+
defined('_JEXEC') or die;
11+
12+
use Joomla\CMS\Language\Text;
13+
use Joomla\CMS\Router\Route;
14+
15+
?>
16+
<form action="<?php echo Route::_('index.php?option=com_users&view=notes'); ?>" method="post" name="adminForm" id="adminForm">
17+
18+
<div class="px-4 py-5 my-5 text-center">
19+
<span class="fa-8x icon-users user mb-4" aria-hidden="true"></span>
20+
<h1 class="display-5 fw-bold"><?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_TITLE'); ?></h1>
21+
<div class="col-lg-6 mx-auto">
22+
<p class="lead mb-4">
23+
<?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_REQUESTS'); ?>
24+
</p>
25+
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
26+
<a href="<?php echo Route::_('index.php?option=com_users&view=note&layout=edit'); ?>" class="btn btn-primary btn-lg px-4 me-sm-3"><?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_BUTTON_ADD'); ?></a>
27+
<a href="https://docs.joomla.org/Special:MyLanguage/Help40:User_Notes" class="btn btn-outline-secondary btn-lg px-4"><?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_BUTTON_LEARNMORE'); ?></a>
28+
</div>
29+
</div>
30+
</div>
31+
32+
<input type="hidden" name="task" value="">
33+
<input type="hidden" name="boxchecked" value="0">
34+
</form>

administrator/language/en-GB/com_users.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ COM_USERS_NEW_NOTE="New Note"
230230
COM_USERS_NOTE_FORM_EDIT="Edit Note"
231231
COM_USERS_NOTE_FORM_NEW="New Note"
232232
COM_USERS_NOTES="User Notes: New/Edit"
233+
COM_USERS_NOTES_BLANKSTATE_TITLE="No User Notes have been created yet."
234+
COM_USERS_NOTES_BLANKSTATE_REQUESTS="User Notes can be used to store a range of information about each user on your site."
235+
COM_USERS_NOTES_BLANKSTATE_BUTTON_ADD="Add your first note"
236+
COM_USERS_NOTES_BLANKSTATE_BUTTON_LEARNMORE="Learn more"
233237
COM_USERS_NOTES_FOR_USER="Notes for user %s (ID #%d)"
234238
COM_USERS_NOTES_N_ITEMS_ARCHIVED="%d User Notes archived."
235239
COM_USERS_NOTES_N_ITEMS_ARCHIVED_1="User Note archived."

0 commit comments

Comments
 (0)