]> source.dussan.org Git - gitblit.git/commitdiff
Sprinkled some icons throughout ui. Centralized icon retrieval.
authorJames Moger <james.moger@gitblit.com>
Tue, 26 Apr 2011 01:52:38 +0000 (21:52 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 26 Apr 2011 01:52:38 +0000 (21:52 -0400)
29 files changed:
gitblit.properties
src/com/gitblit/GitBlit.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/RepositoryPage.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/models/RepositoryModel.java
src/com/gitblit/wicket/pages/EditRepositoryPage.html
src/com/gitblit/wicket/pages/EditRepositoryPage.java
src/com/gitblit/wicket/pages/RepositoriesPage.html
src/com/gitblit/wicket/pages/RepositoriesPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TreePage.html
src/com/gitblit/wicket/pages/TreePage.java
src/com/gitblit/wicket/panels/BasePanel.java
src/com/gitblit/wicket/panels/HistoryPanel.java
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/PageLinksPanel.html
src/com/gitblit/wicket/panels/PageLinksPanel.java
src/com/gitblit/wicket/panels/RefsPanel.java
src/com/gitblit/wicket/panels/SearchPanel.java
src/com/gitblit/wicket/panels/TagsPanel.java
src/com/gitblit/wicket/resources/book_16x16.png [new file with mode: 0644]
src/com/gitblit/wicket/resources/bug_16x16.png [new file with mode: 0644]
src/com/gitblit/wicket/resources/file_16x16.png [new file with mode: 0644]
src/com/gitblit/wicket/resources/folder_16x16.png [new file with mode: 0644]
src/com/gitblit/wicket/resources/gitblit.css
src/com/gitblit/wicket/resources/lock_16x16.png [new file with mode: 0644]
src/com/gitblit/wicket/resources/pixel.png [new file with mode: 0644]

index 4b08135806465600c01f4890a2a7678fe2663afb..992549978b9b19655234a46e6f6f87d3f0eb4adf 100644 (file)
@@ -66,6 +66,10 @@ web.diffStyle = gitblit
 # Control if email addresses are shown in web ui\r
 web.showEmailAddresses = true\r
 \r
+# Shows a combobox in the page links header with commit, committer, and author\r
+# search selection.  Default search is commit.\r
+web.showSearchTypeSelection = false\r
+\r
 # Generates a line graph of repository activity over time on the Summary page.\r
 # This is a real-time graph so generation may be expensive. \r
 web.generateActivityGraph = true\r
@@ -78,9 +82,9 @@ web.summaryCommitCount = 16
 # Value must exceed 0 else default of 5 is used\r
 web.summaryRefsCount = 5\r
 \r
-# The number of commits to show on each page of a Log\r
-# Value must exceed 0 else default of 50 is used\r
-web.logPageCommitCount = 50\r
+# The number of items to show on a page before showing the first, prev, next\r
+# pagination links.  A default if 50 is used for any invalid value.\r
+web.itemsPerPage = 50\r
 \r
 # Registered extensions for google-code-prettify\r
 web.prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
@@ -113,12 +117,6 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
 # Example per-repository regex substitutions overrides global\r
 #regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
 \r
-# Enable tickets pages for all repositories (if ticgit branch is present)\r
-tickets.global = false\r
-\r
-# Enable tickets pages for specified repository (if ticgit branch is present)\r
-#tickets.myrepository = true\r
-\r
 #\r
 # Server Settings\r
 #\r
index c412b18a314ec7fcde6171710820e1b169e48f67..c56b3cbb06f7fa38191ba6156d32293e3f2f0ba6 100644 (file)
@@ -116,7 +116,7 @@ public class GitBlit implements ServletContextListener {
                JGitUtils.setRepositoryOwner(r, repository.owner);\r
                JGitUtils.setRepositoryUseTickets(r, repository.useTickets);\r
                JGitUtils.setRepositoryUseDocs(r, repository.useDocs);\r
-               JGitUtils.setRepositoryUseNamedUsers(r, repository.useNamedUsers);\r
+               JGitUtils.setRepositoryRestrictedAccess(r, repository.useRestrictedAccess);\r
        }\r
 \r
        public List<String> getRepositoryList() {\r
@@ -130,9 +130,15 @@ public class GitBlit implements ServletContextListener {
                        Repository r = getRepository(repo);\r
                        String description = JGitUtils.getRepositoryDescription(r);\r
                        String owner = JGitUtils.getRepositoryOwner(r);\r
+                       String group = JGitUtils.getRepositoryGroup(r);\r
                        Date lastchange = JGitUtils.getLastChange(r);\r
+                       RepositoryModel model = new RepositoryModel(repo, description, owner, lastchange);\r
+                       model.group = group;\r
+                       model.useTickets = JGitUtils.getRepositoryUseTickets(r);\r
+                       model.useDocs = JGitUtils.getRepositoryUseDocs(r);\r
+                       model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);\r
                        r.close();\r
-                       repositories.add(new RepositoryModel(repo, description, owner, lastchange));\r
+                       repositories.add(model);\r
                }\r
                return repositories;\r
        }\r
