0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 18:02:52 +01:00

Mirror fix

This commit is contained in:
Unknown 2014-03-18 18:31:54 -04:00
parent 58147bef20
commit fbd252c1cf
18 changed files with 133 additions and 83 deletions

View file

@ -18,6 +18,7 @@ func Home(ctx *middleware.Context) {
ctx.Render.HTML(200, "home", ctx.Data) ctx.Render.HTML(200, "home", ctx.Data)
} }
func Help(ctx *middleware.Context) string { func Help(ctx *middleware.Context) {
return "This is help page" ctx.Data["PageIsHelp"] = true
ctx.Render.HTML(200, "help", ctx.Data)
} }

View file

@ -182,10 +182,12 @@ func Commits(ctx *middleware.Context, params martini.Params) {
ctx.Render.HTML(200, "repo/commits", ctx.Data) ctx.Render.HTML(200, "repo/commits", ctx.Data)
} }
func Issues(ctx *middleware.Context) string { func Issues(ctx *middleware.Context) {
return "This is issues page" ctx.Data["IsRepoToolbarIssues"] = true
ctx.Render.HTML(200, "repo/issues", ctx.Data)
} }
func Pulls(ctx *middleware.Context) string { func Pulls(ctx *middleware.Context) {
return "This is pulls page" ctx.Data["IsRepoToolbarPulls"] = true
ctx.Render.HTML(200, "repo/pulls", ctx.Data)
} }

View file

@ -14,10 +14,11 @@ import (
"github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/middleware"
) )
// render user setting page (email, website modify) // Render user setting page (email, website modify)
func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.Data["Title"] = "Setting" ctx.Data["Title"] = "Setting"
ctx.Data["PageIsUserSetting"] = true ctx.Data["PageIsUserSetting"] = true // For navbar arrow.
ctx.Data["IsUserPageSetting"] = true // For setting nav highlight.
user := ctx.User user := ctx.User
ctx.Data["Owner"] = user ctx.Data["Owner"] = user
@ -50,6 +51,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) { func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) {
ctx.Data["Title"] = "Password" ctx.Data["Title"] = "Password"
ctx.Data["PageIsUserSetting"] = true ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingPasswd"] = true
if ctx.Req.Method == "GET" { if ctx.Req.Method == "GET" {
ctx.Render.HTML(200, "user/password", ctx.Data) ctx.Render.HTML(200, "user/password", ctx.Data)
@ -149,20 +151,23 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
} }
ctx.Data["PageIsUserSetting"] = true ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingSSH"] = true
ctx.Data["Keys"] = keys ctx.Data["Keys"] = keys
ctx.Render.HTML(200, "user/publickey", ctx.Data) ctx.Render.HTML(200, "user/publickey", ctx.Data)
} }
func SettingNotification(ctx *middleware.Context) { func SettingNotification(ctx *middleware.Context) {
// todo user setting notification // TODO: user setting notification
ctx.Data["Title"] = "Notification" ctx.Data["Title"] = "Notification"
ctx.Data["PageIsUserSetting"] = true ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingNotify"] = true
ctx.Render.HTML(200, "user/notification", ctx.Data) ctx.Render.HTML(200, "user/notification", ctx.Data)
} }
func SettingSecurity(ctx *middleware.Context) { func SettingSecurity(ctx *middleware.Context) {
// todo user setting security // TODO: user setting security
ctx.Data["Title"] = "Security" ctx.Data["Title"] = "Security"
ctx.Data["PageIsUserSetting"] = true ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingSecurity"] = true
ctx.Render.HTML(200, "user/security", ctx.Data) ctx.Render.HTML(200, "user/security", ctx.Data)
} }

View file

