Skip to content

Commit

Permalink
UI: update category icons to show sub elements (#4245)
Browse files Browse the repository at this point in the history
  • Loading branch information
schuer committed Jan 4, 2021
1 parent 1da538c commit 91dab02
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion redaxo/src/addons/be_style/assets/css/styles.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions redaxo/src/addons/be_style/scss/_icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
.rex-icon-category {
@extend .fa-folder;
}
.rex-icon-category-without-elements {
@extend .fa-folder-o;
}
.rex-icon-cronjob {
@extend .fa-code;
}
Expand Down
2 changes: 2 additions & 0 deletions redaxo/src/addons/structure/lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ article_doesnt_exist = Artikel existiert nicht!
cant_delete_sitestartarticle = Der Webseiten-Startartikel kann nicht gelöscht werden!
cant_delete_notfoundarticle = Der "Nicht-gefunden" Artikel kann nicht gelöscht werden!
structure_copy = Kopie
category_has_child_elements = Kategorie enthält Kindelemente
category_without_child_elements = Kategorie ohne Kindelemente

all_categories = Alle Kategorien
categories = Kategorien
Expand Down
2 changes: 2 additions & 0 deletions redaxo/src/addons/structure/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ article_doesnt_exist = Article doesn't exist!
cant_delete_sitestartarticle = The start article can not be deleted!
cant_delete_notfoundarticle = Not-found article can not be deleted
structure_copy = Copy
category_has_child_elements = Category has child elements
category_without_child_elements = Category without child elements

all_categories = All categories
categories = Categories
Expand Down
8 changes: 7 additions & 1 deletion redaxo/src/addons/structure/pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@
$i_category_id = $KAT->getValue('id');

$kat_link = $structureContext->getContext()->getUrl(['category_id' => $i_category_id]);
$kat_icon_td = '<td class="rex-table-icon"><a href="' . $kat_link . '" title="' . rex_escape($KAT->getValue('catname')) . '"><i class="rex-icon rex-icon-category"></i></a></td>';

/** @var rex_category $kat_object */
$kat_object = rex_category::get($KAT->getValue('id'));
$kat_has_child_elements = (count($kat_object->getChildren()) > 0 || count($kat_object->getArticles()) > 1); // contains child categories or articles other than the start article
$kat_icon_class = $kat_has_child_elements ? 'rex-icon-category' : 'rex-icon-category-without-elements';
$kat_icon_title = $kat_has_child_elements ? rex_i18n::msg('category_has_child_elements') : rex_i18n::msg('category_without_child_elements');
$kat_icon_td = '<td class="rex-table-icon"><a href="' . $kat_link . '" title="' . rex_escape($KAT->getValue('catname')) . '"><i class="rex-icon ' . $kat_icon_class . '" title="' . $kat_icon_title . '"></i></a></td>';

$kat_status = $catStatusTypes[$KAT->getValue('status')][0];
$status_class = $catStatusTypes[$KAT->getValue('status')][1];
Expand Down

0 comments on commit 91dab02

Please sign in to comment.