index df7be6bfd983fb3f2c62f67c82a667803cad03f2..eddd3df610bc4671ba0ccdea31921cb6a39749eb 100644 (file)
@@ -749,6 +749,14 @@ public class JGitUtils {
                setRepositoryConfigString(r, "owner", owner);\r
        }\r
        \r
+       public static String getRepositoryGroup(Repository r) {\r
+               return getRepositoryConfigString(r, "group");\r
+       }\r
+       \r
+       public static void setRepositoryGroup(Repository r, String group) {\r
+               setRepositoryConfigString(r, "group", group);\r
+       } \r
+       \r
        public static boolean getRepositoryUseTickets(Repository r) {\r
                return getRepositoryConfigBoolean(r, "useTickets", false);\r
        }\r
@@ -765,12 +773,12 @@ public class JGitUtils {
                setRepositoryConfigBoolean(r, "useDocs", value);\r
        }\r
        \r
-       public static boolean getRepositoryUseNamedUsers(Repository r) {\r
-               return getRepositoryConfigBoolean(r, "useNamedUsers", false);\r
+       public static boolean getRepositoryRestrictedAccess(Repository r) {\r
+               return getRepositoryConfigBoolean(r, "restrictedAccess", false);\r
        }\r
        \r
-       public static void setRepositoryUseNamedUsers(Repository r, boolean value) {\r
-               setRepositoryConfigBoolean(r, "useNamedUsers", value);\r
+       public static void setRepositoryRestrictedAccess(Repository r, boolean value) {\r
+               setRepositoryConfigBoolean(r, "restrictedAccess", value);\r
        }       \r
        \r
        public static String getRepositoryConfigString(Repository r, String field) {\r
@@ -886,6 +894,10 @@ public class JGitUtils {
                metrics.add(0, total);\r
                return metrics;\r
        }\r
+       \r
+       public static RefModel getDocumentsBranch(Repository r) {\r
+               return getTicketsBranch(r);\r
+       }\r
 \r
        public static RefModel getTicketsBranch(Repository r) {\r
                RefModel ticgitBranch = null;\r
index cbe1d05ac656655463896dd7cdc9d217448f2937..18b1e789929a8b3bd858a0d50e95b35bed48613a 100644 (file)
@@ -66,4 +66,8 @@ gb.filesRenamed = {0} files renamed
 gb.missingUsername = Missing Username\r
 gb.edit = edit\r
 gb.searchTypeTooltip = Select Search Type\r
-gb.searchTooltip = Search Git:Blit
\ No newline at end of file
+gb.searchTooltip = Search Git:Blit\r
+gb.rename = rename\r
+gb.delete = delete\r
+gb.docs = docs\r
+gb.restrictedAccess = restricted access
\ No newline at end of file
index 6e0347996b8bc560aef792206ad2edbe5f52d967..30e41a5fa19f879a363cff4004d364ef696c1ed7 100644 (file)
@@ -140,26 +140,26 @@ public abstract class RepositoryPage extends BasePage {
        \r
        protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
                if (searchType.equals(SearchType.AUTHOR)) {\r
-                       WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);\r
+                       WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
                } else if (searchType.equals(SearchType.COMMITTER)) {\r
-                       WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);\r
+                       WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
                }\r
        }\r
        \r
        protected void setChangeTypeTooltip(Component container, ChangeType type) {\r
                switch (type) {\r
                case ADD:\r
-                       WicketUtils.setHtmlTitle(container, getString("gb.addition"));\r
+                       WicketUtils.setHtmlTooltip(container, getString("gb.addition"));\r
                        break;\r
                case COPY:\r
                case RENAME:\r
-                       WicketUtils.setHtmlTitle(container, getString("gb.rename"));\r
+                       WicketUtils.setHtmlTooltip(container, getString("gb.rename"));\r
                        break;\r
                case DELETE:\r
-                       WicketUtils.setHtmlTitle(container, getString("gb.deletion"));\r
+                       WicketUtils.setHtmlTooltip(container, getString("gb.deletion"));\r
                        break;\r
                case MODIFY:\r
-                       WicketUtils.setHtmlTitle(container, getString("gb.modification"));\r
+                       WicketUtils.setHtmlTooltip(container, getString("gb.modification"));\r
                        break;\r
                }\r
        }\r
index 63e6621f07835464892fe06fbb5790b4a7ce25dd..fb8e29676f2538dd9239f9cf29a6232d751deee5 100644 (file)
@@ -9,6 +9,8 @@ import org.apache.wicket.Component;
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.behavior.SimpleAttributeModifier;\r
 import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.image.ContextImage;\r
+import org.apache.wicket.resource.ContextRelativeResource;\r
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
 import org.eclipse.jgit.lib.Constants;\r
 \r
@@ -28,7 +30,7 @@ public class WicketUtils {
                container.add(new SimpleAttributeModifier("style", value));\r
        }\r
 \r
-       public static void setHtmlTitle(Component container, String value) {\r
+       public static void setHtmlTooltip(Component container, String value) {\r
                container.add(new SimpleAttributeModifier("title", value));\r
        }\r
 \r
@@ -77,10 +79,34 @@ public class WicketUtils {
 \r
        public static Label createAuthorLabel(String wicketId, String author) {\r
                Label label = new Label(wicketId, author);\r
-               WicketUtils.setHtmlTitle(label, author);\r
+               WicketUtils.setHtmlTooltip(label, author);\r
                return label;\r
        }\r
 \r
+       public static ContextImage newClearPixel(String wicketId) {\r
+               return newImage(wicketId, "pixel.png");\r
+       }\r
+       \r
+       public static ContextImage newBlankImage(String wicketId) {\r
+               return newImage(wicketId, "blank.png");\r
+       }\r
+\r
+       public static ContextImage newImage(String wicketId, String file) {\r
+               return newImage(wicketId, file, null);\r
+       }\r
+\r
+       public static ContextImage newImage(String wicketId, String file, String tooltip) {\r
+               ContextImage img = new ContextImage(wicketId, "/com/gitblit/wicket/resources/" + file);\r
+               if (!StringUtils.isEmpty(tooltip)) {\r
+                       setHtmlTooltip(img, tooltip);\r
+               }\r
+               return img;\r
+       }\r
+       \r
+       public static ContextRelativeResource getResource(String file) {\r
+               return new ContextRelativeResource("/com/gitblit/wicket/resources/" + file);\r
+       }\r
+\r
        public static PageParameters newRepositoryParameter(String repositoryName) {\r
                return new PageParameters("r=" + repositoryName);\r
        }\r
@@ -170,7 +196,7 @@ public class WicketUtils {
                }\r
                Label label = new Label(wicketId, dateString);\r
                WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));\r
-               WicketUtils.setHtmlTitle(label, title);\r
+               WicketUtils.setHtmlTooltip(label, title);\r
                return label;\r
        }\r
 \r
@@ -182,7 +208,7 @@ public class WicketUtils {
                String dateString = df.format(date);\r
                String title = TimeUtils.timeAgo(date);\r
                Label label = new Label(wicketId, dateString);\r
-               WicketUtils.setHtmlTitle(label, title);\r
+               WicketUtils.setHtmlTooltip(label, title);\r
                return label;\r
        }\r
 }\r
