去除主题预览功能

pull/137/head
ruibaby 2019-03-10 10:42:39 +08:00
parent 590a0ffa6c
commit 12a6b548a4
3 changed files with 3 additions and 27 deletions

View File

@ -33,21 +33,6 @@ public abstract class BaseController {
return themeStr.toString();
}
/**
*
*
* @param theme
* @param pageName
* @return String
*/
public String render(String theme, String pageName) {
final StrBuilder themeStr = new StrBuilder("themes/");
themeStr.append(theme);
themeStr.append("/");
themeStr.append(pageName);
return themeStr.toString();
}
/**
* 404
*

View File

@ -17,7 +17,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import static cc.ryanc.halo.model.support.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
@ -45,9 +44,8 @@ public class FrontIndexController extends BaseController {
* @return
*/
@GetMapping
public String index(@RequestParam(value = "theme", defaultValue = "") String theme,
Model model) {
return this.index(model, theme, 1, Sort.by(DESC, "postPriority").and(Sort.by(DESC, "postDate")));
public String index(Model model) {
return this.index(model, 1, Sort.by(DESC, "postPriority").and(Sort.by(DESC, "postDate")));
}
/**
@ -59,7 +57,6 @@ public class FrontIndexController extends BaseController {
*/
@GetMapping(value = "page/{page}")
public String index(Model model,
@RequestParam(value = "theme", defaultValue = "") String theme,
@PathVariable(value = "page") Integer page,
@SortDefault.SortDefaults({
@SortDefault(sort = "postPriority", direction = DESC),
@ -82,9 +79,6 @@ public class FrontIndexController extends BaseController {
model.addAttribute("is_index", true);
model.addAttribute("posts", posts);
model.addAttribute("rainbow", rainbow);
if (StrUtil.isNotEmpty(theme)) {
return this.render(theme, "index");
}
return this.render("index");
}
}

View File

@ -27,9 +27,6 @@
font-size: 18px;
line-height: 30px;
}
.theme-title a{
color: #000;
}
.btn-delete:hover{
color: red;
}
@ -56,7 +53,7 @@
</div>
<div class="box-footer">
<span class="theme-title">
<a href="${options.blog_url!}?theme=${theme.themeName!}" target="_blank" title="点击预览该主题">${theme.themeName!?cap_first}</a>
${theme.themeName!?cap_first}
</span>
<#if theme.hasOptions>
<button class="btn btn-primary btn-sm pull-right btn-theme-setting" onclick="halo.layerModal('/admin/themes/options?theme=${theme.themeName!}&hasUpdate=<#if theme.hasUpdate>true<#else>false</#if>','${theme.themeName!} <@spring.message code="admin.themes.js.theme-setting" />')" style="display: none"><@spring.message code='admin.themes.btn.setting' /></button>