Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 17, 2019
1 parent de87596 commit 862f4dc
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGE_LOGS.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<title>Solo Change Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="apple-touch-icon" href="/favicon.png">
<link rel="apple-touch-icon" href="https://static.b3log.org/images/brand/solo-32.png">
<style>
a {
color: #4285f4;
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/b3log/solo/processor/IndexProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,15 @@ public void showStart(final RequestContext context) {
dataModel.put(Common.REFERER, referer);
Keys.fillRuntime(dataModel);
dataModelService.fillMinified(dataModel);

Solos.addGoogleNoIndex(context);
try {
final JSONObject preference = optionQueryService.getPreference();
dataModelService.fillCommon(context, dataModel, preference);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e);

context.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
import org.b3log.latke.util.Execs;
import org.b3log.latke.util.Strings;
import org.b3log.solo.SoloServletListener;
import org.b3log.solo.model.*;
import org.b3log.solo.model.Common;
import org.b3log.solo.model.Option;
import org.b3log.solo.model.Skin;
import org.b3log.solo.model.UserExt;
import org.b3log.solo.service.DataModelService;
import org.b3log.solo.service.ExportService;
import org.b3log.solo.service.OptionQueryService;
Expand Down Expand Up @@ -142,7 +145,6 @@ public void showAdminIndex(final RequestContext context) {
dataModel.put(Common.YEAR, String.valueOf(Calendar.getInstance().get(Calendar.YEAR)));
dataModel.put(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT, preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT));
dataModel.put(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE, preference.getInt(Option.ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE));
dataModel.put(Option.ID_C_LOCALE_STRING, preference.getString(Option.ID_C_LOCALE_STRING));
dataModel.put(Skin.SKIN_DIR_NAME, preference.getString(Skin.SKIN_DIR_NAME));
Keys.fillRuntime(dataModel);
dataModelService.fillMinified(dataModel);
Expand All @@ -158,6 +160,7 @@ public void showAdminIndex(final RequestContext context) {
dataModel.put(Common.UPLOAD_URL, upload.optString(Common.UPLOAD_URL));
dataModel.put(Common.UPLOAD_MSG, upload.optString(Common.UPLOAD_MSG));
}
dataModelService.fillCommon(context, dataModel, preference);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Admin index render failed", e);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/b3log/solo/service/DataModelService.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,7 @@ public void fillRecentComments(final Map<String, Object> dataModel, final JSONOb
* @param preference the specified preference
* @throws ServiceException service exception
*/
public void fillCommon(final RequestContext context, final Map<String, Object> dataModel, final JSONObject preference)
throws ServiceException {
public void fillCommon(final RequestContext context, final Map<String, Object> dataModel, final JSONObject preference) throws ServiceException {
fillSide(context, dataModel, preference);
fillBlogHeader(context, dataModel, preference);
fillBlogFooter(context, dataModel, preference);
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/CHANGE_LOGS.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<title>Solo Change Logs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="apple-touch-icon" href="/favicon.png">
<link rel="apple-touch-icon" href="https://static.b3log.org/images/brand/solo-32.png">
<style>
a {
color: #4285f4;
Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/WEB-INF/static-resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<static-files>
<!-- Uses the STANDARD Ant Path Pattern to configure these paths! -->

<include path="/favicon.png"/>
<include path="/robots.txt"/>
<include path="/sw.js"/>
<include path="/manifest.json"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/admin/admin-index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<title>${adminConsoleLabel} - ${blogTitle}</title>
<link type="text/css" rel="stylesheet" href="${staticServePath}/scss/admin.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/styles/atom-one-light.min.css" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
<link rel="icon" type="image/png" href="${faviconURL}" />
<link rel="manifest" href="${servePath}/manifest.json">
</head>
<body onhashchange="admin.setCurByHash();">
Expand Down
Binary file removed src/main/webapp/favicon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/webapp/macro-common-page.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<title>${title}<#if blogTitle??> - ${blogTitle}</#if></title>
<link type="text/css" rel="stylesheet"
href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/>
<link rel="apple-touch-icon" href="${staticServePath}/favicon.png">
<link rel="icon" type="image/png" href="${faviconURL}"/>
<link rel="apple-touch-icon" href="${faviconURL}">
</head>
<body>
<div class="wrap">
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/search.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<title>${searchLabel} - ${blogTitle}${searchLabel}</title>
<link type="text/css" rel="stylesheet"
href="${staticServePath}/scss/start.css?${staticResourceVersion}" charset="utf-8"/>
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png"/>
<link rel="apple-touch-icon" href="${staticServePath}/favicon.png">
<link rel="icon" type="image/png" href="${faviconURL}"/>
<link rel="apple-touch-icon" href="${faviconURL}">
</head>
<body class="search__body">
<div class="search__header fn-clear">
<a href="${servePath}"><img width="44" border="0" alt="Solo" title="Solo" src="${staticServePath}/favicon.png"/></a>
<a href="${servePath}"><img width="32" border="0" alt="Solo" title="Solo" src="${faviconURL}"/></a>
<div class="search__input">
<input value="${keyword}" id="keyword" type="text" onkeypress="if(event.keyCode===13){document.getElementById('searchBtn').click()}">
<button id="searchBtn" onclick="window.location.href='${servePath}/search?keyword=' + document.getElementById('keyword').value">搜索</button>
Expand Down

0 comments on commit 862f4dc

Please sign in to comment.