| @@ -406,6 +406,8 @@ sspi_auth_failed = SSPI authentication failed | |||
| change_email = Change email | |||
| change_email_address = Change email address | |||
| new_email_address = New email address | |||
| openi_community_really_awesome = OpenI, Really Awesome! | |||
| [phone] | |||
| format_err=The format of phone number is wrong. | |||
| query_err=Fail to query phone number, please try again later. | |||
| @@ -409,6 +409,8 @@ sspi_auth_failed=SSPI 认证失败 | |||
| change_email=修改邮箱 | |||
| change_email_address=修改邮箱地址 | |||
| new_email_address=新邮箱地址 | |||
| openi_community_really_awesome=启智社区 确实给力 | |||
| [phone] | |||
| format_err=手机号格式错误。 | |||
| query_err=查询手机号失败,请稍后再试。 | |||
| @@ -36,6 +36,7 @@ import ( | |||
| "code.gitea.io/gitea/modules/util" | |||
| "code.gitea.io/gitea/services/externalaccount" | |||
| "code.gitea.io/gitea/services/mailer" | |||
| "code.gitea.io/gitea/services/repository" | |||
| "gitea.com/macaron/captcha" | |||
| "github.com/markbates/goth" | |||
| @@ -145,6 +146,11 @@ func checkAutoLogin(ctx *context.Context) bool { | |||
| return false | |||
| } | |||
| func getActivityTpl() string { | |||
| result, _ := repository.RecommendContentFromPromote(setting.RecommentRepoAddr + "/signin/activity_tpl") | |||
| return result | |||
| } | |||
| // SignIn render sign in page | |||
| func SignIn(ctx *context.Context) { | |||
| ctx.Data["Title"] = ctx.Tr("sign_in") | |||
| @@ -168,6 +174,7 @@ func SignIn(ctx *context.Context) { | |||
| ctx.Data["PageIsLogin"] = true | |||
| ctx.Data["EnableSSPI"] = models.IsSSPIEnabled() | |||
| ctx.Data["EnableCloudBrain"] = true | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| ctx.HTML(200, tplSignIn) | |||
| } | |||
| @@ -185,6 +192,7 @@ func SignInCloudBrain(ctx *context.Context) { | |||
| ctx.Data["PageIsSignIn"] = true | |||
| ctx.Data["PageIsCloudBrainLogin"] = true | |||
| ctx.Data["EnableCloudBrain"] = true | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| ctx.HTML(200, tplSignInCloudBrain) | |||
| } | |||
| @@ -197,6 +205,7 @@ func SignInPhone(ctx *context.Context) { | |||
| } | |||
| ctx.Data["PageIsPhoneLogin"] = true | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| ctx.HTML(200, tplSignInPhone) | |||
| } | |||
| @@ -206,6 +215,7 @@ func SignInPhonePost(ctx *context.Context, form auth.PhoneNumberCodeForm) { | |||
| ctx.Data["PageIsPhoneLogin"] = true | |||
| ctx.Data["IsCourse"] = ctx.QueryBool("course") | |||
| ctx.Data["EnableCloudBrain"] = true | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| if ctx.HasError() { | |||
| ctx.HTML(200, tplSignInPhone) | |||
| @@ -356,6 +366,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) { | |||
| func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) { | |||
| ctx.Data["PageIsCloudBrainLogin"] = true | |||
| ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login/cloud_brain" | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| SignInPostCommon(ctx, form) | |||
| } | |||
| @@ -363,6 +374,7 @@ func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) { | |||
| func SignInPost(ctx *context.Context, form auth.SignInForm) { | |||
| ctx.Data["PageIsLogin"] = true | |||
| ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login" | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| SignInPostCommon(ctx, form) | |||
| } | |||
| @@ -1257,6 +1269,7 @@ func SignUp(ctx *context.Context) { | |||
| //Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true | |||
| ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| ctx.HTML(200, tplSignUp) | |||
| } | |||
| @@ -1272,6 +1285,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo | |||
| ctx.Data["CaptchaType"] = setting.Service.CaptchaType | |||
| ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey | |||
| ctx.Data["PageIsSignUp"] = true | |||
| ctx.Data["ActivityTpl"] = getActivityTpl() | |||
| //Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true | |||
| if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration { | |||
| @@ -417,7 +417,7 @@ func cloudBrainFileNoteBookCreate(ctx *context.Context, option api.CreateFileNot | |||
| } | |||
| func getCloudbrainType(optionType int) int { | |||
| if optionType < 1 { | |||
| if optionType <= GPUType { | |||
| return models.TypeCloudBrainOne | |||
| } | |||
| if setting.ModelartsCD.Enabled { | |||
| @@ -1,3 +1,13 @@ | |||
| <style> | |||
| @media only screen and (max-width: 767px) { | |||
| .mobile-text-align-center { | |||
| text-align: center !important; | |||
| } | |||
| .mobile-justify-content-center { | |||
| justify-content: center !important; | |||
| } | |||
| } | |||
| </style> | |||
| <footer style="border-top:none;"> | |||
| <div class="ui container"> | |||
| <div class="ui grid"> | |||
| @@ -1,9 +1,51 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| @media only screen and (max-width: 1200px) { | |||
| ._container { | |||
| display:block !important; | |||
| } | |||
| ._left-img-area { | |||
| display: none; | |||
| } | |||
| ._right_content_area { | |||
| } | |||
| ._right_content_area .segment { | |||
| margin-left: auto !important; | |||
| border-top-left-radius: .28571429rem !important; | |||
| border-bottom-left-radius: .28571429rem !important; | |||
| border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||
| } | |||
| } | |||
| </style> | |||
| <script> | |||
| var ActivityTpl = {{ .ActivityTpl }}; | |||
| </script> | |||
| <div class="user signin{{if .LinkAccountMode}} icon{{end}}"> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| <div class="ui container"> | |||
| <div class="ui raised very padded text container segment"> | |||
| {{template "user/auth/signin_inner" .}} | |||
| <div class="ui container" style="margin-top:60px;"> | |||
| <div class="_container" style="display:flex;justify-content:center;"> | |||
| <div class="_left-img-area" style="padding-right:0;flex:2"> | |||
| <div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||
| border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||
| -webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||
| box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||
| {{ if .ActivityTpl }} | |||
| {{ .ActivityTpl | Safe}} | |||
| {{ else }} | |||
| {{ template "user/auth/signin_up_img_default" .}} | |||
| {{ end }} | |||
| </div> | |||
| </div> | |||
| <div class="_right_content_area" style="padding-left:0;flex:3;"> | |||
| <div class="ui raised very padded text container segment" style="margin-left:0; | |||
| border-top-left-radius: 0; | |||
| border-bottom-left-radius: 0; | |||
| border-left: none !important; | |||
| "> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| {{template "user/auth/signin_inner" .}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -1,9 +1,48 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| @media only screen and (max-width: 1200px) { | |||
| ._container { | |||
| display:block !important; | |||
| } | |||
| ._left-img-area { | |||
| display: none; | |||
| } | |||
| ._right_content_area { | |||
| } | |||
| ._right_content_area .segment { | |||
| margin-left: auto !important; | |||
| border-top-left-radius: .28571429rem !important; | |||
| border-bottom-left-radius: .28571429rem !important; | |||
| border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||
| } | |||
| } | |||
| </style> | |||
| <div class="user signin"> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| <div class="ui container"> | |||
| <div class="ui raised very padded text container segment"> | |||
| {{template "user/auth/signin_cloudbrain" .}} | |||
| <div class="ui container" style="margin-top:60px;"> | |||
| <div class="_container" style="display:flex;justify-content:center;"> | |||
| <div class="_left-img-area" style="padding-right:0;flex:2"> | |||
| <div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||
| border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||
| -webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||
| box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||
| {{ if .ActivityTpl }} | |||
| {{ .ActivityTpl | Safe}} | |||
| {{ else }} | |||
| {{ template "user/auth/signin_up_img_default" .}} | |||
| {{ end }} | |||
| </div> | |||
| </div> | |||
| <div class="_right_content_area" style="padding-left:0;flex:3;"> | |||
| <div class="ui raised very padded text container segment" style="margin-left:0; | |||
| border-top-left-radius: 0; | |||
| border-bottom-left-radius: 0; | |||
| border-left: none !important; | |||
| "> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| {{template "user/auth/signin_cloudbrain" .}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -1,5 +1,5 @@ | |||
| {{if or .EnablePhone .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}} | |||
| <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar"> | |||
| <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar" style="margin-bottom:45px !important;background-color:transparent !important;"> | |||
| {{if .EnablePhone }} | |||
| <a class="{{if .PageIsPhoneLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/phone"> | |||
| {{.i18n.Tr "phone.mobile_login"}} | |||
| @@ -1,73 +1,111 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| @media only screen and (max-width: 1200px) { | |||
| ._container { | |||
| display:block !important; | |||
| } | |||
| ._left-img-area { | |||
| display: none; | |||
| } | |||
| ._right_content_area { | |||
| } | |||
| ._right_content_area .segment { | |||
| margin-left: auto !important; | |||
| border-top-left-radius: .28571429rem !important; | |||
| border-bottom-left-radius: .28571429rem !important; | |||
| border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||
| } | |||
| } | |||
| </style> | |||
| <div class="user signin"> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| <div class="ui container"> | |||
| <div class="ui raised very padded text container segment"> | |||
| <style> | |||
| .full.height{background-color: #F9F9F9;} | |||
| .ui.left:not(.action){ float:none;} | |||
| .ui.left{ float:none;} | |||
| .ui.secondary.pointing.menu{ border-bottom:none;} | |||
| </style> | |||
| {{template "base/alert" .}} | |||
| <div class="ui negative message" style="display:none;"> | |||
| <p></p> | |||
| </div> | |||
| <div class="ui centered grid"> | |||
| <div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||
| <div class="ui bottom aligned two column grid"> | |||
| <div class="column"> | |||
| <h2 class="ui header"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signin_title"}} | |||
| {{else}} | |||
| {{.i18n.Tr "auth.login_userpass"}} | |||
| {{end}} | |||
| </h2> | |||
| </div> | |||
| {{if .ShowRegistrationButton}} | |||
| <div class="ui right floated column"> | |||
| <a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a> | |||
| </div> | |||
| {{end}} | |||
| <div class="ui container" style="margin-top:60px;"> | |||
| <div class="_container" style="display:flex;justify-content:center;"> | |||
| <div class="_left-img-area" style="padding-right:0;flex:2"> | |||
| <div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||
| border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||
| -webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||
| box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||
| {{ if .ActivityTpl }} | |||
| {{ .ActivityTpl | Safe}} | |||
| {{ else }} | |||
| {{ template "user/auth/signin_up_img_default" .}} | |||
| {{ end }} | |||
| </div> | |||
| <div class="ui grid"> | |||
| <div class="column"> | |||
| <form class="ui form" action="/user/login/phone" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| {{if .EnablePhone }} | |||
| <div class="use-type" usetype="1" autofocus="true"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </div> | |||
| {{end}} | |||
| <div class="two fields inline"> | |||
| <div class="field"> | |||
| <div class="ui checkbox"> | |||
| <label>{{.i18n.Tr "auth.remember_me"}}</label> | |||
| <input name="remember" type="checkbox"> | |||
| </div> | |||
| <div class="_right_content_area" style="padding-left:0;flex:3;"> | |||
| <div class="ui raised very padded text container segment" style="margin-left:0; | |||
| border-top-left-radius: 0; | |||
| border-bottom-left-radius: 0; | |||
| border-left: none !important; | |||
| "> | |||
| <style> | |||
| .full.height{background-color: #F9F9F9;} | |||
| .ui.left:not(.action){ float:none;} | |||
| .ui.left{ float:none;} | |||
| .ui.secondary.pointing.menu{ border-bottom:none;} | |||
| </style> | |||
| {{template "user/auth/signin_navbar" .}} | |||
| {{template "base/alert" .}} | |||
| <div class="ui negative message" style="display:none;"> | |||
| <p></p> | |||
| </div> | |||
| <div class="ui centered grid"> | |||
| <div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||
| <div class="ui bottom aligned two column grid"> | |||
| <div class="column"> | |||
| <h2 class="ui header"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signin_title"}} | |||
| {{else}} | |||
| {{.i18n.Tr "auth.login_userpass"}} | |||
| {{end}} | |||
| </h2> | |||
| </div> | |||
| {{if .ShowRegistrationButton}} | |||
| <div class="ui right floated column"> | |||
| <a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a> | |||
| </div> | |||
| {{end}} | |||
| </div> | |||
| <div class="field" style="padding-right: 0; text-align: right;"> | |||
| <a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a> | |||
| </div> | |||
| </div> | |||
| <div class="ui grid"> | |||
| <div class="column"> | |||
| <form class="ui form" action="/user/login/phone" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| {{if .EnablePhone }} | |||
| <div class="use-type" usetype="1" autofocus="true"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </div> | |||
| {{end}} | |||
| <div class="ui hidden divider"></div> | |||
| <div class="two fields inline"> | |||
| <div class="field"> | |||
| <div class="ui checkbox"> | |||
| <label>{{.i18n.Tr "auth.remember_me"}}</label> | |||
| <input name="remember" type="checkbox"> | |||
| </div> | |||
| </div> | |||
| <div class="field" style="padding-right: 0; text-align: right;"> | |||
| <a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a> | |||
| </div> | |||
| </div> | |||
| <div class="center aligned field"> | |||
| <button class="fluid large ui blue button"> | |||
| {{.i18n.Tr "sign_in"}} | |||
| </button> | |||
| <div class="ui hidden divider"></div> | |||
| <div class="center aligned field"> | |||
| <button class="fluid large ui blue button"> | |||
| {{.i18n.Tr "sign_in"}} | |||
| </button> | |||
| </div> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| @@ -0,0 +1,45 @@ | |||
| <div style="width:100%;height:100%; | |||
| border-radius: 0.28571429rem; | |||
| border-top-right-radius: 0; | |||
| border-bottom-right-radius: 0; | |||
| -webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||
| box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15); | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: center; | |||
| padding: 0 40px; | |||
| background: url('/img/login_bg_default.png') center center no-repeat; | |||
| background-size: cover; | |||
| border-right:none !important; | |||
| "> | |||
| <div style="margin: 14px 0;"> | |||
| <span style="font-weight:500;font-size:28px;color:rgb(0, 122, 255);">{{.i18n.Tr "auth.openi_community_really_awesome"}}</span> | |||
| </div> | |||
| <div style="margin: 14px 0;"> | |||
| <span style="font-weight:300;font-size:14px;color:rgb(140, 162, 170);">{{.i18n.Tr "home.page_description"}}</span> | |||
| </div> | |||
| <div style="margin: 14px 0;"> | |||
| <div style="width:111px"> | |||
| <a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning"> | |||
| <div style=" | |||
| width: 111px; | |||
| height: 40px; | |||
| font-size: 14px; | |||
| border-color: rgb(0, 122, 255); | |||
| border-width: 1px; | |||
| border-style: solid; | |||
| color: rgb(0, 122, 255); | |||
| display:flex; | |||
| align-items: center; | |||
| justify-content: center; | |||
| "> | |||
| <svg xmlns="http://www.w3.org/2000/svg" style="margin-right:8px;margin-top:-2px;" class="styles__StyledSVGIconPathComponent-sc-16fsqc8-0 fPsHiw svg-icon-path-icon fill" viewBox="0 0 32 32" width="16" height="16"><defs data-reactroot=""></defs><g><path fill="rgb(0, 122, 255)" d="M2.667 5.324c0.005-0.729 0.594-1.318 1.322-1.324h24.022c0.731 0 1.323 0.593 1.323 1.324v21.352c-0.005 0.729-0.594 1.318-1.322 1.324h-24.022c-0.731-0.001-1.323-0.593-1.323-1.324v0-21.352zM14.667 6.667h-9.333v18.667h9.333v-18.667zM17.333 6.667v18.667h9.333v-18.667h-9.333zM18.667 9.333h6.667v2.667h-6.667v-2.667zM18.667 13.333h6.667v2.667h-6.667v-2.667z"></path></g></svg> | |||
| <span>{{.i18n.Tr "custom.Platform_Tutorial"}}</span> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -1,112 +1,151 @@ | |||
| <style> | |||
| .full.height{background-color: #F9F9F9;} | |||
| </style> | |||
| <div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;"> | |||
| <div class="ui raised very padded text container segment"> | |||
| <div class="ui centered grid"> | |||
| <div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||
| <div class="ui bottom aligned two column grid"> | |||
| <div class="column"> | |||
| <h2 class="ui header"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signup_title"}} | |||
| {{else}} | |||
| {{.i18n.Tr "sign_up"}} | |||
| {{end}} | |||
| </h2> | |||
| </div> | |||
| {{if not .LinkAccountMode}} | |||
| <div class="ui right floated column"> | |||
| <a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a> | |||
| </div> | |||
| {{end}} | |||
| </div> | |||
| <div class="ui grid"> | |||
| <div class="column"> | |||
| <form class="ui form" action="{{.SignUpLink}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} | |||
| {{template "base/alert" .}} | |||
| {{end}} | |||
| <div class="ui negative message" style="display:none;"> | |||
| <p></p> | |||
| </div> | |||
| {{if .DisableRegistration}} | |||
| <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p> | |||
| {{else}} | |||
| <div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}"> | |||
| <span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span> | |||
| </div> | |||
| <div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required> | |||
| </div> | |||
| <div class="field {{if .Err_Email}}error{{end}}"> | |||
| <input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required> | |||
| </div> | |||
| {{if not .DisablePassword}} | |||
| <div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required> | |||
| </div> | |||
| <div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required> | |||
| </div> | |||
| {{end}} | |||
| {{if and .EnableCaptcha (eq .CaptchaType "image")}} | |||
| <div class="field"> | |||
| {{.Captcha.CreateHtml}} | |||
| </div> | |||
| <div class="field {{if .Err_Captcha}}error{{end}}"> | |||
| <input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off"> | |||
| </div> | |||
| {{end}} | |||
| {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} | |||
| <div class="field required"> | |||
| <div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> | |||
| </div> | |||
| <style> | |||
| @media only screen and (max-width: 1200px) { | |||
| ._container { | |||
| display:block !important; | |||
| } | |||
| ._left-img-area { | |||
| display: none; | |||
| } | |||
| ._right_content_area { | |||
| } | |||
| ._right_content_area .segment { | |||
| margin-left: auto !important; | |||
| border-top-left-radius: .28571429rem !important; | |||
| border-bottom-left-radius: .28571429rem !important; | |||
| border-left: border: 1px solid rgba(34,36,38,.15) !important; | |||
| } | |||
| } | |||
| </style> | |||
| <div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;"> | |||
| <div class="_container" style="display:flex;justify-content:center;"> | |||
| <div class="_left-img-area" style="padding-right:0;flex:2"> | |||
| <div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0; | |||
| border-bottom-right-radius: 0;border-right:none !important;overflow: hidden; | |||
| -webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15); | |||
| box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);"> | |||
| {{ if .ActivityTpl }} | |||
| {{ .ActivityTpl | Safe}} | |||
| {{ else }} | |||
| {{ template "user/auth/signin_up_img_default" .}} | |||
| {{ end }} | |||
| </div> | |||
| </div> | |||
| <div class="_right_content_area" style="padding-left:0;flex:3;"> | |||
| <div class="ui raised very padded text container segment" style="margin-left:0; | |||
| border-top-left-radius: 0; | |||
| border-bottom-left-radius: 0; | |||
| border-left: none !important; | |||
| "> | |||
| <div class="ui centered grid"> | |||
| <div class="sixteen wide mobile ten wide tablet ten wide computer column"> | |||
| <div class="ui bottom aligned two column grid"> | |||
| <div class="column"> | |||
| <h2 class="ui header"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signup_title"}} | |||
| {{else}} | |||
| {{.i18n.Tr "sign_up"}} | |||
| {{end}} | |||
| {{if .EnablePhone }} | |||
| <div class="use-type" usetype="0"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </h2> | |||
| </div> | |||
| {{if not .LinkAccountMode}} | |||
| <div class="ui right floated column"> | |||
| <a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a> | |||
| </div> | |||
| {{end}} | |||
| </div> | |||
| <div class="ui grid"> | |||
| <div class="column"> | |||
| <form class="ui form" action="{{.SignUpLink}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} | |||
| {{template "base/alert" .}} | |||
| {{end}} | |||
| <div class="ui negative message" style="display:none;"> | |||
| <p></p> | |||
| </div> | |||
| {{end}} | |||
| <div class="field"> | |||
| <div style="display:flex;"> | |||
| <div style="display:flex;align-items:center;"> | |||
| <span>{{.i18n.Tr "recommender"}}</span> | |||
| {{if .DisableRegistration}} | |||
| <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p> | |||
| {{else}} | |||
| <div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}"> | |||
| <span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span> | |||
| </div> | |||
| <div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required> | |||
| </div> | |||
| <div class="field {{if .Err_Email}}error{{end}}"> | |||
| <input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required> | |||
| </div> | |||
| <input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" /> | |||
| </div> | |||
| </div> | |||
| <div class="field"> | |||
| <div class="ui checkbox"> | |||
| <input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label> | |||
| </div> | |||
| </div> | |||
| <div class="ui hidden divider"></div> | |||
| <div class="center aligned field"> | |||
| <button class="fluid large ui blue button"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signup_submit"}} | |||
| {{else}} | |||
| {{.i18n.Tr "auth.create_new_account"}} | |||
| {{if not .DisablePassword}} | |||
| <div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required> | |||
| </div> | |||
| <div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}"> | |||
| <input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required> | |||
| </div> | |||
| {{end}} | |||
| </button> | |||
| </div> | |||
| {{end}} | |||
| </form> | |||
| </div> | |||
| {{if and .EnableCaptcha (eq .CaptchaType "image")}} | |||
| <div class="field"> | |||
| {{.Captcha.CreateHtml}} | |||
| </div> | |||
| <div class="field {{if .Err_Captcha}}error{{end}}"> | |||
| <input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off"> | |||
| </div> | |||
| {{end}} | |||
| {{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}} | |||
| <div class="field required"> | |||
| <div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div> | |||
| </div> | |||
| {{end}} | |||
| {{if .EnablePhone }} | |||
| <div class="use-type" usetype="0"> | |||
| {{template "user/auth/phone_verify" .}} | |||
| </div> | |||
| {{end}} | |||
| <div class="field"> | |||
| <div style="display:flex;"> | |||
| <div style="display:flex;align-items:center;"> | |||
| <span>{{.i18n.Tr "recommender"}}</span> | |||
| </div> | |||
| <input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" /> | |||
| </div> | |||
| </div> | |||
| <div class="field"> | |||
| <div class="ui checkbox"> | |||
| <input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label> | |||
| </div> | |||
| </div> | |||
| <div class="ui hidden divider"></div> | |||
| <div class="center aligned field"> | |||
| <button class="fluid large ui blue button"> | |||
| {{if .LinkAccountMode}} | |||
| {{.i18n.Tr "auth.oauth_signup_submit"}} | |||
| {{else}} | |||
| {{.i18n.Tr "auth.create_new_account"}} | |||
| {{end}} | |||
| </button> | |||
| </div> | |||
| {{end}} | |||
| </form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <script> | |||
| ; (function() { | |||
| var getUrlParams = function() { | |||
| @@ -53,8 +53,8 @@ export default { | |||
| index_web: '', | |||
| repo_name_name: '', | |||
| alias:'', | |||
| IsPermit:false | |||
| }, | |||
| IsPermit: false, | |||
| // rule1:[{min:3,max:5,message:'1',trigger:"blur"}], | |||
| rule: { | |||
| index_web: [ | |||