aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorMartin van Beurden <chadoe@gmail.com>2014-09-14 19:35:22 +0200
committerMartin van Beurden <chadoe@gmail.com>2014-09-18 20:50:48 +0200
commit0055cbd3651ebde0f8b6cc70c9c44de56dc38830 (patch)
tree64a9ea617ba1f704139881c3960fa2425dad9018 /templates/base
parent4f74b4e6578be4251af65cd08daa37c884e431a0 (diff)
downloadgitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.tar.gz
gitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.zip
Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts: modules/setting/setting.go Conflicts: templates/repo/release/list.tmpl templates/user/dashboard/dashboard.tmpl Conflicts: routers/repo/setting.go
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/head.tmpl26
-rw-r--r--templates/base/navbar.tmpl18
2 files changed, 22 insertions, 22 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index a58299f8cf..55dd469093 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
- <head>
+ <head{{if AppRootSubUrl}} data-suburl="{{AppRootSubUrl}}"{{end}}>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="shortcut icon" href="/img/favicon.png" />
+ <link rel="shortcut icon" href="{{AppRootSubUrl}}/img/favicon.png" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="author" content="Gogs - Go Git Service" />
@@ -19,21 +19,21 @@
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
{{else}}
- <link href="/css/bootstrap.min.css" rel="stylesheet" />
- <link href="/css/font-awesome.min.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/bootstrap.min.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/font-awesome.min.css" rel="stylesheet" />
- <script src="/js/jquery-1.10.1.min.js"></script>
- <script src="/js/bootstrap.min.js"></script>
+ <script src="{{AppRootSubUrl}}/js/jquery-1.10.1.min.js"></script>
+ <script src="{{AppRootSubUrl}}/js/bootstrap.min.js"></script>
{{end}}
- <link href="/css/todc-bootstrap.min.css" rel="stylesheet" />
- <link href="/css/datepicker3.css" rel="stylesheet" />
- <link href="/css/bootstrap-colorpicker.min.css" rel="stylesheet" />
- <link href="/css/markdown.css" rel="stylesheet" />
- <link href="/css/gogs.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/todc-bootstrap.min.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/datepicker3.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/bootstrap-colorpicker.min.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/markdown.css" rel="stylesheet" />
+ <link href="{{AppRootSubUrl}}/css/gogs.css" rel="stylesheet" />
- <script src="/js/lib.js"></script>
- <script src="/js/app.js"></script>
+ <script src="{{AppRootSubUrl}}/js/lib.js"></script>
+ <script src="{{AppRootSubUrl}}/js/app.js"></script>
<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
</head>
<body>
diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl
index 75096a4e43..991e773d8b 100644
--- a/templates/base/navbar.tmpl
+++ b/templates/base/navbar.tmpl
@@ -1,8 +1,8 @@
<div class="masthead navbar" id="masthead">
<div class="container">
<nav class="nav">
- <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
- <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
+ <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="{{AppRootSubUrl}}/"><img src="{{AppRootSubUrl}}/img/favicon.png" alt="Gogs Logo" id="logo"></a>
+ <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="{{AppRootSubUrl}}/">Dashboard</a>
<a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>
{{if .IsSigned}}
{{if .HasAccess}}
@@ -22,27 +22,27 @@
</div>
</form> -->
{{end}}
- <a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
+ <a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppRootSubUrl}}/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a>
- <a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="/user/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
+ <a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="{{AppRootSubUrl}}/user/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
{{if .IsAdmin}}
- <a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
+ <a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="{{AppRootSubUrl}}/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
{{end}}
<div class="navbar-right nav-item pull-right{{if .PageIsNewRepo}} active{{end}}" id="nav-repo-new" data-toggle="tooltip" data-placement="bottom" title="New Repo">
<button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
<div class="dropdown-menu">
<ul class="list-unstyled">
- <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
- <li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
+ <li><a href="{{AppRootSubUrl}}/repo/create"><i class="fa fa-book"></i>Repository</a></li>
+ <li><a href="{{AppRootSubUrl}}/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
<!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
</ul>
</div>
</div>
{{else}}
- <a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/" rel="nofollow">Sign In</a>
- <a id="nav-signup" class="nav-item navbar-right" href="/user/sign_up/" rel="nofollow">Sign Up</a>
+ <a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppRootSubUrl}}/user/login/" rel="nofollow">Sign In</a>
+ <a id="nav-signup" class="nav-item navbar-right" href="{{AppRootSubUrl}}/user/sign_up/" rel="nofollow">Sign Up</a>
{{end}}
</nav>
</div>