Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Nov 25, 2022
2 parents a0ca325 + dabbde0 commit 557789c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,30 @@
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<li wicket:id="item" class="nav-item">
<a wicket:id="link" class="nav-link">
<i wicket:id="icon" class="nav-icon"></i>
<p>
<span wicket:id="label"/>
<a wicket:id="link" class="d-flex nav-link" data-bs-toggle="tooltip" data-bs-placement="right">
<span class="flex-shrink-1">
<i wicket:id="icon" class="nav-icon"/>
</span>
<div class="d-flex flex-grow-1 text-truncate">
<div class="text-truncate">
<span wicket:id="label"/>
</div>
<wicket:enclosure child="arrow">
<i wicket:id="arrow" class="fas fa-angle-left right"></i>
<span class="ml-auto flex-shrink-1">
<i wicket:id="arrow" class="mr-1 fas fa-angle-left right"/>
</span>
</wicket:enclosure>
</p>

<span class="badge badge-primary right" wicket:id="bubble"/>
<span class="my-1 ml-auto flex-shrink-1 badge badge-primary right" wicket:id="bubble"/>
</div>
</a>
<ul wicket:id="submenu" class="nav nav-treeview">
<li wicket:id="subItem" class="nav-item">
<a wicket:id="subLink" class="nav-link" href="#">
<i class="nav-icon" style="min-width: 20px;" wicket:id="subLinkIcon"></i>
<a wicket:id="subLink" class="d-flex nav-link" href="#" data-bs-toggle="tooltip" data-bs-placement="right">
<span>
<i class="nav-icon" style="min-width: 20px;" wicket:id="subLinkIcon"/>
</span>
&nbsp;
<p wicket:id="subLabel"/>
<div class="text-truncate" wicket:id="subLabel"/>
</a>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ private void initLayout() {

item.add(AttributeModifier.append("style", () -> isMenuExpanded() ? "" : "display: none;"));

StringResourceModel labelModel = new StringResourceModel(
"${nameModel}",
getModel()).setDefaultValue(new PropertyModel<>(getModel(), "nameModel"));
AjaxLink<Void> link = new AjaxLink<>(ID_LINK) {
private static final long serialVersionUID = 1L;

Expand All @@ -88,13 +91,14 @@ public void onClick(AjaxRequestTarget target) {

return mmi.hasActiveSubmenu(getPageBase()) || mmi.isMenuActive(getPageBase()) ? "active" : null;
}));
link.add(AttributeModifier.append("title", labelModel));
item.add(link);

WebMarkupContainer icon = new WebMarkupContainer(ID_ICON);
icon.add(AttributeModifier.append("class", new PropertyModel<>(getModel(), MainMenuItem.F_ICON_CLASS)));
link.add(icon);

Label label = new Label(ID_LABEL, new StringResourceModel("${nameModel}", getModel()).setDefaultValue(new PropertyModel<>(getModel(), "nameModel")));
Label label = new Label(ID_LABEL, labelModel);
label.setRenderBodyOnly(true);
link.add(label);

Expand Down Expand Up @@ -124,6 +128,9 @@ protected void populateItem(ListItem<MenuItem> listItem) {
private void createSubmenu(final ListItem<MenuItem> listItem) {
IModel<MenuItem> menuItem = listItem.getModel();

StringResourceModel labelModel = new StringResourceModel("${nameModel}", menuItem);
labelModel.setDefaultValue(new PropertyModel<>(menuItem, "nameModel"));

Link<String> subLink = new Link<>(ID_SUB_LINK) {
private static final long serialVersionUID = 1L;

Expand All @@ -139,8 +146,9 @@ public void onClick() {
WebMarkupContainer subLinkIcon = new WebMarkupContainer(ID_SUB_LINK_ICON);
subLinkIcon.add(AttributeAppender.append("class", new PropertyModel<>(menuItem, MainMenuItem.F_ICON_CLASS)));
subLink.add(subLinkIcon);
subLink.add(AttributeModifier.append("title", labelModel));

Label subLabel = new Label(ID_SUB_LABEL, new StringResourceModel("${nameModel}", menuItem).setDefaultValue(new PropertyModel<>(menuItem, "nameModel")));
Label subLabel = new Label(ID_SUB_LABEL, labelModel);
subLink.add(subLabel);
}

Expand Down

0 comments on commit 557789c

Please sign in to comment.