1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

#1333 Disable Gravatar option when install

This commit is contained in:
Unknwon 2015-08-30 00:22:26 +08:00
parent 8d73832bdf
commit 302938e646
8 changed files with 22 additions and 5 deletions

View File

@ -95,6 +95,8 @@ mail_notify = Enable Mail Notification
server_service_title = Server and Other Services Settings
offline_mode = Enable Offline Mode
offline_mode_popup = Disable CDN even in production mode, all resource files will be served locally.
disable_gravatar = Disable Gravatar Service
disable_gravatar_popup = Disable Gravatar and custom sources, all avatars are uploaded by users or default.
disable_registration = Disable Self-registration
disable_registration_popup = Disable user self-registration, only admin can create accounts.
require_sign_in_view = Enable Require Sign In to View Pages

View File

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.6.7.0829 Beta"
const APP_VER = "0.6.7.0830 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -36,6 +36,7 @@ type InstallForm struct {
MailNotify bool
OfflineMode bool
DisableGravatar bool
DisableRegistration bool
RequireSignInView bool

File diff suppressed because one or more lines are too long

View File

@ -169,6 +169,12 @@ function initInstall() {
}
}
});
$('#offline-mode input').change(function () {
if ($(this).is(':checked')) {
$('#disable-gravatar').checkbox('check');
}
});
};
function initRepository() {

View File

@ -131,6 +131,7 @@ func Install(ctx *middleware.Context) {
// Server and other services settings
form.OfflineMode = setting.OfflineMode
form.DisableGravatar = setting.DisableGravatar
form.DisableRegistration = setting.Service.DisableRegistration
form.RequireSignInView = setting.Service.RequireSignInView
@ -260,6 +261,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
cfg.Section("service").Key("ENABLE_NOTIFY_MAIL").SetValue(com.ToStr(form.MailNotify))
cfg.Section("server").Key("OFFLINE_MODE").SetValue(com.ToStr(form.OfflineMode))
cfg.Section("picture").Key("DISABLE_GRAVATAR").SetValue(com.ToStr(form.DisableGravatar))
cfg.Section("service").Key("DISABLE_REGISTRATION").SetValue(com.ToStr(form.DisableRegistration))
cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").SetValue(com.ToStr(form.RequireSignInView))

View File

@ -1 +1 @@
0.6.7.0829 Beta
0.6.7.0830 Beta

View File

@ -158,11 +158,17 @@
</div>
<div class="content">
<div class="inline field">
<div class="ui checkbox">
<div class="ui checkbox" id="offline-mode">
<label class="poping up" data-content="{{.i18n.Tr "install.offline_mode_popup"}}"><strong>{{.i18n.Tr "install.offline_mode"}}</strong></label>
<input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox" id="disable-gravatar">
<label class="poping up" data-content="{{.i18n.Tr "install.disable_gravatar_popup"}}"><strong>{{.i18n.Tr "install.disable_gravatar"}}</strong></label>
<input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label class="poping up" data-content="{{.i18n.Tr "install.disable_registration_popup"}}"><strong>{{.i18n.Tr "install.disable_registration"}}</strong></label>