Browse Source

Support custom header colors and finish theme flattening (issue 209)

tags/v1.3.0
James Moger 11 years ago
parent
commit
c129a913c4

+ 7
- 0
releases.moxie View File

@@ -53,6 +53,7 @@ r17: {
- Added a ui for the ref log introduced in 1.2.1 (issue-177)
- Added weblogic.xml to WAR for deployment on WebLogic (issue 199)
- Support setting a custom header logo (issue 208)
- Support header color customizations (issue 209)
- Support username substitution in web.otherUrls (issue 213)
- Option to force client-side basic authentication instead of form-based authentication if web.authenticateViewPages=true (issue 222)
- Setting to automatically create an user account based on an authenticated user principal from the servlet container (issue-246)
@@ -134,6 +135,12 @@ r17: {
- { name: 'web.activityCacheDays', defaultValue: 14 }
- { name: 'web.allowAppCloneLinks', defaultValue: 'true' }
- { name: 'web.forceDefaultLocale', defaultValue: ' ' }
- { name: 'web.headerLogo', defaultValue: '${baseFolder}/logo.png' }
- { name: 'web.headerBackgroundColor', defaultValue: ' ' }
- { name: 'web.headerForegroundColor', defaultValue: ' ' }
- { name: 'web.headerHoverColor', defaultValue: ' ' }
- { name: 'web.headerBorderColor', defaultValue: ' ' }
- { name: 'web.headerBorderFocusColor', defaultValue: ' ' }
- { name: 'web.metricAuthorExclusions', defaultValue: ' ' }
- { name: 'web.overviewReflogCount', defaultValue: 5 }
- { name: 'web.reflogChangesPerPage', defaultValue: 10 }

+ 40
- 0
src/main/distrib/data/gitblit.properties View File

@@ -538,6 +538,46 @@ web.siteName =
# BASEFOLDER
web.headerLogo = ${baseFolder}/logo.png
# You may specify a custom header background CSS color. If unspecified, the
# default color will be used.
#
# e.g. web.headerBackgroundColor = #002060
#
# SINCE 1.3.0
web.headerBackgroundColor =
# You may specify a custom header foreground CSS color. If unspecified, the
# default color will be used.
#
# e.g. web.headerForegroundColor = white
#
# SINCE 1.3.0
web.headerForegroundColor =
# You may specify a custom header foreground hover CSS color. If unspecified, the
# default color will be used.
#
# e.g. web.headerHoverColor = white
#
# SINCE 1.3.0
web.headerHoverColor =
# You may specify a custom header border CSS color. If unspecified, the default
# color will be used.
#
# e.g. web.headerBorderColor = #002060
#
# SINCE 1.3.0
web.headerBorderColor =
# You may specify a custom header border CSS color. If unspecified, the default
# color will be used.
#
# e.g. web.headerBorderFocusColor = #ff9900
#
# SINCE 1.3.0
web.headerBorderFocusColor =
# If *web.authenticateAdminPages*=true, users with "admin" role can create
# repositories, create users, and edit repository metadata.
#

+ 3
- 2
src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.html View File

@@ -15,8 +15,9 @@
<wicket:extend>
<body onload="document.getElementById('query').focus(); prettyPrint();">
<div class="container">
<div class="pageTitle">
<h2><wicket:message key="gb.search"></wicket:message></h2>
<!-- page header -->
<div class="dashboardTitle">
<wicket:message key="gb.search"></wicket:message>
</div>
<form class="form-inline" wicket:id="searchForm">
<div class="row">

+ 1
- 1
src/main/java/com/gitblit/wicket/pages/ProjectPage.html View File

@@ -7,7 +7,7 @@
<body>
<wicket:extend>
<div class="container">
<div class="row" style="padding-top:5px;">
<div class="row">
<div class="span12">
<div class="dashboardTitle">
<span wicket:id="projectTitle"></span>

+ 1
- 1
src/main/java/com/gitblit/wicket/pages/RepositoriesPage.html View File

@@ -7,7 +7,7 @@
<body>
<wicket:extend>
<div class="container">
<div class="markdown" style="padding-bottom:5px;" wicket:id="repositoriesMessage">[repositories message]</div>
<div class="markdown" style="padding: 5px 0px;" wicket:id="repositoriesMessage">[repositories message]</div>
<div wicket:id="repositoriesPanel">[repositories panel]</div>
</div>

+ 47
- 0
src/main/java/com/gitblit/wicket/pages/RootPage.java View File

@@ -33,6 +33,9 @@ import java.util.regex.Pattern;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.PageParameters;
import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.markup.html.IHeaderContributor;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.markup.html.form.TextField;
@@ -83,6 +86,50 @@ public abstract class RootPage extends BasePage {
@Override
protected void setupPage(String repositoryName, String pageName) {
// CSS header overrides
add(new HeaderContributor(new IHeaderContributor() {
private static final long serialVersionUID = 1L;
public void renderHead(IHeaderResponse response) {
StringBuilder buffer = new StringBuilder();
buffer.append("<style type=\"text/css\">\n");
buffer.append(".navbar-inner {\n");
final String headerBackground = GitBlit.getString(Keys.web.headerBackgroundColor, null);
if (!StringUtils.isEmpty(headerBackground)) {
buffer.append(MessageFormat.format("background-color: {0};\n", headerBackground));
}
final String headerBorder = GitBlit.getString(Keys.web.headerBorderColor, null);
if (!StringUtils.isEmpty(headerBorder)) {
buffer.append(MessageFormat.format("border-bottom: 1px solid {0} !important;\n", headerBorder));
}
buffer.append("}\n");
final String headerBorderFocus = GitBlit.getString(Keys.web.headerBorderFocusColor, null);
if (!StringUtils.isEmpty(headerBorderFocus)) {
buffer.append(".navbar ul li:focus, .navbar .active {\n");
buffer.append(MessageFormat.format("border-bottom: 4px solid {0};\n", headerBorderFocus));
buffer.append("}\n");
}
final String headerForeground = GitBlit.getString(Keys.web.headerForegroundColor, null);
if (!StringUtils.isEmpty(headerForeground)) {
buffer.append(".navbar ul.nav li a {\n");
buffer.append(MessageFormat.format("color: {0};\n", headerForeground));
buffer.append("}\n");
buffer.append(".navbar ul.nav .active a {\n");
buffer.append(MessageFormat.format("color: {0};\n", headerForeground));
buffer.append("}\n");
}
final String headerHover = GitBlit.getString(Keys.web.headerHoverColor, null);
if (!StringUtils.isEmpty(headerHover)) {
buffer.append(".navbar ul.nav li a:hover {\n");
buffer.append(MessageFormat.format("color: {0} !important;\n", headerHover));
buffer.append("}\n");
}
buffer.append("</style>\n");
response.renderString(buffer.toString());
}
}));
boolean authenticateView = GitBlit.getBoolean(Keys.web.authenticateViewPages, false);
boolean authenticateAdmin = GitBlit.getBoolean(Keys.web.authenticateAdminPages, true);
boolean allowAdmin = GitBlit.getBoolean(Keys.web.allowAdministration, true);

+ 2
- 7
src/main/resources/bootstrap/css/bootstrap-responsive.css View File

@@ -688,24 +688,19 @@
position: static;
}
.navbar-fixed-top {
margin-bottom: 18px;
margin-bottom: 0px;
}
.navbar-fixed-bottom {
margin-top: 18px;
}
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
padding: 5px;
padding: 0px 5px 1px;
}
.navbar .container {
width: auto;
padding: 0;
}
.navbar .brand {
padding-right: 10px;
padding-left: 10px;
margin: 0 0 0 -5px;
}
.nav-collapse {
clear: both;
}

+ 24
- 16
src/main/resources/gitblit.css View File

@@ -1,6 +1,6 @@
body {
/* 50px to start the container 10px below the navbar */
padding-top: 60px;
/* 47px is the header height */
padding-top: 47px;
}
footer {
@@ -61,6 +61,9 @@ hr {
.navbar .brand {
padding: 0px 10px 0px 20px;
}
.navbar .btn-navbar {
margin-top: 10px;
}
.navbar .pull-right {
margin: 0;
@@ -88,20 +91,16 @@ hr {
.navbar-inner {
background-color: #002060;
background-repeat: none;
background-image: none;
-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);
-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);
box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);
border-bottom: 2px solid #ff9900 !important;
box-shadow: none;
border-bottom: 1px solid #002060 !important;
}
.navbar ul li:focus, .navbar .active {
background-repeat:no-repeat;
background-image: url(arrow_page.png);
background-position: center bottom;
outline: 0;
padding-bottom:3px;
outline: 0;
padding-bottom: 1px;
border-bottom: 3px solid #ff9900;
margin-bottom: -1px;
}
.navbar .active a {
@@ -152,8 +151,8 @@ div.reflog i {
div.dashboardTitle {
font-size: 1.75em;
padding-bottom: 5px;
margin-bottom: 10px;
padding: 5px 0px;
margin: 10px 0px;
border-bottom: 1px solid #ccc;
}
@@ -165,12 +164,12 @@ div.dashboardTitle small {
.repositorynavbar {
background-color: #fbfbfb;
border-bottom: 1px solid #ccc;
margin-top: -8px;
margin-bottom: 10px;
}
.repositorynavbar .title {
line-height: 32px;
padding: 5px 0px;
}
.repositorynavbar .repository {
@@ -183,7 +182,8 @@ div.dashboardTitle small {
color: #002060;
}
.repositorynavbar .repositorynavbar-inner {
.repositorynavbar .repositorynavbar-inner {
padding-top: 2px;
}
.repositorynavbar ul {
@@ -221,6 +221,14 @@ div.dashboardTitle small {
text-decoration: underline;
}
@media (max-width: 767px) {
.repositorynavbar {
margin-right: -20px;
margin-left: -20px;
padding: 0px 5px;
}
}
.btn-appmenu {
border-radius: 4px !important;
background-color: #002060;

+ 4
- 4
src/site/custom.less View File

@@ -66,10 +66,10 @@
}
ul > li:focus, .active {
background-repeat:no-repeat;
background-image: url('../../arrow_page.png');
background-position: center bottom;
outline: 0;
outline: 0;
padding-bottom: 1px;
border-bottom: 3px solid #ff9900;
margin-bottom: -1px;
}
}

Loading…
Cancel
Save