diff options
author | fuxiaohei <fuxiaohei@vip.qq.com> | 2014-06-23 19:11:20 +0800 |
---|---|---|
committer | fuxiaohei <fuxiaohei@vip.qq.com> | 2014-06-23 19:11:20 +0800 |
commit | fb53cc4fa82bbbbba4b8b0281d5f5657b1a6fafc (patch) | |
tree | 0bcf6cdae0be51b7c5cadb38b04d3c48ba8f9253 | |
parent | f393dc652007238c27bd5d1954a03ba97412eee5 (diff) | |
download | gitea-fb53cc4fa82bbbbba4b8b0281d5f5657b1a6fafc.tar.gz gitea-fb53cc4fa82bbbbba4b8b0281d5f5657b1a6fafc.zip |
add organization setting page
-rw-r--r-- | cmd/web.go | 1 | ||||
-rw-r--r-- | routers/org/org.go | 5 | ||||
-rw-r--r-- | templates/org/setting.tmpl | 151 |
3 files changed, 157 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go index 65ea606433..d29183a9dc 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -194,6 +194,7 @@ func runWeb(*cli.Context) { r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) + r.Get("/:org/setting", org.Setting) }) m.Group("/:username/:reponame", func(r martini.Router) { diff --git a/routers/org/org.go b/routers/org/org.go index 8073d10b8e..ff97402ebc 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -29,3 +29,8 @@ func Dashboard(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Dashboard" ctx.HTML(200, "org/dashboard") } + +func Setting(ctx *middleware.Context, param martini.Params) { + ctx.Data["Title"] = "Setting" + ctx.HTML(200, "org/setting") +} diff --git a/templates/org/setting.tmpl b/templates/org/setting.tmpl new file mode 100644 index 0000000000..1be9707a1a --- /dev/null +++ b/templates/org/setting.tmpl @@ -0,0 +1,151 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body-nav"> + <div class="container"> + <div class="btn-group pull-left" id="dashboard-switch"> + <button type="button" class="btn btn-default"> + <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" + title="username"> + gogits + </button> + <!-- + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> + <span class="caret"></span> + </button> + <div class="dropdown-menu clone-group-btn no-propagation"> + <ul id="dashboard-switch-menu" class="list-unstyled"> + <li class="checked"><a href="#"><i class="fa fa-check"></i> + <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" title="username"> + gogits/gogs</a> + </li> + </ul> + </div>--> + </div> + <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="#">Setting</a></li> + <!-- <li><a href="/pulls">Pull Requests</a></li> + <li><a href="/stars">Stars</a></li> --> + </ul> + </div> +</div> +<div id="body" class="container" data-page="org"> + <div id="user-setting-nav" class="col-md-2 repo-setting-nav"> + <ul class="list-group"> + <li class="list-group-item active"><a href="#">Options</a></li> + </ul> + </div> + <div id="repo-setting-container" class="col-md-10"> + {{template "base/alert" .}} + <div class="panel panel-default"> + <div class="panel-heading"> + Repository Options + </div> + + <div class="panel-body"> + <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="form-horizontal"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="update"> + + <div class="form-group"> + <label class="col-md-3 text-right" for="org-setting-name">Name</label> + + <div class="col-md-9"> + <input class="form-control" name="name" value="" title="" id="org-setting-name"/> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right" for="org-email">Email</label> + + <div class="col-md-9"> + <input class="form-control" name="email" value="" title="" id="org-email" type="email"/> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right" for="org-desc">Description</label> + + <div class="col-md-9"> + <textarea class="form-control" name="desc" id="org-desc" rows="3">{{.Repository.Description}}</textarea> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right" for="org-site">Official Site</label> + + <div class="col-md-9"> + <input type="url" class="form-control" name="site" value="{{.Repository.Website}}" + id="org-site"/> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right" for="org-location">Location</label> + + <div class="col-md-9"> + <input class="form-control" name="email" value="" title="" id="org-location"/> + </div> + </div> + + <div class="form-group"> + <div class="col-md-9 col-md-offset-3"> + <button class="btn btn-primary" type="submit">Save Options</button> + </div> + </div> + </form> + </div> + </div> + + <div class="panel panel-warning"> + <div class="panel-heading"> + Danger Zone + </div> + <div class="panel-body"> + <button type="button" class="btn btn-default pull-right" href="#delete-org-modal" data-toggle="modal"> + Delete this organization + </button> + <dd> + <dt>Delete this organization</dt> + <dl>Once you delete this organization and all repositories in, there is no going back. Please be + certain. + </dl> + </dd> + + <div class="modal fade" id="delete-org-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" + aria-hidden="true"> + <div class="modal-dialog"> + <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" + class="modal-content"> + {{.CsrfTokenHtml}} + <input type="hidden" name="action" value="delete"> + + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" + aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">Delete organization</h4> + </div> + + <div class="modal-body"> + <div class="form-group"> + <label>Please enter your organization name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label> + <input name="organization" class="form-control" type="text" + placeholder="Type your organization name" required="required"> + </div> + </div> + + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button class="btn btn-danger btn-lg">I understand the consequences, delete this + organization + </button> + </div> + </form> + </div> + </div> + </div> + </div> + </div> +</div> +{{template "base/footer" .}} |