## Features
- Activity timeline
-- SSH/HTTPS(Clone only) protocol support.
+- SSH/HTTP(S) protocol support.
- Register/delete/rename account.
- Create/delete/watch/rename/transfer public repository.
- Repository viewer.
## 功能特性
- 活动时间线
-- SSH/HTTPS(仅限 Clone) 协议支持
+- SSH/HTTP(S) 协议支持
- 注册/删除/重命名用户
- 创建/删除/关注/重命名/转移公开仓库
- 仓库浏览器
// Test that go1.2 tag above is included in builds. main.go refers to this definition.
const go12tag = true
-const APP_VER = "0.2.2.0407 Alpha"
+const APP_VER = "0.2.2.0408 Alpha"
func init() {
base.AppVer = APP_VER
return err
}
+// SetRepoEnvs sets environment variables for command update.
+func SetRepoEnvs(userId int64, userName, repoName string) {
+ os.Setenv("userId", base.ToStr(userId))
+ os.Setenv("userName", userName)
+ os.Setenv("repoName", repoName)
+}
+
// InitRepository initializes README and .gitignore if needed.
func initRepository(f string, user *User, repo *Repository, initReadme bool, repoLang, license string) error {
repoPath := RepoPath(user.Name, repo.Name)
return nil
}
- // for update use
- os.Setenv("userName", user.Name)
- os.Setenv("userId", base.ToStr(user.Id))
- os.Setenv("repoName", repo.Name)
+ SetRepoEnvs(user.Id, user.Name, repo.Name)
// Apply changes and commit.
return initRepoCommit(tmpDir, user.NewGitSig())
AppName string
AppLogo string
AppUrl string
+ IsProdMode bool
Domain string
SecretKey string
RunUser string
"AppDomain": func() string {
return Domain
},
+ "IsProdMode": func() bool {
+ return IsProdMode
+ },
"LoadTimes": func(startTime time.Time) string {
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
},
switch base.Cfg.MustValue("", "RUN_MODE") {
case "prod":
martini.Env = martini.Prod
+ base.IsProdMode = true
case "test":
martini.Env = martini.Test
}
qlog.Fatal("Unknown command")
}
- // for update use
- os.Setenv("userName", user.Name)
- os.Setenv("userId", strconv.Itoa(int(user.Id)))
- os.Setenv("repoName", repoName)
+ models.SetRepoEnvs(user.Id, user.Name, repoName)
gitcmd := exec.Command(verb, repoPath)
gitcmd.Dir = base.RepoRootPath
<meta name="_csrf" content="{{.CsrfToken}}" />
<!-- Stylesheets -->
+ {{if IsProdMode}}
+ <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
+ <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
+
+ <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/todc-bootstrap.min.css" rel="stylesheet" />
<link href="/css/font-awesome.min.css" rel="stylesheet" />
- <link href="/css/markdown.css" rel="stylesheet" />
- <link href="/css/gogs.css" rel="stylesheet" />
<script src="/js/jquery-1.10.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
+ {{end}}
+
+ <link href="/css/todc-bootstrap.min.css" rel="stylesheet" />
+ <link href="/css/markdown.css" rel="stylesheet" />
+ <link href="/css/gogs.css" rel="stylesheet" />
+
<script src="/js/lib.js"></script>
<script src="/js/app.js"></script>
<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>