index a9410b512bc17f6259dae19207f0f735c52201d5..8df3808351b91c7b9c986c8ba064c8d474fda0ba 100644 (file)
@@ -9,10 +9,11 @@ public class RepositoryModel implements Serializable {
        public String name;\r
        public String description;\r
        public String owner;\r
+       public String group;\r
        public Date lastChange;\r
        public boolean useTickets;\r
        public boolean useDocs;\r
-       public boolean useNamedUsers;\r
+       public boolean useRestrictedAccess;\r
 \r
        public RepositoryModel(String name, String description, String owner, Date lastchange) {\r
                this.name = name;\r
index 1e04ed054ec9153f150a15ca6925f74649e7683e..f202e918f33f4c4fa50f22e0bef7cac59eaed050 100644 (file)
        <form wicket:id="editForm">\r
                <table class="plain">\r
                        <tbody>\r
-                               <tr><th>Name</th><td><input type="text" wicket:id="name" size="30" /></td></tr>\r
-                               <tr><th>Description</th><td><input type="text" wicket:id="description" size="80" /></td></tr>\r
-                               <tr><th>Owner</th><td><input type="text" wicket:id="owner" size="30" /></td></tr>\r
-                               <tr><th>Use Git:Blit Tickets</th><td><input type="checkbox" wicket:id="useTickets"/>distributed Git:Blit ticketing</td></tr>\r
-                               <tr><th>Use Git:Blit Docs</th><td><input type="checkbox" wicket:id="useDocs"/>distributed Git:Blit documentation</td></tr>\r
-                               <tr><th>Named User Access</th><td><input type="checkbox" wicket:id="useNamedUsers"/>not implemented</td></tr>\r
-                               <tr><td colspan="2"><input type="submit" value="Submit"/></td></tr>\r
+                               <tr><th>Name</th><td class="edit"><input type="text" wicket:id="name" size="30" tabindex="1" /></td></tr>\r
+                               <tr><th>Description</th><td class="edit"><input type="text" wicket:id="description" size="80" tabindex="2" /></td></tr>\r
+                               <tr><th>Owner</th><td class="edit"><input type="text" wicket:id="owner" size="30" tabindex="3" /></td></tr>\r
+                               <tr><th>Group</th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></td></tr>\r
+                               <tr><th>Enable Tickets</th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> <i>distributed Ticgit ticketing</i></td></tr>\r
+                               <tr><th>Enable Docs</th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> <i>distributed Markdown documentation</i></td></tr>\r
+                               <tr><td class="edit" colspan="2"><input type="submit" value="Submit" tabindex="7" /></td></tr>\r
                        </tbody>\r
                </table>\r
        </form> \r
index fab3203efc23f60c3f9f8612b60a11c1503b8481..e2905683bfeee4cf141ec1ce9e8b58a75c432b45 100644 (file)
@@ -7,8 +7,10 @@ import org.apache.wicket.markup.html.form.CheckBox;
 import org.apache.wicket.markup.html.form.Form;\r
 import org.apache.wicket.markup.html.form.TextField;\r
 import org.apache.wicket.model.CompoundPropertyModel;\r
+import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.GitBlit;\r
+import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.AdminPage;\r
 import com.gitblit.wicket.BasePage;\r
 import com.gitblit.wicket.WicketUtils;\r
@@ -30,8 +32,17 @@ public class EditRepositoryPage extends BasePage {
                // edit constructor\r
                super(params);\r
                isCreate = false;\r
-               String repositoryName = WicketUtils.getRepositoryName(params);\r
-               setupPage(new RepositoryModel(repositoryName, "", "", new Date()));\r
+               String name = WicketUtils.getRepositoryName(params);\r
+               Repository r = GitBlit.self().getRepository(name);\r
+               String description = JGitUtils.getRepositoryDescription(r);\r
+               String owner = JGitUtils.getRepositoryOwner(r);\r
+               String group = JGitUtils.getRepositoryGroup(r);\r
+               RepositoryModel model = new RepositoryModel(name, description, owner, new Date());\r
+               model.group = group;\r
+               model.useTickets = JGitUtils.getRepositoryUseTickets(r);\r
+               model.useDocs = JGitUtils.getRepositoryUseDocs(r);\r
+               model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);\r
+               setupPage(model);\r
        }\r
 \r
        protected void setupPage(final RepositoryModel repository) {\r
@@ -55,9 +66,9 @@ public class EditRepositoryPage extends BasePage {
                form.add(new TextField<String>("name").setEnabled(isCreate));\r
                form.add(new TextField<String>("description"));\r
                form.add(new TextField<String>("owner"));\r
+               form.add(new TextField<String>("group"));\r
                form.add(new CheckBox("useTickets"));\r
                form.add(new CheckBox("useDocs"));\r
-               form.add(new CheckBox("useNamedUsers"));\r
 \r
                add(form);\r
        }\r
index 24a344643a564df83ae3d6f1acf0b6673183fc56..bb132922e9dc708216a0a62eae43389fcbb8eb68 100644 (file)
@@ -20,6 +20,7 @@
                        <th wicket:id="orderByRepository"><wicket:message key="gb.repository">Repository</wicket:message></th>\r
                        <th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>\r
                        <th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>\r
+                       <th></th>\r
                        <th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>\r
                        <th></th>\r
                </tr>\r
@@ -28,8 +29,9 @@
                        <td><div class="list" wicket:id="repositoryName">[repository name]</div></td>\r
                        <td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>\r
                        <td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>\r
+                       <td class="icon"><img wicket:id="ticketsIcon" /><img wicket:id="docsIcon" /><img wicket:id="restrictedAccessIcon" /></td>\r
                        <td><span wicket:id="repositoryLastChange">[last change]</span></td>\r
-                       <td><a wicket:id="repositoryLinks"><wicket:message key="gb.edit">[edit]</wicket:message></a></td>\r
+                       <td class="rightAlign"><span wicket:id="repositoryLinks"></span></td>\r
                        </tr>\r
        </tbody>\r
        </table>\r
                        <a wicket:id="newRepository"><wicket:message key="gb.newRepository"></wicket:message></a> | <a wicket:id="newUser"><wicket:message key="gb.newUser"></wicket:message></a>\r
                </div>  \r
        </wicket:fragment>\r
+       \r
+       <wicket:fragment wicket:id="repositoryAdminLinks">\r
+               <span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a> | <a wicket:id="renameRepository"><wicket:message key="gb.rename">[rename]</wicket:message></a> | <a wicket:id="deleteRepository"><wicket:message key="gb.delete">[delete]</wicket:message></a></span>\r
+       </wicket:fragment>\r
 </wicket:extend>\r
 </body>\r
 </html>
\ No newline at end of file
index 4aba988f1f65a2d71abcbf96cedac9f06569b706..a7ec963ac3d58875760b78d8d566c7867566cb0c 100644 (file)
@@ -48,7 +48,7 @@ public class RepositoriesPage extends BasePage {
                } else {\r
                        showAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);\r
                }\r
-               \r
+\r
                Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);\r
                adminLinks.add(new BookmarkablePageLink<Void>("newRepository", EditRepositoryPage.class));\r
                adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
