Skip to content

[4.0] com_users notes blank state #1685

@jgerman-bot

Description

@jgerman-bot

New language relevant PR in upstream repo: joomla/joomla-cms#33273 Here are the upstream changes:

Click to expand the diff!
diff --git a/administrator/components/com_users/src/View/Notes/HtmlView.php b/administrator/components/com_users/src/View/Notes/HtmlView.php
index 6f6376c9f2e0..99a4489b162f 100644
--- a/administrator/components/com_users/src/View/Notes/HtmlView.php
+++ b/administrator/components/com_users/src/View/Notes/HtmlView.php
@@ -95,6 +95,11 @@ public function display($tpl = null)
 		$this->filterForm    = $this->get('FilterForm');
 		$this->activeFilters = $this->get('ActiveFilters');
 
+		if (!count($this->items) && $this->get('IsBlankSlate'))
+		{
+			$this->setLayout('blankstate');
+		}
+
 		// Check for errors.
 		if (count($errors = $this->get('Errors')))
 		{
diff --git a/administrator/components/com_users/tmpl/notes/blankstate.php b/administrator/components/com_users/tmpl/notes/blankstate.php
new file mode 100644
index 000000000000..f26149674818
--- /dev/null
+++ b/administrator/components/com_users/tmpl/notes/blankstate.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @package     Joomla.Administrator
+ * @subpackage  com_users
+ *
+ * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
+ * @license     GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+defined('_JEXEC') or die;
+
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+
+?>
+<form action="<?php echo Route::_('index.php?option=com_users&view=notes'); ?>" method="post" name="adminForm" id="adminForm">
+
+	<div class="px-4 py-5 my-5 text-center">
+		<span class="fa-8x icon-users user mb-4" aria-hidden="true"></span>
+		<h1 class="display-5 fw-bold"><?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_TITLE'); ?></h1>
+		<div class="col-lg-6 mx-auto">
+			<p class="lead mb-4">
+				<?php echo Text::_('COM_USERS_NOTES_BLANKSTATE_REQUESTS'); ?>
+			</p>
+			<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
+				<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>
+				<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>
+			</div>
+		</div>
+	</div>
+
+	<input type="hidden" name="task" value="">
+	<input type="hidden" name="boxchecked" value="0">
+</form>
diff --git a/administrator/language/en-GB/com_users.ini b/administrator/language/en-GB/com_users.ini
index 4b87f5496a95..63da66df1333 100644
--- a/administrator/language/en-GB/com_users.ini
+++ b/administrator/language/en-GB/com_users.ini
@@ -230,6 +230,10 @@ COM_USERS_NEW_NOTE="New Note"
 COM_USERS_NOTE_FORM_EDIT="Edit Note"
 COM_USERS_NOTE_FORM_NEW="New Note"
 COM_USERS_NOTES="User Notes: New/Edit"
+COM_USERS_NOTES_BLANKSTATE_TITLE="No User Notes have been created yet."
+COM_USERS_NOTES_BLANKSTATE_REQUESTS="User Notes can be used to store a range of information about each user on your site."
+COM_USERS_NOTES_BLANKSTATE_BUTTON_ADD="Add your first note"
+COM_USERS_NOTES_BLANKSTATE_BUTTON_LEARNMORE="Learn more"
 COM_USERS_NOTES_FOR_USER="Notes for user %s (ID #%d)"
 COM_USERS_NOTES_N_ITEMS_ARCHIVED="%d User Notes archived."
 COM_USERS_NOTES_N_ITEMS_ARCHIVED_1="User Note archived."

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions