]> source.dussan.org Git - gitblit.git/commitdiff
Set rel="nofollow" on compressed download links
authorJames Moger <james.moger@gitblit.com>
Thu, 20 Jun 2013 21:26:03 +0000 (17:26 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 20 Jun 2013 21:26:03 +0000 (17:26 -0400)
releases.moxie
src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java
src/main/java/com/gitblit/wicket/panels/LinkPanel.java

index 4d2e87524f37b3d7770cfcc4fca96b8d44145b8f..74e7d14d4a355d7bff62e6962ea17b5e9ad4777c 100644 (file)
@@ -41,6 +41,7 @@ r17: {
         - Properly set application/json content-type on api calls\r
         - Make days back filter choices a setting\r
         - Changed default days back filter setting to 7 days\r
+        - Set rel="nofollow" on compressed download links\r
         - Improved page title\r
         - Updated Polish translation\r
         - Updated Japanese translation\r
@@ -71,7 +72,7 @@ r17: {
 \r
     contributors:\r
        - Bandarupalli Satyanarayana\r
-       - Chad H.\r
+       - Chad Horohoe\r
        - Christian Aistleitner\r
        - David Ostrovsky\r
        - Egbert Teeselink\r
@@ -86,7 +87,7 @@ r17: {
        - Lukasz Jader\r
        - Martijn Laan\r
        - Matthias Bauer\r
-       - Michal Pailloncy\r
+       - Michael Pailloncy\r
        - Michael Schaefers\r
        - Oliver Doepner\r
        - Philip Boutros\r
@@ -99,14 +100,14 @@ r17: {
        - Thomas Pummer\r
        - William Whittle\r
        - Yukihiko Sawanobori\r
-        - github/akquinet\r
-        - github/dapengme\r
+       - github/akquinet\r
+       - github/dapengme\r
        \r
        dependencyChanges:\r
        - JGit 3.0.0-SNAPSHOT\r
        - Iconic font\r
        - AngularJS 1.0.7\r
-        - FreeMarker 2.3.19\r
+       - FreeMarker 2.3.19\r
        \r
        settings:\r
        - { name: 'git.daemonBindInterface', defaultValue: 'localhost' }\r
index b22c75876d083d5e440a21bc5e4983b2cdcc2fa8..122ae55e073f769e19ef61174bb3e62da6cd1e10 100644 (file)
@@ -60,7 +60,8 @@ public class CompressedDownloadsPanel extends Panel {
                                \r
                                String href = DownloadZipServlet.asLink(baseUrl, repositoryName,\r
                                                objectId, path, format);\r
-                               Component c = new LinkPanel("compressedLink", null, format.name(), href);\r
+                               LinkPanel c = new LinkPanel("compressedLink", null, format.name(), href);\r
+                               c.setNoFollow();\r
                                item.add(c);\r
                                Label lb = new Label("linkSep", "|");\r
                                lb.setVisible(counter > 0);\r
index 688a957621b5fd0be2d2bd2a14ae44a17651abaa..21470b279894cae8fdd5b46ce51d46dae719cf38 100644 (file)
@@ -15,6 +15,7 @@
  */\r
 package com.gitblit.wicket.panels;\r
 \r
+import org.apache.wicket.Component;\r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.behavior.SimpleAttributeModifier;\r
 import org.apache.wicket.markup.html.WebPage;\r
@@ -106,5 +107,10 @@ public class LinkPanel extends Panel {
                link.add(new Label("label", labelModel));\r
                add(link);\r
        }\r
+       \r
+       public void setNoFollow() {\r
+               Component c = get("link");\r
+               c.add(new SimpleAttributeModifier("rel", "nofollow"));\r
+       }\r
 \r
 }\r