Browse Source

#1333 Disable Gravatar option when install

Unknwon 9 years ago
parent
commit
302938e646

+ 2 - 0
conf/locale/locale_en-US.ini

@@ -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

+ 1 - 1
gogs.go

@@ -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())

+ 1 - 0
modules/auth/user_form.go

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

File diff suppressed because it is too large
+ 0 - 0
modules/bindata/bindata.go


+ 6 - 0
public/js/gogs.js

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

+ 2 - 0
routers/install.go

@@ -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))
 

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.6.7.0829 Beta
+0.6.7.0830 Beta

+ 7 - 1
templates/install.tmpl

@@ -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>

Some files were not shown because too many files changed in this diff