Commit 7c1b49c2 authored by Liang Ding's avatar Liang Ding

Fix #12043

parent c6ed7f53
...@@ -19,7 +19,7 @@ package org.b3log.solo.model; ...@@ -19,7 +19,7 @@ package org.b3log.solo.model;
* This class defines option model relevant keys. * This class defines option model relevant keys.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.1, Nov 8, 2015 * @version 1.3.0.1, Nov 20, 2015
* @since 0.6.0 * @since 0.6.0
*/ */
public final class Option { public final class Option {
...@@ -185,6 +185,11 @@ public final class Option { ...@@ -185,6 +185,11 @@ public final class Option {
*/ */
public static final String ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK = "allowVisitDraftViaPermalink"; public static final String ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK = "allowVisitDraftViaPermalink";
/**
* Key of allow register.
*/
public static final String ID_C_ALLOW_REGISTER = "allowRegister";
/** /**
* Key of version. * Key of version.
*/ */
......
...@@ -15,19 +15,17 @@ ...@@ -15,19 +15,17 @@
*/ */
package org.b3log.solo.model; package org.b3log.solo.model;
import org.b3log.latke.Keys; import org.b3log.latke.Keys;
import org.b3log.latke.logging.Level; import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger; import org.b3log.latke.logging.Logger;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* This class defines all comment model relevant keys. * This class defines all comment model relevant keys.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.10, Nov 8, 2015 * @version 1.3.0.10, Nov 20, 2015
* @since 0.3.1 * @since 0.3.1
*/ */
public final class Preference { public final class Preference {
...@@ -152,6 +150,11 @@ public final class Preference { ...@@ -152,6 +150,11 @@ public final class Preference {
*/ */
public static final String ALLOW_VISIT_DRAFT_VIA_PERMALINK = "allowVisitDraftViaPermalink"; public static final String ALLOW_VISIT_DRAFT_VIA_PERMALINK = "allowVisitDraftViaPermalink";
/**
* Key of allow register.
*/
public static final String ALLOW_REGISTER = "allowRegister";
/** /**
* Key of version. * Key of version.
*/ */
...@@ -215,7 +218,8 @@ public final class Preference { ...@@ -215,7 +218,8 @@ public final class Preference {
/** /**
* Private default constructor. * Private default constructor.
*/ */
private Preference() {} private Preference() {
}
/** /**
* Default preference. * Default preference.
...@@ -348,6 +352,11 @@ public final class Preference { ...@@ -348,6 +352,11 @@ public final class Preference {
*/ */
public static final String DEFAULT_ALLOW_VISIT_DRAFT_VIA_PERMALINK = "false"; public static final String DEFAULT_ALLOW_VISIT_DRAFT_VIA_PERMALINK = "false";
/**
* Default allow register.
*/
public static final String DEFAULT_ALLOW_REGISTER = "false";
/** /**
* Default allow comment article/page. * Default allow comment article/page.
*/ */
...@@ -423,6 +432,7 @@ public final class Preference { ...@@ -423,6 +432,7 @@ public final class Preference {
/** /**
* Private default constructor. * Private default constructor.
*/ */
private Default() {} private Default() {
}
} }
} }
...@@ -46,7 +46,7 @@ import org.json.JSONObject; ...@@ -46,7 +46,7 @@ import org.json.JSONObject;
* Preference console request processing. * Preference console request processing.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.7, Nov 7, 2015 * @version 1.2.0.7, Nov 20, 2015
* @since 0.4.0 * @since 0.4.0
*/ */
@RequestProcessor @RequestProcessor
...@@ -306,6 +306,7 @@ public class PreferenceConsole { ...@@ -306,6 +306,7 @@ public class PreferenceConsole {
* "signHTML": "" * "signHTML": ""
* }, ...]", * }, ...]",
* "allowVisitDraftViaPermalink": boolean, * "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "version": "", * "version": "",
* "articleListStyle": "", // Optional values: "titleOnly"/"titleAndContent"/"titleAndAbstract" * "articleListStyle": "", // Optional values: "titleOnly"/"titleAndContent"/"titleAndAbstract"
* "commentable": boolean, * "commentable": boolean,
...@@ -395,6 +396,7 @@ public class PreferenceConsole { ...@@ -395,6 +396,7 @@ public class PreferenceConsole {
* "signHTML": "" * "signHTML": ""
* }, ...], * }, ...],
* "allowVisitDraftViaPermalink": boolean, * "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "articleListStyle": "", * "articleListStyle": "",
* "commentable": boolean, * "commentable": boolean,
* "feedOutputMode: "", * "feedOutputMode: "",
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package org.b3log.solo.processor.console; package org.b3log.solo.processor.console;
import javax.inject.Inject; import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -33,18 +32,19 @@ import org.b3log.latke.servlet.annotation.RequestProcessing; ...@@ -33,18 +32,19 @@ import org.b3log.latke.servlet.annotation.RequestProcessing;
import org.b3log.latke.servlet.annotation.RequestProcessor; import org.b3log.latke.servlet.annotation.RequestProcessor;
import org.b3log.latke.servlet.renderer.JSONRenderer; import org.b3log.latke.servlet.renderer.JSONRenderer;
import org.b3log.latke.util.Requests; import org.b3log.latke.util.Requests;
import org.b3log.solo.model.Option;
import org.b3log.solo.service.PreferenceQueryService;
import org.b3log.solo.service.UserMgmtService; import org.b3log.solo.service.UserMgmtService;
import org.b3log.solo.service.UserQueryService; import org.b3log.solo.service.UserQueryService;
import org.b3log.solo.util.QueryResults; import org.b3log.solo.util.QueryResults;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* User console request processing. * User console request processing.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="mailto:385321165@qq.com">DASHU</a> * @author <a href="mailto:385321165@qq.com">DASHU</a>
* @version 1.1.0.4, Oct 17, 2015 * @version 1.2.0.4, Nov 20, 2015
* @since 0.4.0 * @since 0.4.0
*/ */
@RequestProcessor @RequestProcessor
...@@ -67,6 +67,12 @@ public class UserConsole { ...@@ -67,6 +67,12 @@ public class UserConsole {
@Inject @Inject
private UserMgmtService userMgmtService; private UserMgmtService userMgmtService;
/**
* Preference query service.
*/
@Inject
private PreferenceQueryService preferenceQueryService;
/** /**
* Language service. * Language service.
*/ */
...@@ -86,8 +92,7 @@ public class UserConsole { ...@@ -86,8 +92,7 @@ public class UserConsole {
* </pre> * </pre>
* </p> * </p>
* *
* @param request the specified http servlet request, for example, * @param request the specified http servlet request, for example, <pre>
* <pre>
* { * {
* "oId": "", * "oId": "",
* "userName": "", * "userName": "",
...@@ -98,6 +103,7 @@ public class UserConsole { ...@@ -98,6 +103,7 @@ public class UserConsole {
* "userAvatar": "" // optional * "userAvatar": "" // optional
* } * }
* </pre> * </pre>
*
* @param context the specified http request context * @param context the specified http request context
* @param response the specified http servlet response * @param response the specified http servlet response
* @throws Exception exception * @throws Exception exception
...@@ -149,8 +155,7 @@ public class UserConsole { ...@@ -149,8 +155,7 @@ public class UserConsole {
* </pre> * </pre>
* </p> * </p>
* *
* @param request the specified http servlet request, for example, * @param request the specified http servlet request, for example, <pre>
* <pre>
* { * {
* "userName": "", * "userName": "",
* "userEmail": "", * "userEmail": "",
...@@ -160,6 +165,7 @@ public class UserConsole { ...@@ -160,6 +165,7 @@ public class UserConsole {
* "userAvatar": "" // optional * "userAvatar": "" // optional
* } * }
* </pre> * </pre>
*
* @param response the specified http servlet response * @param response the specified http servlet response
* @param context the specified http request context * @param context the specified http request context
* @throws Exception exception * @throws Exception exception
...@@ -169,10 +175,10 @@ public class UserConsole { ...@@ -169,10 +175,10 @@ public class UserConsole {
throws Exception { throws Exception {
final JSONRenderer renderer = new JSONRenderer(); final JSONRenderer renderer = new JSONRenderer();
context.setRenderer(renderer); context.setRenderer(renderer);
final JSONObject ret = new JSONObject(); final JSONObject ret = new JSONObject();
renderer.setJSONObject(ret);
try { try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response); final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
...@@ -180,8 +186,18 @@ public class UserConsole { ...@@ -180,8 +186,18 @@ public class UserConsole {
if (userQueryService.isAdminLoggedIn(request)) { // if the administrator register a new user, treats the new user as a normal user if (userQueryService.isAdminLoggedIn(request)) { // if the administrator register a new user, treats the new user as a normal user
// (defaultRole) who could post article // (defaultRole) who could post article
requestJSONObject.put(User.USER_ROLE, Role.DEFAULT_ROLE); requestJSONObject.put(User.USER_ROLE, Role.DEFAULT_ROLE);
} else { // if a normal user or a visitor register a new user, treates the new user as a visitor (visitorRole) who couldn't } else {
// post article final JSONObject preference = preferenceQueryService.getPreference();
if (!preference.optBoolean(Option.ID_C_ALLOW_REGISTER)) {
ret.put(Keys.STATUS_CODE, false);
ret.put(Keys.MSG, langPropsService.get("notAllowRegisterLabel"));
return;
}
// if a normal user or a visitor register a new user, treates the new user as a visitor
// (visitorRole) who couldn't post article
requestJSONObject.put(User.USER_ROLE, Role.VISITOR_ROLE); requestJSONObject.put(User.USER_ROLE, Role.VISITOR_ROLE);
} }
...@@ -190,8 +206,6 @@ public class UserConsole { ...@@ -190,8 +206,6 @@ public class UserConsole {
ret.put(Keys.OBJECT_ID, userId); ret.put(Keys.OBJECT_ID, userId);
ret.put(Keys.MSG, langPropsService.get("addSuccLabel")); ret.put(Keys.MSG, langPropsService.get("addSuccLabel"));
ret.put(Keys.STATUS_CODE, true); ret.put(Keys.STATUS_CODE, true);
renderer.setJSONObject(ret);
} catch (final ServiceException e) { } catch (final ServiceException e) {
LOGGER.log(Level.ERROR, e.getMessage(), e); LOGGER.log(Level.ERROR, e.getMessage(), e);
...@@ -254,9 +268,8 @@ public class UserConsole { ...@@ -254,9 +268,8 @@ public class UserConsole {
/** /**
* Gets users by the specified request json object. * Gets users by the specified request json object.
* <p> * <p>
* The request URI contains the pagination arguments. For example, the * The request URI contains the pagination arguments. For example, the request URI is /console/users/1/10/20, means
* request URI is /console/users/1/10/20, means the current page is 1, the * the current page is 1, the page size is 10, and the window size is 20.
* page size is 10, and the window size is 20.
* </p> * </p>
* *
* <p> * <p>
......
...@@ -70,7 +70,7 @@ import org.json.JSONObject; ...@@ -70,7 +70,7 @@ import org.json.JSONObject;
* Solo initialization service. * Solo initialization service.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.2.8, Nov 8, 2015 * @version 1.4.2.8, Nov 20, 2015
* @since 0.4.0 * @since 0.4.0
*/ */
@Service @Service
...@@ -698,6 +698,12 @@ public class InitService { ...@@ -698,6 +698,12 @@ public class InitService {
allowVisitDraftViaPermalinkOpt.put(Option.OPTION_VALUE, Default.DEFAULT_ALLOW_VISIT_DRAFT_VIA_PERMALINK); allowVisitDraftViaPermalinkOpt.put(Option.OPTION_VALUE, Default.DEFAULT_ALLOW_VISIT_DRAFT_VIA_PERMALINK);
optionRepository.add(allowVisitDraftViaPermalinkOpt); optionRepository.add(allowVisitDraftViaPermalinkOpt);
final JSONObject allowRegisterOpt = new JSONObject();
allowRegisterOpt.put(Keys.OBJECT_ID, Option.ID_C_ALLOW_REGISTER);
allowRegisterOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
allowRegisterOpt.put(Option.OPTION_VALUE, Default.DEFAULT_ALLOW_REGISTER);
optionRepository.add(allowRegisterOpt);
final JSONObject commentableOpt = new JSONObject(); final JSONObject commentableOpt = new JSONObject();
commentableOpt.put(Keys.OBJECT_ID, Option.ID_C_COMMENTABLE); commentableOpt.put(Keys.OBJECT_ID, Option.ID_C_COMMENTABLE);
commentableOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE); commentableOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
......
...@@ -50,7 +50,7 @@ import static org.b3log.solo.util.Skins.setDirectoryForTemplateLoading; ...@@ -50,7 +50,7 @@ import static org.b3log.solo.util.Skins.setDirectoryForTemplateLoading;
* Preference management service. * Preference management service.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.1.9, Nov 8, 2015 * @version 1.3.1.9, Nov 20, 2015
* @since 0.4.0 * @since 0.4.0
*/ */
@Service @Service
...@@ -253,6 +253,10 @@ public class PreferenceMgmtService { ...@@ -253,6 +253,10 @@ public class PreferenceMgmtService {
allowVisitDraftViaPermalinkOpt.put(Option.OPTION_VALUE, preference.optString(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK)); allowVisitDraftViaPermalinkOpt.put(Option.OPTION_VALUE, preference.optString(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK));
optionRepository.update(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK, allowVisitDraftViaPermalinkOpt); optionRepository.update(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK, allowVisitDraftViaPermalinkOpt);
final JSONObject allowRegisterOpt = optionRepository.get(Option.ID_C_ALLOW_REGISTER);
allowRegisterOpt.put(Option.OPTION_VALUE, preference.optString(Option.ID_C_ALLOW_REGISTER));
optionRepository.update(Option.ID_C_ALLOW_REGISTER, allowRegisterOpt);
final JSONObject articleListDisplayCountOpt = optionRepository.get(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT); final JSONObject articleListDisplayCountOpt = optionRepository.get(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT);
articleListDisplayCountOpt.put(Option.OPTION_VALUE, preference.optString(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT)); articleListDisplayCountOpt.put(Option.OPTION_VALUE, preference.optString(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT));
optionRepository.update(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT, articleListDisplayCountOpt); optionRepository.update(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT, articleListDisplayCountOpt);
......
...@@ -26,7 +26,6 @@ import org.b3log.latke.repository.RepositoryException; ...@@ -26,7 +26,6 @@ import org.b3log.latke.repository.RepositoryException;
import org.b3log.latke.service.ServiceException; import org.b3log.latke.service.ServiceException;
import org.b3log.latke.service.annotation.Service; import org.b3log.latke.service.annotation.Service;
import org.b3log.solo.model.Option; import org.b3log.solo.model.Option;
import org.b3log.solo.model.Preference;
import org.b3log.solo.repository.OptionRepository; import org.b3log.solo.repository.OptionRepository;
import org.b3log.solo.repository.PreferenceRepository; import org.b3log.solo.repository.PreferenceRepository;
import org.json.JSONArray; import org.json.JSONArray;
...@@ -47,12 +46,6 @@ public class PreferenceQueryService { ...@@ -47,12 +46,6 @@ public class PreferenceQueryService {
*/ */
private static final Logger LOGGER = Logger.getLogger(PreferenceQueryService.class.getName()); private static final Logger LOGGER = Logger.getLogger(PreferenceQueryService.class.getName());
/**
* Preference repository.
*/
@Inject
private PreferenceRepository preferenceRepository;
/** /**
* Option repository. * Option repository.
*/ */
...@@ -109,13 +102,4 @@ public class PreferenceQueryService { ...@@ -109,13 +102,4 @@ public class PreferenceQueryService {
return null; return null;
} }
} }
/**
* Sets the preference repository with the specified preference repository.
*
* @param preferenceRepository the specified preference repository
*/
public void setPreferenceRepository(final PreferenceRepository preferenceRepository) {
this.preferenceRepository = preferenceRepository;
}
} }
...@@ -44,7 +44,7 @@ import org.json.JSONObject; ...@@ -44,7 +44,7 @@ import org.json.JSONObject;
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a> * @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a>
* @version 1.0.0.1, Nov 8, 2015 * @version 1.1.0.1, Nov 20, 2015
* @since 1.2.0 * @since 1.2.0
*/ */
@Service @Service
...@@ -392,13 +392,6 @@ public class UpgradeService { ...@@ -392,13 +392,6 @@ public class UpgradeService {
timeZoneIdOpt.put(Option.OPTION_VALUE, timeZoneId); timeZoneIdOpt.put(Option.OPTION_VALUE, timeZoneId);
optionRepository.add(timeZoneIdOpt); optionRepository.add(timeZoneIdOpt);
final String version = preference.optString(Preference.VERSION);
final JSONObject versionOpt = new JSONObject();
versionOpt.put(Keys.OBJECT_ID, Option.ID_C_VERSION);
versionOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
versionOpt.put(Option.OPTION_VALUE, TO_VER);
optionRepository.add(versionOpt);
final String editorType = preference.optString(Preference.EDITOR_TYPE); final String editorType = preference.optString(Preference.EDITOR_TYPE);
final JSONObject editorTypeOpt = new JSONObject(); final JSONObject editorTypeOpt = new JSONObject();
editorTypeOpt.put(Keys.OBJECT_ID, Option.ID_C_EDITOR_TYPE); editorTypeOpt.put(Keys.OBJECT_ID, Option.ID_C_EDITOR_TYPE);
...@@ -428,6 +421,18 @@ public class UpgradeService { ...@@ -428,6 +421,18 @@ public class UpgradeService {
subjectOpt.put(Option.OPTION_VALUE, subject); subjectOpt.put(Option.OPTION_VALUE, subject);
optionRepository.add(subjectOpt); optionRepository.add(subjectOpt);
final JSONObject versionOpt = new JSONObject();
versionOpt.put(Keys.OBJECT_ID, Option.ID_C_VERSION);
versionOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
versionOpt.put(Option.OPTION_VALUE, TO_VER);
optionRepository.add(versionOpt);
final JSONObject allowRegisterOpt = new JSONObject();
allowRegisterOpt.put(Keys.OBJECT_ID, Option.ID_C_ALLOW_REGISTER);
allowRegisterOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
allowRegisterOpt.put(Option.OPTION_VALUE, Preference.Default.DEFAULT_ALLOW_REGISTER);
optionRepository.add(allowRegisterOpt);
preference.put(Preference.VERSION, TO_VER); preference.put(Preference.VERSION, TO_VER);
preferenceRepository.update(Preference.PREFERENCE, preference); preferenceRepository.update(Preference.PREFERENCE, preference);
......
...@@ -16,18 +16,20 @@ ...@@ -16,18 +16,20 @@
# #
# Description: Solo language configurations(en_US). # Description: Solo language configurations(en_US).
# Version: 2.5.2.6, Nov 7, 2015 # Version: 2.5.2.7, Nov 20, 2015
# Author: Liang Ding # Author: Liang Ding
# Author: Liyuan Li # Author: Liyuan Li
# Author: Dongxu Wang # Author: Dongxu Wang
# #
notAllowRegisterLabel=Not allow register
allowRegister1Label=Allow Register:
footerContent1Label=Footer: footerContent1Label=Footer:
userAvatar1Label=Avatar: userAvatar1Label=Avatar:
uploadFileLabel=Upload <a href="http://hacpai.com/article/1442418791213" target="_blank">(?)</a> uploadFileLabel=Upload <a href="http://hacpai.com/article/1442418791213" target="_blank">(?)</a>
accessKey1Label=Access Key: accessKey1Label=Access Key:
secretKey1Label=Secret Key: secretKey1Label=Secret Key:
domain1Label=\u57df\u540d: domain1Label=Domain:
bucket1Label=Bucket: bucket1Label=Bucket:
qiniuLabel=Qiniu qiniuLabel=Qiniu
contributorsLabel=Contributors contributorsLabel=Contributors
...@@ -66,7 +68,7 @@ aboutContentLabel=<p><a href="https://github.com/b3log/solo" target="_blank">Sol ...@@ -66,7 +68,7 @@ aboutContentLabel=<p><a href="https://github.com/b3log/solo" target="_blank">Sol
is an open source (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache License 2.0</a>) blogging program, which can run on <a href="http://code.google.com/appengine" target="_blank">Google App Engine</a> and a standard Servlet container.</p>\ is an open source (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache License 2.0</a>) blogging program, which can run on <a href="http://code.google.com/appengine" target="_blank">Google App Engine</a> and a standard Servlet container.</p>\
<p><a href="http://b3log.org" target="_blank">B3log</a> advocates the rights of equality, freedom and passion, and we are trying to create a bran-new experience about individual blogging + community. Sound interesting? <a href="https://github.com/b3log/solo/wiki/Join_us" target="_blank">Join us</a>!</p>\ <p><a href="http://b3log.org" target="_blank">B3log</a> advocates the rights of equality, freedom and passion, and we are trying to create a bran-new experience about individual blogging + community. Sound interesting? <a href="https://github.com/b3log/solo/wiki/Join_us" target="_blank">Join us</a>!</p>\
<a target="blank" href="http://b3log.org/donate.html">\ <a target="blank" href="http://b3log.org/donate.html">\
<div class="ico-alipay-me" alt="Alipay B3log" title="\u901a\u8fc7\u652f\u4ed8\u5b9d\u6536\u6b3e\u4e3b\u9875\u8fdb\u884c\u6350\u8d60"></div></a> <div class="ico-alipay-me" alt="Alipay B3log" title="\u901a\u8fc7\u652f\u4ed8\u5b9d\u8fdb\u884c\u6350\u8d60"></div></a>
confirmLabel=Confirm confirmLabel=Confirm
adminConsoleLabel=Admin adminConsoleLabel=Admin
adminIndexLabel=Admin Index adminIndexLabel=Admin Index
......
...@@ -16,12 +16,14 @@ ...@@ -16,12 +16,14 @@
# #
# Description: Solo default language configurations(zh_CN). # Description: Solo default language configurations(zh_CN).
# Version: 2.5.4.14, Nov 7, 2015 # Version: 2.5.4.15, Nov 20, 2015
# Author: Liang Ding # Author: Liang Ding
# Author: Liyuan Li # Author: Liyuan Li
# Author: Dongxu Wang # Author: Dongxu Wang
# #
notAllowRegisterLabel=\u6682\u4e0d\u5f00\u653e\u6ce8\u518c\uff01
allowRegister1Label=\u5141\u8bb8\u6ce8\u518c\uff1a
footerContent1Label=\u9875\u811a\uff1a footerContent1Label=\u9875\u811a\uff1a
userAvatar1Label=\u5934\u50cf\uff1a userAvatar1Label=\u5934\u50cf\uff1a
uploadFileLabel=\u6587\u4ef6\u4e0a\u4f20 <a href="http://hacpai.com/article/1442418791213" target="_blank">(?)</a> uploadFileLabel=\u6587\u4ef6\u4e0a\u4f20 <a href="http://hacpai.com/article/1442418791213" target="_blank">(?)</a>
...@@ -66,7 +68,7 @@ aboutContentLabel=<p><a href="https://github.com/b3log/solo" target="_blank">Sol ...@@ -66,7 +68,7 @@ aboutContentLabel=<p><a href="https://github.com/b3log/solo" target="_blank">Sol
\u662f\u4e00\u6b3e\u5f00\u6e90\uff08<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache License 2.0</a>\uff09\u7684\u535a\u5ba2\u7a0b\u5e8f\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u5728\u591a\u79cd\u4e91\u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728\u6807\u51c6 Servlet \u5bb9\u5668\u4e0a\u8fd0\u884c\u3002</p>\ \u662f\u4e00\u6b3e\u5f00\u6e90\uff08<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache License 2.0</a>\uff09\u7684\u535a\u5ba2\u7a0b\u5e8f\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u5728\u591a\u79cd\u4e91\u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u5728\u6807\u51c6 Servlet \u5bb9\u5668\u4e0a\u8fd0\u884c\u3002</p>\
<p><a href="http://b3log.org" target="_blank">B3log</a> \u63d0\u5021\u5e73\u7b49\u3001\u81ea\u7531\u3001\u5954\u653e\uff0c\u5e76\u6b63\u5728\u5c1d\u8bd5\u6784\u5efa\u4e2a\u4eba\u535a\u5ba2+\u8bba\u575b\u7684\u4e92\u52a8\u4f53\u9a8c\u3002\u5982\u679c\u60a8\u6709\u5174\u8da3\uff0c<a href="https://github.com/b3log/solo/wiki/Join_us" target="_blank">\u52a0\u5165\u6211\u4eec</a>\u5427\uff01\ <p><a href="http://b3log.org" target="_blank">B3log</a> \u63d0\u5021\u5e73\u7b49\u3001\u81ea\u7531\u3001\u5954\u653e\uff0c\u5e76\u6b63\u5728\u5c1d\u8bd5\u6784\u5efa\u4e2a\u4eba\u535a\u5ba2+\u8bba\u575b\u7684\u4e92\u52a8\u4f53\u9a8c\u3002\u5982\u679c\u60a8\u6709\u5174\u8da3\uff0c<a href="https://github.com/b3log/solo/wiki/Join_us" target="_blank">\u52a0\u5165\u6211\u4eec</a>\u5427\uff01\
</p><a target="blank" href="http://b3log.org/donate.html">\ </p><a target="blank" href="http://b3log.org/donate.html">\
<div class="ico-alipay-me" alt="Alipay B3log" title="\u901a\u8fc7\u652f\u4ed8\u5b9d\u6536\u6b3e\u4e3b\u9875\u8fdb\u884c\u6350\u8d60"></div></a> <div class="ico-alipay-me" alt="Alipay B3log" title="\u901a\u8fc7\u652f\u4ed8\u5b9d\u8fdb\u884c\u6350\u8d60"></div></a>
confirmLabel=\u786e\u5b9a confirmLabel=\u786e\u5b9a
adminConsoleLabel=\u540e\u53f0\u7ba1\u7406 adminConsoleLabel=\u540e\u53f0\u7ba1\u7406
adminIndexLabel=\u540e\u53f0\u9996\u9875 adminIndexLabel=\u540e\u53f0\u9996\u9875
......
...@@ -280,6 +280,14 @@ ...@@ -280,6 +280,14 @@
<input id="commentable" type="checkbox" class="normalInput"/> <input id="commentable" type="checkbox" class="normalInput"/>
</td> </td>
</tr> </tr>
<tr>
<th>
<label for="allowRegister">${allowRegister1Label}</label>
</th>
<td>
<input id="allowRegister" type="checkbox" class="normalInput"/>
</td>
</tr>
<tr> <tr>
<th> <th>
<label for="feedOutputMode">${feedOutputModel1Label}</label> <label for="feedOutputMode">${feedOutputModel1Label}</label>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.9, Nov 7, 2015 * @version 1.2.1.9, Nov 20, 2015
*/ */
/* preference 相关操作 */ /* preference 相关操作 */
...@@ -63,8 +63,11 @@ admin.preference = { ...@@ -63,8 +63,11 @@ admin.preference = {
$("#relevantArticlesDisplayCount").val(preference.relevantArticlesDisplayCount); $("#relevantArticlesDisplayCount").val(preference.relevantArticlesDisplayCount);
$("#randomArticlesDisplayCount").val(preference.randomArticlesDisplayCount); $("#randomArticlesDisplayCount").val(preference.randomArticlesDisplayCount);
$("#keyOfSolo").val(preference.keyOfSolo); $("#keyOfSolo").val(preference.keyOfSolo);
preference.enableArticleUpdateHint ? $("#enableArticleUpdateHint").attr("checked", "checked") : $("#enableArticleUpdateHint").removeAttr("checked");
preference.allowVisitDraftViaPermalink ? $("#allowVisitDraftViaPermalink").attr("checked", "checked") : $("allowVisitDraftViaPermalink").removeAttr("checked"); "true" === preference.enableArticleUpdateHint ? $("#enableArticleUpdateHint").attr("checked", "checked") : $("#enableArticleUpdateHint").removeAttr("checked");
"true" === preference.allowVisitDraftViaPermalink ? $("#allowVisitDraftViaPermalink").attr("checked", "checked") : $("allowVisitDraftViaPermalink").removeAttr("checked");
"true" === preference.allowRegister ? $("#allowRegister").attr("checked", "checked") : $("#allowRegister").removeAttr("checked");
"true" === preference.commentable ? $("#commentable").attr("checked", "checked") : $("commentable").removeAttr("checked");
admin.preference.locale = preference.localeString; admin.preference.locale = preference.localeString;
admin.preference.editorType = preference.editorType; admin.preference.editorType = preference.editorType;
...@@ -102,15 +105,10 @@ admin.preference = { ...@@ -102,15 +105,10 @@ admin.preference = {
}); });
} }
// Article list style
$("#articleListDisplay").val(preference.articleListStyle); $("#articleListDisplay").val(preference.articleListStyle);
// Editor Type
$("#editorType").val(preference.editorType); $("#editorType").val(preference.editorType);
// Feed output
$("#feedOutputMode").val(preference.feedOutputMode); $("#feedOutputMode").val(preference.feedOutputMode);
$("#feedOutputCnt").val(preference.feedOutputCnt); $("#feedOutputCnt").val(preference.feedOutputCnt);
// Commentable
preference.commentable ? $("#commentable").attr("checked", "checked") : $("commentable").removeAttr("checked");
$("#loadMsg").text(""); $("#loadMsg").text("");
} }
...@@ -230,7 +228,8 @@ admin.preference = { ...@@ -230,7 +228,8 @@ admin.preference = {
"editorType": $("#editorType").val(), "editorType": $("#editorType").val(),
"feedOutputMode": $("#feedOutputMode").val(), "feedOutputMode": $("#feedOutputMode").val(),
"feedOutputCnt": $("#feedOutputCnt").val(), "feedOutputCnt": $("#feedOutputCnt").val(),
"commentable": $("#commentable").prop("checked") "commentable": $("#commentable").prop("checked"),
"allowRegister": $("#allowRegister").prop("checked")
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment