James Moger
2013-06-26 c129a913c4fd64558aef4cbad41c4246f5886a97
Support custom header colors and finish theme flattening (issue-209)
9 files modified
160 ■■■■ changed files
releases.moxie 7 ●●●●● patch | view | raw | blame | history
src/main/distrib/data/gitblit.properties 40 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.html 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/ProjectPage.html 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/RepositoriesPage.html 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/RootPage.java 47 ●●●●● patch | view | raw | blame | history
src/main/resources/bootstrap/css/bootstrap-responsive.css 9 ●●●● patch | view | raw | blame | history
src/main/resources/gitblit.css 40 ●●●●● patch | view | raw | blame | history
src/site/custom.less 8 ●●●● patch | view | raw | blame | history
releases.moxie
@@ -53,6 +53,7 @@
     - 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 @@
    - { 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 }
src/main/distrib/data/gitblit.properties
@@ -538,6 +538,46 @@
# 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.
#
src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.html
@@ -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">
src/main/java/com/gitblit/wicket/pages/ProjectPage.html
@@ -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>
src/main/java/com/gitblit/wicket/pages/RepositoriesPage.html
@@ -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>
src/main/java/com/gitblit/wicket/pages/RootPage.java
@@ -33,6 +33,9 @@
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 @@
    @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);
src/main/resources/bootstrap/css/bootstrap-responsive.css
@@ -688,23 +688,18 @@
    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;
src/main/resources/gitblit.css
@@ -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 @@
.navbar .brand {
    padding: 0px 10px 0px 20px;
}
.navbar .btn-navbar {
    margin-top: 10px;
}
.navbar .pull-right {
    margin: 0;
@@ -88,20 +91,16 @@
.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.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 @@
.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 @@
    color: #002060;
}
.repositorynavbar .repositorynavbar-inner {
.repositorynavbar .repositorynavbar-inner {
    padding-top: 2px;
}
.repositorynavbar ul {
@@ -221,6 +221,14 @@
    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;
src/site/custom.less
@@ -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;
    }
}