]> source.dussan.org Git - gitblit.git/commitdiff
Support custom header colors and finish theme flattening (issue 209)
authorJames Moger <james.moger@gitblit.com>
Wed, 26 Jun 2013 21:10:13 +0000 (17:10 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 26 Jun 2013 21:10:13 +0000 (17:10 -0400)
releases.moxie
src/main/distrib/data/gitblit.properties
src/main/java/com/gitblit/wicket/pages/LuceneSearchPage.html
src/main/java/com/gitblit/wicket/pages/ProjectPage.html
src/main/java/com/gitblit/wicket/pages/RepositoriesPage.html
src/main/java/com/gitblit/wicket/pages/RootPage.java
src/main/resources/bootstrap/css/bootstrap-responsive.css
src/main/resources/gitblit.css
src/site/custom.less

index 0327e4beb43f7c72fa9d439c95eb20b1caae197d..ff7e0927a05b9072ad313a9a0942d16723487e2f 100644 (file)
@@ -53,6 +53,7 @@ r17: {
         - Added a ui for the ref log introduced in 1.2.1 (issue-177)\r
         - Added weblogic.xml to WAR for deployment on WebLogic (issue 199)\r
         - Support setting a custom header logo (issue 208)\r
+        - Support header color customizations (issue 209)\r
         - Support username substitution in web.otherUrls (issue 213)\r
         - Option to force client-side basic authentication instead of form-based authentication if web.authenticateViewPages=true (issue 222)\r
         - Setting to automatically create an user account based on an authenticated user principal from the servlet container (issue-246)\r
@@ -134,6 +135,12 @@ r17: {
        - { name: 'web.activityCacheDays', defaultValue: 14 }\r
        - { name: 'web.allowAppCloneLinks', defaultValue: 'true' }\r
        - { name: 'web.forceDefaultLocale', defaultValue: ' ' }\r
+       - { name: 'web.headerLogo', defaultValue: '${baseFolder}/logo.png' }\r
+       - { name: 'web.headerBackgroundColor', defaultValue: ' ' }\r
+       - { name: 'web.headerForegroundColor', defaultValue: ' ' }\r
+       - { name: 'web.headerHoverColor', defaultValue: ' ' }\r
+       - { name: 'web.headerBorderColor', defaultValue: ' ' }\r
+       - { name: 'web.headerBorderFocusColor', defaultValue: ' ' }\r
        - { name: 'web.metricAuthorExclusions', defaultValue: ' ' }\r
        - { name: 'web.overviewReflogCount', defaultValue: 5 }\r
        - { name: 'web.reflogChangesPerPage', defaultValue: 10 }\r
index 50b09f300399c3c9c8fff96d6ff051b16c0d79e5..f6ed3833a21db149946dc637a16d9922f348ccba 100644 (file)
@@ -538,6 +538,46 @@ web.siteName =
 # BASEFOLDER\r
 web.headerLogo = ${baseFolder}/logo.png\r
 \r
+# You may specify a custom header background CSS color.  If unspecified, the\r
+# default color will be used.\r
+#\r
+# e.g. web.headerBackgroundColor = #002060\r
+#\r
+# SINCE 1.3.0\r
+web.headerBackgroundColor =\r
+\r
+# You may specify a custom header foreground CSS color.  If unspecified, the\r
+# default color will be used.\r
+#\r
+# e.g. web.headerForegroundColor = white\r
+#\r
+# SINCE 1.3.0\r
+web.headerForegroundColor =\r
+\r
+# You may specify a custom header foreground hover CSS color.  If unspecified, the\r
+# default color will be used.\r
+#\r
+# e.g. web.headerHoverColor = white\r
+#\r
+# SINCE 1.3.0\r
+web.headerHoverColor =\r
+\r
+# You may specify a custom header border CSS color.  If unspecified, the default\r
+# color will be used.\r
+#\r
+# e.g. web.headerBorderColor = #002060\r
+#\r
+# SINCE 1.3.0\r
+web.headerBorderColor =\r
+\r
+# You may specify a custom header border CSS color.  If unspecified, the default\r
+# color will be used.\r
+#\r
+# e.g. web.headerBorderFocusColor = #ff9900\r
+#\r
+# SINCE 1.3.0\r
+web.headerBorderFocusColor =\r
+\r
 # If *web.authenticateAdminPages*=true, users with "admin" role can create\r
 # repositories, create users, and edit repository metadata.\r
 #\r
index 20d31c39e7f35a2566e672a24baca4c74cc22205..91a6ef43883869975c8a3bb7a67da2c22167f8c4 100644 (file)
@@ -15,8 +15,9 @@
 <wicket:extend>\r
 <body onload="document.getElementById('query').focus(); prettyPrint();">\r
 <div class="container">\r
-       <div class="pageTitle">\r
-               <h2><wicket:message key="gb.search"></wicket:message></h2>\r
+       <!-- page header -->\r
+       <div class="dashboardTitle">\r
+               <wicket:message key="gb.search"></wicket:message>                               \r
        </div>\r
        <form class="form-inline" wicket:id="searchForm">\r
                <div class="row">\r
index 925b18e14fbe7dd6e9db53eb649bc8c452a7cfcf..aaf9108e798c20c104d1bf83d0c70abaabd93cb9 100644 (file)
@@ -7,7 +7,7 @@
 <body>\r
 <wicket:extend>\r
                <div class="container">\r
-                       <div class="row" style="padding-top:5px;">\r
+                       <div class="row">\r
                                <div class="span12">\r
                                        <div class="dashboardTitle">\r
                                                <span wicket:id="projectTitle"></span>\r
index d78467450c8fe5e04d666579f0b93de178176432..36670a8003f954e03d84b9319d1cf80070993dee 100644 (file)
@@ -7,7 +7,7 @@
 <body>\r
 <wicket:extend>\r
 <div class="container">\r
-       <div class="markdown" style="padding-bottom:5px;" wicket:id="repositoriesMessage">[repositories message]</div>\r
+       <div class="markdown" style="padding: 5px 0px;" wicket:id="repositoriesMessage">[repositories message]</div>\r
        \r
        <div wicket:id="repositoriesPanel">[repositories panel]</div>\r
 </div>\r
index f4ac907b67a4c5d58f8cadf21494f9907474a811..7739e6dffce5d8e9ed2a35ee1e2e5695d574efe3 100644 (file)
@@ -33,6 +33,9 @@ import java.util.regex.Pattern;
 \r
 import org.apache.wicket.MarkupContainer;\r
 import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.behavior.HeaderContributor;\r
+import org.apache.wicket.markup.html.IHeaderContributor;\r
+import org.apache.wicket.markup.html.IHeaderResponse;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.form.PasswordTextField;\r
 import org.apache.wicket.markup.html.form.TextField;\r
@@ -83,6 +86,50 @@ public abstract class RootPage extends BasePage {
 \r
        @Override\r
        protected void setupPage(String repositoryName, String pageName) {\r
+\r
+               // CSS header overrides\r
+               add(new HeaderContributor(new IHeaderContributor() {\r
+                       private static final long serialVersionUID = 1L;\r
+\r
+                       public void renderHead(IHeaderResponse response) {\r
+                               StringBuilder buffer = new StringBuilder();\r
+                               buffer.append("<style type=\"text/css\">\n");\r
+                               buffer.append(".navbar-inner {\n");\r
+                               final String headerBackground = GitBlit.getString(Keys.web.headerBackgroundColor, null);\r
+                               if (!StringUtils.isEmpty(headerBackground)) {\r
+                                       buffer.append(MessageFormat.format("background-color: {0};\n", headerBackground));\r
+                               }\r
+                               final String headerBorder = GitBlit.getString(Keys.web.headerBorderColor, null);\r
+                               if (!StringUtils.isEmpty(headerBorder)) {\r
+                                       buffer.append(MessageFormat.format("border-bottom: 1px solid {0} !important;\n", headerBorder));\r
+                               }\r
+                               buffer.append("}\n");\r
+                               final String headerBorderFocus = GitBlit.getString(Keys.web.headerBorderFocusColor, null);\r
+                               if (!StringUtils.isEmpty(headerBorderFocus)) {\r
+                                       buffer.append(".navbar ul li:focus, .navbar .active {\n");\r
+                                       buffer.append(MessageFormat.format("border-bottom: 4px solid {0};\n", headerBorderFocus));\r
+                                       buffer.append("}\n");\r
+                               }\r
+                               final String headerForeground = GitBlit.getString(Keys.web.headerForegroundColor, null);\r
+                               if (!StringUtils.isEmpty(headerForeground)) {\r
+                                       buffer.append(".navbar ul.nav li a {\n");\r
+                                       buffer.append(MessageFormat.format("color: {0};\n", headerForeground));\r
+                                       buffer.append("}\n");\r
+                                       buffer.append(".navbar ul.nav .active a {\n");\r
+                                       buffer.append(MessageFormat.format("color: {0};\n", headerForeground));\r
+                                       buffer.append("}\n");\r
+                               }\r
+                               final String headerHover = GitBlit.getString(Keys.web.headerHoverColor, null);\r
+                               if (!StringUtils.isEmpty(headerHover)) {\r
+                                       buffer.append(".navbar ul.nav li a:hover {\n");\r
+                                       buffer.append(MessageFormat.format("color: {0} !important;\n", headerHover));\r
+                                       buffer.append("}\n");\r
+                               }\r
+                               buffer.append("</style>\n");\r
+                               response.renderString(buffer.toString());\r
+                               }\r
+                       }));\r
+               \r
                boolean authenticateView = GitBlit.getBoolean(Keys.web.authenticateViewPages, false);\r
                boolean authenticateAdmin = GitBlit.getBoolean(Keys.web.authenticateAdminPages, true);\r
                boolean allowAdmin = GitBlit.getBoolean(Keys.web.allowAdministration, true);\r
index 06e55c0b45b2d997138bd186cb1bb5788b882016..7e7ec697f46a2c97e790d4f4dc627a0fe77cffe0 100644 (file)
     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;
   }
index d10f3809c285d2f516a369d68ee12a07da3846a3..cf69900550f60f229bd1bdf749f2c1af69ce96ac 100644 (file)
@@ -1,6 +1,6 @@
 body {\r
-        /* 50px to start the container 10px below the navbar */\r
-       padding-top: 60px;\r
+        /* 47px is the header height */\r
+       padding-top: 47px;\r
 }\r
 \r
 footer {\r
@@ -61,6 +61,9 @@ hr {
 .navbar .brand {\r
        padding: 0px 10px 0px 20px;\r
 }\r
+.navbar .btn-navbar {\r
+       margin-top: 10px;\r
+}\r
 \r
 .navbar .pull-right {\r
        margin: 0;\r
@@ -88,20 +91,16 @@ hr {
 \r
 .navbar-inner {\r
        background-color: #002060;\r
-       background-repeat: none;\r
        background-image: none;\r
-       -webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);\r
-       -moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);\r
-       box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);\r
-       border-bottom: 2px solid #ff9900 !important;\r
+       box-shadow: none;\r
+       border-bottom: 1px solid #002060 !important;\r
 }\r
 \r
 .navbar ul li:focus, .navbar .active {\r
-       background-repeat:no-repeat;\r
-       background-image: url(arrow_page.png);\r
-       background-position: center bottom;\r
-       outline: 0;\r
-       padding-bottom:3px;\r
+       outline: 0;     \r
+       padding-bottom: 1px;\r
+       border-bottom: 3px solid #ff9900;\r
+       margin-bottom: -1px;\r
 }\r
 \r
 .navbar .active a {\r
@@ -152,8 +151,8 @@ div.reflog i {
 \r
 div.dashboardTitle {\r
        font-size: 1.75em;\r
-       padding-bottom: 5px;\r
-       margin-bottom: 10px;\r
+       padding: 5px 0px;\r
+       margin: 10px 0px;\r
        border-bottom: 1px solid #ccc;\r
 }\r
 \r
@@ -165,12 +164,12 @@ div.dashboardTitle small {
 .repositorynavbar {\r
        background-color: #fbfbfb;\r
        border-bottom: 1px solid #ccc;\r
-       margin-top: -8px;\r
        margin-bottom: 10px;\r
 }\r
 \r
 .repositorynavbar .title {\r
        line-height: 32px;\r
+       padding: 5px 0px;\r
 }\r
 \r
 .repositorynavbar .repository {\r
@@ -183,7 +182,8 @@ div.dashboardTitle small {
     color: #002060;\r
 }\r
 \r
-.repositorynavbar .repositorynavbar-inner {    \r
+.repositorynavbar .repositorynavbar-inner {\r
+       padding-top: 2px;\r
 }\r
 \r
 .repositorynavbar ul {\r
@@ -221,6 +221,14 @@ div.dashboardTitle small {
        text-decoration: underline;\r
 }\r
 \r
+@media (max-width: 767px) {\r
+       .repositorynavbar {\r
+    margin-right: -20px;\r
+    margin-left: -20px;\r
+    padding: 0px 5px;\r
+  }\r
+}\r
+\r
 .btn-appmenu {\r
        border-radius: 4px !important;\r
     background-color: #002060;\r
index ca207dfa400e3723b91afe73ec84ffa392343f20..96e70ca780e48544073ad2a5901f160531af0ff7 100644 (file)
        }\r
        \r
        ul > li:focus, .active {\r
-               background-repeat:no-repeat;\r
-               background-image: url('../../arrow_page.png');\r
-               background-position: center bottom;\r
-               outline: 0;\r
+               outline: 0;     \r
+               padding-bottom: 1px;\r
+               border-bottom: 3px solid #ff9900;\r
+               margin-bottom: -1px;\r
        }\r
 }\r
 \r