Merge branch 'master' of github.com:gogits/gogs

Conflicts:
	conf/app.ini
This commit is contained in:
Unknown 2014-03-25 06:54:22 -04:00
commit e95be2cb3e
52 changed files with 424 additions and 263 deletions

25
.gitignore vendored
View File

@ -1,3 +1,5 @@
gogs gogs
*.exe *.exe
*.exe~ *.exe~
@ -10,3 +12,26 @@ data/
.idea/ .idea/
*.iml *.iml
public/img/avatar/ public/img/avatar/
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe

40
LICENSE
View File

@ -1,19 +1,27 @@
Copyright (c) 2011 Dmitriy Zaporozhets Copyright (c) 2014
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Redistribution and use in source and binary forms, with or without
of this software and associated documentation files (the "Software"), to deal modification, are permitted provided that the following conditions are met:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in * Redistributions of source code must retain the above copyright notice, this
all copies or substantial portions of the Software. list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * Redistributions in binary form must reproduce the above copyright notice,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, this list of conditions and the following disclaimer in the documentation
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE and/or other materials provided with the distribution.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * Neither the name of the {organization} nor the names of its
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN contributors may be used to endorse or promote products derived from
THE SOFTWARE. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,7 +1,7 @@
; App name that shows on every page title ; App name that shows on every page title
APP_NAME = Gogs: Go Git Service APP_NAME = Gogs: Go Git Service
APP_LOGO = img/favicon.png APP_LOGO = img/favicon.png
; Check it if you run locally ; Change it if you run locally
RUN_USER = git RUN_USER = git
; Either "dev", "prod" or "test", default is "dev" ; Either "dev", "prod" or "test", default is "dev"
RUN_MODE = dev RUN_MODE = dev

View File

@ -251,8 +251,8 @@ var client = &http.Client{}
func (this *thunderTask) fetch() error { func (this *thunderTask) fetch() error {
req, _ := http.NewRequest("GET", this.Url, nil) req, _ := http.NewRequest("GET", this.Url, nil)
req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8") req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/jpeg,image/png,*/*;q=0.8")
req.Header.Set("Accept-Encoding", "gzip,deflate,sdch") req.Header.Set("Accept-Encoding", "deflate,sdch")
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.8") req.Header.Set("Accept-Language", "zh-CN,zh;q=0.8")
req.Header.Set("Cache-Control", "no-cache") req.Header.Set("Cache-Control", "no-cache")
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36") req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36")

View File

