@@ -1,3 +1,4 @@ | |||||
Copyright (c) 2020 The OpenI&Trustie Authors | |||||
Copyright (c) 2016 The Gitea Authors | Copyright (c) 2016 The Gitea Authors | ||||
Copyright (c) 2015 The Gogs Authors | Copyright (c) 2015 The Gogs Authors | ||||
@@ -293,6 +293,16 @@ func MakeEmailPrimary(email *EmailAddress) error { | |||||
} | } | ||||
user.Email = email.Email | user.Email = email.Email | ||||
has, err = sess.Where("id!=?", user.ID). | |||||
And("type=?", user.Type). | |||||
And("email=?", strings.ToLower(user.Email)). | |||||
Get(new(User)) | |||||
if err != nil { | |||||
return err | |||||
} else if has { | |||||
return ErrEmailAlreadyUsed{user.Email} | |||||
} | |||||
if _, err = sess.ID(user.ID).Cols("email").Update(user); err != nil { | if _, err = sess.ID(user.ID).Cols("email").Update(user); err != nil { | ||||
return err | return err | ||||
} | } | ||||
@@ -1 +0,0 @@ | |||||
<svg clip-rule="evenodd" fill-rule="evenodd" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m83.046 35.842c10.395-.091 22.52-.636 42.972-1.719 12.367.282-4.316 74.37-26.594 76.038h-37.152c-8.48-.911-19.934-18.203-21.002-23.216-9.735-.215-34.086-2.695-35.192-29.423-.707-17.106 12.085-23.932 21.632-23.904 3.736.01 7.213.478 9.708.505 19.935 1.104 30.433 1.729 42.366 1.733l.021 21.503 3.241 1.61zm18.936 34.047-31.267-15.193-15.192 31.267 31.267 15.192zm-71.781-26.813c-12.443-.333-15.784 7.423-14.833 14.834 1.782 13.885 11.469 17.605 22.851 19.11-4.462-12.24-6.666-20.251-8.018-33.944z" transform="matrix(.128847 0 0 .128847 -.779534 -1.26275)"/><g transform="matrix(.128847 0 0 .128847 -.779534 -1.26275)"><g transform="matrix(.940904 -.338674 .338674 .940904 0 0)"><circle cx="49.065" cy="90.078" r="3.475"/><circle cx="36.81" cy="102.105" r="3.475"/><circle cx="46.484" cy="111.439" r="3.475"/></g><path d="m97.333 18.062h2.673v27.261h-2.673z" transform="matrix(.898609 .43875 -.447723 .916987 .406685 -.832937)"/><path d="m76.558 68.116c12.976 6.396 13.013 4.102 4.891 20.908" fill="none" stroke="#000" stroke-width="2.68"/></g></svg> |
@@ -0,0 +1,17 @@ | |||||
<svg clip-rule="evenodd" fill-rule="evenodd" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"> | |||||
<path class="st0" d="M54.7,15.9L34.8,4.5c-1.7-1-3.9-1-5.6,0L9.3,15.9c-1.8,1-2.8,2.9-2.8,4.9v22.8c0,2,1.1,3.9,2.8,4.9l4.9,2.8 | |||||
c-0.1,0.2-0.1,0.5-0.1,0.7c0,2.1,1.6,3.8,3.7,3.8s3.8-1.6,3.8-3.7c0-2.1-1.6-3.8-3.7-3.8c-0.9,0-1.8,0.3-2.5,0.9l-4.9-2.8 | |||||
c-1-0.6-1.6-1.7-1.6-2.9V20.9c0-1.2,0.6-2.3,1.6-2.9L30.3,6.5c1-0.6,2.3-0.6,3.3,0l19.8,11.4c1,0.6,1.7,1.7,1.6,2.9v22.8 | |||||
c0,1.2-0.6,2.3-1.6,2.9L33.7,58c-0.2,0.1-0.4,0.2-0.6,0.3v-7.1c0-0.1,0-0.2,0-0.4v-4.1h0.1l11.4-7.6c0.3-0.2,0.5-0.6,0.5-1V25.9 | |||||
c2-0.6,3.1-2.8,2.5-4.8c-0.6-2-2.8-3.1-4.8-2.5c-2,0.6-3.1,2.8-2.5,4.8c0.4,1.2,1.3,2.1,2.5,2.5v11.4L33,43.9V20.8 | |||||
c2-0.6,3.1-2.8,2.5-4.8c-0.6-2-2.8-3.1-4.8-2.5c-2,0.6-3.1,2.8-2.5,4.8c0.4,1.2,1.3,2.1,2.5,2.5V36l-6.4-3.7v-6.1 | |||||
c2-0.6,3.1-2.8,2.5-4.8c-0.6-2-2.8-3.1-4.8-2.5s-3.1,2.8-2.5,4.8c0.4,1.2,1.3,2.1,2.5,2.5v6.7c0,0.4,0.2,0.8,0.6,1l8.2,4.8V49 | |||||
l-14.1-8.2v-10c2-0.6,3-2.7,2.4-4.7s-2.7-3-4.7-2.4c-2,0.6-3,2.7-2.4,4.7c0.4,1.1,1.3,2,2.4,2.4v10.7c0,0.4,0.2,0.8,0.6,1l15.8,9.1 | |||||
v8c0,0,0,0.1,0,0.1v0.1V60c0,0,0,0,0,0.1l0.1,0.1l0,0l0.1,0.1l0,0c0,0,0.1,0.1,0.1,0.1l0,0l0.2,0.1l0,0h0.2l0,0c0.1,0,0.1,0,0.2,0 | |||||
h0.2c1,0,2-0.3,2.8-0.7l19.8-11.4c1.8-0.9,2.9-2.7,3.1-4.7V20.9C57.5,18.9,56.4,17,54.7,15.9 M17.9,50.8c0.8,0,1.4,0.6,1.4,1.4 | |||||
s-0.6,1.4-1.4,1.4s-1.4-0.6-1.4-1.4l0,0C16.5,51.4,17.1,50.8,17.9,50.8 M44,21c0.8,0,1.4,0.6,1.4,1.4c0,0.8-0.6,1.4-1.4,1.4 | |||||
c-0.8,0-1.4-0.6-1.4-1.4l0,0C42.6,21.7,43.2,21,44,21 M23.1,21.3c0.8,0,1.4,0.6,1.4,1.4s-0.6,1.4-1.4,1.4c-0.8,0-1.4-0.6-1.4-1.4 | |||||
S22.4,21.3,23.1,21.3L23.1,21.3 M15.5,25.9c0.8,0,1.4,0.6,1.4,1.4s-0.6,1.4-1.4,1.4c-0.8,0-1.4-0.6-1.4-1.4S14.7,25.9,15.5,25.9 | |||||
L15.5,25.9 M31.9,15.8c0.8,0,1.4,0.6,1.4,1.4s-0.6,1.4-1.4,1.4c-0.8,0-1.4-0.6-1.4-1.4C30.4,16.4,31.1,15.8,31.9,15.8 | |||||
C31.9,15.8,31.9,15.8,31.9,15.8"/> | |||||
</svg> |
@@ -590,6 +590,9 @@ func Home(ctx *context.Context) { | |||||
if err == nil && contributors != nil { | if err == nil && contributors != nil { | ||||
var contributorInfos []*ContributorInfo | var contributorInfos []*ContributorInfo | ||||
for _, c := range contributors { | for _, c := range contributors { | ||||
if strings.Compare(c.Email,"") == 0 { | |||||
continue | |||||
} | |||||
// get user info from committer email | // get user info from committer email | ||||
user, err := models.GetUserByEmail(c.Email) | user, err := models.GetUserByEmail(c.Email) | ||||
if err == nil { | if err == nil { | ||||
@@ -80,6 +80,12 @@ func EmailPost(ctx *context.Context, form auth.AddEmailForm) { | |||||
// Make emailaddress primary. | // Make emailaddress primary. | ||||
if ctx.Query("_method") == "PRIMARY" { | if ctx.Query("_method") == "PRIMARY" { | ||||
if err := models.MakeEmailPrimary(&models.EmailAddress{ID: ctx.QueryInt64("id")}); err != nil { | if err := models.MakeEmailPrimary(&models.EmailAddress{ID: ctx.QueryInt64("id")}); err != nil { | ||||
if _, ok := err.(models.ErrEmailAlreadyUsed); ok { | |||||
ctx.Flash.Error(ctx.Tr("form.email_been_used")) | |||||
ctx.Redirect(setting.AppSubURL + "/user/settings/account") | |||||
return | |||||
} | |||||
ctx.ServerError("MakeEmailPrimary", err) | ctx.ServerError("MakeEmailPrimary", err) | ||||
return | return | ||||
} | } | ||||
@@ -111,7 +111,7 @@ | |||||
}; | }; | ||||
</script> | </script> | ||||
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png"> | <link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png"> | ||||
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926"> | |||||
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926"> | |||||
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}"> | <link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}"> | ||||
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css"> | <link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css"> | ||||
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous"> | <link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous"> | ||||
@@ -181,7 +181,7 @@ var _hmt = _hmt || []; | |||||
(function() { | (function() { | ||||
var hm = document.createElement("script"); | var hm = document.createElement("script"); | ||||
hm.src = "https://hm.baidu.com/hm.js?7c4ef0a24be6109ab22e63c832ab21cf"; | hm.src = "https://hm.baidu.com/hm.js?7c4ef0a24be6109ab22e63c832ab21cf"; | ||||
var s = document.getElementsByTagName("script")[0]; | |||||
var s = document.getElementsByTagName("script")[0]; | |||||
s.parentNode.insertBefore(hm, s); | s.parentNode.insertBefore(hm, s); | ||||
})(); | })(); | ||||
</script> | </script> | ||||
@@ -111,7 +111,7 @@ | |||||
}; | }; | ||||
</script> | </script> | ||||
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png"> | <link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png"> | ||||
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926"> | |||||
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926"> | |||||
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}"> | <link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}"> | ||||
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css"> | <link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css"> | ||||
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous"> | <link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous"> | ||||
@@ -182,7 +182,7 @@ var _hmt = _hmt || []; | |||||
(function() { | (function() { | ||||
var hm = document.createElement("script"); | var hm = document.createElement("script"); | ||||
hm.src = "https://hm.baidu.com/hm.js?7c4ef0a24be6109ab22e63c832ab21cf"; | hm.src = "https://hm.baidu.com/hm.js?7c4ef0a24be6109ab22e63c832ab21cf"; | ||||
var s = document.getElementsByTagName("script")[0]; | |||||
var s = document.getElementsByTagName("script")[0]; | |||||
s.parentNode.insertBefore(hm, s); | s.parentNode.insertBefore(hm, s); | ||||
})(); | })(); | ||||
</script> | </script> | ||||
@@ -197,7 +197,7 @@ var _hmt = _hmt || []; | |||||
{{if not .PageIsInstall}} | {{if not .PageIsInstall}} | ||||
<div class="ui container"> | <div class="ui container"> | ||||
<div class="ui top secondary stackable main menu following bar"> | |||||
<div class="ui top secondary stackable main menu following bar"> | |||||
{{template "base/head_navbar_home" .}} | {{template "base/head_navbar_home" .}} | ||||
</div><!-- end bar --> | </div><!-- end bar --> | ||||
</div> | </div> | ||||
@@ -1,6 +1,6 @@ | |||||
{ | { | ||||
"short_name": "Gitea", | |||||
"name": "Gitea - Git with a cup of tea", | |||||
"short_name": "OpenI", | |||||
"name": "OpenI - 启智AI开发协作平台", | |||||
"icons": [ | "icons": [ | ||||
{ | { | ||||
"src": "{{StaticUrlPrefix}}/img/gitea-lg.png", | "src": "{{StaticUrlPrefix}}/img/gitea-lg.png", | ||||
@@ -165,7 +165,7 @@ | |||||
<div class="inline required field"> | <div class="inline required field"> | ||||
<label>镜像</label> | <label>镜像</label> | ||||
<input type="text" list="cloudbrain_image" placeholder="选择镜像" name="image" required autofocus maxlength="36"> | |||||
<input type="text" list="cloudbrain_image" placeholder="选择镜像" name="image" required autofocus maxlength="255"> | |||||
<datalist class="ui search" id="cloudbrain_image" style='width:385px;' name="image"> | <datalist class="ui search" id="cloudbrain_image" style='width:385px;' name="image"> | ||||
{{range .images}} | {{range .images}} | ||||
<option name="image" value="{{.Place}}">{{.PlaceView}}</option> | <option name="image" value="{{.Place}}">{{.PlaceView}}</option> | ||||
@@ -62,14 +62,14 @@ | |||||
<a class="text-over" style="display:block;" @click="copyUrl(scope.row.place)">{{ scope.row.place }}</a> | <a class="text-over" style="display:block;" @click="copyUrl(scope.row.place)">{{ scope.row.place }}</a> | ||||
</el-tooltip> | </el-tooltip> | ||||
<span class="text-over" :title="scope.row.description">{{ scope.row.description | clearP}}</span> | |||||
<span class="text-over" :title="scope.row.description | clearP">{{ scope.row.description | clearP}}</span> | |||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
prop="provider" | prop="provider" | ||||
label="提供者" | label="提供者" | ||||
width="120" | width="120" | ||||
align="center" | |||||
align="left" | |||||
sortable> | sortable> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
@@ -102,7 +102,7 @@ | |||||
<div class="ui sixteen wide column"> | <div class="ui sixteen wide column"> | ||||
<div class="ui two column stackable grid"> | <div class="ui two column stackable grid"> | ||||
<div class="column"> | <div class="column"> | ||||
<el-input placeholder="请输入内容" v-model="search" class="input-with-select" @keyup.enter.native="searchName()"> | |||||
<el-input placeholder="请输入镜像名称关健词" v-model="search" class="input-with-select" @keyup.enter.native="searchName()"> | |||||
<el-button slot="append" id="success" icon="el-icon-search" @click="searchName()">搜索</el-button> | <el-button slot="append" id="success" icon="el-icon-search" @click="searchName()">搜索</el-button> | ||||
</el-input> | </el-input> | ||||
</div> | </div> | ||||
@@ -154,14 +154,14 @@ | |||||
<a class="text-over" style="display:block;" @click="copyUrl(scope.row.place)">{{ scope.row.place }}</a> | <a class="text-over" style="display:block;" @click="copyUrl(scope.row.place)">{{ scope.row.place }}</a> | ||||
</el-tooltip> | </el-tooltip> | ||||
<span class="text-over" :title="scope.row.description">{{ scope.row.description | clearP }}</span> | |||||
<span class="text-over" :title="scope.row.description | clearP">{{ scope.row.description | clearP }}</span> | |||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
prop="provider" | prop="provider" | ||||
label="提供者" | label="提供者" | ||||
width="120" | width="120" | ||||
align="center" | |||||
align="left" | |||||
sortable> | sortable> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
@@ -195,7 +195,7 @@ | |||||
<div class="ui sixteen wide column"> | <div class="ui sixteen wide column"> | ||||
<div class="ui two column stackable grid"> | <div class="ui two column stackable grid"> | ||||
<div class="column"> | <div class="column"> | ||||
<el-input placeholder="请输入内容" v-model="search" class="input-with-select"> | |||||
<el-input placeholder="请输入镜像名称关健词" v-model="search" class="input-with-select"> | |||||
<el-button slot="append" id="success" icon="el-icon-search">搜索</el-button> | <el-button slot="append" id="success" icon="el-icon-search">搜索</el-button> | ||||
</el-input> | </el-input> | ||||
</div> | </div> | ||||
@@ -225,7 +225,7 @@ | |||||
<div class="ui sixteen wide column"> | <div class="ui sixteen wide column"> | ||||
<div class="ui two column stackable grid"> | <div class="ui two column stackable grid"> | ||||
<div class="column"> | <div class="column"> | ||||
<el-input placeholder="请输入内容" v-model="search" class="input-with-select"> | |||||
<el-input placeholder="请输入镜像名称关健词" v-model="search" class="input-with-select"> | |||||
<el-button slot="append" id="success" icon="el-icon-search">搜索</el-button> | <el-button slot="append" id="success" icon="el-icon-search">搜索</el-button> | ||||
</el-input> | </el-input> | ||||
</div> | </div> | ||||
@@ -362,10 +362,12 @@ export default { | |||||
searchName(){ | searchName(){ | ||||
if(this.activeName=='first'){ | if(this.activeName=='first'){ | ||||
this.params.name = this.search | this.params.name = this.search | ||||
this.params.page = 1 | |||||
this.getImageList() | this.getImageList() | ||||
} | } | ||||
if(this.activeName=='second'){ | if(this.activeName=='second'){ | ||||
this.params1.name = this.search | this.params1.name = this.search | ||||
this.params1.page = 1 | |||||
this.getImageList1() | this.getImageList1() | ||||
} | } | ||||