<wicket:extend>\r
\r
<div class="forkSource">\r
- <b><span class="repositorySwatch" wicket:id="forkSourceSwatch"></span></b>\r
- <span wicket:id="forkSourceAvatar" style="vertical-align: baseline;"></span>\r
- <span wicket:id="forkSourceProject">[a project]</span> / <span wicket:id="forkSource">[a fork]</span> \r
+ <div>\r
+ <b><span class="repositorySwatch" wicket:id="forkSourceSwatch"></span></b>\r
+ <span wicket:id="forkSourceAvatar" style="vertical-align: baseline;"></span>\r
+ <span wicket:id="forkSourceProject">[a project]</span> / <span wicket:id="forkSource">[a fork]</span>\r
+ </div> \r
+ <div style="padding-left:32px;" wicket:id="forkSourceOrigin">[origin repository]</div>\r
</div>\r
\r
<div wicket:id="fork">\r
- <div class="forkEntry">\r
+ <div class="forkEntry" style="margin-left:32px;">\r
<span wicket:id="anAvatar" style="vertical-align: baseline;"></span>\r
<span wicket:id="aProject">[a project]</span> / <span wicket:id="aFork">[a fork]</span>\r
+ <span wicket:id="anIcon" class="forks"></span>\r
</div>\r
</div>\r
+ \r
+ <wicket:fragment wicket:id="originFragment">\r
+ <p class="originRepository"><wicket:message key="gb.forkedFrom">[forked from]</wicket:message> <span wicket:id="originRepository">[origin repository]</span></p>\r
+ </wicket:fragment>\r
+ \r
</wicket:extend> \r
</body>\r
</html>
\ No newline at end of file
*/\r
package com.gitblit.wicket.pages;\r
\r
+import java.text.MessageFormat;\r
import java.util.ArrayList;\r
import java.util.List;\r
\r
import org.apache.wicket.Component;\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
// user can not view the origin\r
add(new Label("forkSource", StringUtils.stripDotGit(source)));\r
}\r
+ \r
+ // superOrigin?\r
+ if (StringUtils.isEmpty(origin.originRepository)) {\r
+ // origin is root\r
+ add(new Label("forkSourceOrigin").setVisible(false));\r
+ } else {\r
+ // origin has an origin\r
+ RepositoryModel superOrigin = GitBlit.self().getRepositoryModel(origin.originRepository);\r
+ if (!user.canViewRepository(superOrigin)) {\r
+ // show superOrigin repository without link\r
+ Fragment forkFrag = new Fragment("forkSourceOrigin", "originFragment", this);\r
+ forkFrag.add(new Label("originRepository", StringUtils.stripDotGit(superOrigin.name)));\r
+ add(forkFrag);\r
+ } else {\r
+ // link to superOrigin repository\r
+ Fragment forkFrag = new Fragment("forkSourceOrigin", "originFragment", this);\r
+ forkFrag.add(new LinkPanel("originRepository", null, StringUtils.stripDotGit(superOrigin.name), \r
+ SummaryPage.class, WicketUtils.newRepositoryParameter(superOrigin.name)));\r
+ add(forkFrag);\r
+ }\r
+ }\r
\r
// only display user-accessible forks\r
List<RepositoryModel> forks = new ArrayList<RepositoryModel>();\r
String repo = StringUtils.getLastPathElement(fork.name);\r
item.add(new LinkPanel("aFork", null, StringUtils.stripDotGit(repo), SummaryPage.class, WicketUtils.newRepositoryParameter(fork.name)));\r
\r
- WicketUtils.setCssStyle(item, "margin-left:25px;");\r
+ if (ArrayUtils.isEmpty(fork.forks)) {\r
+ // repository is a leaf\r
+ Component icon = new Label("anIcon", "<i class=\"icon-leaf\" ></i>").setEscapeModelStrings(false);\r
+ WicketUtils.setHtmlTooltip(icon, MessageFormat.format(getString("gb.noForks"), fork.name));\r
+ item.add(icon);\r
+ } else {\r
+ // show forks link\r
+ item.add(new LinkPanel("anIcon", null, "(" + getString("gb.forks") + ")", ForksPage.class, WicketUtils.newRepositoryParameter(fork.name)));\r
+ }\r
}\r
};\r
\r