]> source.dussan.org Git - gitea.git/commitdiff
more HTTP clone word fix
authorUnknwon <u@gogs.io>
Sun, 22 Nov 2015 18:01:42 +0000 (13:01 -0500)
committerUnknwon <u@gogs.io>
Sun, 22 Nov 2015 18:01:42 +0000 (13:01 -0500)
modules/template/template.go
routers/repo/pull.go
templates/repo/bare.tmpl
templates/repo/home.tmpl

index 8d602760adc67582952c36146d13a2b93404b3fe..37c7d793514df93c1adf2efa7239e1d5d575fe89 100644 (file)
@@ -25,8 +25,8 @@ var Funcs template.FuncMap = map[string]interface{}{
        "GoVer": func() string {
                return strings.Title(runtime.Version())
        },
-       "Protocol": func() string {
-               return string(setting.Protocol)
+       "UseHTTPS": func() bool {
+               return strings.HasPrefix(setting.AppUrl, "https")
        },
        "AppName": func() string {
                return setting.AppName
index ee66da73b0b31d05a5a62889d4e4d88caa876b57..d7b4828a91b09dba8ad2d8bd5bf06b015c6aa4f2 100644 (file)
@@ -448,7 +448,7 @@ func ParseCompareInfo(ctx *middleware.Context) (*models.User, *models.Repository
 
        // Check if current user has fork of repository.
        headRepo, has := models.HasForkedRepo(headUser.Id, repo.ID)
-       if !has || !ctx.User.IsAdminOfRepo(headRepo) {
+       if !has || (!ctx.User.IsAdminOfRepo(headRepo) && !ctx.User.IsAdmin) {
                ctx.Handle(404, "HasForkedRepo", nil)
                return nil, nil, nil, nil, "", ""
        }
index e57420d8e5fbf08d52b8770d333b24129387051c..af839cbaf83a34086230020eeaec22f6ebec4bab 100644 (file)
@@ -22,7 +22,7 @@
               </button>
               {{end}}
               <button class="ui {{if $.DisableSSH}}blue{{end}} basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
-                HTTPS
+                {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
               </button>
               <input id="repo-clone-url" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
               <button class="ui basic button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
index 4069eff384f3fe14aa8e01f9811c2bc0bee9cc32..ab82c8423c51fd09c104af7b45cb0a32ec82babf 100644 (file)
@@ -18,7 +18,7 @@
           </button>
           {{end}}
           <button class="ui {{if $.DisableSSH}}blue{{end}} basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
-            {{if eq Protocol "http"}}HTTP{{else}}HTTPS{{end}}
+            {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
           </button>
           <input id="repo-clone-url" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
           <button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">