@ -243,7 +243,7 @@ func newNotifyMailService() {
} }
func NewConfigContext() { func NewConfigContext() {
var err error //var err error
workDir, err := exeDir() workDir, err := exeDir()
if err != nil { if err != nil {
fmt.Printf("Fail to get work directory: %s\n", err) fmt.Printf("Fail to get work directory: %s\n", err)

View File

@ -52,14 +52,14 @@ html, body {
} }
/* gogits nav header */ /* gogits nav header */
.gogs-masthead { .masthead {
background-color: #428bca; background-color: #428bca;
box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1); box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1);
margin: 0; margin: 0;
} }
/* gogits nav item link */ /* gogits nav item link */
.gogs-nav-item { .nav-item {
position: relative; position: relative;
display: inline-block; display: inline-block;
padding: 10px; padding: 10px;
@ -69,39 +69,39 @@ html, body {
height: 46px; height: 46px;
} }
#gogs-nav-logo { #nav-logo {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
margin-right: 10px; margin-right: 10px;
} }
.gogs-nav-item:hover, .nav-item:hover,
.gogs-nav-item:focus { .nav-item:focus {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
} }
.gogs-nav-item.navbar-right { .nav-item.navbar-right {
margin-top: 3px; margin-top: 3px;
} }
.gogs-nav-item.navbar-btn { .nav-item.navbar-btn {
cursor: pointer; cursor: pointer;
margin-top: 8px; margin-top: 8px;
padding: 5px 15px; padding: 5px 15px;
height: 30px; height: 30px;
} }
.gogs-nav-item.navbar-right .fa { .nav-item.navbar-right .fa {
margin: 0; margin: 0;
} }
/* gogits nav item active status */ /* gogits nav item active status */
.gogs-nav .active { .nav .active {
color: #fff; color: #fff;
} }
.gogs-nav .active:after { .nav .active:after {
position: absolute; position: absolute;
bottom: -1px; bottom: -1px;
left: 50%; left: 50%;
@ -115,29 +115,29 @@ html, body {
border-left: 5px solid transparent; border-left: 5px solid transparent;
} }
#gogs-nav-logo:after { #nav-logo:after {
bottom: -4px !important; bottom: -4px !important;
} }
#gogs-nav-avatar:after { #nav-avatar:after {
bottom: -4px !important; bottom: -4px !important;
} }
.gogs-nav .tooltip { .nav .tooltip {
border: none; border: none;
} }
/* gogits logo */ /* gogits logo */
#gogs-nav-avatar { #nav-avatar {
margin-top: 0; margin-top: 0;
} }
#gogs-logo, #gogs-nav-avatar img { #logo, #nav-avatar img {
width: 28px; width: 28px;
height: 28px; height: 28px;
} }
#gogs-nav-out { #nav-out {
margin-top: 10px; margin-top: 10px;
padding: 5px 0; padding: 5px 0;
margin-left: 10px; margin-left: 10px;
@ -145,56 +145,56 @@ html, body {
float: right; float: right;
} }
#gogs-nav-signin, #gogs-nav-signup { #nav-signin, #nav-signup {
float: right; float: right;
margin-left: 1em; margin-left: 1em;
} }
#gogs-nav-out .fa { #nav-out .fa {
vertical-align: -10%; vertical-align: -10%;
margin: 0 .5em; margin: 0 .5em;
} }
/* gogits body */ /* gogits body */
#gogs-body { #body {
padding-bottom: 60px; padding-bottom: 60px;
margin-top: 30px; margin-top: 30px;
} }
#gogs-body .btn-default { #body .btn-default {
background-color: #FFF; background-color: #FFF;
background-image: linear-gradient(to bottom, #FFF 0, #FAFAFA 100%); background-image: linear-gradient(to bottom, #FFF 0, #FAFAFA 100%);
} }
#gogs-body-nav { #body-nav {
background-color: #FFF; background-color: #FFF;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
height: 66px height: 66px
} }
#gogs-body-nav .nav { #body-nav .nav {
font-size: 14px; font-size: 14px;
margin-top: 12px; margin-top: 12px;
} }
#gogs-body-nav .nav-pills li a { #body-nav .nav-pills li a {
color: #444; color: #444;
} }
#gogs-body-nav .nav-pills li.active a { #body-nav .nav-pills li.active a {
font-weight: bold; font-weight: bold;
border-bottom: 2px solid #d26911; border-bottom: 2px solid #d26911;
background-color: transparent; background-color: transparent;
color: #444; color: #444;
} }
#gogs-body-nav .nav-pills li:hover a { #body-nav .nav-pills li:hover a {
background-color: transparent; background-color: transparent;
text-decoration: underline; text-decoration: underline;
} }
/* gogits login card */ /* gogits login card */
.gogs-card { .card {
margin: auto; margin: auto;
padding: 30px; padding: 30px;
background: #fff; background: #fff;
@ -203,78 +203,87 @@ html, body {
box-sizing: border-box; box-sizing: border-box;
} }
.gogs-card h3 { .card h3 {
margin-top: 0; margin-top: 0;
margin-bottom: 30px; margin-bottom: 30px;
padding-bottom: 20px; padding-bottom: 20px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
#gogs-login-card { #login-card {
width: 600px; width: 600px;
} }
#gogs-login-card .form-control { #login-card .form-control {
padding: 6px 12px; padding: 6px 12px;
box-sizing: content-box; box-sizing: content-box;
} }
#gogs-login-card .control-label { #login-card .control-label {
height: 44px; height: 44px;
line-height: 30px; line-height: 30px;
} }
.gogs-card .btn { #install-card {
width: 800px;
}
#install-card .form-group {
margin-left: 0;
margin-right: 0;
}
.card .btn {
cursor: pointer; cursor: pointer;
margin-right: 1.2em; margin-right: 1.2em;
} }
#gogs-social-login { #social-login {
margin-top: 30px; margin-top: 30px;
padding-top: 20px; padding-top: 20px;
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
} }
#gogs-social-login .btn { #social-login .btn {
float: none; float: none;
margin: auto; margin: auto;
} }
/* gogs-user-profile */ /* gogs-user-profile */
#gogs-user-avatar { #user-avatar {
width: 200px; width: 200px;
height: 200px; height: 200px;
border-radius: 6px; border-radius: 6px;
} }
#gogs-user-avatar-commit { #user-avatar-commit {
width: 16px; width: 16px;
height: 16px; height: 16px;
border-radius: 2px; border-radius: 2px;
} }
#gogs-user-name { #user-name {
margin-top: 20px; margin-top: 20px;
font-size: 1.6em; font-size: 1.6em;
font-weight: bold; font-weight: bold;
margin-bottom: 20px; margin-bottom: 20px;
} }
#gogs-user-profile .profile-info .list-group-item { #user-profile .profile-info .list-group-item {
background-color: transparent; background-color: transparent;
padding-top: 18px; padding-top: 18px;
color: #666; color: #666;
} }
#gogs-user-profile .profile-info .list-group-item a { #user-profile .profile-info .list-group-item a {
margin: 0; margin: 0;
padding: 0; padding: 0;
display: inline; display: inline;
color: #0093c4; color: #0093c4;
} }
#gogs-user-profile .profile-info .list-group { #user-profile .profile-info .list-group {
border-top: 1px solid #ccc; border-top: 1px solid #ccc;
padding-bottom: 18px; padding-bottom: 18px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
@ -282,50 +291,50 @@ html, body {
padding-right: 18px; padding-right: 18px;
} }
#gogs-user-activity .tab-pane { #user-activity .tab-pane {
padding: 20px; padding: 20px;
} }
#gogs-user-act-tabs li.active a { #user-act-tabs li.active a {
border-bottom-color: #ddd; border-bottom-color: #ddd;
} }
/* gogits repo create */ /* gogits repo create */
#gogs-repo-create { #repo-create {
width: 800px; width: 800px;
} }
#gogs-repo-create textarea[name=desc] { #repo-create textarea[name=desc] {
height: 8em; height: 8em;
} }
/* gogits user setting */ /* gogits user setting */
#gogs-user-setting-nav > h4, #gogs-user-setting-container > h4, #gogs-user-setting-container > div > h4, #user-setting-nav > h4, #user-setting-container > h4, #user-setting-container > div > h4,
#gogs-ssh-keys > h4, #gogs-user-delete > h4, #gogs-repo-setting-container .tab-pane > h4 { #ssh-keys > h4, #user-delete > h4, #repo-setting-container .tab-pane > h4 {
padding-bottom: 18px; padding-bottom: 18px;
margin-bottom: 18px; margin-bottom: 18px;
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
} }
#gogs-user-setting-nav .list-group .list-group-item a { #user-setting-nav .list-group .list-group-item a {
margin-left: 0; margin-left: 0;
padding: .6em; padding: .6em;
font-size: 14px; font-size: 14px;
color: #3B73AF; color: #3B73AF;
} }
#gogs-user-setting-nav .list-group .list-group-item { #user-setting-nav .list-group .list-group-item {
background-color: transparent; background-color: transparent;
} }
#gogs-user-setting-nav .list-group .list-group-item-success a { #user-setting-nav .list-group .list-group-item-success a {
font-weight: bold; font-weight: bold;
color: #444; color: #444;
} }
.gogs-admin-nav { .admin-nav {
background-color: #FFF; background-color: #FFF;
padding-top: 10px; padding-top: 10px;
padding-left: 0; padding-left: 0;
@ -333,49 +342,49 @@ html, body {
border: 1px solid #D8D8D8; border: 1px solid #D8D8D8;
} }
.gogs-admin-nav li { .admin-nav li {
margin-bottom: 8px; margin-bottom: 8px;
border-left: 4px solid transparent; border-left: 4px solid transparent;
} }
.gogs-admin-nav li:hover { .admin-nav li:hover {
border-left-color: #EEE; border-left-color: #EEE;
} }
.gogs-admin-nav li.active:hover { .admin-nav li.active:hover {
border-left: 4px solid #DD4B39; border-left: 4px solid #DD4B39;
} }
#gogs-repo-setting-container .form-horizontal label { #repo-setting-container .form-horizontal label {
line-height: 30px; line-height: 30px;
} }
/* gogits user ssh keys */ /* gogits user ssh keys */
#gogs-ssh-keys .list-group-item { #ssh-keys .list-group-item {
padding: 15px 0; padding: 15px 0;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
#gogs-ssh-keys .list-group-item .delete { #ssh-keys .list-group-item .delete {
margin: -5px 50px 0; margin: -5px 50px 0;
} }
#gogs-ssh-keys .list-group-item:after { #ssh-keys .list-group-item:after {
clear: both; clear: both;
} }
#gogs-ssh-keys .name { #ssh-keys .name {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
} }
#gogs-ssh-keys .print { #ssh-keys .print {
padding-left: 1em; padding-left: 1em;
color: #888; color: #888;
} }
#gogs-ssh-add { #ssh-add {
display: inline-block; display: inline-block;
color: white; color: white;
cursor: pointer; cursor: pointer;
@ -383,25 +392,25 @@ html, body {
border-radius: 3px; border-radius: 3px;
} }
#gogs-ssh-form textarea { #ssh-form textarea {
height: 16em; height: 16em;
} }
/* #gogs-feed */ /* #feed */
#gogs-feed-right .repo-panel .panel-heading .btn { #feed-right .repo-panel .panel-heading .btn {
margin-top: -4px; margin-top: -4px;
} }
#gogs-feed-right .repo-panel .panel-body { #feed-right .repo-panel .panel-body {
padding: 0; padding: 0;
} }
#gogs-feed-right .repo-panel .list-group { #feed-right .repo-panel .list-group {
margin-bottom: 0; margin-bottom: 0;
} }
#gogs-feed-right .repo-panel .list-group-item a { #feed-right .repo-panel .list-group-item a {
display: block; display: block;
margin-left: 0; margin-left: 0;
background-color: transparent; background-color: transparent;
@ -409,11 +418,11 @@ html, body {
font-weight: bold; font-weight: bold;
} }
#gogs-feed-right .repo-panel .list-group-item .fa { #feed-right .repo-panel .list-group-item .fa {
color: #666; color: #666;
} }
#gogs-feed-right .repo-panel .list-group-item { #feed-right .repo-panel .list-group-item {
font-size: 14px; font-size: 14px;
line-height: 32px; line-height: 32px;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
@ -421,97 +430,101 @@ html, body {
clear: both; clear: both;
} }
#gogs-feed-right .repo-panel .list-group-item:last-child { #feed-right .repo-panel .list-group-item:last-child {
border-bottom: none; border-bottom: none;
} }
#gogs-feed-right .repo-panel .list-group-item:hover { #feed-right .repo-panel .list-group-item:hover {
background-color: #eafffd; background-color: #eafffd;
background-color: rgba(65, 131, 196, 0.1); background-color: rgba(65, 131, 196, 0.1);
} }
#gogs-feed-right .repo-panel span.stars { #feed-right .repo-panel span.stars {
color: #666; color: #666;
margin-right: 1em; margin-right: 1em;
} }
/* gogits repo single page */ /* gogits repo single page */
#gogs-body-nav.gogs-repo-nav { #body-nav.repo-nav {
padding-top: 16px; padding-top: 16px;
padding-bottom: 30px; padding-bottom: 30px;
height: auto; height: auto;
} }
.gogs-repo-nav .name { .repo-nav .name {
margin-top: 15px; margin-top: 15px;
} }
.gogs-repo-nav .desc { .repo-nav .desc {
color: #888; color: #888;
margin-bottom: 0; margin-bottom: 0;
} }
.gogs-repo-nav h3 .fa { .repo-nav h3 .fa {
color: #BBB; color: #BBB;
margin-left: 0; margin-left: 0;
} }
.gogs-repo-nav .actions { .repo-nav .actions {
padding-top: 20px; padding-top: 20px;
} }
.gogs-repo-nav .btn-default { .repo-nav .btn-default {
font-family: Tahoma, Arial, sans-serif; font-family: Tahoma, Arial, sans-serif;
} }
#gogs-repo-watching .dropdown-menu { #repo-watching .dropdown-menu {
width: 280px; width: 280px;
padding: 0; padding: 0;
} }
#gogs-repo-watching .dropdown-menu .dropdown-item:hover .dropdown-header, #gogs-repo-watching .dropdown-item .dropdown-header.text-primary { #repo-watching .dropdown-menu .dropdown-item:hover .dropdown-header, #repo-watching .dropdown-item .dropdown-header.text-primary {
color: rgb(65, 131, 196); color: rgb(65, 131, 196);
cursor: pointer; cursor: pointer;
} }
#gogs-repo-watching .dropdown-menu .description { #repo-watching .dropdown-menu .description {
padding: 0 20px; padding: 0 20px;
color: #888; color: #888;
} }
#gogs-repo-watching .dropdown-menu .dropdown-header { #repo-watching .dropdown-menu .dropdown-header {
color: #444; color: #444;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;
margin-bottom: 4px; margin-bottom: 4px;
} }
#gogs-repo-toolbar { #repo-toolbar {
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
background-color: #FFF; background-color: #FFF;
height: 40px; height: 40px;
font-size: 14px; font-size: 14px;
} }
#gogs-repo-toolbar .navbar-default { #repo-toolbar .navbar-default {
border: none; border: none;
height: 39px; height: 39px;
} }
#gogs-repo-toolbar .nav > li > a { #repo-toolbar .nav > li > a {
height: 39px; height: 39px;
} }
#gogs-repo-toolbar .navbar-toolbar.navbar-default .navbar-nav > .active > a:after { #repo-toolbar .nav .active {
color: #F6F6F6;
}
#repo-toolbar .nav > .active > a:after {
border-bottom-color: #999; border-bottom-color: #999;
} }
#gogs-repo-toolbar .navbar.nav-toolbar { #repo-toolbar .navbar.nav-toolbar {
margin-bottom: 0; margin-bottom: 0;
} }
#gogs-repo-toolbar .navbar-collapse { #repo-toolbar .navbar-collapse {
padding: 0; padding: 0;
} }
@ -579,29 +592,29 @@ html, body {
min-width: 200px; min-width: 200px;
} }
#gogs-repo-clone .dropdown-menu { #repo-clone .dropdown-menu {
width: 400px; width: 400px;
padding: 20px; padding: 20px;
} }
#gogs-repo-clone .input-group { #repo-clone .input-group {
margin-bottom: 15px; margin-bottom: 15px;
} }
/* #gogs-source */ /* #source */
#gogs-source { #source {
margin-top: -20px; margin-top: -20px;
} }
#gogs-source .source-toolbar:after { #source .source-toolbar:after {
clear: both; clear: both;
} }
#gogs-source .source-toolbar .branch-switch { #source .source-toolbar .branch-switch {
display: inline-block; display: inline-block;
} }
#gogs-source .source-toolbar .breadcrumb { #source .source-toolbar .breadcrumb {
margin: 0 .5em; margin: 0 .5em;
padding: 6px 15px; padding: 6px 15px;
font-size: 16px; font-size: 16px;
@ -610,9 +623,9 @@ html, body {
background-color: transparent; background-color: transparent;
} }
#gogs-source .source-toolbar, #source .source-toolbar,
#gogs-source .info-box, #source .info-box,
#gogs-source .file-content { #source .file-content {
margin: 0 0 10px; margin: 0 0 10px;
} }
@ -676,7 +689,7 @@ html, body {
margin: 0 .5em 0 0; margin: 0 .5em 0 0;
} }
.file-content .file-head .file-size{ .file-content .file-head .file-size {
font-size: 13px; font-size: 13px;
color: #888; color: #888;
margin-left: 1em; margin-left: 1em;
@ -932,7 +945,7 @@ html, body {
color: #888; color: #888;
} }
#gogs-source .file-content.diff-file-box { #source .file-content.diff-file-box {
margin-bottom: 20px; margin-bottom: 20px;
} }