@@ -60,7 +60,7 @@ public class RepositoriesPage extends BasePage {
                if (messageSource.equalsIgnoreCase("gitblit")) {\r
                        // Read default welcome message\r
                        try {\r
-                               ContextRelativeResource res = new ContextRelativeResource("/com/gitblit/wicket/resources/welcome.mkd");\r
+                               ContextRelativeResource res = WicketUtils.getResource("welcome.mkd");\r
                                InputStream is = res.getResourceStream().getInputStream();\r
                                InputStreamReader reader = new InputStreamReader(is);\r
                                StringWriter writer = new StringWriter();\r
@@ -112,6 +112,25 @@ public class RepositoriesPage extends BasePage {
                                PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);\r
                                item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));\r
                                item.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));\r
+\r
+                               if (entry.useTickets) {\r
+                                       item.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png", getString("gb.tickets")));\r
+                               } else {\r
+                                       item.add(WicketUtils.newClearPixel("ticketsIcon"));\r
+                               }\r
+                               \r
+                               if (entry.useDocs) {\r
+                                       item.add(WicketUtils.newImage("docsIcon", "book_16x16.png", getString("gb.docs")));\r
+                               } else {\r
+                                       item.add(WicketUtils.newClearPixel("docsIcon"));\r
+                               }\r
+                               \r
+                               if (entry.useRestrictedAccess) {\r
+                                       item.add(WicketUtils.newImage("restrictedAccessIcon", "lock_16x16.png", getString("gb.restrictedAccess")));\r
+                               } else {\r
+                                       item.add(WicketUtils.newClearPixel("restrictedAccessIcon"));\r
+                               }\r
+                               \r
                                item.add(new Label("repositoryOwner", entry.owner));\r
 \r
                                String lastChange = TimeUtils.timeAgo(entry.lastChange);\r
