shortTopbarTitle

pull/1046/merge
jimmytheneutrino 2016-07-05 03:00:31 +03:00 committed by Justin Richer
parent e08b7f89fc
commit fa4722cdd8
3 changed files with 29 additions and 1 deletions

View File

@ -49,6 +49,8 @@ public class ConfigurationPropertiesBean {
private String issuer;
private String topbarTitle;
private String shortTopbarTitle;
private String logoImageUrl;
@ -118,6 +120,17 @@ public class ConfigurationPropertiesBean {
public void setTopbarTitle(String topbarTitle) {
this.topbarTitle = topbarTitle;
}
/**
* @return If shortTopbarTitle is undefined, returns topbarTitle.
*/
public String getShortTopbarTitle() {
return shortTopbarTitle == null ? topbarTitle : shortTopbarTitle;
}
public void setShortTopbarTitle(String shortTopbarTitle) {
this.shortTopbarTitle = shortTopbarTitle;
}
/**
* @return the logoImageUrl

View File

@ -134,5 +134,14 @@ public class ConfigurationPropertiesBeanTest {
}
}
@Test
public void testShortTopbarTitle() {
ConfigurationPropertiesBean bean = new ConfigurationPropertiesBean();
bean.setTopbarTitle("LONG");
assertEquals("LONG", bean.getShortTopbarTitle());
bean.setShortTopbarTitle("SHORT");
assertEquals("SHORT", bean.getShortTopbarTitle());
}
}

View File

@ -34,7 +34,13 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href=""><img src="${ config.logoImageUrl }" /> ${config.topbarTitle}</a>
<a class="brand" href="">
<img src="${ config.logoImageUrl }" />
<span>
<span class="visible-phone">${config.shortTopbarTitle}</span>
<span class="hidden-phone">${config.topbarTitle}</span>
</span>
</a>
<c:if test="${ not empty pageName }">
<div class="nav-collapse collapse">
<ul class="nav">