Browse Source

add draft page for empty link

pull/31/head
FuXiaoHei 11 years ago
parent
commit
d18237850c
  1. 14
      routers/user/setting.go
  2. 2
      templates/repo/single.tmpl
  3. 19
      templates/user/notification.tmpl
  4. 19
      templates/user/security.tmpl
  5. 2
      web.go

14
routers/user/setting.go

@ -154,3 +154,17 @@ func SettingSSHKeys(form auth.AddSSHKeyForm, r render.Render, data base.TmplData
data["Keys"] = keys
r.HTML(200, "user/publickey", data)
}
func SettingNotification(r render.Render, data base.TmplData) {
// todo user setting notification
data["Title"] = "Notification"
data["PageIsUserSetting"] = true
r.HTML(200, "user/notification", data)
}
func SettingSecurity(r render.Render, data base.TmplData) {
// todo user setting security
data["Title"] = "Security"
data["PageIsUserSetting"] = true
r.HTML(200, "user/security", data)
}

2
templates/repo/single.tmpl

@ -30,7 +30,7 @@
<tbody>
{{range .Files}}
<tr {{if .IsDir}}class="is-dir"{{end}}>
<td class="name"><i class="fa fa-file"></i><a href="#">{{.Name}}</a></td>
<td class="name"><i class="fa {{if .IsDir}}fa-folder{{else}}fa-file{{end}}"></i><a href="#">{{.Name}}</a></td>
<td class="date"><time datetime="{{.Created}}" data-title="true" title="{{.Created}}">{{TimeSince .Created}}</time></td>
<td class="text">{{.Message}}</td>
</tr>

19
templates/user/notification.tmpl

@ -0,0 +1,19 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-user-setting-nav" class="col-md-3">
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item"><a href="/user/setting">Account Profile</a></li>
<li class="list-group-item"><a href="/user/setting/password">Password</a></li>
<li class="list-group-item list-group-item-success"><a href="/user/setting/notification">Notifications</a></li>
<li class="list-group-item"><a href="/user/setting/ssh/">SSH Keys</a></li>
<li class="list-group-item"><a href="/user/setting/security">Security</a></li>
<li class="list-group-item"><a href="/user/delete">Delete Account</a></li>
</ul>
</div>
<div id="gogs-user-setting-container" class="col-md-9">
<h4>Notification</h4>
</div>
</div>
{{template "base/footer" .}}

19
templates/user/security.tmpl

@ -0,0 +1,19 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-user-setting-nav" class="col-md-3">
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item"><a href="/user/setting">Account Profile</a></li>
<li class="list-group-item"><a href="/user/setting/password">Password</a></li>
<li class="list-group-item"><a href="/user/setting/notification">Notifications</a></li>
<li class="list-group-item"><a href="/user/setting/ssh/">SSH Keys</a></li>
<li class="list-group-item list-group-item-success"><a href="/user/setting/security">Security</a></li>
<li class="list-group-item"><a href="/user/delete">Delete Account</a></li>
</ul>
</div>
<div id="gogs-user-setting-container" class="col-md-9">
<h4>Security</h4>
</div>
</div>
{{template "base/footer" .}}

2
web.go

@ -67,6 +67,8 @@ func runWeb(*cli.Context) {
m.Any("/user/setting", auth.SignInRequire(true), binding.BindIgnErr(auth.UpdateProfileForm{}), user.Setting)
m.Any("/user/setting/password", auth.SignInRequire(true), binding.BindIgnErr(auth.UpdatePasswdForm{}), user.SettingPassword)
m.Any("/user/setting/ssh", auth.SignInRequire(true), binding.BindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys)
m.Any("/user/setting/notification",auth.SignInRequire(true),user.SettingNotification)
m.Any("/user/setting/security",auth.SignInRequire(true),user.SettingSecurity)
m.Get("/user/:username", auth.SignInRequire(false), user.Profile)

Loading…
Cancel
Save