@@ -119,8 +138,15 @@ public class RepositoriesPage extends BasePage {
                                item.add(lastChangeLabel);\r
                                WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));\r
 \r
-                               item.add(new BookmarkablePageLink<Void>("repositoryLinks", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setVisible(showAdmin));\r
-                               \r
+                               if (showAdmin) {\r
+                                       Fragment repositoryLinks = new Fragment("repositoryLinks", "repositoryAdminLinks", this);\r
+                                       repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)));\r
+                                       repositoryLinks.add(new BookmarkablePageLink<Void>("renameRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));\r
+                                       repositoryLinks.add(new BookmarkablePageLink<Void>("deleteRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));\r
+                                       item.add(repositoryLinks);\r
+                               } else {\r
+                                       item.add(new Label("repositoryLinks"));\r
+                               }\r
                                WicketUtils.setAlternatingBackground(item, counter);\r
                                counter++;\r
                        }\r
index 3d4a6ef86a79fff1aea8d7f73744737c20f95924..0c4c59536a8809b5cfbc4569208a4c3618c7f47c 100644 (file)
@@ -7,7 +7,6 @@ import java.util.List;
 \r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
 import org.eclipse.jgit.lib.Repository;\r
 import org.wicketstuff.googlecharts.AbstractChartData;\r
 import org.wicketstuff.googlecharts.Chart;\r
@@ -100,7 +99,7 @@ public class SummaryPage extends RepositoryPage {
                        \r
                        add(new Chart("commitsChart", provider));\r
                } else {\r
-                       add(new ContextImage("commitsChart", "blank.png"));\r
+                       add(WicketUtils.newBlankImage("commitsChart"));\r
                }\r
        }\r
 \r
index f72792fc4742cf16c38812478aa657386f37c0a0..f180c9d3e0c6337e2d4f1e2b778f6a94bf448895 100644 (file)
@@ -24,6 +24,7 @@
        <!-- changed paths -->  \r
        <table style="width:100%" class="pretty">\r
                <tr wicket:id="changedPath">\r
+                       <td class="icon"><img wicket:id="pathIcon" /></td>\r
                        <td><span wicket:id="pathName"></span></td>                     \r
                        <td class="size"><span wicket:id="pathSize">[path size]</span></td>\r
                        <td class="mode"><span wicket:id="pathPermissions">[path permissions]</span></td>\r
index e29ba421fc6553a03d9b1da2bfc47c000bf7cd51..9022d444f14ba5dc4e2b071d09b39e1e612099fa 100644 (file)
@@ -57,12 +57,14 @@ public class TreePage extends RepositoryPage {
                                item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));\r
                                if (entry.isParentPath) {\r
                                        // parent .. path\r
+                                       item.add(WicketUtils.newBlankImage("pathIcon"));\r
                                        item.add(new Label("pathSize", ""));\r
                                        item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
                                        item.add(new Label("pathLinks", ""));\r
                                } else {\r
                                        if (entry.isTree()) {\r
                                                // folder/tree link\r
+                                               item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));\r
                                                item.add(new Label("pathSize", ""));\r
                                                item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
 \r
@@ -73,6 +75,7 @@ public class TreePage extends RepositoryPage {
                                                item.add(links);\r
                                        } else {\r
                                                // blob link\r
+                                               item.add(WicketUtils.newImage("pathIcon", "file_16x16.png"));\r
                                                item.add(new Label("pathSize", byteFormat.format(entry.size)));\r
                                                item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));\r
 \r
index 8a168ab4edb09d50189a5485927c6c6e70a36ee2..43cd126330bf4dcc374daa05727cd7eae83ca183 100644 (file)
@@ -25,9 +25,9 @@ public abstract class BasePanel extends Panel {
 \r
        protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
                if (searchType.equals(SearchType.AUTHOR)) {\r
-                       WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);\r
+                       WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
                } else if (searchType.equals(SearchType.COMMITTER)) {\r
-                       WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);\r
+                       WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
                }\r
        }\r
 }\r
