Skip to content

Commit

Permalink
improvements for deployment information is applied in GUI: header col…
Browse files Browse the repository at this point in the history
…or, logo, application name
  • Loading branch information
KaterynaHonchar committed Jan 31, 2017
1 parent 70f818d commit 11e0eac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Expand Up @@ -76,6 +76,7 @@

<div class="navbar-title" wicket:id="pageTitleContainer">
<span class="page-title" wicket:id="pageTitle">
<span wicket:id="deploymentName"/>
<span wicket:id="pageTitleReal"/>
</span>
</div>
Expand Down
Expand Up @@ -191,6 +191,7 @@ public abstract class PageBase extends WebPage implements ModelServiceLocator {
private static final String ID_CUSTOM_LOGO_IMG_SRC = "customLogoImgSrc";
private static final String ID_CUSTOM_LOGO_IMG_CSS = "customLogoImgCss";
private static final String ID_NAVIGATION = "navigation";
private static final String ID_DEPLOYMENT_NAME = "deploymentName";

private static final String OPERATION_GET_SYSTEM_CONFIG = DOT_CLASS + "getSystemConfiguration";
private static final String OPERATION_GET_DEPLOYMENT_INFORMATION = DOT_CLASS + "getDeploymentInformation";
Expand Down Expand Up @@ -534,16 +535,21 @@ private void initTitleLayout(WebMarkupContainer mainHeader) {
pageTitleContainer.add(pageTitle);

String environmentName = "";
IModel<String> titleModel = createPageTitleModel();
IModel<String> fullTitleModel = null;
if (deploymentInfoModel != null && deploymentInfoModel.getObject() != null &&
StringUtils.isNotEmpty(deploymentInfoModel.getObject().getName())) {
environmentName = deploymentInfoModel.getObject().getName();
}
if (StringUtils.isNotEmpty(environmentName)){
fullTitleModel = new Model<String>(environmentName + ": " + titleModel.getObject());
}
Label pageTitleReal = new Label(ID_PAGE_TITLE_REAL, fullTitleModel != null ? fullTitleModel : titleModel);
Model<String> deploymentNameModel = new Model<String>(StringUtils.isNotEmpty(environmentName) ? environmentName + ": " : "");
Label deploymentName = new Label(ID_DEPLOYMENT_NAME, deploymentNameModel);
deploymentName.add(new VisibleEnableBehaviour(){
public boolean isVisible(){
return StringUtils.isNotEmpty(deploymentNameModel.getObject());
}
});
deploymentName.setRenderBodyOnly(true);
pageTitle.add(deploymentName);

Label pageTitleReal = new Label(ID_PAGE_TITLE_REAL, createPageTitleModel());
pageTitleReal.setRenderBodyOnly(true);
pageTitle.add(pageTitleReal);

Expand Down

0 comments on commit 11e0eac

Please sign in to comment.