}
// RefUrl guesses and returns reference URL.
-func (sf *SubModuleFile) RefUrl() string {
+func (sf *SubModuleFile) RefUrl(appUrl string) string {
if sf.refUrl == "" {
return ""
}
i := strings.Index(url, "@")
j := strings.LastIndex(url, ":")
if i > -1 && j > -1 {
- return "http://" + url[i+1:j] + "/" + url[j+1:]
+ // fix problem with reverse proxy works only with local server
+ if strings.Contains(appUrl,url[i+1:j]) {
+ return appUrl + url[j+1:]
+ } else {
+ return "http://" + url[i+1:j] + "/" + url[j+1:]
+ }
}
+
return url
}
<span class="octicon octicon-file-submodule"></span>
</td>
<td class="name">
- {{if $commit.RefUrl}}
- <a href="{{$commit.RefUrl}}" class="text-truncate">{{$entry.Name}}</a> @ <a href="{{$commit.RefUrl}}/commit/{{$commit.RefId}}">{{ShortSha $commit.RefId}}</a>
+ {{if $commit.RefUrl AppUrl}}
+ <a href="{{$commit.RefUrl AppUrl}}" class="text-truncate">{{$entry.Name}}</a> @ <a href="{{$commit.RefUrl AppUrl}}/commit/{{$commit.RefId}}">{{ShortSha $commit.RefId}}</a>
{{else}}
{{$entry.Name}} @ {{ShortSha $commit.RefId}}
{{end}}