index f8592133719c4085639af60fb798e87cd178b0ad..234e00baf308cd1323f3fd704d888c79de0d37ed 100644 (file)
@@ -5,7 +5,6 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 import org.apache.wicket.markup.html.panel.Fragment;\r
 import org.apache.wicket.markup.repeater.Item;\r
@@ -43,7 +42,7 @@ public class HistoryPanel extends BasePanel {
        public HistoryPanel(String wicketId, final String repositoryName, final String objectId, final String path, Repository r, int limit, int pageOffset) {\r
                super(wicketId);\r
                boolean pageResults = limit <= 0;\r
-               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
                if (itemsPerPage <= 1) {\r
                        itemsPerPage = 50;\r
                }\r
@@ -107,16 +106,16 @@ public class HistoryPanel extends BasePanel {
 \r
                                // merge icon\r
                                if (entry.getParentCount() > 1) {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+                                       item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
                                } else {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+                                       item.add(WicketUtils.newBlankImage("commitIcon"));\r
                                }\r
 \r
                                String shortMessage = entry.getShortMessage();\r
                                String trimmedMessage = StringUtils.trimShortLog(shortMessage);\r
                                LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
                                if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+                                       WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
                                }\r
                                item.add(shortlog);\r
 \r
index 8895dbcbe6e72da7fd09d19f3899ea8c1e55b199..23afc377aed35bf9b4bff983a046313bc8c7116f 100644 (file)
@@ -5,7 +5,6 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
@@ -38,7 +37,7 @@ public class LogPanel extends BasePanel {
        public LogPanel(String wicketId, final String repositoryName, final String objectId, Repository r, int limit, int pageOffset) {\r
                super(wicketId);\r
                boolean pageResults = limit <= 0;\r
-               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
                if (itemsPerPage <= 1) {\r
                        itemsPerPage = 50;\r
                }\r
@@ -87,9 +86,9 @@ public class LogPanel extends BasePanel {
 \r
                                // merge icon\r
                                if (entry.getParentCount() > 1) {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+                                       item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
                                } else {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+                                       item.add(WicketUtils.newBlankImage("commitIcon"));\r
                                }\r
                                \r
                                // short message\r
@@ -97,7 +96,7 @@ public class LogPanel extends BasePanel {
                                String trimmedMessage = StringUtils.trimShortLog(shortMessage);\r
                                LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
                                if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+                                       WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
                                }\r
                                item.add(shortlog);\r
 \r
index c467779aa2a3f34007367b58f1362c1e8a40c1a6..7cad29f05a7e28cfcfd4e79b6cd5500c8eb5f70d 100644 (file)
@@ -9,7 +9,7 @@
        <form wicket:id="searchForm">\r
                <div class="search">\r
                        <select wicket:id="searchType"/>                        \r
-                       <input type="text" id="searchBox" wicket:id="searchBox" value=""/>\r
+                       <input type="text" id="searchBox" wicket:id="searchBox" size="25" value=""/>\r
                </div>\r
        </form>\r
                \r
index deb0f6d246c463ad54140a176b78e478efdcac17..c2bae8fea0ed1ed3a9fd10d543700bb9d2871a69 100644 (file)
@@ -1,6 +1,5 @@
 package com.gitblit.wicket.panels;\r
 \r
-import java.text.MessageFormat;\r
 import java.util.ArrayList;\r
 import java.util.Arrays;\r
 import java.util.HashMap;\r
@@ -63,16 +62,20 @@ public class PageLinksPanel extends Panel {
                add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
 \r
-               // Get the repository tickets setting\r
-               boolean checkTicgit = GitBlit.self().settings().getBoolean(Keys.tickets.global, false);\r
-               checkTicgit |= GitBlit.self().settings().getBoolean(MessageFormat.format(Keys.tickets._ROOT + ".{0}", repositoryName), false);\r
-\r
-               // Add dynamic repository extras\r
                List<String> extras = new ArrayList<String>();\r
-               if (checkTicgit && JGitUtils.getTicketsBranch(r) != null) {\r
+\r
+               // Get the repository tickets setting\r
+               boolean checkTickets = JGitUtils.getRepositoryUseTickets(r);\r
+               if (checkTickets && JGitUtils.getTicketsBranch(r) != null) {\r
                        extras.add("tickets");\r
                }\r
 \r
+               // Get the repository docs setting\r
+               boolean checkDocs = JGitUtils.getRepositoryUseDocs(r);\r
+               if (checkDocs && JGitUtils.getDocumentsBranch(r) != null) {\r
+                       extras.add("docs");\r
+               }\r
+\r
                ListDataProvider<String> extrasDp = new ListDataProvider<String>(extras);\r
                DataView<String> extrasView = new DataView<String>("extra", extrasDp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -81,7 +84,10 @@ public class PageLinksPanel extends Panel {
                                String extra = item.getModelObject();\r
                                if (extra.equals("tickets")) {\r
                                        item.add(new Label("extraSeparator", " | "));\r
-                                       item.add(new LinkPanel("extraLink", null, "tickets", TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                                       item.add(new LinkPanel("extraLink", null, getString("gb.tickets"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
+                               } else if (extra.equals("docs")) {\r
+                                       item.add(new Label("extraSeparator", " | "));\r
+                                       item.add(new LinkPanel("extraLink", null, getString("gb.docs"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                                }\r
                        }\r
                };\r
@@ -110,7 +116,7 @@ public class PageLinksPanel extends Panel {
                private final String repositoryName;\r
 \r
                private final IModel<String> searchBoxModel = new Model<String>("");\r
-               \r
+\r
                private final IModel<SearchType> searchTypeModel = new Model<SearchType>(SearchType.COMMIT);\r
 \r
                public SearchForm(String id, String repositoryName) {\r
@@ -118,11 +124,11 @@ public class PageLinksPanel extends Panel {
                        this.repositoryName = repositoryName;\r
                        DropDownChoice<SearchType> searchType = new DropDownChoice<SearchType>("searchType", Arrays.asList(SearchType.values()));\r
                        searchType.setModel(searchTypeModel);\r
-                       WicketUtils.setHtmlTitle(searchType, getString("gb.searchTypeTooltip"));\r
-                       add(searchType);\r
+                       WicketUtils.setHtmlTooltip(searchType, getString("gb.searchTypeTooltip"));\r
+                       add(searchType.setVisible(GitBlit.self().settings().getBoolean(Keys.web.showSearchTypeSelection, false)));\r
                        TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);\r
                        add(searchBox);\r
-                       WicketUtils.setHtmlTitle(searchBox, getString("gb.searchTooltip"));\r
+                       WicketUtils.setHtmlTooltip(searchBox, getString("gb.searchTooltip"));\r
                        WicketUtils.setInputPlaceholder(searchBox, getString("gb.search"));\r
                }\r
 \r
@@ -130,6 +136,13 @@ public class PageLinksPanel extends Panel {
                public void onSubmit() {\r
                        SearchType searchType = searchTypeModel.getObject();\r
                        String searchString = searchBoxModel.getObject();\r
+                       for (SearchType type : SearchType.values()) {\r
+                               if (searchString.toLowerCase().startsWith(type.name().toLowerCase() + ":")) {\r
+                                       searchType = type;\r
+                                       searchString = searchString.substring(type.name().toLowerCase().length() + 1).trim();\r
+                                       break;\r
+                               }\r
+                       }\r
                        setResponsePage(SearchPage.class, WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType));\r
                }\r
        }\r
index b84d9df88ede5850561c1a550f3e4add08e07d9a..e8d8c7f345cb744cb544905dc0764894cdc8b9f4 100644 (file)
@@ -57,7 +57,7 @@ public class RefsPanel extends Panel {
                                        c = new LinkPanel("refName", null, entry, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry));\r
                                        WicketUtils.setCssClass(c, "otherRef");\r
                                }\r
-                               WicketUtils.setHtmlTitle(c, entry);\r
+                               WicketUtils.setHtmlTooltip(c, entry);\r
                                item.add(c);\r
                        }\r
                };\r
index c7e038d3feed072aab9ac585ca73080d5a849d19..7a877324766ef46edafed3d313afc000e8cdee1c 100644 (file)
@@ -4,7 +4,6 @@ import java.util.Date;
 import java.util.List;\r
 import java.util.Map;\r
 \r
-import org.apache.wicket.markup.html.image.ContextImage;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 import org.apache.wicket.markup.repeater.Item;\r
 import org.apache.wicket.markup.repeater.data.DataView;\r
@@ -34,7 +33,7 @@ public class SearchPanel extends BasePanel {
        public SearchPanel(String wicketId, final String repositoryName, final String objectId, final String value, SearchType searchType, Repository r, int limit, int pageOffset) {\r
                super(wicketId);\r
                boolean pageResults = limit <= 0;\r
-               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);\r
+               int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);\r
                if (itemsPerPage <= 1) {\r
                        itemsPerPage = 50;\r
                }\r
@@ -77,9 +76,9 @@ public class SearchPanel extends BasePanel {
 \r
                                // merge icon\r
                                if (entry.getParentCount() > 1) {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
+                                       item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
                                } else {\r
-                                       item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+                                       item.add(WicketUtils.newBlankImage("commitIcon"));\r
                                }\r
 \r
                                String shortMessage = entry.getShortMessage();\r
@@ -87,7 +86,7 @@ public class SearchPanel extends BasePanel {
                                // TODO highlight matches\r
                                LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
                                if (!shortMessage.equals(trimmedMessage)) {\r
-                                       WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
+                                       WicketUtils.setHtmlTooltip(shortlog, shortMessage);\r
                                }\r
                                item.add(shortlog);\r
 \r
index 40871b1fa0fb4dad629c7e6d0fd596bcb4ab52a6..e55b672eba96c8f7eb147c184a82155d4746d319 100644 (file)
@@ -3,7 +3,6 @@ package com.gitblit.wicket.panels;
 import java.util.List;\r
 \r
 import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.image.ContextImage;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 import org.apache.wicket.markup.html.panel.Fragment;\r
 import org.apache.wicket.markup.repeater.Item;\r
@@ -54,9 +53,9 @@ public class TagsPanel extends BasePanel {
 \r
                                // tag icon\r
                                if (entry.isAnnotatedTag()) {\r
-                                       item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/tag_16x16.png"));\r
+                                       item.add(WicketUtils.newImage("tagIcon", "tag_16x16.png"));\r
                                } else {\r
-                                       item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+                                       item.add(WicketUtils.newBlankImage("tagIcon"));\r
                                }\r
                                \r
                                item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
diff --git a/src/com/gitblit/wicket/resources/book_16x16.png b/src/com/gitblit/wicket/resources/book_16x16.png
new file mode 100644 (file)
index 0000000..e48ff95
Binary files /dev/null and b/src/com/gitblit/wicket/resources/book_16x16.png differ
diff --git a/src/com/gitblit/wicket/resources/bug_16x16.png b/src/com/gitblit/wicket/resources/bug_16x16.png
new file mode 100644 (file)
index 0000000..c7299fd
Binary files /dev/null and b/src/com/gitblit/wicket/resources/bug_16x16.png differ
diff --git a/src/com/gitblit/wicket/resources/file_16x16.png b/src/com/gitblit/wicket/resources/file_16x16.png
new file mode 100644 (file)
index 0000000..eda4488
Binary files /dev/null and b/src/com/gitblit/wicket/resources/file_16x16.png differ
diff --git a/src/com/gitblit/wicket/resources/folder_16x16.png b/src/com/gitblit/wicket/resources/folder_16x16.png
new file mode 100644 (file)
index 0000000..f1ed9ab
Binary files /dev/null and b/src/com/gitblit/wicket/resources/folder_16x16.png differ
index 12c43ed49ea91a427180150abecef15eef05e80c..3200381bc33a9ac90ddf484400fb241c332480af 100644 (file)
@@ -172,15 +172,20 @@ div.search {
        color:yellow;\r
        text-align:right;\r
        float:right;\r
-       padding:4px 4px 3px 3px;        \r
+       padding:4px 4px 3px 3px;\r
+       border-left: 1px solid #8080f0;\r
+       margin: 0px;\r
+       height: 23px;\r
 }\r
 \r
 div.search input {\r
+       vertical-align: top;\r
        background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center;\r
        color: #ddd;\r
        background-color: #000070;\r
        border: 1px solid transparent;\r
-       padding: 0px 2px 2px 22px;      \r
+       padding: 2px 2px 2px 22px;\r
+       margin: 0px;\r
 }\r
 \r
 div.search input:hover, div.search input:focus {\r
@@ -380,6 +385,7 @@ div.commitLegend {
        float: right;\r
        padding: 0.4em;\r
        vertical-align:top;\r
+       margin: 0px;\r
 }\r
 \r
 div.commitLegend span {\r
@@ -424,6 +430,21 @@ table.plain {
        padding: 8px;\r
 }\r
 \r
+table.plain td.edit {\r
+       padding: 3px;\r
+}\r
+\r
+table.plain td.edit input {\r
+       margin: 0px;\r
+       outline: 1px solid transparent;\r
+       border: 1px solid #ccc; \r
+       padding-left:5px;\r
+}\r
+\r
+table.plain td.edit input:focus, table.plain td.edit input:hover{\r
+       border: 1px solid orange;\r
+}\r
+\r
 table.pretty, table.repositories, table.comments {\r
        margin-bottom:5px;\r
        border-spacing: 0px;\r
@@ -436,8 +457,8 @@ table.pretty, table.comments, table.repositories {
 }\r
 \r
 table.pretty td.icon {\r
-       padding: 0px;\r
-       width: 20px;\r
+       padding: 0px 0px 0px 2px;       \r
+       width: 18px;\r
 }\r
 \r
 table.pretty td.icon img {\r
@@ -456,11 +477,16 @@ table.comments td {
 table.repositories th {\r
        background-color:#D2C3AF;\r
        padding: 4px;\r
+       border-top: 1px solid #808080;\r
        border-bottom: 1px solid #808080;\r
 }\r
 \r
 table.repositories td {\r
-       padding: 4px;\r
+       padding: 2px;\r
+}\r
+\r
+table.repositories td.icon img {\r
+       vertical-align: top;\r
 }\r
 \r
 table.repositories th a {\r
diff --git a/src/com/gitblit/wicket/resources/lock_16x16.png b/src/com/gitblit/wicket/resources/lock_16x16.png
new file mode 100644 (file)
index 0000000..ddf83d9
Binary files /dev/null and b/src/com/gitblit/wicket/resources/lock_16x16.png differ
diff --git a/src/com/gitblit/wicket/resources/pixel.png b/src/com/gitblit/wicket/resources/pixel.png
new file mode 100644 (file)
index 0000000..4d5f6df
Binary files /dev/null and b/src/com/gitblit/wicket/resources/pixel.png differ