Skip to content

Commit

Permalink
Merge pull request joomla#88 from chmst/increase-quickicons-addnew
Browse files Browse the repository at this point in the history
Quickicons: Make bigger add buttons
  • Loading branch information
chmst authored Mar 26, 2019
2 parents d486cee + 50660b9 commit 7355502
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.mod_quickicon.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; Note : All ini files need to be saved as UTF-8

MOD_QUICKICON="Quick Icons"
MOD_QUICKICON_ADD_NEW="Add New"
MOD_QUICKICON_ADD_NEW="New %s"
MOD_QUICKICON_ARTICLE_MANAGER="Articles"
MOD_QUICKICON_ARTICLE_MANAGER_1="Article"
MOD_QUICKICON_CATEGORY_MANAGER="Article Categories"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public static function &getButtons(Registry $params, CMSApplication $application
'amount' => $amount,
'link' => Route::_('index.php?option=com_users'),
'linkadd' => Route::_('index.php?option=com_users&task=user.add'),
'addwhat' => Text::plural('MOD_QUICKICON_USER_MANAGER', 1),
'name' => Text::plural('MOD_QUICKICON_USER_MANAGER', $amount),
'access' => array('core.manage', 'com_users', 'core.create', 'com_users'),
'group' => 'MOD_QUICKICON_USERS',
Expand All @@ -110,6 +111,7 @@ public static function &getButtons(Registry $params, CMSApplication $application
'amount' => $amount,
'link' => Route::_('index.php?option=com_users'),
'linkadd' => Route::_('index.php?option=com_menus&task=item.add'),
'addwhat' => Text::plural('MOD_QUICKICON_MENUITEMS_MANAGER', 1),
'name' => Text::plural('MOD_QUICKICON_MENUITEMS_MANAGER', $amount),
'access' => array('core.manage', 'com_menus', 'core.create', 'com_menus'),
'group' => 'MOD_QUICKICON_STRUCTURE',
Expand All @@ -124,6 +126,7 @@ public static function &getButtons(Registry $params, CMSApplication $application
'amount' => $amount,
'link' => Route::_('index.php?option=com_content'),
'linkadd' => Route::_('index.php?option=com_content&task=article.add'),
'addwhat' => Text::plural('MOD_QUICKICON_ARTICLE_MANAGER', 1),
'name' => Text::plural('MOD_QUICKICON_ARTICLE_MANAGER', $amount),
'access' => array('core.manage', 'com_content', 'core.create', 'com_content'),
'group' => 'MOD_QUICKICON_CONTENT',
Expand All @@ -137,6 +140,7 @@ public static function &getButtons(Registry $params, CMSApplication $application
self::$buttons[$key][] = [
'amount' => $amount,
'link' => Route::_('index.php?option=com_categories'),
'addwhat' => Text::plural('MOD_QUICKICON_CATEGORY_MANAGER', 1),
'linkadd' => Route::_('index.php?option=com_categories&task=category.add'),
'name' => Text::plural('MOD_QUICKICON_CATEGORY_MANAGER', $amount),
'access' => array('core.manage', 'com_categories', 'core.create', 'com_categories'),
Expand Down Expand Up @@ -208,6 +212,7 @@ public static function &getButtons(Registry $params, CMSApplication $application
$default = array(
'amount' => null,
'link' => null,
'addwhat' => null,
'linkadd' => null,
'name' => null,
'image' => null,
Expand Down
5 changes: 3 additions & 2 deletions administrator/templates/atum/scss/blocks/_quickicons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

.quickicon-name {
font-size: 1rem;
padding-bottom: .3rem;
}

.quickicon-amount {
Expand All @@ -46,6 +47,7 @@

.quickicon-linkadd {
font-size: .9rem;
line-height: 3.4rem;
border-top: 1px solid $light_blue;
text-decoration: none;

Expand All @@ -57,10 +59,9 @@

a:not(.quickicon-linkadd) {
display: inline-flex;
min-height: 6rem;
min-height: 5.4rem;
flex-direction: column;
width: 100%;
padding-bottom: 6px;
transition: all .25s ease;
text-align: center;

Expand Down
15 changes: 8 additions & 7 deletions layouts/joomla/quickicons/icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// The title for the link (a11y)
$title = empty($displayData['title']) ? '' : (' title="' . $this->escape($displayData['title']) . '"');

$add = empty($displayData['addwhat']) ? '' : $displayData['addwhat'];
// The information
$text = empty($displayData['text']) ? '' : ('<span class="j-links-link">' . $displayData['text'] . '</span>');

Expand All @@ -36,13 +36,13 @@
<a <?php echo $id . $class; ?> href="<?php echo $displayData['link']; ?>"<?php echo $target . $onclick . $title; ?>>

<?php if (isset($displayData['amount'])): ?>
<div class="quickicon-icon d-flex align-self-end">
<div class="quickicon-amount">
<?php
$amount = (int) $displayData['amount'];
if ($amount < 100000):
echo '<span class="quickicon-amount">' . $amount . '</span>';
echo $amount;
else:
echo '<span class="quickicon-amount">' . floor($amount / 1000) . '<span class="thsd">' . $amount % 1000 . '</span></span>';
echo floor($amount / 1000) . '<span class="thsd">' . $amount % 1000 . '</span>';
endif;
?>
</div>
Expand All @@ -57,14 +57,15 @@
<?php endif; ?>
<?php // Information or action
if (isset($displayData['text'])): ?>
<div class="quickicon-text d-flex align-items-end"><?php echo $text; ?></div>
<div class="quickicon-text d-flex align-items-center"><?php echo $text; ?></div>
<?php endif; ?>
</a>
<?php // Add the link to the edit-form
if (!empty($displayData['linkadd'])): ?>
<a class="btn-block text-center quickicon-linkadd j-links-link py-1" href="<?php echo $displayData['linkadd']; ?>">
<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>
<?php echo Text::_('MOD_QUICKICON_ADD_NEW'); ?>
<span class="fa fa-plus mr-2" aria-hidden="true"></span>
<span class="sr-only"><?php echo Text::sprintf('MOD_QUICKICON_ADD_NEW', $add); ?></span>
<span aria-hidden="true"><?php echo $add; ?></span>
</a>
<?php endif; ?>
</li>
Expand Down

0 comments on commit 7355502

Please sign in to comment.