diff options
author | zhsso <zhssoge@gmail.com> | 2014-04-10 14:20:58 -0400 |
---|---|---|
committer | zhsso <zhssoge@gmail.com> | 2014-04-10 14:20:58 -0400 |
commit | a4cbe79567072befd96cf1b7eb319de1e2809ca3 (patch) | |
tree | 3dff34e53f34632532fd7a05e00e6f06b3e7fb82 /templates | |
parent | f3ed11d177d76bcb1850c6670c1516d25a66eb2c (diff) | |
download | gitea-a4cbe79567072befd96cf1b7eb319de1e2809ca3.tar.gz gitea-a4cbe79567072befd96cf1b7eb319de1e2809ca3.zip |
fix
Diffstat (limited to 'templates')
57 files changed, 3134 insertions, 0 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl new file mode 100644 index 0000000000..31cfb77bad --- /dev/null +++ b/templates/admin/config.tmpl @@ -0,0 +1,179 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-10"> + <div class="panel panel-default"> + <div class="panel-heading"> + Server Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Application Name</dt> + <dd>{{AppName}}</dd> + <dt>Application Version</dt> + <dd>{{AppVer}}</dd> + <dt>Application URL</dt> + <dd>{{.AppUrl}}</dd> + <dt>Domain</dt> + <dd>{{.Domain}}</dd> + <hr/> + <dt>Run User</dt> + <dd>{{.RunUser}}</dd> + <dt>Run Mode</dt> + <dd>{{.RunMode}}</dd> + <hr/> + <dt>Repository Root Path</dt> + <dd>{{.RepoRootPath}}</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Database Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Type</dt> + <dd>{{.DbCfg.Type}}</dd> + <dt>Host</dt> + <dd>{{.DbCfg.Host}}</dd> + <dt>Name</dt> + <dd>{{.DbCfg.Name}}</dd> + <dt>User</dt> + <dd>{{.DbCfg.User}}</dd> + <dt>SslMode</dt> + <dd>{{.DbCfg.SslMode}} (for "postgres" only)</dd> + <dt>Path</dt> + <dd>{{.DbCfg.Path}} (for "sqlite3" only)</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Service Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Register Email Confirmation</dt> + <dd><i class="fa fa{{if .Service.RegisterEmailConfirm}}-check{{end}}-square-o"></i></dd> + <dt>Disenable Registeration</dt> + <dd><i class="fa fa{{if .Service.DisenableRegisteration}}-check{{end}}-square-o"></i></dd> + <dt>Require Sign In View</dt> + <dd><i class="fa fa{{if .Service.RequireSignInView}}-check{{end}}-square-o"></i></dd> + <dt>Mail Notification</dt> + <dd><i class="fa fa{{if .Service.NotifyMail}}-check{{end}}-square-o"></i></dd> + <dt>Enable Cache Avatar</dt> + <dd><i class="fa fa{{if .Service.EnableCacheAvatar}}-check{{end}}-square-o"></i></dd> + <hr/> + <dt>Active Code Lives</dt> + <dd>{{.Service.ActiveCodeLives}} minutes</dd> + <dt>Reset Password Code Lives</dt> + <dd>{{.Service.ResetPwdCodeLives}} minutes</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Mailer Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Enabled</dt> + <dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd> + <dt>Name</dt> + <dd>{{.Mailer.Name}}</dd> + <dt>Host</dt> + <dd>{{.Mailer.Host}}</dd> + <dt>User</dt> + <dd>{{.Mailer.User}}</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Cache Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Cache Adapter</dt> + <dd>{{.CacheAdapter}}</dd> + <dt>Cache Config</dt> + <dd><div style="padding-top: 5px;"><pre>{{.CacheConfig}}</pre></div></dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Session Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Session Provider</dt> + <dd>{{.SessionProvider}}</dd> + <dt>Cookie Name</dt> + <dd>{{.SessionConfig.CookieName}}</dd> + <dt>Enable Set Cookie</dt> + <dd><i class="fa fa{{if .SessionConfig.EnableSetCookie}}-check{{end}}-square-o"></i></dd> + <dt>GC Interval Time</dt> + <dd>{{.SessionConfig.GcIntervalTime}} seconds</dd> + <dt>Session Life Time</dt> + <dd>{{.SessionConfig.SessionLifeTime}} seconds</dd> + <dt>HTTPS Only</dt> + <dd><i class="fa fa{{if .SessionConfig.CookieSecure}}-check{{end}}-square-o"></i></dd> + <dt>Cookie Life Time</dt> + <dd>{{.SessionConfig.CookieLifeTime}} seconds</dd> + <dt>Session ID Hash Function</dt> + <dd>{{.SessionConfig.SessionIDHashFunc}}</dd> + <dt>Session ID Hash Key</dt> + <dd>{{.SessionConfig.SessionIDHashKey}}</dd> + <dt>Provider Config</dt> + <dd>{{.SessionConfig.ProviderConfig}}</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Picture Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Picture Service</dt> + <dd>{{.PictureService}}</dd> + </dl> + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + Log Configuration + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Log Mode</dt> + <dd>{{.LogMode}}</dd> + <dt>Log Config</dt> + <dd> + <div style="padding-top: 5px;"><pre>{{.LogConfig}}</pre></div> + </dd> + </dl> + + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl new file mode 100644 index 0000000000..2334c676d9 --- /dev/null +++ b/templates/admin/dashboard.tmpl @@ -0,0 +1,115 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-10"> + <div class="panel panel-default"> + <div class="panel-heading"> + Statistic + </div> + + <div class="panel-body"> + Gogs database has <b>{{.Stats.Counter.User}}</b> users, <b>{{.Stats.Counter.PublicKey}}</b> SSH keys, <b>{{.Stats.Counter.Repo}}</b> repositories, <b>{{.Stats.Counter.Watch}}</b> watches, <b>{{.Stats.Counter.Action}}</b> actions, and <b>{{.Stats.Counter.Access}}</b> accesses. + </div> + </div> + + <div class="panel panel-default"> + <div class="panel-heading"> + System Monitor Status + </div> + + <div class="panel-body"> + <dl class="dl-horizontal admin-dl-horizontal"> + <dt>Server Uptime</dt> + <dd>{{.SysStatus.Uptime}}</dd> + + <dt>Current Goroutines</dt> + <dd>{{.SysStatus.NumGoroutine}}</dd> + + <hr/> + <dt>Current Memory Usage</dt> + <dd>{{.SysStatus.MemAllocated}}</dd> + + <dt>Total Memory Allocated</dt> + <dd>{{.SysStatus.MemTotal}}</dd> + + <dt>Memory Obtained</dt> + <dd>{{.SysStatus.MemSys}}</dd> + + <dt>Pointer Lookup Times</dt> + <dd>{{.SysStatus.Lookups}}</dd> + + <dt>Memory Allocate Times</dt> + <dd>{{.SysStatus.MemMallocs}}</dd> + + <dt>Memory Free Times</dt> + <dd>{{.SysStatus.MemFrees}}</dd> + + <hr/> + <dt>Current Heap Usage</dt> + <dd>{{.SysStatus.HeapAlloc}}</dd> + + <dt>Heap Memory Obtained</dt> + <dd>{{.SysStatus.HeapSys}}</dd> + + <dt>Heap Memory Idle</dt> + <dd>{{.SysStatus.HeapIdle}}</dd> + + <dt>Heap Memory In Use</dt> + <dd>{{.SysStatus.HeapInuse}}</dd> + + <dt>Heap Memory Released</dt> + <dd>{{.SysStatus.HeapReleased}}</dd> + + <dt>Heap Objects</dt> + <dd>{{.SysStatus.HeapObjects}}</dd> + + <hr/> + <dt>Bootstrap Stack Usage</dt> + <dd>{{.SysStatus.StackInuse}}</dd> + + <dt>Stack Memory Obtained</dt> + <dd>{{.SysStatus.StackSys}}</dd> + + <dt>MSpan Structures Usage</dt> + <dd>{{.SysStatus.MSpanInuse}}</dd> + + <dt>MSpan Structures Obtained</dt> + <dd>{{.SysStatus.HeapSys}}</dd> + + <dt>MCache Structures Usage</dt> + <dd>{{.SysStatus.MCacheInuse}}</dd> + + <dt>MCache Structures Obtained</dt> + <dd>{{.SysStatus.MCacheSys}}</dd> + + <dt>Profiling Bucket Hash Table Obtained</dt> + <dd>{{.SysStatus.BuckHashSys}}</dd> + + <dt>GC Metadada Obtained</dt> + <dd>{{.SysStatus.GCSys}}</dd> + + <dt>Other System Allocation Obtained</dt> + <dd>{{.SysStatus.OtherSys}}</dd> + + <hr/> + <dt>Next GC Recycle</dt> + <dd>{{.SysStatus.NextGC}}</dd> + + <dt>Last GC Time</dt> + <dd>{{.SysStatus.LastGC}} ago</dd> + + <dt>Total GC Pause</dt> + <dd>{{.SysStatus.PauseTotalNs}}</dd> + + <dt>Last GC Pause</dt> + <dd>{{.SysStatus.PauseNs}}</dd> + + <dt>GC Times</dt> + <dd>{{.SysStatus.NumGC}}</dd> + </dl> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/admin/nav.tmpl b/templates/admin/nav.tmpl new file mode 100644 index 0000000000..33ecfae5e3 --- /dev/null +++ b/templates/admin/nav.tmpl @@ -0,0 +1,8 @@ +<div id="user-setting-nav" class="col-md-2 admin-nav"> + <ul class="list-group"> + <li class="list-group-item{{if .PageIsDashboard}} active{{end}}"><a href="/admin"><i class="fa fa-tachometer fa-lg"></i> Dashboard</a></li> + <li class="list-group-item{{if .PageIsUsers}} active{{end}}"><a href="/admin/users"><i class="fa fa-users fa-lg"></i> Users</a></li> + <li class="list-group-item{{if .PageIsRepos}} active{{end}}"><a href="/admin/repos"><i class="fa fa-book fa-lg"></i> Repositories</a></li> + <li class="list-group-item{{if .PageIsConfig}} active{{end}}"><a href="/admin/config"><i class="fa fa-cogs fa-lg"></i> Configuration</a></li> + </ul> +</div>
\ No newline at end of file diff --git a/templates/admin/repos.tmpl b/templates/admin/repos.tmpl new file mode 100644 index 0000000000..3c0f5e09f7 --- /dev/null +++ b/templates/admin/repos.tmpl @@ -0,0 +1,42 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-10"> + <div class="panel panel-default"> + <div class="panel-heading"> + Repository Management + </div> + + <div class="panel-body"> + <table class="table table-striped"> + <thead> + <tr> + <th>Id</th> + <th>Owner</th> + <th>Name</th> + <th>Private</th> + <th>Watches</th> + <th>Forks</th> + <th>Created</th> + </tr> + </thead> + <tbody> + {{range .Repos}} + <tr> + <td>{{.Id}}</td> + <th>{{.UserName}}</th> + <td><a href="/{{.UserName}}/{{.Name}}">{{.Name}}</a></td> + <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td> + <td>{{.NumWatches}}</td> + <td>{{.NumForks}}</td> + <td>{{DateFormat .Created "M d, Y"}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/admin/users.tmpl b/templates/admin/users.tmpl new file mode 100644 index 0000000000..14fddf33c4 --- /dev/null +++ b/templates/admin/users.tmpl @@ -0,0 +1,45 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-10"> + <div class="panel panel-default"> + <div class="panel-heading"> + User Management + </div> + + <div class="panel-body"> + <a href="/admin/users/new" class="btn btn-primary">New Account</a> + <table class="table table-striped"> + <thead> + <tr> + <th>Id</th> + <th>Name</th> + <th>E-mail</th> + <th>Actived</th> + <th>Admin</th> + <th>Repos</th> + <th>Join</th> + <th>Edit</th> + </tr> + </thead> + <tbody> + {{range .Users}} + <tr> + <td>{{.Id}}</td> + <td><a href="/user/{{.Name}}">{{.Name}}</a></td> + <td>{{.Email}}</td> + <td><i class="fa fa{{if .IsActive}}-check{{end}}-square-o"></i></td> + <td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td> + <td>{{.NumRepos}}</td> + <td>{{DateFormat .Created "M d, Y"}}</td> + <td><a href="/admin/users/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td> + </tr> + {{end}} + </tbody> + </table> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/admin/users/edit.tmpl b/templates/admin/users/edit.tmpl new file mode 100644 index 0000000000..5db2c7a95e --- /dev/null +++ b/templates/admin/users/edit.tmpl @@ -0,0 +1,84 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-9"> + <div class="panel panel-default"> + <div class="panel-heading"> + Edit Account + </div> + + <div class="panel-body"> + <br/> + <form action="/admin/users/{{.User.Id}}" method="post" class="form-horizontal"> + {{if .IsSuccess}}<p class="alert alert-success">Account profile has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} + {{.CsrfTokenHtml}} + <input type="hidden" value="{{.User.Id}}" name="userId"/> + <div class="form-group"> + <label class="col-md-3 control-label">Username: </label> + <label class="control-label">{{.User.Name}}</label> + </div> + + <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Email<strong class="text-danger">*</strong></label> + <div class="col-md-7"> + <input name="email" class="form-control" placeholder="Type account's e-mail address" value="{{.User.Email}}" required="required"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Website</label> + <div class="col-md-7"> + <input name="website" class="form-control" placeholder="Type account's website URL" value="{{.User.Website}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Location</label> + <div class="col-md-7"> + <input name="location" class="form-control" placeholder="Type account's current location" value="{{.User.Location}}"> + </div> + </div> + + <div class="form-group {{if .Err_Avatar}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Gravatar Email<strong class="text-danger">*</strong></label> + <div class="col-md-7"> + <input name="avatar" class="form-control" placeholder="Type account's Gravatar e-mail address" required="required" value="{{.User.AvatarEmail}}"> + </div> + </div> + + <div class="form-group"> + <div class="col-md-7 col-md-offset-3"> + <div class="checkbox"> + <label> + <input type="checkbox" name="active" {{if .User.IsActive}}checked{{end}}> + <strong>This account has activated</strong> + </label> + </div> + </div> + </div> + + <div class="form-group"> + <div class="col-md-7 col-md-offset-3"> + <div class="checkbox"> + <label> + <input type="checkbox" name="admin" {{if .User.IsAdmin}}checked{{end}}> + <strong>This account has administor permisson</strong> + </label> + </div> + </div> + </div> + <hr/> + <div class="form-group"> + <div class="col-md-offset-3 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary btn-block">Update account profile</button> + <a type="button" href="/admin/users/{{.User.Id}}/delete" class="btn btn-lg btn-danger btn-block">Delete this account</a> + </div> + </div> + </form> + </div> + </div> + + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/admin/users/new.tmpl b/templates/admin/users/new.tmpl new file mode 100644 index 0000000000..7f441f32b3 --- /dev/null +++ b/templates/admin/users/new.tmpl @@ -0,0 +1,55 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="admin"> + {{template "admin/nav" .}} + <div id="admin-container" class="col-md-9"> + <div class="panel panel-default"> + <div class="panel-heading"> + New Account + </div> + + <div class="panel-body"> + <br/> + <form action="/admin/users/new" method="post" class="form-horizontal"> + {{.CsrfTokenHtml}} + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Username: </label> + <div class="col-md-7"> + <input name="username" class="form-control" placeholder="Type account's username" value="{{.username}}" required="required"> + </div> + </div> + + <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Email: </label> + <div class="col-md-7"> + <input name="email" class="form-control" placeholder="Type account's e-mail address" value="{{.email}}" required="required" title="Email is not valid"> + </div> + </div> + + <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Password: </label> + <div class="col-md-7"> + <input name="passwd" type="password" class="form-control" placeholder="Type account's password" required="required" title="Password must contain at least 6 characters"> + </div> + </div> + + <div class="form-group {{if .Err_RetypePasswd}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Re-type: </label> + <div class="col-md-7"> + <input name="retypepasswd" type="password" class="form-control" placeholder="Re-type account's password" required="required" title="Re-type Password must be same to Password"> + </div> + </div> + <hr/> + <div class="form-group"> + <div class="col-md-offset-3 col-md-7"> + <button type="submit" class="btn btn-lg btn-primary">Create new account</button> + </div> + </div> + </form> + </div> + </div> + + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl new file mode 100644 index 0000000000..6c2da63e5d --- /dev/null +++ b/templates/base/footer.tmpl @@ -0,0 +1,21 @@ +<div class="wrapper-push"></div> +</div> +<footer id="footer"> + <div class="container footer-wrap"> + <div class="row"> + <div class="col-md-6"> + <p>© 2014 GoGits · Version: {{AppVer}} · + Page: <b>{{LoadTimes .PageStartTime}}</b> · + Template: <b>{{call .TmplLoadTimes}}</b> + </p> + </div> + + <div class="col-md-1" style="margin: -5px;"> + <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github fa-2x"></i></a> + </div> + <p class="desc"></p> + </div> + </div> +</footer> +</body> +</html>
\ No newline at end of file diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl new file mode 100644 index 0000000000..648eb7c467 --- /dev/null +++ b/templates/base/head.tmpl @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <link rel="shortcut icon" href="/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" /> + <meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" /> + <meta name="keywords" content="go, git"> + <meta name="_csrf" content="{{.CsrfToken}}" /> + {{if .Repository.IsGoget}}<meta name="go-import" content="{{AppDomain}} git {{.CloneLink.HTTPS}}">{{end}} + + <!-- 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/font-awesome.min.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> + </head> + <body> + <div id="wrapper"> + <noscript>Please enable JavaScript in your browser!</noscript>
\ No newline at end of file diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl new file mode 100644 index 0000000000..c0855d81ef --- /dev/null +++ b/templates/base/navbar.tmpl @@ -0,0 +1,45 @@ +<div class="masthead navbar" id="masthead"> + <div class="container"> + <nav class="nav"> + <a id="nav-logo" class="nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a> + <a class="nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a> + <a class="nav-item{{if .PageIsHelp}} active{{end}}" href="https://github.com/gogits/gogs/wiki">Help</a>{{if .IsSigned}} + <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-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/setting" data-toggle="tooltip" data-placement="bottom" title="Setting"><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>{{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/mirror"><i class="fa fa-clipboard"></i>Mirror</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/">Sign In</a> + <a id="nav-signup" class="nav-item navbar-right" href="/user/sign_up/">Sign Up</a>{{end}} + </nav> + </div> +</div> +<!--<nav class="navbar navbar-inverse navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse"> + <i class="fa fa-bars"></i> + </button> + <a class="navbar-brand" href="/"><img src="/img/favicon.png" alt="Gogs Logo"></a> + </div> + + <div class="collapse navbar-collapse" id="gopmweb-navbar-collapse"> + <ul class="nav navbar-nav"> + <li><a>{{.Title}}</a></li> + </ul> + + <a href="/user/signin" class="navbar-right btn btn-success navbar-btn">Sign In</a> + </div> + </div> +</nav>--> diff --git a/templates/help.tmpl b/templates/help.tmpl new file mode 100644 index 0000000000..e835c2981e --- /dev/null +++ b/templates/help.tmpl @@ -0,0 +1,11 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body-nav"> + <div class="container"> + <h3>Help</h3> + </div> +</div> +<div id="body" class="container" data-page="user"> + {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/home.tmpl b/templates/home.tmpl new file mode 100644 index 0000000000..d3a8c0c343 --- /dev/null +++ b/templates/home.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container"> + <h4>Hey there, welcome to the land of Gogs!</h4> + <p>If you just get your Gogs server running, go <a href="/install">install</a> guide page will help you setup things for your first-time run.</p> + <img src="http://gowalker.org/public/gogs_demo.gif"> +</div> +{{template "base/footer" .}} diff --git a/templates/install.tmpl b/templates/install.tmpl new file mode 100644 index 0000000000..c70cfa3e6b --- /dev/null +++ b/templates/install.tmpl @@ -0,0 +1,211 @@ +{{template "base/head" .}} +<div id="body" class="container"> + <form action="/install" method="post" class="form-horizontal card" id="install-card"> + {{.CsrfTokenHtml}} + <h3>Install Steps For First-time Run</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <p class="help-block text-center">Gogs requires MySQL or PostgreSQL, SQLite3 only available for official binary version</p> + <div class="form-group"> + <label class="col-md-3 control-label">Database Type: </label> + <div class="col-md-8"> + <select name="database" id="install-database" class="form-control"> + <option value="mysql">MySQL</option> + <option value="pgsql">PostgreSQL</option> + <option value="sqlite">SQLite3</option> + </select> + </div> + </div> + + <div class="server-sql"> + <div class="form-group"> + <label class="col-md-3 control-label">Host: </label> + <div class="col-md-8"> + <input name="host" class="form-control" placeholder="Type database server host" value="{{.host}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">User: </label> + + <div class="col-md-8"> + <input name="user" class="form-control" placeholder="Type database username" value="{{.user}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Password: </label> + + <div class="col-md-8"> + <input name="passwd" type="password" class="form-control" placeholder="Type database password" value="{{.passwd}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Database Name: </label> + + <div class="col-md-8"> + <input name="database_name" type="text" class="form-control" placeholder="Type mysql database name" value="{{.database_name}}"> + <p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p> + </div> + </div> + + <div class="form-group pgsql-setting hide"> + <label class="col-md-3 control-label">SSL Mode: </label> + <div class="col-md-8"> + <select name="ssl_mode" class="form-control"> + <option value="disable">Disable</option> + <option value="require">Require</option> + <option value="verify-full">Verify Full</option> + </select> + </div> + </div> + </div> + + <div class="sqlite-setting hide"> + <div class="form-group"> + <label class="col-md-3 control-label">Path: </label> + + <div class="col-md-8"> + <input name="database_path" class="form-control" placeholder="Type sqlite3 file path" value="{{.database_path}}"> + <p class="help-block">The file path of SQLite3 database.</p> + </div> + </div> + </div> + + <hr/> + + <p class="help-block text-center">General Settings of Gogs</p> + <div class="form-group"> + <label class="col-md-3 control-label">Repository Path: </label> + + <div class="col-md-8"> + <input name="repo_path" type="text" class="form-control" placeholder="Type your repository directory" value="{{.repo_path}}" required="required"> + + <p class="help-block">The git copy of each repository is saved in this directory.</p> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Run User: </label> + + <div class="col-md-8"> + <input name="run_user" type="text" class="form-control" placeholder="Type system user name" value="{{.run_user}}" required="required"> + <p class="help-block">The user has access to visit and run Gogs.</p> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Domain: </label> + + <div class="col-md-8"> + <input name="domain" type="text" class="form-control" placeholder="Type your domain name" value="{{.domain}}" required="required"> + <p class="help-block">This affects SSH clone URL.</p> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">App URL: </label> + + <div class="col-md-8"> + <input name="app_url" type="text" class="form-control" placeholder="Type app root URL" value="{{.app_url}}" required="required"> + <p class="help-block">This affects HTTP/HTTPS clone URL and somewhere in e-mail.</p> + </div> + </div> + + <hr/> + + <p class="help-block text-center">Admin Account Settings</p> + <div class="form-group"> + <label class="col-md-3 control-label">Username: </label> + <div class="col-md-8"> + <input name="admin_name" type="text" class="form-control" placeholder="Type admin user name" value="{{.admin_name}}" required="required"> + </div> + </div> + + <div class="form-group {{if .Err_AdminPasswd}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Password: </label> + <div class="col-md-8"> + <input name="admin_pwd" type="password" class="form-control" placeholder="Type admin user password" value="{{.admin_pwd}}" required="required"> + </div> + </div> + + <div class="form-group {{if .Err_AdminEmail}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">E-mail: </label> + <div class="col-md-8"> + <input name="admin_email" type="text" class="form-control" placeholder="Type admin user e-mail" value="{{.admin_email}}" required="required"> + </div> + </div> + + <hr/> + + <div class="form-group text-center"> + <button class="btn btn-danger btn-lg">Install Gogs</button> + <button class="btn btn-default btn-sm" type="button" data-toggle="modal" data-target="#advance-options-modal"> + Advanced Options + </button> + </div> + + <div class="modal fade" id="advance-options-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"><h4 class="modal-title">Advanced Options</h4></div> + <div class="modal-body"> + <p class="help-block text-center">Email Service Settings</p> + + <div class="form-group"> + <label class="col-md-3 control-label">SMTP Host: </label> + + <div class="col-md-8"> + <input name="smtp_host" type="text" class="form-control" placeholder="Type SMTP host address and port" value="{{.smtp_host}}"> + </div> + </div> + <div class="form-group"> + <label class="col-md-3 control-label">Username: </label> + + <div class="col-md-8"> + <input name="mailer_user" type="text" class="form-control" placeholder="Type SMTP user e-mail address" value="{{.mailer_user}}"> + </div> + </div> + <div class="form-group"> + <label class="col-md-3 control-label">Password: </label> + + <div class="col-md-8"> + <input name="mailer_pwd" type="password" class="form-control" placeholder="Type SMTP user password" value="{{.mailer_pwd}}"> + </div> + </div> + <hr/> + <p class="text-center help-block">Notification Settings</p> + + <div class="form-group"> + <div class="col-md-offset-3 col-md-7"> + <div class="checkbox"> + <label> + <input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}> + <strong>Enable Register Confirmation</strong> + </label> + </div> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-3 col-md-7"> + <div class="checkbox"> + <label> + <input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}> + <strong>Enable Mail Notification</strong> + </label> + </div> + </div> + </div> + </div> + + <div class="modal-footer"> + <button type="button" class="btn btn-success" data-dismiss="modal">Confirm</button> + </div> + </div> + </div> + </div> + + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/issue/create.tmpl b/templates/issue/create.tmpl new file mode 100644 index 0000000000..5375040b09 --- /dev/null +++ b/templates/issue/create.tmpl @@ -0,0 +1,43 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="issue"> + <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form"> + {{.CsrfTokenHtml}} + <div class="col-md-1"> + <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/> + </div> + <div class="col-md-8 panel panel-default"> + <div class="form-group panel-body"> + <input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" /> + </div> + <div class="form-group panel-body"> + <div class="md-help pull-right"><!-- todo help link --> + Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a> + </div> + <ul class="nav nav-tabs" data-init="tabs"> + <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li> + <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repoLink={{.RepoLink}}" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li> + </ul> + <div class="tab-content"> + <div class="tab-pane" id="issue-textarea"> + <div class="form-group"> + <textarea class="form-control" name="content" id="issue-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="content">{{.content}}</textarea> + </div> + </div> + <div class="tab-pane issue-preview-content" id="issue-preview">loading...</div> + </div> + </div> + <div class="text-right panel-body"> + <div class="form-group"> + <input type="hidden" value="id" name="repo-id"/> + <button class="btn-success btn">Create new issue</button> + </div> + </div> + </div> + </form> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/issue/list.tmpl b/templates/issue/list.tmpl new file mode 100644 index 0000000000..de25b0e37f --- /dev/null +++ b/templates/issue/list.tmpl @@ -0,0 +1,40 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="issue"> + <div class="col-md-3 filter-list"> + <ul class="list-unstyled"> + <li><a href="{{.RepoLink}}/issues"{{if eq .ViewType "all"}} class="active"{{end}}>All Issues <strong class="pull-right">{{.IssueCount}}</strong></a></li> + <!-- <li><a href="#">Assigned to you</a></li> --> + <li><a href="{{.RepoLink}}/issues?type=created_by"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.IssueCreatedCount}}</strong></a></li> + <!-- <li><a href="#">Mentioned</a></li> --> + </ul> + </div> + <div class="col-md-9"> + <div class="filter-option"> + <div class="btn-group"> + <a class="btn btn-default issue-open{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}">{{.OpenCount}} Open</a> + <a class="btn btn-default issue-close{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?state=closed&type={{.ViewType}}">{{.ClosedCount}} Closed</a> + </div> + </div> + <div class="issues list-group"> + {{range .Issues}} + <div class="list-group-item issue-item" id="issue-{{.Id}}"> + <span class="number pull-right">#{{.Index}}</span> + <h5 class="title"><a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a></h5> + <p class="info"> + <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/> + <a href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a></span> + <span class="time">{{TimeSince .Created}}</span> + <span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span> + </p> + </div> + {{end}} + </div> + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/issue/user.tmpl b/templates/issue/user.tmpl new file mode 100644 index 0000000000..1d49395cb9 --- /dev/null +++ b/templates/issue/user.tmpl @@ -0,0 +1,52 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="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>Your Issues</h3> + </div> +</div> +<div id="body" class="container" data-page="user"> + {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} + <div id="issue"> + <div class="col-md-3 filter-list"> + <ul class="list-unstyled"> + <li><a href="/issues"{{if eq .ViewType "all"}} class="active"{{end}}>In your repositories <strong class="pull-right">{{.AllIssueCount}}</strong></a></li> + <!-- <li><a href="#">Assigned to you</a></li> --> + <li><a href="/issues?type=created_by"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.CreatedByCount}}</strong></a></li> + <li><hr/></li> + {{range .Repos}} + <li><a href="/issues?type={{$.ViewType}}{{if eq $.RepoId .Id}}{{else}}&repoid={{.Id}}{{end}}" class="sm{{if eq $.RepoId .Id}} active{{end}}">{{$.SignedUser.Name}}/{{.Name}} <strong class="pull-right">{{.NumOpenIssues}}</strong></a></li> + {{end}} + </ul> + </div> + <div class="col-md-9"> + <div class="filter-option"> + <div class="btn-group"> + <a class="btn btn-default issue-open{{if not .IsShowClosed}} active{{end}}" href="/issues?type={{.ViewType}}&repoid={{.RepoId}}">{{.OpenIssueCount}} Open</a> + <a class="btn btn-default issue-close{{if .IsShowClosed}} active{{end}}" href="/issues?state=closed&type={{.ViewType}}&repoid={{.RepoId}}">{{.ClosedIssueCount}} Close</a> + </div> + </div> + <div class="issues list-group"> + {{range .Issues}} + <div class="list-group-item issue-item" id="issue-{{.Id}}"> + <span class="number pull-right">#{{.Index}}</span> + <h5 class="title"><a href="/{{$.SignedUser.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a></h5> + <p class="info"> + <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/> + <a href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a></span> + <span class="time">{{TimeSince .Created}}</span> + <span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span> + </p> + </div> + {{end}} + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/issue/view.tmpl b/templates/issue/view.tmpl new file mode 100644 index 0000000000..16d60d3584 --- /dev/null +++ b/templates/issue/view.tmpl @@ -0,0 +1,105 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="issue"> + <div id="issue-{{.Issue.Id}}" class="issue-whole issue-is-opening"> + <div class="issue-head clearfix"> + <div class="number pull-right">#{{.Issue.Index}}</div> + <a class="author pull-left" href="/user/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a> + <h1 class="title pull-left">{{.Issue.Name}}</h1> + <input id="issue-edit-title" class="form-control input-lg pull-left hidden" type="text" value="{{.Issue.Name}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="title"/> + <input type="hidden" value="{{.Issue.Id}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/> + <p class="info pull-left"> + {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a> + <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a> + <a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}} + <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span> + <a href="/user/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue + <span class="time">{{TimeSince .Issue.Created}}</span> · {{.Issue.NumComments}} comments + </p> + </div> + <div class="issue-main"> + <div class="panel panel-default issue-content"> + <div class="panel-body markdown"> + <div class="content"> + {{str2html .Issue.RenderedContent}} + </div> + <textarea class="form-control hidden" name="content" id="issue-edit-content" rows="10" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="content">{{.Issue.Content}}</textarea> + </div> + </div> + {{range .Comments}} + {{if eq .Type 0}} + <div class="issue-child" id="issue-comment-{{.Id}}"> + <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> + <div class="issue-content panel panel-default"> + <div class="panel-heading"> + <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created}}</span> + <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a> + <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> --> + <span class="role label label-default pull-right">Owner</span> + </div> + <div class="panel-body markdown"> + {{str2html .Content}} + </div> + </div> + </div> + {{else if eq .Type 1}} + <div class="issue-child issue-opened"> + <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a> + <div class="issue-content"> + <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created}}</span> + </div> + </div> + {{else if eq .Type 2}} + <div class="issue-child issue-closed"> + <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a> + <div class="issue-content"> + <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created}}</span> + </div> + </div> + {{end}} + {{end}} + <hr class="issue-line"/> + {{if .SignedUser}}<div class="issue-child issue-reply"> + <a class="user pull-left" href="/user/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a> + <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post"> + {{.CsrfTokenHtml}} + <div class="panel-body"> + <div class="form-group"> + <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a> + </div> + <ul class="nav nav-tabs" data-init="tabs"> + <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li> + <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repoLink={{.RepoLink}}" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li> + </ul> + <div class="tab-content"> + <div class="tab-pane" id="issue-textarea"> + <div class="form-group"> + <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/> + <textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="content">{{.content}}</textarea> + </div> + </div> + <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div> + </div> + </div> + <div class="text-right"> + <div class="form-group"> + {{if .Issue.IsClosed}} + <input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}} + <input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}} + <button class="btn-success btn" id="issue-reply-btn">Comment</button> + </div> + </div> + </div> + </form> + </div>{{else}}<div class="alert alert-warning"><a class="btn btn-success btn-lg" href="/user/sign_up">Sign up for free</a> to join this conversation. Already have an account? <a href="/user/login">Sign in to comment</a></div>{{end}} + </div><!-- + <div class="col-md-3"> + label assignment milestone dashboard + </div>--> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/mail/auth/active_email.tmpl b/templates/mail/auth/active_email.tmpl new file mode 100644 index 0000000000..c04ddc8a30 --- /dev/null +++ b/templates/mail/auth/active_email.tmpl @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>{{.User.Name}}, please activate your account</title> +</head> +<body style="background:#eee;"> +<div style="color:#333; font:12px/1.5 Tahoma,Arial,sans-serif;; text-shadow:1px 1px #fff; padding:0; margin:0;"> + <div style="width:600px;margin:0 auto; padding:40px 0 20px;"> + <div style="border:1px solid #d9d9d9;border-radius:3px; background:#fff; box-shadow: 0px 2px 5px rgba(0, 0, 0,.05); -webkit-box-shadow: 0px 2px 5px rgba(0, 0, 0,.05);"> + <div style="padding: 20px 15px;"> + <h1 style="font-size:20px; padding:10px 0 20px; margin:0; border-bottom:1px solid #ddd;"><img src="{{.AppUrl}}/{{.AppLogo}}" style="height: 32px; margin-bottom: -10px;"> <a style="color:#333;text-decoration:none;" target="_blank" href="{{.AppUrl}}">{{.AppName}}</a></h1> + <div style="padding:40px 15px;"> + <div style="font-size:16px; padding-bottom:30px; font-weight:bold;"> + Hi <span style="color: #00BFFF;">{{.User.Name}}</span>, + </div> + <div style="font-size:14px; padding:0 15px;"> + <p style="margin:0;padding:0 0 9px 0;">Please click following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p> + <p style="margin:0;padding:0 0 9px 0;"> + <a href="{{.AppUrl}}user/activate?code={{.Code}}">{{.AppUrl}}user/activate?code={{.Code}}</a> + </p> + <p style="margin:0;padding:0 0 9px 0;">Copy and paste it to your browser if the link is not working.</p> + </div> + </div> + </div> + </div> + <div style="color:#aaa;padding:10px;text-align:center;"> + © 2014 <a style="color:#888;text-decoration:none;" target="_blank" href="http://gogits.org">Gogs: Go Git Service</a> + </div> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/templates/mail/auth/register_success.tmpl b/templates/mail/auth/register_success.tmpl new file mode 100644 index 0000000000..0a69280847 --- /dev/null +++ b/templates/mail/auth/register_success.tmpl @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>{{.User.Name}}, welcome to {{.AppName}}</title> +</head> +<body style="background:#eee;"> +<div style="color:#333; font:12px/1.5 Tahoma,Arial,sans-serif;; text-shadow:1px 1px #fff; padding:0; margin:0;"> + <div style="width:600px;margin:0 auto; padding:40px 0 20px;"> + <div style="border:1px solid #d9d9d9;border-radius:3px; background:#fff; box-shadow: 0px 2px 5px rgba(0, 0, 0,.05); -webkit-box-shadow: 0px 2px 5px rgba(0, 0, 0,.05);"> + <div style="padding: 20px 15px;"> + <h1 style="font-size:20px; padding:10px 0 20px; margin:0; border-bottom:1px solid #ddd;"><img src="{{.AppUrl}}/{{.AppLogo}}" style="height: 32px; margin-bottom: -10px;"> <a style="color:#333;text-decoration:none;" target="_blank" href="{{.AppUrl}}">{{.AppName}}</a></h1> + <div style="padding:40px 15px;"> + <div style="font-size:16px; padding-bottom:30px; font-weight:bold;"> + Hi <span style="color: #00BFFF;">{{.User.Name}}</span>, welcome to register {{.AppName}}! + </div> + <div style="font-size:14px; padding:0 15px;"> + <p style="margin:0;padding:0 0 9px 0;">Please click following link to verify your e-mail address within <b>{{.ActiveCodeLives}} hours</b>.</p> + <p style="margin:0;padding:0 0 9px 0;"> + <a href="{{.AppUrl}}user/activate?code={{.Code}}">{{.AppUrl}}user/activate?code={{.Code}}</a> + </p> + <p style="margin:0;padding:0 0 9px 0;">Copy and paste it to your browser if the link is not working.</p> + </div> + </div> + </div> + </div> + <div style="color:#aaa;padding:10px;text-align:center;"> + © 2014 <a style="color:#888;text-decoration:none;" target="_blank" href="http://gogits.org">Gogs: Go Git Service</a> + </div> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/templates/mail/auth/reset_passwd.tmpl b/templates/mail/auth/reset_passwd.tmpl new file mode 100644 index 0000000000..11861f4e20 --- /dev/null +++ b/templates/mail/auth/reset_passwd.tmpl @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>{{.User.Name}}, please reset your password</title> +</head> +<body style="background:#eee;"> +<div style="color:#333; font:12px/1.5 Tahoma,Arial,sans-serif;; text-shadow:1px 1px #fff; padding:0; margin:0;"> + <div style="width:600px;margin:0 auto; padding:40px 0 20px;"> + <div style="border:1px solid #d9d9d9;border-radius:3px; background:#fff; box-shadow: 0px 2px 5px rgba(0, 0, 0,.05); -webkit-box-shadow: 0px 2px 5px rgba(0, 0, 0,.05);"> + <div style="padding: 20px 15px;"> + <h1 style="font-size:20px; padding:10px 0 20px; margin:0; border-bottom:1px solid #ddd;"><img src="{{.AppUrl}}/{{.AppLogo}}" style="height: 32px; margin-bottom: -10px;"> <a style="color:#333;text-decoration:none;" target="_blank" href="{{.AppUrl}}">{{.AppName}}</a></h1> + <div style="padding:40px 15px;"> + <div style="font-size:16px; padding-bottom:30px; font-weight:bold;"> + Hi <span style="color: #00BFFF;">{{.User.Name}}</span>, + </div> + <div style="font-size:14px; padding:0 15px;"> + <p style="margin:0;padding:0 0 9px 0;">Please click following link to reset your password within <b>{{.ActiveCodeLives}} hours</b>.</p> + <p style="margin:0;padding:0 0 9px 0;"> + <a href="{{.AppUrl}}user/reset_password?code={{.Code}}">{{.AppUrl}}user/reset_password?code={{.Code}}</a> + </p> + <p style="margin:0;padding:0 0 9px 0;">Copy and paste it to your browser if the link is not working.</p> + </div> + </div> + </div> + </div> + <div style="color:#aaa;padding:10px;text-align:center;"> + © 2014 <a style="color:#888;text-decoration:none;" target="_blank" href="http://gogits.org">Gogs: Go Git Service</a> + </div> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/templates/release/list.tmpl b/templates/release/list.tmpl new file mode 100644 index 0000000000..d7c4674e84 --- /dev/null +++ b/templates/release/list.tmpl @@ -0,0 +1,86 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="release"> + <h4 id="release-head"> + <span class="release"><strong>Release</strong></span> / + <a class="tag" href="/{tag_link}">Tags</a> + <!-- comment : if in tag page, show a.release and span.tag please --> + </h4> + <ul id="release-list" class="list-unstyled"> + <li class="release-item release-tag clearfix" id="release-tag-{release_tag_id}"> + <div class="col-md-2 text-right"> + <a class="commit" href="{commit_link}"><i class="fa fa-code"></i>commit-sha</a> + </div> + <div class="col-md-10"> + <h5 class="title"><a href="{release_single_link}">Release Tag</a><i class="fa fa-tag"></i></h5> + <p class="info"> + <span class="author"><img class="avatar" src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132" alt="" width="20"> + <a href="/user/fuxiaohei">fuxiaohei</a></span> + <span class="time">1 week ago</span> + <span class="ahead"><strong>0</strong> commits since this tag</span> + </p> + <p class="download"> + <a class="download-link" href="{release_download_link}"><i class="fa fa-download"></i>zip</a> + <a class="download-link" href="{release_download_link}"><i class="fa fa-download"></i>tar.gz</a> + </p> + <span class="dot"> </span> + </div> + </li> + <li class="release-item clearfix" id="release-{release_id}"> + <div class="col-md-2 text-right"> + <span class="btn btn-success status stable">Stable</span> + <a class="tag" href="{commit_link}"><i class="fa fa-tag"></i>release tag</a> + <a class="commit" href="{commit_link}"><i class="fa fa-code"></i>commit-sha</a> + </div> + <div class="col-md-10"> + <h4 class="title"><a href="{release_single_link}">Release Title</a></h4> + <p class="info"> + <span class="author"><img class="avatar" src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132" alt="" width="20"> + <a href="/user/fuxiaohei">fuxiaohei</a></span> + <span class="time">1 week ago</span> + <span class="ahead"><strong>0</strong> commits since this tag</span> + </p> + <div class="markdown desc"> + release descriptions, support markdown content + </div> + <p class="download"> + <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (ZIP)</a> + <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (TAR.GZ)</a> + </p> + <span class="dot"> </span> + </div> + </li> + <li class="release-item clearfix" id="release-{release_id}"> + <div class="col-md-2 text-right"> + <span class="btn btn-warning status pre-release">Pre-Release</span> + <a class="tag" href="{commit_link}"><i class="fa fa-tag"></i>release tag</a> + <a class="commit" href="{commit_link}"><i class="fa fa-code"></i>commit-sha</a> + </div> + <div class="col-md-10"> + <h4 class="title"><a href="{release_single_link}">Release Title</a></h4> + <p class="info"> + <span class="author"><img class="avatar" src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132" alt="" width="20"> + <a href="/user/fuxiaohei">fuxiaohei</a></span> + <span class="time">1 week ago</span> + <span class="ahead"><strong>0</strong> commits since this tag</span> + </p> + <div class="markdown desc"> + release descriptions, support markdown content + </div> + <p class="download"> + <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (ZIP)</a> + <a class="btn btn-default" href="{release_download_link}"><i class="fa fa-download"></i>Source Code (TAR.GZ)</a> + </p> + <span class="dot"> </span> + </div> + </li> + </ul> + </div> + {{range .Releases}} + {{.}} + {{end}} +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/release/new.tmpl b/templates/release/new.tmpl new file mode 100644 index 0000000000..fe5aa179c9 --- /dev/null +++ b/templates/release/new.tmpl @@ -0,0 +1,66 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="release"> + <h4 id="release-head">New Release</h4> + <form id="release-new-form" action="" class="form form-inline"> + <div class="form-group"> + <input id="release-tag-name" type="text" class="form-control" placeholder="tag name"/> + <span class="target-at">@</span> + <div class="btn-group" id="release-new-target-select"> + <button type="button" class="btn btn-default"><i class="fa fa-code-fork fa-lg fa-m"></i> + <span class="target-text">Target : </span> + <strong id="release-new-target-name"> master</strong> + </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" id="release-new-target-branch-list"> + <ul class="list-group"> + <li class="list-group-item"> + <a href="#" rel="master"><i class="fa fa-code-fork"></i>master</a> + </li> + </ul> + </div> + </div> + <p class="help-block">Choose an existing tag without release notes</p> + </div> + <div class="form-group" style="display: block"> + <input class="form-control input-lg" id="release-new-title" name="title" type="text" placeholder="release title"/> + </div> + <div class="form-group col-md-8" style="display: block" id="release-new-content-div"> + <div class="md-help pull-right"> + Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a> + </div> + <ul class="nav nav-tabs" data-init="tabs"> + <li class="release-write active"><a href="#release-textarea" data-toggle="tab">Write</a></li> + <li class="release-preview"><a href="#release-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repo=repo_id&release=new" data-ajax-name="release-preview" data-ajax-method="post" data-preview="#release-preview">Preview</a></li> + </ul> + <div class="tab-content"> + <div class="tab-pane active" id="release-textarea"> + <div class="form-group"> + <textarea class="form-control" name="content" id="release-new-content" rows="10" placeholder="Write some content" data-ajax-rel="release-preview" data-ajax-val="val" data-ajax-field="content"></textarea> + </div> + </div> + <div class="tab-pane release-preview-content" id="release-preview">loading...</div> + </div> + </div> + <div class="text-right form-group col-md-8" style="display: block"> + <hr/> + <label for="release-new-pre-release"> + <input id="release-new-pre-release" type="checkbox" name="is-pre-release" value="true"/> + <strong>This is a pre-release</strong> + </label> + <p class="help-block">We’ll point out that this release is identified as non-production ready.</p> + </div> + <div class="text-right form-group col-md-8" style="display: block"> + <input type="hidden" value="id" name="repo-id"> + <button class="btn-success btn">Publish release</button> + <input class="btn btn-default" type="submit" name="is-draft" value="Save Draft"/> + </div> + </form> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/branches.tmpl b/templates/repo/branches.tmpl new file mode 100644 index 0000000000..8d2d59d7fd --- /dev/null +++ b/templates/repo/branches.tmpl @@ -0,0 +1,42 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="source"> + <div class="panel panel-default branch-box info-box"> + <div class="panel-heading info-head"> + <h4>Branches</h4> + </div> + <table class="panel-footer table branch-list table table-hover"> + <thead> + <tr> + <th class="name"></th> + <th class="behind">Behind</th> + <th class="ahead">Ahead</th> + <th class="date">Last Commit</th> + <th class="action"></th> + </tr> + </thead> + <tbody> + <tr class="branch-main"> + <td class="name" colspan="3"> + <a href="#"><strong>BranchName</strong></a> + <button class="btn btn-primary btn-sm">base branch</button> + </td> + <td class="date">3 years ago</td> + <td class="action"></td> + </tr> + <tr> + <td class="name"><a href="#"><strong>BranchName</strong></a></td> + <td class="behind">102 <span class="graph" style="width: 100%"></span></td> + <td class="ahead"><span class="graph" style="width: 4%"></span>4</td> + <td class="date">3 years ago</td> + <td class="action"><a class="btn btn-info btn-sm" href="#">compare</a></td> + </tr> + </tbody> + </table> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl new file mode 100644 index 0000000000..efe35936c4 --- /dev/null +++ b/templates/repo/commits.tmpl @@ -0,0 +1,40 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="commits"> + <div class="panel panel-default commit-box info-box"> + <div class="panel-heading info-head"> + <div class="search pull-right form"> + <input class="form-control search" type="search" placeholder="search commit"/> + </div> + <h4>{{.CommitCount}} Commits</h4> + </div> + <table class="panel-footer table commit-list table table-striped"> + <thead> + <tr> + <th class="author">Author</th> + <th class="sha">Commit</th> + <th class="message">Message</th> + <th class="date">Date</th> + </tr> + </thead> + <tbody> + {{ $username := .Username}} + {{ $reponame := .Reponame}} + {{$r := List .Commits}} + {{range $r}} + <tr> + <td class="author"><img class="avatar" src="{{AvatarLink .Committer.Email}}" alt=""/><a href="/user/{{.Committer.Name}}">{{.Committer.Name}}</a></td> + <td class="sha"><a class="label label-success" href="/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td> + <td class="message">{{.Message}} </td> + <td class="date">{{TimeSince .Committer.When}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl new file mode 100644 index 0000000000..dc509fc1cc --- /dev/null +++ b/templates/repo/create.tmpl @@ -0,0 +1,78 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container" id="body"> + <form action="/repo/create" method="post" class="form-horizontal card" id="repo-create"> + {{.CsrfTokenHtml}} + <h3>Create New Repository</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <div class="form-group"> + <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <p class="form-control-static">{{.SignedUserName}}</p> + <input type="hidden" value="{{.SignedUserId}}" name="userId"/> + </div> + </div> + + <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}"> + <label class="col-md-2 control-label">Repository<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required"> + <span class="help-block">Great repository names are short and memorable. </span> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Visibility<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <p class="form-control-static">Public</p> + <input type="hidden" value="public" name="visibility"/> + </div> + </div> + + <div class="form-group {{if .Err_Description}}has-error has-feedback{{end}}"> + <label class="col-md-2 control-label">Description</label> + <div class="col-md-8"> + <textarea name="desc" class="form-control" placeholder="Type your repository description">{{.desc}}</textarea> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Language</label> + <div class="col-md-8"> + <select class="form-control" name="language"> + <option value="">Select a language</option> + {{range .LanguageIgns}}<option value="{{.}}">{{.}}</option>{{end}} + </select> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">License</label> + <div class="col-md-8"> + <select class="form-control" name="license"> + <option value="">Select a license</option> + {{range .Licenses}}<option value="{{.}}">{{.}}</option>{{end}} + </select> + </div> + </div> + + <div class="form-group"> + <div class="col-md-8 col-md-offset-2"> + <div class="checkbox"> + <label> + <input type="checkbox" name="initReadme" {{if .initReadme}}checked{{end}}> + <strong>Initialize this repository with a README</strong> + </label> + </div> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-2 col-md-8"> + <button type="submit" class="btn btn-lg btn-primary">Create repository</button> + <a href="/" class="text-danger">Cancel</a> + </div> + </div> + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl new file mode 100644 index 0000000000..5c95ddefde --- /dev/null +++ b/templates/repo/diff.tmpl @@ -0,0 +1,420 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +<div id="body" class="container" data-page="repo"> + <div id="source"> + <div class="panel panel-info diff-box diff-head-box"> + <div class="panel-heading"> + <a class="pull-right btn btn-primary btn-sm" href="{{.SourcePath}}">Browse Source</a> + <h4>{{.Commit.Message}}</h4> + </div> + <div class="panel-body"> + <span class="pull-right"> + commit <span class="label label-default sha">{{ShortSha .CommitId}}</span> + </span> + <p class="author"> + <img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/> + <a class="name" href="#"><strong>{{.Commit.Author.Name}}</strong></a> + <span class="time">{{TimeSince .Commit.Author.When}}</span> + </p> + </div> + </div> + + <div class="diff-detail-box diff-box"> + <a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a> + <p class="showing"> + <i class="fa fa-retweet"></i> + <strong> {{.Diff.NumFiles}} changed files</strong> with <strong>{{.Diff.TotalAddition}} additions</strong> and <strong>{{.Diff.TotalDeletion}} deletions</strong>. + </p> + <ol class="detail-files collapse" id="diff-files"> + {{range .Diff.Files}} + <li> + <div class="diff-counter count pull-right"> + <span class="add" data-line="{{.Addition}}">{{.Addition}}</span> + <span class="bar"> + <span class="pull-left add"></span> + <span class="pull-left del"></span> + </span> + <span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span> + </div> + <!-- todo finish all file status, now modify, add, delete and rename --> + <span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}"> </span> + <a class="file" href="#diff-1">{{.Name}}</a> + </li> + {{end}} + </ol> + </div> + + {{range .Diff.Files}} + <div class="panel panel-default diff-file-box diff-box file-content" id="diff-2"> + <div class="panel-heading"> + <div class="diff-counter count pull-left"> + <span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span> + <span class="bar"> + <span class="pull-left add"></span> + <span class="pull-left del"></span> + </span> + <span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span> + </div> + <a class="btn btn-default btn-sm pull-right" href="{{$.SourcePath}}/{{.Name}}">View File</a> + <span class="file">{{.Name}}</span> + </div> + {{$isImage := (call $.IsImageFile .Name)}} + <div class="panel-body file-body file-code code-view code-diff"> + {{if $isImage}} + <div class="text-center"> + <img src="{{$.RawPath}}/{{.Name}}"> + </div> + {{else}} + <table> + <tbody> + {{range .Sections}} + {{range .Lines}} + <tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1"> + <td class="lines-num lines-num-old"> + <span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span> + </td> + <td class="lines-code"> + <pre>{{.Content}}</pre> + </td> + </tr> + {{end}} + {{end}} + <!-- <tr class="same-code nl-2 ol-2"> + <td class="lines-num lines-num-old"> + <span rel="L1">2</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">2</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-3 ol-3"> + <td class="lines-num lines-num-old"> + <span rel="L3">3</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L3">3</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="add-code nl-4 ol-0"> + <td class="lines-num lines-num-old"> + <span rel="add">+</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L4">4</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="add-code nl-5 ol-0"> + <td class="lines-num lines-num-old"> + <span rel="add">+</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L5">5</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-4"> + <td class="lines-num lines-num-old"> + <span rel="L4">4</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-5"> + <td class="lines-num lines-num-old"> + <span rel="L5">5</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-6"> + <td class="lines-num lines-num-old"> + <span rel="L6">6</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-7"> + <td class="lines-num lines-num-old"> + <span rel="L7">7</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-6 ol-8"> + <td class="lines-num lines-num-old"> + <span rel="L8">8</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L6">6</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-7 ol-9"> + <td class="lines-num lines-num-old"> + <span rel="L1">9</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">7</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-8 ol-10"> + <td class="lines-num lines-num-old"> + <span rel="L1">10</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">8</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> --> + </tbody> + </table> + {{end}} + </div> + </div> + {{end}} + + <!-- <div class="panel panel-default diff-file-box diff-box file-content"> + <div class="panel-heading"> + <div class="diff-counter count pull-left"> + <span class="add" data-line="2">+ 2</span> + <span class="bar"> + <span class="pull-left add"></span> + <span class="pull-left del"></span> + </span> + <span class="del" data-line="4">- 4</span> + </div> + <a class="btn btn-default btn-sm pull-right" href="#">View File</a> + <span class="file">data/test/bson_test/simple_type.go</span> + </div> + <div class="panel-body file-body file-code code-view code-diff"> + <table> + <tbody> + <tr class="same-code nl-1 ol-1"> + <td class="lines-num lines-num-old"> + <span rel="L1">1</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">1</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-2 ol-2"> + <td class="lines-num lines-num-old"> + <span rel="L1">2</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">2</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-3 ol-3"> + <td class="lines-num lines-num-old"> + <span rel="L3">3</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L3">3</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="add-code nl-4 ol-0"> + <td class="lines-num lines-num-old"> + <span rel="add">+</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L4">4</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="add-code nl-5 ol-0"> + <td class="lines-num lines-num-old"> + <span rel="add">+</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L5">5</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-4"> + <td class="lines-num lines-num-old"> + <span rel="L4">4</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-5"> + <td class="lines-num lines-num-old"> + <span rel="L5">5</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-6"> + <td class="lines-num lines-num-old"> + <span rel="L6">6</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="del-code nl-0 ol-7"> + <td class="lines-num lines-num-old"> + <span rel="L7">7</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="del">-</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-6 ol-8"> + <td class="lines-num lines-num-old"> + <span rel="L8">8</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L6">6</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-7 ol-9"> + <td class="lines-num lines-num-old"> + <span rel="L1">9</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">7</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-8 ol-10"> + <td class="lines-num lines-num-old"> + <span rel="L1">10</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">8</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="ellipsis-code"> + <td class="text-center lines-ellipsis" colspan="2"> + <i class="fa fa-ellipsis-h"></i> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-8 ol-10"> + <td class="lines-num lines-num-old"> + <span rel="L1">10</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">8</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + <tr class="same-code nl-8 ol-10"> + <td class="lines-num lines-num-old"> + <span rel="L1">10</span> + </td> + <td class="lines-num lines-num-new"> + <span rel="L1">8</span> + </td> + <td class="lines-code"> + <pre> "github.com/youtube/vitess/go/bson"</pre> + </td> + </tr> + </tbody> + </table> + </div> + </div> + + <div class="panel panel-default diff-file-box diff-box file-content"> + <div class="panel-heading"> + <div class="diff-counter count pull-left"> + <span class="add" data-line="0">BIN</span> + <span class="bar"> + <span class="pull-left add"></span> + <span class="pull-left del"></span> + </span> + <span class="del" data-line="1"></span> + </div> + <a class="btn btn-default btn-sm pull-right" href="#">View File</a> + <span class="file">data/test/bson_test/simple_type.png</span> + </div> + <div class="panel-body file-body file-code code-view code-bin"> + <table> + <tbody> + <tr class="text-center"><td><img src="http://1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=200" alt=""/></td></tr> + </tbody> + </table> + </div> + </div> --> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/list.tmpl b/templates/repo/list.tmpl new file mode 100644 index 0000000000..403c62d62c --- /dev/null +++ b/templates/repo/list.tmpl @@ -0,0 +1,10 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container" id="body"> + <ul> + {{range .Repos}} + <li>{{.Name}} stars: {{.NumStars}} forks: {{.NumForks}} watches:{{.NumWatchs}}</li> + {{end}} + </ul> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/mirror.tmpl b/templates/repo/mirror.tmpl new file mode 100644 index 0000000000..2ac21dd617 --- /dev/null +++ b/templates/repo/mirror.tmpl @@ -0,0 +1,81 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container" id="body"> + <form action="/repo/create" method="post" class="form-horizontal card" id="repo-create"> + {{.CsrfTokenHtml}} + <h3>Create Repository Mirror</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <div class="form-group"> + <label class="col-md-2 control-label">From<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <select class="form-control" name="from"> + <option value="">GitHub</option> + </select> + </div> + </div> + <div class="form-group"> + <label class="col-md-2 control-label">URL<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="url" type="text" class="form-control" placeholder="Type your mirror repository url link" required="required"> + </div> + </div> + <div class="form-group"> + <div class="col-md-offset-2 col-md-8"> + <a class="btn btn-default" data-toggle="collapse" data-target="#repo-import-auth">Need Authorization</a> + </div> + <div id="repo-import-auth" class="collapse"> + <div class="form-group"> + <label class="col-md-2 control-label">Username</label> + <div class="col-md-8"> + <input name="auth-username" type="text" class="form-control"> + </div> + </div> + <div class="form-group"> + <label class="col-md-2 control-label">Password</label> + <div class="col-md-8"> + <input name="auth-password" type="text" class="form-control"> + </div> + </div> + </div> + </div> + <hr/> + <div class="form-group"> + <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <p class="form-control-static">{{.SignedUserName}}</p> + <input type="hidden" value="{{.SignedUserId}}" name="userId"/> + </div> + </div> + + <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}"> + <label class="col-md-2 control-label">Repository<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required"> + <span class="help-block">Great repository names are short and memorable. </span> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Visibility<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <p class="form-control-static">Public</p> + <input type="hidden" value="public" name="visibility"/> + </div> + </div> + + <div class="form-group {{if .Err_Description}}has-error has-feedback{{end}}"> + <label class="col-md-2 control-label">Description</label> + <div class="col-md-8"> + <textarea name="desc" class="form-control" placeholder="Type your repository description">{{.desc}}</textarea> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-2 col-md-8"> + <button type="submit" class="btn btn-lg btn-primary">Mirror repository</button> + <a href="/" class="text-danger">Cancel</a> + </div> + </div> + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl new file mode 100644 index 0000000000..3ce27f921e --- /dev/null +++ b/templates/repo/nav.tmpl @@ -0,0 +1,64 @@ +<div id="body-nav" class="repo-nav"> + <div class="container"> + <div class="row"> + <div class="col-md-7"> + <h3 class="name"><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="/{{.Owner.Name}}/{{.Repository.Name}}">{{.Repository.Name}}</a></h3> + <p class="desc">{{.Repository.Description}}{{if .Repository.Website}} <a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}</p> + </div> + <div class="col-md-5 actions text-right clone-group-btn"> + {{if not .IsBareRepo}} + <div class="btn-group" id="repo-clone"> + <button type="button" class="btn btn-default"><i class="fa fa-download fa-lg fa-m"></i></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 dropdown-menu-right no-propagation"> + <div class="input-group"> + <span class="input-group-btn"> + <button class="btn btn-default" data-link="{{.CloneLink.SSH}}" type="button">SSH</button> + <button class="btn btn-default" data-link="{{.CloneLink.HTTPS}}" type="button">HTTPS</button> + </span> + <input type="text" class="form-control clone-group-url" value="" readonly id="repo-clone-ipt"/> + <span class="input-group-btn"> + <button class="btn btn-default" type="button" data-toggle="tooltip" title="copy to clipboard" data-placement="top" data-init="copy" data-copy-val="val" data-copy-from="#repo-clone-ipt"><i class="fa fa-copy"></i></button> + </span> + </div> + <p class="help-block text-center">Need help cloning? Visit <a href="#">Help</a>!</p> + <!-- <hr/> + <div class="clone-zip text-center"> + <a class="btn btn-success btn-lg" href="#"><i class="fa fa-suitcase"></i>Download ZIP</a> + </div> --> + </div> + </div> + <div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch"> + {{if .IsRepositoryWatching}} + <button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button> + {{else}} + <button type="button" class="btn btn-default"><i class="fa fa-eye-slash fa-lg fa-m"></i></button> + {{end}} + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> + <span class="caret"></span> + </button> + <div class="dropdown-menu"> + <div class="dropdown-item text-left to-unwatch"> + <h4 role="presentation" class="dropdown-header {{if not .IsRepositoryWatching}}text-primary{{end}}">Not Watching</h4> + <p class="description">You only receive notifications for conversations in which you participate or are @mentioned.</p> + <p class="divider"></p> + </div> + <div class="dropdown-item text-left to-watch"> + <h4 role="presentation" class="dropdown-header {{if .IsRepositoryWatching}}text-primary{{end}}">Watching</h4> + <p class="description">You receive notifications for all conversations in this repository.</p> + </div> + </div> + </div> + <!-- <div class="btn-group"> + <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Star"><i class="fa fa-star"></i> {{.Repository.NumStars}}</button> + </div> --> + {{end}} + <!-- <div class="btn-group"> + <a type="button" {{if not .IsRepositoryOwner}}href="/{{.Username}}/{{.Reponame}}/fork"{{end}} class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Fork"><i class="fa fa-code-fork fa-lg"></i> {{.Repository.NumForks}}</a> + </div> --> + </div> + </div> + </div> +</div>
\ No newline at end of file diff --git a/templates/repo/pulls.tmpl b/templates/repo/pulls.tmpl new file mode 100644 index 0000000000..8c5d9376c8 --- /dev/null +++ b/templates/repo/pulls.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="source"> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl new file mode 100644 index 0000000000..1adf0090c7 --- /dev/null +++ b/templates/repo/setting.tmpl @@ -0,0 +1,169 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="user-setting-nav" class="col-md-3"> + <ul class="list-group"> + <li class="list-group-item active"><a href="/{{.Owner.Name}}/{{.Repository.Name}}/settings">Options</a></li> + <!--<li class="list-group-item"><a href="#">Collaborators</a></li> + <li class="list-group-item"><a href="#">Notifications</a></li>--> + </ul> + </div> + + <div id="repo-setting-container" class="col-md-9"> + {{if .IsSuccess}}<p class="alert alert-success">Repository options has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} + <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="repo-setting-name">Name</label> + <div class="col-md-9"> + <input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" id="repo-setting-name"/> + <p class="help-block hidden"><span class="text-danger">Cautious : </span>your repository name is changing !</p> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right">Description</label> + <div class="col-md-9"> + <textarea class="form-control" name="desc" id="repo-desc" rows="3">{{.Repository.Description}}</textarea> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 text-right">Official Site</label> + <div class="col-md-9"> + <input type="url" class="form-control" name="site" value="{{.Repository.Website}}" /> + </div> + </div> + <hr> + <!-- <div class="form-group"> + <label class="col-md-3 text-right">Default Branch</label> + <div class="col-md-9"> + <select name="branch" id="repo-default-branch" class="form-control"> + <option value="">Branch</option> + </select> + </div> + </div> --> + + <div class="form-group"> + <div class="col-md-offset-3 col-md-9"> + <div class="checkbox"> + <label style="line-height: 15px;"> + <input type="checkbox" name="goget" {{if .Repository.IsGoget}}checked{{end}}> + <strong>Enable 'go get' meta</strong> + </label> + </div> + </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="#transfer-repository-modal" data-toggle="modal"> + Transfer ownership + </button> + <dd> + <dt>Transfer ownership</dt> + <dl>Transfer this repo to another user or to an organization where you have admin rights.</dl> + </dd> + + <div class="modal fade" id="transfer-repository-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="transfer"> + + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">Do you really want to transfer this repo?</h4> + </div> + + <div class="modal-body"> + <div class="alert alert-warning">This is important, pay attention.</div> + <ul> + <!-- <li>Transferring may be delayed until the new owner approves the transfer.</li> --> + <!-- <li>If you are transferring into an org, teams <strong>will not be set</strong>. An owner on the org will need to set teams for the repo.</li> --> + <li>Admin rights will be transferred to the new owner, you <strong>will lose admin rights</strong>.</li> + <!-- <li>Admin rights will be transferred to the new owner, you <strong>may lose admin rights</strong> if you are transferring into an organization account.</li> --> + <li>Redirect entries <strong>will NOT be</strong> set up from the previous location.</li> + <li>Git access <strong>will NOT continue</strong> to work from the previous location.</li> + </ul> + <div class="form-group"> + <label>Please type the name of the repository to confirm "<strong class="text-danger">{{.Repository.Name}}</strong>"</label> + <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required"> + </div> + + <div class="form-group"> + <label>Please type the name of the new owner:</label> + <input name="owner" class="form-control" type="text" placeholder="Type new owner's 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, transfer this repository</button> + </div> + </form> + </div> + </div> + </div> + <hr> + <div class="panel-body"> + <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal"> + Delete this repository + </button> + <dd> + <dt>Delete this repository</dt> + <dl>Once you delete a repository, there is no going back. Please be certain.</dl> + </dd> + + <div class="modal fade" id="delete-repository-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 repository</h4> + </div> + + <div class="modal-body"> + <div class="form-group"> + <label>Please enter your repository name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label> + <input name="repository" class="form-control" type="text" placeholder="Type your repository 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 repository</button> + </div> + </form> + </div> + </div> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl new file mode 100644 index 0000000000..7ee6b0cafe --- /dev/null +++ b/templates/repo/single.tmpl @@ -0,0 +1,40 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="source"> + <div class="source-toolbar"> + {{ $n := len .Treenames}} + {{if not .IsFile}}<button class="btn btn-default pull-right hidden"><i class="fa fa-plus-square"></i>Add File</button>{{end}} + <div class="dropdown branch-switch"> + <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{if .IsBranch}}{{.BranchName}}{{else}}{{ShortSha .CommitId}}{{end}} + <b class="caret"></b></a> + <ul class="dropdown-menu"> + {{range .Branches}} + <li><a {{if eq . $.BranchName}}class="current" {{end}}href="/{{$.Username}}/{{$.Reponame}}/src/{{.}}">{{.}}</a></li> + {{end}} + </ul> + </div> + {{ $l := Subtract $n 1}} + <ol class="breadcrumb"> + <li class="root dir"> + <a href="{{.BranchLink}}">{{.Repository.Name}}</a></li> + {{range $i, $v := .Treenames}} + <li class="dir"> + {{if eq $i $l}}{{$v}} + {{else}} + <a href="{{$.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a> + {{end}} + </li> + {{end}} + </ol> + </div> + {{if .IsFile}} + {{template "repo/single_file" .}} + {{else}} + {{template "repo/single_list" .}} + {{end}} + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/single_bare.tmpl b/templates/repo/single_bare.tmpl new file mode 100644 index 0000000000..3f63915352 --- /dev/null +++ b/templates/repo/single_bare.tmpl @@ -0,0 +1,54 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="source"> + <div class="panel panel-default guide-box clone-group-btn"> + <div class="panel-heading guide-head"> + <h4>Quick Guide</h4> + </div> + <div class="panel-body guide-content text-center"> + <form action="{{.RepoLink}}/import" method="post"> + {{.CsrfTokenHtml}} + <h3>Clone from existing repository</h3> + <div class="input-group col-md-6 col-md-offset-3"> + <span class="input-group-btn"> + <button class="btn btn-default" type="button">URL</button> + </span> + <input name="passwd" type="password" class="form-control" placeholder="Type existing repository address" required="required"> + <span class="input-group-btn"> + <button type="submit" class="btn btn-default" type="button">Clone</button> + </span> + </div> + </form> + + <h3>Clone this repository</h3> + <div class="input-group col-md-8 col-md-offset-2 guide-buttons"> + <span class="input-group-btn"> + <button class="btn btn-default" data-link="{{.CloneLink.SSH}}" type="button">SSH</button> + <button class="btn btn-default" data-link="{{.CloneLink.HTTPS}}" type="button">HTTPS</button> + </span> + <input type="text" class="form-control clone-group-url" id="guide-clone-url" value="" readonly/> + <span class="input-group-btn"> + <button class="btn btn-default" type="button" data-toggle="tooltip" title="copy to clipboard" data-placement="top" data-init="copy" data-copy-val="val" data-copy-from="#guide-clone-url"><i class="fa fa-copy"></i></button> + </span> + </div> + <p>We recommend every repository include a <strong>README</strong>, <strong>LICENSE</strong>, and <strong>.gitignore</strong>.</p> + <hr/> + <h3>Create a new repository on the command line</h3> + <pre class="text-left"><code>touch README.md +git init +git add README.md +git commit -m "first commit" +git remote add origin <span class="clone-url"></span> +git push -u origin master</code></pre> + <hr/> + <h3>Push an existing repository from the command line</h3> + <pre class="text-left"><code>git remote add origin <span class="clone-url"></span> +git push -u origin master</code></pre> + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl new file mode 100644 index 0000000000..9199ca91f7 --- /dev/null +++ b/templates/repo/single_file.tmpl @@ -0,0 +1,50 @@ +<div class="panel panel-default file-content"> + <div class="panel-heading file-head"> + {{if .ReadmeExist}} + <i class="icon fa fa-book"></i> + {{if .ReadmeInSingle}} + {{.FileName}} + {{else}} + {{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span> + {{end}} + {{else}} + <i class="icon fa fa-file-text-o"></i> + {{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span> + {{end}} + {{if not .ReadmeInSingle}} + <div class="btn-group pull-right"> + <a class="btn btn-default hidden" href="#">Edit</a> + <a class="btn btn-default" href="{{.FileLink}}">Raw</a> + <a class="btn btn-default hidden" href="#">Blame</a> + <a class="btn btn-default hidden" href="#">History</a> + <a class="btn btn-danger hidden" href="#">Delete</a> + </div> + {{end}} + </div> + {{if not .FileIsText}} + <div class="panel-footer text-center"> + {{if .IsImageFile}} + <img src="{{.FileLink}}"> + {{else}} + <a href="{{.FileLink}}" class="btn btn-default">View Raw</a> + {{end}} + </div> + {{else}} + {{if .ReadmeExist}} + <div class="panel-body file-body markdown"> + {{.FileContent|str2html}} + </div> + {{else}} + <div class="panel-body file-body file-code code-view"> + <table> + <tbody> + <tr> + <td class="lines-num"></td> + <td class="lines-code markdown"><pre class="prettyprint linenums{{if .FileExt}} lang-{{.FileExt}}{{end}}">{{.FileContent}}</pre></td> + </tr> + </tbody> + </table> + </div> + {{end}} + {{end}} +</div> diff --git a/templates/repo/single_list.tmpl b/templates/repo/single_list.tmpl new file mode 100644 index 0000000000..b0c31d1e44 --- /dev/null +++ b/templates/repo/single_list.tmpl @@ -0,0 +1,54 @@ +<div class="panel panel-default info-box"> + <div class="panel-heading info-head"> + <a href="/{{.Username}}/{{.Reponame}}/commit/{{.LastCommit.Oid.String}}">{{.LastCommit.Message}}</a> + </div> + <div class="panel-body info-content"> + <a href="/user/{{.LastCommit.Author.Name}}">{{.LastCommit.Author.Name}}</a> <span class="text-muted">{{TimeSince .LastCommit.Author.When}}</span> + </div> + <table class="panel-footer table file-list"> + <thead class="hidden"> + <tr> + <th class="icon"></th> + <th class="name">Filename</th> + <th class="text">Message</th> + <th class="date">Date modified</th> + </tr> + </thead> + <tbody> + {{if .HasParentPath}} + <tr class="has-parent"> + <td class="icon"><a href="{{.BranchLink}}{{.ParentPath}}"><i class="fa fa-reply"></i></a></td> + <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td> + <td class="text"></td> + <td class="date"></td> + </tr> + {{end}} + {{range .Files}} + <tr + {{if .IsDir}}class="is-dir"{{end}}> + <td class="icon"> + <i class="fa {{if .IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i> + </td> + <td class="name"> + <span class="wrap"> + {{if .IsDir}} + <a href="{{$.BranchLink}}/{{.Path}}">{{.Name}}</a> + {{else}} + <a href="{{$.BranchLink}}/{{.Path}}">{{.Name}}</a> + {{end}} + </span> + </td> + <td class="text"> + <span class="wrap"><a href="/{{$.Username}}/{{$.Reponame}}/commit/{{.Commit.Oid}}">{{.Commit.Message}}</a></span> + </td> + <td class="date"> + <span class="wrap">{{TimeSince .Commit.Committer.When}}</span> + </td> + </tr> + {{end}} + </tbody> + </table> +</div> +{{if .ReadmeExist}} + {{template "repo/single_file" .}} +{{end}}
\ No newline at end of file diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl new file mode 100644 index 0000000000..9c137e5179 --- /dev/null +++ b/templates/repo/toolbar.tmpl @@ -0,0 +1,43 @@ +<div id="repo-toolbar"> + <div class="container"> + <nav class="navbar navbar-toolbar navbar-default" role="navigation"> + <div class="collapse navbar-collapse"> + <ul class="nav navbar-nav"> + <li class="{{if .IsRepoToolbarSource}}active{{end}}"><a href="{{.RepoLink}}{{if .BranchName}}{{if ne .BranchName `master`}}/src/{{.BranchName}}{{end}}{{end}}">Source</a></li> + {{if not .IsBareRepo}} + <li class="{{if .IsRepoToolbarCommits}}active{{end}}"><a href="{{.RepoLink}}/commits/{{if .BranchName}}{{.BranchName}}{{else}}master{{end}}">Commits</a></li> + <!-- <li class="{{if .IsRepoToolbarBranches}}active{{end}}"><a href="{{.RepoLink}}/branches">Branches</a></li> --> + <!-- <li class="{{if .IsRepoToolbarPulls}}active{{end}}"><a href="{{.RepoLink}}/pulls">Pull Requests</a></li> --> + <li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="{{.RepoLink}}/issues">{{if .Repository.NumOpenIssues}}<span class="badge">{{.Repository.NumOpenIssues}}</span> {{end}}Issues <!--<span class="badge">42</span>--></a></li> + {{if .IsRepoToolbarIssues}} + <li class="tmp">{{if .IsRepoToolbarIssuesList}}<a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button> + </a>{{end}}</li> + {{end}} + <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumReleases}}<span class="badge">{{.Repository.NumReleases}}</span> {{end}}Releases</a></li> + {{if .IsRepoToolbarReleases}} + <li class="tmp">{{if not .IsRepoReleaseNew}}<a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a>{{end}}</li> + {{end}} + <!-- <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="{{.RepoLink}}/wiki">Wiki</a></li> + </ul> + </li> -->{{end}} + </ul> + <ul class="nav navbar-nav navbar-right"> + {{if not .IsBareRepo}} + <!-- <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistic <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Graphic</a></li> + <li><a href="#">Pulse</a></li> + <li><a href="#">Network</a></li> + </ul> + </li> -->{{end}}{{if .IsRepositoryOwner}} + <li class="{{if .IsRepoToolbarSetting}}active{{end}}"><a href="{{.RepoLink}}/settings">Settings</a> + </li>{{end}} + </ul> + </div> + </nav> + </div> +</div> diff --git a/templates/status/200.tmpl b/templates/status/200.tmpl new file mode 100644 index 0000000000..0846ad7951 --- /dev/null +++ b/templates/status/200.tmpl @@ -0,0 +1,7 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container"> + <p>An error is occurred : {{.ErrorMsg}}</p> + <p>Application Version: {{AppVer}}</p> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/status/401.tmpl b/templates/status/401.tmpl new file mode 100644 index 0000000000..98995381af --- /dev/null +++ b/templates/status/401.tmpl @@ -0,0 +1,6 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container"> + 401 Unauthorized +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/status/403.tmpl b/templates/status/403.tmpl new file mode 100644 index 0000000000..03a88479dd --- /dev/null +++ b/templates/status/403.tmpl @@ -0,0 +1,6 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container"> + 403 Forbidden +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl new file mode 100644 index 0000000000..f68676fe23 --- /dev/null +++ b/templates/status/404.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container text-center"> + <p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p> + <hr/> + <p>Application Version: {{AppVer}}</p> + <p>If you think it is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl new file mode 100644 index 0000000000..dd7358115d --- /dev/null +++ b/templates/status/500.tmpl @@ -0,0 +1,10 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container text-center"> + <p style="margin-top: 80px"><img src="/img/500.png" alt="404"/></p> + <hr/> + <p>An error is occurred : {{.ErrorMsg}}</p> + <hr/> + <p>Application Version: {{AppVer}}</p> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/active.tmpl b/templates/user/active.tmpl new file mode 100644 index 0000000000..9cac069dce --- /dev/null +++ b/templates/user/active.tmpl @@ -0,0 +1,36 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container"> + <form action="/user/activate" method="post" class="form-horizontal card" id="login-card"> + {{.CsrfTokenHtml}} + <h3>Activate Your Account</h3> + {{if .IsActivatePage}} + {{if .ServiceNotEnabled}} + <p>Sorry, Register Mail Confirmation has been disabled.</p> + {{else if .ResendLimited}} + <p>Sorry, you are sending activation e-mail too frequently, please wait 3 minutes.</p> + {{else}} + <p>New confirmation e-mail has been sent to <b>{{.SignedUser.Email}}</b>, please check your inbox within {{.Hours}} hours to complete your registeration.</p> + <hr/> + <a href="http://{{Mail2Domain .SignedUser.Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a> + {{end}} + {{else}} + {{if .IsSendRegisterMail}} + <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within {{.Hours}} hours to complete your registeration.</p> + <hr/> + <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a> + {{else if .IsActivateFailed}} + <p>Sorry, your confirmation code has been exipired or not valid.</p> + {{else}} + <p>Hi, {{.SignedUser.Name}}, you have an unconfirmed email address(<b>{{.SignedUser.Email}}</b>). If you haven't received a confirmation e-mail or need to resend a new one, please click botton below.</p> + <hr/> + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary">Click here to resend your active e-mail</button> + </div> + </div> + {{end}} + {{end}} + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl new file mode 100644 index 0000000000..e2d7a5093f --- /dev/null +++ b/templates/user/dashboard.tmpl @@ -0,0 +1,54 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body-nav"> + <div class="container"> + <ul class="nav nav-pills pull-right"> + <li class="active"><a href="/">Feed</a></li> + <li><a href="/issues">Issues</a></li> + <!-- <li><a href="/pulls">Pull Requests</a></li> + <li><a href="/stars">Stars</a></li> --> + </ul> + <h3>News Feed</h3> + </div> +</div> +<div id="body" class="container" data-page="user"> + {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} + <div id="feed-left" class="col-md-8"> + <ul class="list-unstyled activity-list"> + {{range .Feeds}} + <li> + <i class="icon fa fa-{{ActionIcon .OpType}}"></i> + <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div> + <span class="clearfix"></span> + </li> + {{else}} + <li>No any activity yet.</li> + {{end}} + </ul> + </div> + <div id="feed-right" class="col-md-4"> + <div class="panel panel-default repo-panel"> + <div class="panel-heading">Your Repositories + <div class="btn-group pull-right" id="user-dashboard-repo-new"> + <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square"></i>New</button> + <div class="dropdown-menu dropdown-menu-right"> + <ul class="list-unstyled"> + <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li> + <li><a href="/repo/mirror"><i class="fa fa-clipboard"></i>Mirror</a></li> + <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> + </ul> + </div> + </div> + </div> + <div class="panel-body"> + <ul class="list-group">{{range .MyRepos}} + <li class="list-group-item"><a href="/{{$.SignedUserName}}/{{.Name}}"> + <!-- <span class="stars pull-right"><i class="fa fa-star"></i>{{.NumStars}}</span> --> + <i class="fa fa-book"></i>{{.Name}}</a> + </li>{{end}} + </ul> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/delete.tmpl b/templates/user/delete.tmpl new file mode 100644 index 0000000000..17c9ea8925 --- /dev/null +++ b/templates/user/delete.tmpl @@ -0,0 +1,46 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + <div id="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"><a href="/user/setting/security">Security</a></li> --> + <li class="list-group-item list-group-item-success"><a href="/user/delete">Delete Account</a></li> + </ul> + </div> + <div id="user-setting-container" class="col-md-9"> + <h4>Delete Account</h4> + <p class="alert alert-danger">{{if not .HasError}}The operation will delete your account permanently. Sorry to see you go, but we know you'll back soon.{{else}}{{.ErrorMsg}}{{end}}</p> + <div class="form-group"> + <button type="submit" class="btn btn-danger btn-lg" href="#delete-account-modal" id="delete-account" data-toggle="modal">Delete Account</button> + </div> + </div> + <div class="modal fade" id="delete-account-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <form action="/user/delete" method="post" class="modal-content" id="user-delete"> + {{.CsrfTokenHtml}} + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">Delete Account</h4> + </div> + + <div class="modal-body"> + <div class="form-group"> + <label>Make sure your are owner of this account. Please enter your password.<strong class="text-danger">*</strong></label> + <input name="password" class="form-control" type="password" placeholder="Type your account password" required="required"> + </div> + </div> + + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button type="submit" class="btn btn-danger">Delete</button> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/forgot_passwd.tmpl b/templates/user/forgot_passwd.tmpl new file mode 100644 index 0000000000..a099ff2744 --- /dev/null +++ b/templates/user/forgot_passwd.tmpl @@ -0,0 +1,32 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container"> + <form action="/user/forget_password" method="post" class="form-horizontal card" id="login-card"> + {{.CsrfTokenHtml}} + <h3>Reset Your Password</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + {{if .IsResetSent}} + <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within {{.Hours}} hours.</p> + <hr/> + <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a> + {{else if .IsResetRequest}} + <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}"> + <label class="col-md-3 control-label">Email: </label> + <div class="col-md-7"> + <input name="email" class="form-control" placeholder="Type your e-mail address" required="required"> + </div> + </div> + <hr/> + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary">Click here to send reset confirmation e-mail</button> + </div> + </div> + {{else if .IsResetDisable}} + <p>Sorry, mail service is not enabled.</p> + {{else if .ResendLimited}} + <p>Sorry, you are sending e-mail too frequently, please wait 3 minutes.</p> + {{end}} + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/notification.tmpl b/templates/user/notification.tmpl new file mode 100644 index 0000000000..7c2e8425d4 --- /dev/null +++ b/templates/user/notification.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + {{template "user/setting_nav" .}} + <div id="user-setting-container" class="col-md-9"> + <h4>Notification</h4> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/password.tmpl b/templates/user/password.tmpl new file mode 100644 index 0000000000..b2cdc72d9e --- /dev/null +++ b/templates/user/password.tmpl @@ -0,0 +1,43 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + {{template "user/setting_nav" .}} + <div id="user-setting-container" class="col-md-9"> + <div id="setting-pwd"> + <h4>Password</h4> + <form class="form-horizontal" id="password-form" method="post" action="/user/setting/password"> + {{.CsrfTokenHtml}} + {{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}} + <div class="form-group"> + <label class="col-md-3 control-label">Old Password<strong class="text-danger">*</strong></label> + <div class="col-md-7"> + <input type="password" name="oldpasswd" class="form-control" placeholder="Type your current password" required="required"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">New Password<strong class="text-danger">*</strong></label> + <div class="col-md-7"> + <input type="password" name="newpasswd" class="form-control" placeholder="Type your new password" required="required"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">Re-Type<strong class="text-danger">*</strong></label> + <div class="col-md-7"> + <input type="password" name="retypepasswd" class="form-control" placeholder="Re-type your new password" required="required"> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-3 col-md-7"> + <button type="submit" class="btn btn-primary">Change Password</button> + <a href="/forget-password/">Forgot your password?</a> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl new file mode 100644 index 0000000000..88ee318f4a --- /dev/null +++ b/templates/user/profile.tmpl @@ -0,0 +1,66 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + <div id="user-profile" class="col-md-3"> + <div class="profile-avatar text-center"> + <a href="http://gravatar.com/emails/" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change your avatar at gravatar.com"> + <img id="user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="{{.Owner.Name}}"/> + </a> + <span id="user-name" class="center-block">{{.Owner.Name}}</span> + </div> + <div class="profile-info"> + <ul class="list-group"> + {{if .Owner.Location}} + <li class="list-group-item"><i class="fa fa-thumb-tack"></i>{{.Owner.Location}}</li> + {{end}} + {{if .Owner.Email}} + <li class="list-group-item"><i class="fa fa-envelope"></i><a href="mailto:{{.Owner.Email}}">{{.Owner.Email}}</a></li> + {{end}} + {{if .Owner.Website}} + <li class="list-group-item"><i class="fa fa-link"></i><a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li> + {{end}} + <li class="list-group-item"><i class="fa fa-clock-o"></i>Joined on {{DateFormat .Owner.Created "M d, Y"}}</li> + </ul> + </div> + </div> + <div id="user-activity" class="col-md-9"> + <ul class="nav nav-tabs" id="user-act-tabs"> + <li{{if not .TabName}} class="active"{{end}}><a href="{{.Owner.HomeLink}}"><i class="fa fa-gittip"></i>Repositories</a></li> + <li{{if eq .TabName "activity"}} class="active"{{end}}><a href="{{.Owner.HomeLink}}?tab=activity"><i class="fa fa-rss"></i>Public Activity</a></li> + </ul> + <div class="tab-content"> + {{if eq .TabName "activity"}} + <div class="tab-pane active"> + <ul class="list-unstyled activity-list"> + {{range .Feeds}} + <li> + <i class="icon fa fa-{{ActionIcon .OpType}}"></i> + <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div> + <span class="clearfix"></span> + </li> + {{else}} + <li>No any public activity yet.</li> + {{end}} + </ul> + </div> + {{else}} + {{$owner := .Owner}} + <div class="tab-pane active"> + <ul class="list-unstyled repo-list"> + {{range .Repos}} + <li> + <div class="meta pull-right"><!-- <i class="fa fa-star"></i> {{.NumStars}} --> <i class="fa fa-code-fork"></i> {{.NumForks}}</div> + <h4> + <a href="/{{$owner.Name}}/{{.Name}}">{{.Name}}</a> + </h4> + <p class="desc">{{.Description}}</p> + <div class="info">Last updated {{.Updated|TimeSince}}</div> + </li> + {{end}} + </ul> + </div> + {{end}} + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/user/publickey.tmpl b/templates/user/publickey.tmpl new file mode 100644 index 0000000000..ecdeb035d2 --- /dev/null +++ b/templates/user/publickey.tmpl @@ -0,0 +1,58 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + {{template "user/setting_nav" .}} + <div id="user-setting-container" class="col-md-9"> + <div id="ssh-keys"> + <h4>SSH Keys</h4>{{if .AddSSHKeySuccess}} + <p class="alert alert-success">New SSH Key has been added !</p>{{else if .HasError}}<p class="alert alert-danger">{{.ErrorMsg}}</p>{{end}} + <ul id="ssh-keys-list" class="list-group"> + <li class="list-group-item"><span class="name">SSH Key's name</span></li> + {{range .Keys}} + <li class="list-group-item"> + <span class="name">{{.Name}}</span> + <span class="print">({{.Fingerprint}})</span> + <button href="#" class="btn btn-danger delete pull-right" rel="{{.Id}}" data-del="{{.Id}}">Delete</button> + </li> + {{end}} + <li class="list-group-item"> + <a class="btn btn-link btn-primary" href="#ssh-add-modal" id="ssh-add" data-toggle="modal">Add SSH Key</a> + </li> + </ul> + <div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <form class="modal-content form-horizontal" id="ssh-form" method="post" action="/user/setting/ssh/"> + {{.CsrfTokenHtml}} + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">Add SSH Key</h4> + </div> + + <div class="modal-body"> + <div class="form-group"> + <label class="col-md-3 control-label">The name of key<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="keyname" class="form-control" placeholder="Type your preferred name" required="required"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-3 control-label">SSH Key<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <textarea name="key_content" class="form-control" placeholder="Type your key content" required="required"></textarea> + </div> + </div> + </div> + + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> + <button type="submit" class="btn btn-primary">Save SSH Key</button> + </div> + </form> + </div> + </div> + <p><strong>Need help?</strong> Check out the guide to <a href="https://help.github.com/articles/generating-ssh-keys" target="_blank">generating SSH keys</a> or troubleshoot <a href="https://help.github.com/ssh-issues/" target="_blank">common SSH Problems</a></p> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/pulls.tmpl b/templates/user/pulls.tmpl new file mode 100644 index 0000000000..47462a9be6 --- /dev/null +++ b/templates/user/pulls.tmpl @@ -0,0 +1,17 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="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="body" class="container" data-page="user"> + {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/reset_passwd.tmpl b/templates/user/reset_passwd.tmpl new file mode 100644 index 0000000000..9190c7c13c --- /dev/null +++ b/templates/user/reset_passwd.tmpl @@ -0,0 +1,26 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container"> + <form action="/user/reset_password?code={{.Code}}" method="post" class="form-horizontal card" id="login-card"> + {{.CsrfTokenHtml}} + <h3>Reset Your Pasword</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + {{if .IsResetForm}} + <div class="form-group"> + <label class="col-md-4 control-label">Password: </label> + <div class="col-md-6"> + <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required"> + </div> + </div> + <hr/> + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary">Click here to reset your password</button> + </div> + </div> + {{else}} + <p>Sorry, your confirmation code has been exipired or not valid.</p> + {{end}} + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/security.tmpl b/templates/user/security.tmpl new file mode 100644 index 0000000000..7de41ebd35 --- /dev/null +++ b/templates/user/security.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + {{template "user/setting_nav" .}} + <div id="user-setting-container" class="col-md-9"> + <h4>Security</h4> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl new file mode 100644 index 0000000000..d582833870 --- /dev/null +++ b/templates/user/setting.tmpl @@ -0,0 +1,57 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="body" class="container" data-page="user"> + {{template "user/setting_nav" .}} + <div id="user-setting-container" class="col-md-9"> + <div id="setting-pwd"> + <h4>Account Profile</h4> + <form class="form-horizontal" id="password-form" method="post" action="/user/setting"> + {{.CsrfTokenHtml}} + {{if .IsSuccess}}<p class="alert alert-success">Your profile has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} + <p>Your Email will be public and used for Account related notifications and any web based operations made via the web.</p> + <div class="form-group"> + <label class="col-md-2 control-label" for="user-setting-username">Username<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="username" class="form-control" placeholder="Type your user name" required="required" value="{{.SignedUser.Name}}" title="{{.SignedUser.Name}}" id="user-setting-username"> + <p class="help-block hidden"><span class="text-danger">Cautious : </span>your username is changing !</p> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="email" class="form-control" placeholder="Type your e-mail address" required="required" value="{{.SignedUser.Email}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Website</label> + <div class="col-md-8"> + <input name="website" class="form-control" placeholder="Type your website URL" value="{{.SignedUser.Website}}"> + </div> + </div> + + <div class="form-group"> + <label class="col-md-2 control-label">Location</label> + <div class="col-md-8"> + <input name="location" class="form-control" placeholder="Type your current location" value="{{.SignedUser.Location}}"> + </div> + </div> + + <div class="form-group {{if .Err_Avatar}}has-error has-feedback{{end}}"> + <label class="col-md-2 control-label">Gravatar Email<strong class="text-danger">*</strong></label> + <div class="col-md-8"> + <input name="avatar" class="form-control" placeholder="Type your Gravatar e-mail address" required="required" value="{{.SignedUser.AvatarEmail}}"> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-2 col-md-8"> + <button type="submit" class="btn btn-primary">Update Profile</button> + </div> + </div> + </form> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/setting_nav.tmpl b/templates/user/setting_nav.tmpl new file mode 100644 index 0000000000..c0f2ae03dd --- /dev/null +++ b/templates/user/setting_nav.tmpl @@ -0,0 +1,11 @@ +<div id="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>
\ No newline at end of file diff --git a/templates/user/signin.tmpl b/templates/user/signin.tmpl new file mode 100644 index 0000000000..eb4cb9ccee --- /dev/null +++ b/templates/user/signin.tmpl @@ -0,0 +1,54 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container" id="body" data-page="user-signin"> + <form action="/user/login" method="post" class="form-horizontal card" id="login-card"> + {{.CsrfTokenHtml}} + <h3>Log in</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Username: </label> + <div class="col-md-6"> + <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required"> + </div> + </div> + + <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Password: </label> + <div class="col-md-6"> + <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required"> + </div> + </div> + + <div class="form-group"> + <div class="col-md-6 col-md-offset-4"> + <div class="checkbox"> + <label> + <input type="checkbox" name="remember" {{if .remember}}checked{{end}}> + <strong>Remember me</strong> + </label> + </div> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary">Log In</button> + <a href="/user/forget_password/">Forgot your password?</a> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <a href="/user/sign_up">Need an account? Sign up now.</a> + </div> + </div> + + {{if .OauthEnabled}} + <div class="form-group text-center" id="social-login"> + <h4>Log In with Social Accounts</h4> + {{if .OauthGitHubEnabled}}<a href="/user/login/github"><i class="fa fa-github-square fa-3x"></i></a>{{end}} + </div> + {{end}} + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl new file mode 100644 index 0000000000..6ed595a350 --- /dev/null +++ b/templates/user/signup.tmpl @@ -0,0 +1,53 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div class="container" id="body" data-page="user-signup"> + <form action="/user/sign_up" method="post" class="form-horizontal card" id="login-card"> + {{.CsrfTokenHtml}} + {{if .DisenableRegisteration}} + Sorry, registeration has been disenabled, you can only get account from administrator. + {{else}} + <h3>Sign Up</h3> + <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> + <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Username: </label> + <div class="col-md-6"> + <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required"> + </div> + </div> + + <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Email: </label> + <div class="col-md-6"> + <input name="email" class="form-control" placeholder="Type your e-mail address" value="{{.email}}" required="required" title="Email is not valid"> + </div> + </div> + + <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Password: </label> + <div class="col-md-6"> + <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required" title="Password must contain at least 6 characters"> + </div> + </div> + + <div class="form-group {{if .Err_RetypePasswd}}has-error has-feedback{{end}}"> + <label class="col-md-4 control-label">Re-type: </label> + <div class="col-md-6"> + <input name="retypepasswd" type="password" class="form-control" placeholder="Re-type your password" required="required" title="Re-type Password must be same to Password"> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <button type="submit" class="btn btn-lg btn-primary">Create an account</button> + </div> + </div> + + <div class="form-group"> + <div class="col-md-offset-4 col-md-6"> + <a href="/user/login">Already have an account? Sign in now!</a> + </div> + </div> + {{end}} + </form> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/user/stars.tmpl b/templates/user/stars.tmpl new file mode 100644 index 0000000000..253efd6eec --- /dev/null +++ b/templates/user/stars.tmpl @@ -0,0 +1,17 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +<div id="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="body" class="container" data-page="user"> + {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} +</div> +{{template "base/footer" .}}
\ No newline at end of file |