@ -151,6 +151,8 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) {
func Delete(ctx *middleware.Context) { func Delete(ctx *middleware.Context) {
ctx.Data["Title"] = "Delete Account" ctx.Data["Title"] = "Delete Account"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingDelete"] = true
if ctx.Req.Method == "GET" { if ctx.Req.Method == "GET" {
ctx.Render.HTML(200, "user/delete", ctx.Data) ctx.Render.HTML(200, "user/delete", ctx.Data)
@ -182,7 +184,7 @@ func Delete(ctx *middleware.Context) {
} }
const ( const (
feedTpl = `<i class="icon fa fa-%s"></i> TPL_FEED = `<i class="icon fa fa-%s"></i>
<div class="info"><span class="meta">%s</span><br>%s</div>` <div class="info"><span class="meta">%s</span><br>%s</div>`
) )
@ -194,20 +196,20 @@ func Feeds(ctx *middleware.Context, form auth.FeedsForm) {
feeds := make([]string, len(actions)) feeds := make([]string, len(actions))
for i := range actions { for i := range actions {
feeds[i] = fmt.Sprintf(feedTpl, base.ActionIcon(actions[i].OpType), feeds[i] = fmt.Sprintf(TPL_FEED, base.ActionIcon(actions[i].OpType),
base.TimeSince(actions[i].Created), base.ActionDesc(actions[i], ctx.User.AvatarLink())) base.TimeSince(actions[i].Created), base.ActionDesc(actions[i], ctx.User.AvatarLink()))
} }
ctx.Render.JSON(200, &feeds) ctx.Render.JSON(200, &feeds)
} }
func Issues(ctx *middleware.Context) string { func Issues(ctx *middleware.Context) {
return "This is issues page" ctx.Render.HTML(200, "user/issues", ctx.Data)
} }
func Pulls(ctx *middleware.Context) string { func Pulls(ctx *middleware.Context) {
return "This is pulls page" ctx.Render.HTML(200, "user/pulls", ctx.Data)
} }
func Stars(ctx *middleware.Context) string { func Stars(ctx *middleware.Context) {
return "This is stars page" ctx.Render.HTML(200, "user/stars", ctx.Data)
} }

View file

@ -3,7 +3,7 @@
<nav class="gogs-nav"> <nav class="gogs-nav">
<a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a> <a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a>
<a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a> <a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
<a class="gogs-nav-item" href="/help">Help</a>{{if .IsSigned}} <a class="gogs-nav-item{{if .PageIsHelp}} active{{end}}" href="/help">Help</a>{{if .IsSigned}}
<a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a> <a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}"> <a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/> <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>

11
templates/help.tmpl Normal file
View file

@ -0,0 +1,11 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body-nav">
<div class="container">
<h3>Help</h3>
</div>
</div>
<div id="gogs-body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div>
{{template "base/footer" .}}

View file

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container"> <div id="gogs-body" class="container">
Website is still in the progress of building...please come back later! Welcome to the land of Gogs! There will be some indroduction!
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

View file

@ -0,0 +1,9 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
{{template "repo/toolbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-source">
</div>
</div>
{{template "base/footer" .}}

View file

@ -0,0 +1,9 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
{{template "repo/toolbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-source">
</div>
</div>
{{template "base/footer" .}}

View file

@ -0,0 +1,17 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body-nav">
<div class="container">
<ul class="nav nav-pills pull-right">
<li><a href="/">Feed</a></li>
<li class="active"><a href="/issues">Issues</a></li>
<li><a href="/pulls">Pull Requests</a></li>
<li><a href="/stars">Stars</a></li>
</ul>
<h3>Issues</h3>
</div>
</div>
<div id="gogs-body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div>
{{template "base/footer" .}}

View file

@ -1,17 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="gogs-body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> {{template "user/setting_nav" .}}
<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"> <div id="gogs-user-setting-container" class="col-md-9">
<h4>Notification</h4> <h4>Notification</h4>
</div> </div>

View file

@ -1,45 +1,35 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="gogs-body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> {{template "user/setting_nav" .}}
<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 list-group-item-success"><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"><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"> <div id="gogs-user-setting-container" class="col-md-9">
<div id="gogs-setting-pwd"> <div id="gogs-setting-pwd">
<h4>Password</h4> <h4>Password</h4>
<form class="form-horizontal" id="gogs-password-form" method="post" action="/user/setting/password">{{if .IsSuccess}} <form class="form-horizontal" id="gogs-password-form" method="post" action="/user/setting/password">{{if .IsSuccess}}
<p class="alert alert-success">Password is changed successfully. You can now sign in via new password.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} <p class="alert alert-success">Password is changed successfully. You can now sign in via new password.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">Old Password<strong class="text-danger">*</strong></label> <label class="col-md-3 control-label">Old Password<strong class="text-danger">*</strong></label>
<div class="col-md-8"> <div class="col-md-7">
<input type="password" name="oldpasswd" class="form-control" placeholder="Type your current password" required="required"> <input type="password" name="oldpasswd" class="form-control" placeholder="Type your current password" required="required">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">New Password<strong class="text-danger">*</strong></label> <label class="col-md-3 control-label">New Password<strong class="text-danger">*</strong></label>
<div class="col-md-8"> <div class="col-md-7">
<input type="password" name="newpasswd" class="form-control" placeholder="Type your new password" required="required"> <input type="password" name="newpasswd" class="form-control" placeholder="Type your new password" required="required">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">Re-Type<strong class="text-danger">*</strong></label> <label class="col-md-3 control-label">Re-Type<strong class="text-danger">*</strong></label>
<div class="col-md-8"> <div class="col-md-7">
<input type="password" name="retypepasswd" class="form-control" placeholder="Re-type your new password" required="required"> <input type="password" name="retypepasswd" class="form-control" placeholder="Re-type your new password" required="required">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-8"> <div class="col-md-offset-3 col-md-7">
<button type="submit" class="btn btn-primary">Change Password</button>&nbsp;&nbsp; <button type="submit" class="btn btn-primary">Change Password</button>&nbsp;&nbsp;
<a href="/forget-password/">Forgot your password?</a> <a href="/forget-password/">Forgot your password?</a>
</div> </div>

View file

@ -1,18 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="gogs-body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> {{template "user/setting_nav" .}}
<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 list-group-item-success"><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"> <div id="gogs-user-setting-container" class="col-md-9">
<div id="gogs-ssh-keys"> <div id="gogs-ssh-keys">
<h4>SSH Keys</h4>{{if .AddSSHKeySuccess}} <h4>SSH Keys</h4>{{if .AddSSHKeySuccess}}

17
templates/user/pulls.tmpl Normal file
View file

@ -0,0 +1,17 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body-nav">
<div class="container">
<ul class="nav nav-pills pull-right">
<li><a href="/">Feed</a></li>
<li><a href="/issues">Issues</a></li>
<li class="active"><a href="/pulls">Pull Requests</a></li>
<li><a href="/stars">Stars</a></li>
</ul>
<h3>Pull Requests</h3>
</div>
</div>
<div id="gogs-body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div>
{{template "base/footer" .}}

View file

@ -1,17 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="gogs-body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> {{template "user/setting_nav" .}}
<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"> <div id="gogs-user-setting-container" class="col-md-9">
<h4>Security</h4> <h4>Security</h4>
</div> </div>

View file

@ -1,17 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="gogs-body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> {{template "user/setting_nav" .}}
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item list-group-item-success"><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"><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"> <div id="gogs-user-setting-container" class="col-md-9">
<div id="gogs-setting-pwd"> <div id="gogs-setting-pwd">
<h4>Account Profile</h4> <h4>Account Profile</h4>

View file

@ -0,0 +1,11 @@
<div id="gogs-user-setting-nav" class="col-md-3">
<h4>Account Setting</h4>
<ul class="list-group">
<li class="list-group-item{{if .IsUserPageSetting}} list-group-item-success{{end}}"><a href="/user/setting">Account Profile</a></li>
<li class="list-group-item{{if .IsUserPageSettingPasswd}} list-group-item-success{{end}}"><a href="/user/setting/password">Password</a></li>
<li class="list-group-item{{if .IsUserPageSettingNotify}} list-group-item-success{{end}}"><a href="/user/setting/notification">Notifications</a></li>
<li class="list-group-item{{if .IsUserPageSettingSSH}} list-group-item-success{{end}}"><a href="/user/setting/ssh/">SSH Keys</a></li>
<li class="list-group-item{{if .IsUserPageSettingSecurity}} list-group-item-success{{end}}"><a href="/user/setting/security">Security</a></li>
<li class="list-group-item{{if .IsUserPageSettingDelete}} list-group-item-success{{end}}"><a href="/user/delete">Delete Account</a></li>
</ul>
</div>

17
templates/user/stars.tmpl Normal file
View file

@ -0,0 +1,17 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="gogs-body-nav">
<div class="container">
<ul class="nav nav-pills pull-right">
<li><a href="/">Feed</a></li>
<li><a href="/issues">Issues</a></li>
<li><a href="/pulls">Pull Requests</a></li>
<li class="active"><a href="/stars">Stars</a></li>
</ul>
<h3>Stars</h3>
</div>
</div>
<div id="gogs-body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div>
{{template "base/footer" .}}