View File

@ -243,7 +243,7 @@ function initCore() {
function initRegister() { function initRegister() {
$.getScript("/js/jquery.validate.min.js", function () { $.getScript("/js/jquery.validate.min.js", function () {
Gogits.validateForm("#gogs-login-card", { Gogits.validateForm("#login-card", {
rules: { rules: {
"username": { "username": {
required: true, required: true,
@ -268,7 +268,7 @@ function initRegister() {
} }
function initUserSetting() { function initUserSetting() {
$('#gogs-ssh-keys .delete').confirmation({ $('#ssh-keys .delete').confirmation({
singleton: true, singleton: true,
onConfirm: function (e, $this) { onConfirm: function (e, $this) {
Gogits.ajaxDelete("", {"id": $this.data("del")}, function (json) { Gogits.ajaxDelete("", {"id": $this.data("del")}, function (json) {
@ -303,7 +303,7 @@ function initRepository() {
// watching script // watching script
(function () { (function () {
var $watch = $('#gogs-repo-watching'), var $watch = $('#repo-watching'),
watchLink = $watch.data("watch"), watchLink = $watch.data("watch"),
unwatchLink = $watch.data("unwatch"); unwatchLink = $watch.data("unwatch");
$watch.on('click', '.to-watch',function () { $watch.on('click', '.to-watch',function () {
@ -354,14 +354,14 @@ function initRepository() {
(function ($) { (function ($) {
$(function () { $(function () {
initCore(); initCore();
var body = $("#gogs-body"); var body = $("#body");
if (body.data("page") == "user-signup") { if (body.data("page") == "user-signup") {
initRegister(); initRegister();
} }
if (body.data("page") == "user") { if (body.data("page") == "user") {
initUserSetting(); initUserSetting();
} }
if ($('.gogs-repo-nav').length) { if ($('.repo-nav').length) {
initRepository(); initRepository();
} }
}); });

13
routers/install.go Normal file
View File

@ -0,0 +1,13 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package routers
import "github.com/gogits/gogs/modules/middleware"
func Install(ctx *middleware.Context){
ctx.Data["PageIsInstall"] = true
ctx.Data["Title"] = "Install"
ctx.HTML(200,"install")
}

View File

@ -45,6 +45,7 @@ func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
} }
ctx.Data["Title"] = "Create issue" ctx.Data["Title"] = "Create issue"
ctx.Data["IsRepoToolbarIssues"] = true
if ctx.Req.Method == "GET" { if ctx.Req.Method == "GET" {
ctx.HTML(200, "issue/create") ctx.HTML(200, "issue/create")

View File

@ -13,6 +13,7 @@ import (
"os/exec" "os/exec"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/log"
@ -45,8 +46,10 @@ gogs serv provide access auth for repositories`,
} }
func init() { func init() {
level := "0"
os.MkdirAll("log", os.ModePerm) os.MkdirAll("log", os.ModePerm)
log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log")) log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, "log/serv.log"))
log.Info("start logging...")
} }
func parseCmd(cmd string) (string, string) { func parseCmd(cmd string) (string, string) {
@ -109,25 +112,32 @@ func runServ(k *cli.Context) {
repoName = repoName[:len(repoName)-4] repoName = repoName[:len(repoName)-4]
} }
isWrite := In(verb, COMMANDS_WRITE)
isRead := In(verb, COMMANDS_READONLY)
repo, err := models.GetRepositoryByName(user.Id, repoName) repo, err := models.GetRepositoryByName(user.Id, repoName)
var isExist bool = true var isExist bool = true
if err != nil { if err != nil {
if err == models.ErrRepoNotExist { if err == models.ErrRepoNotExist {
isExist = false isExist = false
if isRead {
println("Repository", user.Name+"/"+repoName, "is not exist")
return
}
} else { } else {
println("Unavilable repository", err) println("Get repository error:", err)
log.Error(err.Error())
return return
} }
} }
isWrite := In(verb, COMMANDS_WRITE) // access check
isRead := In(verb, COMMANDS_READONLY)
switch { switch {
case isWrite: case isWrite:
has, err := models.HasAccess(user.Name, repoName, models.AU_WRITABLE) has, err := models.HasAccess(user.Name, repoName, models.AU_WRITABLE)
if err != nil { if err != nil {
println("Inernel error:", err) println("Inernel error:", err)
log.Error(err.Error())
return return
} }
if !has { if !has {
@ -138,12 +148,14 @@ func runServ(k *cli.Context) {
has, err := models.HasAccess(user.Name, repoName, models.AU_READABLE) has, err := models.HasAccess(user.Name, repoName, models.AU_READABLE)
if err != nil { if err != nil {
println("Inernel error") println("Inernel error")
log.Error(err.Error())
return return
} }
if !has { if !has {
has, err = models.HasAccess(user.Name, repoName, models.AU_WRITABLE) has, err = models.HasAccess(user.Name, repoName, models.AU_WRITABLE)
if err != nil { if err != nil {
println("Inernel error") println("Inernel error")
log.Error(err.Error())
return return
} }
} }
@ -156,28 +168,30 @@ func runServ(k *cli.Context) {
return return
} }
var rep *git.Repository
repoPath := models.RepoPath(user.Name, repoName)
if !isExist { if !isExist {
if isRead { if isWrite {
println("Repository", user.Name+"/"+repoName, "is not exist") _, err = models.CreateRepository(user, repoName, "", "", "", false, true)
return
} else if isWrite {
_, err := models.CreateRepository(user, repoName, "", "", "", false, true)
if err != nil { if err != nil {
println("Create repository failed") println("Create repository failed")
log.Error(err.Error())
return return
} }
} }
} }
rep, err := git.OpenRepository(models.RepoPath(user.Name, repoName)) rep, err = git.OpenRepository(repoPath)
if err != nil { if err != nil {
println(err.Error()) println("OpenRepository failed:", err.Error())
log.Error(err.Error())
return return
} }
refs, err := rep.AllReferencesMap() refs, err := rep.AllReferencesMap()
if err != nil { if err != nil {
println(err.Error()) println("Get All References failed:", err.Error())
log.Error(err.Error())
return return
} }
@ -194,17 +208,17 @@ func runServ(k *cli.Context) {
if err = gitcmd.Run(); err != nil { if err = gitcmd.Run(); err != nil {
println("execute command error:", err.Error()) println("execute command error:", err.Error())
} log.Error(err.Error())
if !strings.HasPrefix(cmd, "git-receive-pack") {
return return
} }
// update if isRead {
//w, _ := os.Create("serve.log") return
//defer w.Close() }
//log.SetOutput(w)
time.Sleep(time.Second)
// find push reference name
var t = "ok refs/heads/" var t = "ok refs/heads/"
var i int var i int
var refname string var refname string
@ -220,24 +234,31 @@ func runServ(k *cli.Context) {
refname = l[idx+len(t):] refname = l[idx+len(t):]
} }
} }
if refname == "" {
println("No find any reference name:", b.String())
return
}
var ref *git.Reference var ref *git.Reference
var ok bool var ok bool
var l *list.List var l *list.List
//log.Info("----", refname, "-----") //log.Info("----", refname, "-----")
if ref, ok = refs[refname]; !ok { if ref, ok = refs[refname]; !ok {
// for new branch
refs, err = rep.AllReferencesMap() refs, err = rep.AllReferencesMap()
if err != nil { if err != nil {
println(err.Error()) println("Get All References failed:", err.Error())
log.Error(err.Error())
return return
} }
if ref, ok = refs[refname]; !ok { if ref, ok = refs[refname]; !ok {
log.Trace("unknow reference name -", refname, "-", b.String()) log.Error("unknow reference name -", refname, "-", b.String())
return return
} }
l, err = ref.AllCommits() l, err = ref.AllCommits()
if err != nil { if err != nil {
println(err.Error()) println("Get All Commits failed:", err.Error())
log.Error(err.Error())
return return
} }
} else { } else {
@ -246,20 +267,23 @@ func runServ(k *cli.Context) {
//log.Info("00000", ref.Oid.String()) //log.Info("00000", ref.Oid.String())
last, err = ref.LastCommit() last, err = ref.LastCommit()
if err != nil { if err != nil {
println(err.Error()) println("Get last commit failed:", err.Error())
log.Error(err.Error())
return return
} }
ref2, err := rep.LookupReference(ref.Name) ref2, err := rep.LookupReference(ref.Name)
if err != nil { if err != nil {
println(err.Error()) println("look up reference failed:", err.Error())
log.Error(err.Error())
return return
} }
//log.Info("11111", ref2.Oid.String()) //log.Info("11111", ref2.Oid.String())
before, err := ref2.LastCommit() before, err := ref2.LastCommit()
if err != nil { if err != nil {
println(err.Error()) println("Get last commit failed:", err.Error())
log.Error(err.Error())
return return
} }
//log.Info("----", before.Id(), "-----", last.Id()) //log.Info("----", before.Id(), "-----", last.Id())
@ -280,13 +304,8 @@ func runServ(k *cli.Context) {
repo.Id, repoName, refname, &base.PushCommits{l.Len(), commits}); err != nil { repo.Id, repoName, refname, &base.PushCommits{l.Len(), commits}); err != nil {
log.Error("runUpdate.models.CommitRepoAction: %v", err, commits) log.Error("runUpdate.models.CommitRepoAction: %v", err, commits)
} else { } else {
//log.Info("refname", refname)
//log.Info("Listen: %v", cmd)
//fmt.Println("...", cmd)
//runUpdate(k)
c := exec.Command("git", "update-server-info") c := exec.Command("git", "update-server-info")
c.Dir = models.RepoPath(user.Name, repoName) c.Dir = repoPath
err := c.Run() err := c.Run()
if err != nil { if err != nil {
log.Error("update-server-info: %v", err) log.Error("update-server-info: %v", err)

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Server Configuration Server Configuration

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Statistic Statistic

View File

@ -1,4 +1,4 @@
<div id="gogs-user-setting-nav" class="col-md-3 gogs-admin-nav"> <div id="user-setting-nav" class="col-md-3 admin-nav">
<ul class="list-group" data-init="tabs"> <ul class="list-group" data-init="tabs">
<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 .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 .PageIsUsers}} active{{end}}"><a href="/admin/users"><i class="fa fa-users fa-lg"></i> Users</a></li>

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Repository Management Repository Management

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
User Management User Management

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
Edit Account Edit Account

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="admin"> <div id="body" class="container" data-page="admin">
{{template "admin/nav" .}} {{template "admin/nav" .}}
<div id="gogs-admin-container" class="col-md-9"> <div id="admin-container" class="col-md-9">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
New Account New Account

View File

@ -1,25 +1,25 @@
<div class="gogs-masthead navbar" id="masthead"> <div class="masthead navbar" id="masthead">
<div class="container"> <div class="container">
<nav class="gogs-nav"> <nav class="nav">
<a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a> <a id="nav-logo" class="nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
<a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a> <a class="nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
<a class="gogs-nav-item{{if .PageIsHelp}} active{{end}}" href="/help">Help</a>{{if .IsSigned}} <a class="nav-item{{if .PageIsHelp}} active{{end}}" href="/help">Help</a>{{if .IsSigned}}
<a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a> <a id="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="gogs-nav-avatar" class="gogs-nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}"> <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"/> <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a> </a>
<a class="navbar-right gogs-nav-item{{if .PageIsNewRepo}} active{{end}}" href="/repo/create" data-toggle="tooltip" data-placement="bottom" title="New Repository"><i class="fa fa-plus fa-lg"></i></a> <a class="navbar-right nav-item{{if .PageIsNewRepo}} active{{end}}" href="/repo/create" data-toggle="tooltip" data-placement="bottom" title="New Repository"><i class="fa fa-plus fa-lg"></i></a>
<a class="navbar-right gogs-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> <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 gogs-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}} {{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}}
{{else}}<a id="gogs-nav-signin" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/">Sign In</a> {{else}}<a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/">Sign In</a>
<a id="gogs-nav-signup" class="gogs-nav-item navbar-right" href="/user/sign_up/">Sign Up</a>{{end}} <a id="nav-signup" class="nav-item navbar-right" href="/user/sign_up/">Sign Up</a>{{end}}
</nav> </nav>
</div> </div>
</div> </div>
<!--<nav class="navbar navbar-inverse navbar-fixed-top"> <!--<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#gogs-navbar-collapse"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</button> </button>
<a class="navbar-brand" href="/"><img src="/img/favicon.png" alt="Gogs Logo"></a> <a class="navbar-brand" href="/"><img src="/img/favicon.png" alt="Gogs Logo"></a>

View File

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

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
Welcome to the land of Gogs! There will be some indroduction! Welcome to the land of Gogs! There will be some indroduction!
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

70
templates/install.tmpl Normal file
View File

@ -0,0 +1,70 @@
{{template "base/head" .}}
<div id="body" class="container">
<form action="/install" method="post" class="form-horizontal card" id="install-card">
{{.CsrfTokenHtml}}
<h3>Install Steps</h3>
<div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
<p class="help-block text-center">GoGits need MySQL or PostgreSQL server</p>
<div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label"><strong>MySQL </strong>Host: </label>
<div class="col-md-8">
<input name="host" class="form-control" placeholder="Type mysql server ip or domain" value="localhost" required="required">
</div>
</div>
<div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label">Port: </label>
<div class="col-md-8">
<input name="port" class="form-control" placeholder="Type mysql server port" value="3306" required="required">
</div>
</div>
<div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label">User: </label>
<div class="col-md-8">
<input name="user" class="form-control" placeholder="Type mysql username" required="required">
</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-8">
<input name="passwd" type="password" class="form-control" placeholder="Type mysql password" required="required">
</div>
</div>
<div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label">Database: </label>
<div class="col-md-8">
<input name="database" type="text" class="form-control" placeholder="Type mysql database name" value="gogs" required="required">
<p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-3">
<button class="btn btn-sm btn-info">Test Connection</button>
</div>
</div>
<hr/>
<p class="help-block text-center">General settings for GoGits</p>
<div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
<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="/var/gogs/repostiory" required="required">
<p class="help-block">The git copy of each repository is saved in this directory.</p>
</div>
</div>
<div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
<label class="col-md-3 control-label">System User: </label>
<div class="col-md-8">
<input name="system-user" type="text" class="form-control" placeholder="Type mysql password" value="root" required="required">
<p class="help-block">The user has access to visit and run GoGits.</p>
</div>
</div>
<hr/>
<div class="form-group text-center">
<a class="btn btn-danger btn-lg">Install GoGits</a>
</div>
</form>
</div>
{{template "base/footer" .}}

View File

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

View File

@ -2,8 +2,8 @@
{{template "base/navbar" .}} {{template "base/navbar" .}}
{{template "repo/nav" .}} {{template "repo/nav" .}}
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<div id="gogs-source"> <div id="source">
<div class="panel panel-default branch-box info-box"> <div class="panel panel-default branch-box info-box">
<div class="panel-heading info-head"> <div class="panel-heading info-head">
<h4>Branches</h4> <h4>Branches</h4>

View File

@ -2,8 +2,8 @@
{{template "base/navbar" .}} {{template "base/navbar" .}}
{{template "repo/nav" .}} {{template "repo/nav" .}}
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<div id="gogs-commits"> <div id="commits">
<div class="panel panel-default commit-box info-box"> <div class="panel panel-default commit-box info-box">
<div class="panel-heading info-head"> <div class="panel-heading info-head">
<div class="search pull-right form"> <div class="search pull-right form">

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div class="container" id="gogs-body"> <div class="container" id="body">
<form action="/repo/create" method="post" class="form-horizontal gogs-card" id="gogs-repo-create"> <form action="/repo/create" method="post" class="form-horizontal card" id="repo-create">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<h3>Create New Repository</h3> <h3>Create New Repository</h3>
<div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>

View File

@ -2,8 +2,8 @@
{{template "base/navbar" .}} {{template "base/navbar" .}}
{{template "repo/nav" .}} {{template "repo/nav" .}}
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="gogs-body" class="container" data-page="repo"> <div id="body" class="container" data-page="repo">
<div id="gogs-source"> <div id="source">
<div class="panel panel-info diff-box diff-head-box"> <div class="panel panel-info diff-box diff-head-box">
<div class="panel-heading"> <div class="panel-heading">
<a class="pull-right btn btn-primary btn-sm" href="#commit-source">Browse Source</a> <a class="pull-right btn btn-primary btn-sm" href="#commit-source">Browse Source</a>

View File

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

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div class="container" id="gogs-body"> <div class="container" id="body">
<ul> <ul>
{{range .Repos}} {{range .Repos}}
<li>{{.Name}} stars: {{.NumStars}} forks: {{.NumForks}} watches:{{.NumWatchs}}</li> <li>{{.Name}} stars: {{.NumStars}} forks: {{.NumForks}} watches:{{.NumWatchs}}</li>

View File

@ -1,4 +1,4 @@
<div id="gogs-body-nav" class="gogs-repo-nav"> <div id="body-nav" class="repo-nav">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-7">
@ -7,13 +7,13 @@
</div> </div>
<div class="col-md-5 actions text-right clone-group-btn"> <div class="col-md-5 actions text-right clone-group-btn">
{{if not .IsBareRepo}} {{if not .IsBareRepo}}
<!--<div class="btn-group" id="gogs-repo-clone"> <!--<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"><i class="fa fa-download fa-lg fa-m"></i></button>
<button type="button" class="btn btn-default dropdown-toggle" data-container="body" data-toggle="popover" data-placement="bottom" data-content="<label>SSH:</label><div class='input-group'><input type='text' class='form-control' value='{{.CloneLink.SSH}}'></div>" data-html="1"> <button type="button" class="btn btn-default dropdown-toggle" data-container="body" data-toggle="popover" data-placement="bottom" data-content="<label>SSH:</label><div class='input-group'><input type='text' class='form-control' value='{{.CloneLink.SSH}}'></div>" data-html="1">
<span class="caret"></span> <span class="caret"></span>
</button> </button>
</div>--> </div>-->
<div class="btn-group" id="gogs-repo-clone"> <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"><i class="fa fa-download fa-lg fa-m"></i></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> <span class="caret"></span>
@ -36,7 +36,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="gogs-repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch"> <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}} {{if .IsRepositoryWatching}}
<button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button> <button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button>
{{else}} {{else}}

View File

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

View File

@ -2,8 +2,8 @@
{{template "base/navbar" .}} {{template "base/navbar" .}}
{{template "repo/nav" .}} {{template "repo/nav" .}}
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<div id="gogs-user-setting-nav" class="col-md-3"> <div id="user-setting-nav" class="col-md-3">
<ul class="list-group" data-init="tabs"> <ul class="list-group" data-init="tabs">
<li class="list-group-item active"><a href="/{{.Owner.Name}}/{{.Repository.Name}}/settings">Options</a></li> <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="#">Collaborators</a></li>
@ -11,7 +11,7 @@
</ul> </ul>
</div> </div>
<div id="gogs-repo-setting-container" class="col-md-9"> <div id="repo-setting-container" class="col-md-9">
{{if .IsSuccess}}<p class="alert alert-success">Repository option has been successfully updated.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} {{if .IsSuccess}}<p class="alert alert-success">Repository option 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 panel-default">
<div class="panel-heading"> <div class="panel-heading">

View File

@ -2,8 +2,8 @@
{{template "base/navbar" .}} {{template "base/navbar" .}}
{{template "repo/nav" .}} {{template "repo/nav" .}}
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<div id="gogs-source"> <div id="source">
{{if .IsBareRepo}} {{if .IsBareRepo}}
{{template "repo/single_bare" .}} {{template "repo/single_bare" .}}
{{else}} {{else}}

View File

@ -1,4 +1,4 @@
<div id="gogs-repo-toolbar"> <div id="repo-toolbar">
<div class="container"> <div class="container">
<nav class="navbar navbar-toolbar navbar-default" role="navigation"> <nav class="navbar navbar-toolbar navbar-default" role="navigation">
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<p>An error is occurred : {{.ErrorMsg}}</p> <p>An error is occurred : {{.ErrorMsg}}</p>
<p>Application Version: {{AppVer}}</p> <p>Application Version: {{AppVer}}</p>
</div> </div>

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container text-center"> <div id="body" class="container text-center">
<p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p> <p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p>
<hr/> <hr/>
<p>Application Version: {{AppVer}}</p> <p>Application Version: {{AppVer}}</p>

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container text-center"> <div id="body" class="container text-center">
<p style="margin-top: 80px"><img src="/img/500.png" alt="404"/></p> <p style="margin-top: 80px"><img src="/img/500.png" alt="404"/></p>
<hr/> <hr/>
<p>An error is occurred : {{.ErrorMsg}}</p> <p>An error is occurred : {{.ErrorMsg}}</p>

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container"> <div id="body" class="container">
<form action="/user/activate" method="post" class="form-horizontal gogs-card" id="gogs-login-card"> <form action="/user/activate" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<h3>Activate Your Account</h3> <h3>Activate Your Account</h3>
{{if .IsActivatePage}} {{if .IsActivatePage}}

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body-nav"> <div id="body-nav">
<div class="container"> <div class="container">
<ul class="nav nav-pills pull-right"> <ul class="nav nav-pills pull-right">
<li class="active"><a href="/">Feed</a></li> <li class="active"><a href="/">Feed</a></li>
@ -11,9 +11,9 @@
<h3>News Feed</h3> <h3>News Feed</h3>
</div> </div>
</div> </div>
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
<div id="gogs-feed-left" class="col-md-8"> <div id="feed-left" class="col-md-8">
<ul class="list-unstyled activity-list"> <ul class="list-unstyled activity-list">
{{range .Feeds}} {{range .Feeds}}
<li> <li>
@ -26,7 +26,7 @@
{{end}} {{end}}
</ul> </ul>
</div> </div>
<div id="gogs-feed-right" class="col-md-4"> <div id="feed-right" class="col-md-4">
<div class="panel panel-default repo-panel"> <div class="panel panel-default repo-panel">
<div class="panel-heading">Your Repositories <div class="panel-heading">Your Repositories
<a class="btn btn-success pull-right btn-sm" href="/repo/create"><i class="fa fa-plus-square"></i>New Repo</a> <a class="btn btn-success pull-right btn-sm" href="/repo/create"><i class="fa fa-plus-square"></i>New Repo</a>

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
<div id="gogs-user-setting-nav" class="col-md-3"> <div id="user-setting-nav" class="col-md-3">
<h4>Account Setting</h4> <h4>Account Setting</h4>
<ul class="list-group"> <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">Account Profile</a></li>
@ -12,16 +12,16 @@
<li class="list-group-item list-group-item-success"><a href="/user/delete">Delete Account</a></li> <li class="list-group-item list-group-item-success"><a href="/user/delete">Delete Account</a></li>
</ul> </ul>
</div> </div>
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<h4>Delete Account</h4> <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> <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"> <div class="form-group">
<button type="submit" class="btn btn-danger btn-lg" href="#delete-account-modal" id="gogs-delete-account" data-toggle="modal">Delete Account</button> <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> </div>
<div class="modal fade" id="delete-account-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="delete-account-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<form action="/user/delete" method="post" class="modal-content" id="gogs-user-delete"> <form action="/user/delete" method="post" class="modal-content" id="user-delete">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body-nav"> <div id="body-nav">
<div class="container"> <div class="container">
<ul class="nav nav-pills pull-right"> <ul class="nav nav-pills pull-right">
<li><a href="/">Feed</a></li> <li><a href="/">Feed</a></li>
@ -11,7 +11,7 @@
<h3>Issues</h3> <h3>Issues</h3>
</div> </div>
</div> </div>
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{template "user/setting_nav" .}} {{template "user/setting_nav" .}}
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<h4>Notification</h4> <h4>Notification</h4>
</div> </div>
</div> </div>

View File

@ -1,11 +1,11 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{template "user/setting_nav" .}} {{template "user/setting_nav" .}}
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<div id="gogs-setting-pwd"> <div id="setting-pwd">
<h4>Password</h4> <h4>Password</h4>
<form class="form-horizontal" id="gogs-password-form" method="post" action="/user/setting/password"> <form class="form-horizontal" id="password-form" method="post" action="/user/setting/password">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
{{if .IsSuccess}} {{if .IsSuccess}}
<p class="alert alert-success">Password is changed successfully. You can now sign in via new password.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}} <p class="alert alert-success">Password is changed successfully. You can now sign in via new password.</p>{{else if .HasError}}<p class="alert alert-danger form-error">{{.ErrorMsg}}</p>{{end}}

View File

@ -1,12 +1,12 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
<div id="gogs-user-profile" class="col-md-3"> <div id="user-profile" class="col-md-3">
<div class="profile-avatar text-center"> <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"> <a href="http://gravatar.com/emails/" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change your avatar at gravatar.com">
<img id="gogs-user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="{{.Owner.Name}}"/> <img id="user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="{{.Owner.Name}}"/>
</a> </a>
<span id="gogs-user-name" class="center-block">{{.Owner.Name}}</span> <span id="user-name" class="center-block">{{.Owner.Name}}</span>
</div> </div>
<div class="profile-info"> <div class="profile-info">
<ul class="list-group"> <ul class="list-group">
@ -23,8 +23,8 @@
</ul> </ul>
</div> </div>
</div> </div>
<div id="gogs-user-activity" class="col-md-9"> <div id="user-activity" class="col-md-9">
<ul class="nav nav-tabs" id="gogs-user-act-tabs" data-init="tabs"> <ul class="nav nav-tabs" id="user-act-tabs" data-init="tabs">
<li{{if not .TabName}} class="active"{{end}}><a href="{{.Owner.HomeLink}}"><i class="fa fa-gittip"></i>Repositories</a></li> <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> <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> </ul>

View File

@ -1,12 +1,12 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{template "user/setting_nav" .}} {{template "user/setting_nav" .}}
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<div id="gogs-ssh-keys"> <div id="ssh-keys">
<h4>SSH Keys</h4>{{if .AddSSHKeySuccess}} <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}} <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="gogs-ssh-keys-list" class="list-group"> <ul id="ssh-keys-list" class="list-group">
<li class="list-group-item"><span class="name">SSH Key's name</span></li> <li class="list-group-item"><span class="name">SSH Key's name</span></li>
{{range .Keys}} {{range .Keys}}
<li class="list-group-item"> <li class="list-group-item">
@ -16,12 +16,12 @@
</li> </li>
{{end}} {{end}}
<li class="list-group-item"> <li class="list-group-item">
<a class="btn btn-link btn-primary" href="#ssh-add-modal" id="gogs-ssh-add" data-toggle="modal">Add SSH Key</a> <a class="btn btn-link btn-primary" href="#ssh-add-modal" id="ssh-add" data-toggle="modal">Add SSH Key</a>
</li> </li>
</ul> </ul>
<div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<form class="modal-content form-horizontal" id="gogs-ssh-form" method="post" action="/user/setting/ssh/"> <form class="modal-content form-horizontal" id="ssh-form" method="post" action="/user/setting/ssh/">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

View File

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

View File

@ -1,8 +1,8 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{template "user/setting_nav" .}} {{template "user/setting_nav" .}}
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<h4>Security</h4> <h4>Security</h4>
</div> </div>
</div> </div>

View File

@ -1,11 +1,11 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{template "user/setting_nav" .}} {{template "user/setting_nav" .}}
<div id="gogs-user-setting-container" class="col-md-9"> <div id="user-setting-container" class="col-md-9">
<div id="gogs-setting-pwd"> <div id="setting-pwd">
<h4>Account Profile</h4> <h4>Account Profile</h4>
<form class="form-horizontal" id="gogs-password-form" method="post" action="/user/setting"> <form class="form-horizontal" id="password-form" method="post" action="/user/setting">
{{.CsrfTokenHtml}} {{.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}} {{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> <p>Your Email will be public and used for Account related notifications and any web based operations made via the web.</p>

View File

@ -1,4 +1,4 @@
<div id="gogs-user-setting-nav" class="col-md-3"> <div id="user-setting-nav" class="col-md-3">
<h4>Account Setting</h4> <h4>Account Setting</h4>
<ul class="list-group"> <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 .IsUserPageSetting}} list-group-item-success{{end}}"><a href="/user/setting">Account Profile</a></li>

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div class="container" id="gogs-body" data-page="user-signin"> <div class="container" id="body" data-page="user-signin">
<form action="/user/login" method="post" class="form-horizontal gogs-card" id="gogs-login-card"> <form action="/user/login" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<h3>Log in</h3> <h3>Log in</h3>
<div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div> <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
@ -43,7 +43,7 @@
</div> </div>
</div> </div>
<div class="form-group text-center" id="gogs-social-login"> <div class="form-group text-center" id="social-login">
<a class="btn btn-danger btn-lg">Register new account</a> <a class="btn btn-danger btn-lg">Register new account</a>
</div> </div>
</form> </form>

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div class="container" id="gogs-body" data-page="user-signup"> <div class="container" id="body" data-page="user-signup">
<form action="/user/sign_up" method="post" class="form-horizontal gogs-card" id="gogs-login-card"> <form action="/user/sign_up" method="post" class="form-horizontal card" id="login-card">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
{{if .DisenableRegisteration}} {{if .DisenableRegisteration}}
Sorry, registeration has been disenabled, you can only get account from administrator. Sorry, registeration has been disenabled, you can only get account from administrator.

View File

@ -1,6 +1,6 @@
{{template "base/head" .}} {{template "base/head" .}}
{{template "base/navbar" .}} {{template "base/navbar" .}}
<div id="gogs-body-nav"> <div id="body-nav">
<div class="container"> <div class="container">
<ul class="nav nav-pills pull-right"> <ul class="nav nav-pills pull-right">
<li><a href="/">Feed</a></li> <li><a href="/">Feed</a></li>
@ -11,7 +11,7 @@
<h3>Stars</h3> <h3>Stars</h3>
</div> </div>
</div> </div>
<div id="gogs-body" class="container" data-page="user"> <div id="body" class="container" data-page="user">
{{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}} {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}

1
web.go
View File

@ -90,6 +90,7 @@ func runWeb(*cli.Context) {
// Routers. // Routers.
m.Get("/", ignSignIn, routers.Home) m.Get("/", ignSignIn, routers.Home)
m.Get("/install",routers.Install)
m.Get("/issues", reqSignIn, user.Issues) m.Get("/issues", reqSignIn, user.Issues)
m.Get("/pulls", reqSignIn, user.Pulls) m.Get("/pulls", reqSignIn, user.Pulls)
m.Get("/stars", reqSignIn, user.Stars) m.Get("/stars", reqSignIn, user.Stars)