add comment system

pull/1/head
RYAN0UP_ 2018-01-23 23:25:11 +08:00
parent a5c2ae34ba
commit 019e3f7528
399 changed files with 2038 additions and 1191 deletions

13
pom.xml
View File

@ -51,6 +51,12 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 邮件 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
@ -92,6 +98,12 @@
<artifactId>rome</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
</dependencies>
<profiles>
@ -101,7 +113,6 @@
<build>
<finalName>halo</finalName>
<resources>
<!-- 让jar包只存在字节码文件 -->
<resource>
<directory>src/main/java</directory>
<filtering>false</filtering>

View File

@ -3,6 +3,7 @@ package cc.ryanc.halo.config;
import cc.ryanc.halo.model.domain.Attachment;
import cc.ryanc.halo.model.domain.User;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.model.dto.Theme;
import cc.ryanc.halo.service.AttachmentService;
import cc.ryanc.halo.service.OptionsService;
import cc.ryanc.halo.service.UserService;
@ -87,8 +88,19 @@ public class StartupConfiguration implements ApplicationListener<ContextRefreshe
}
}
/**
*
*/
private void loadThemes(){
try{
HaloConst.THEMES.clear();
List<Theme> themes = HaloUtil.getThemes();
if(null!=themes){
HaloConst.THEMES = themes;
}
}catch (Exception e){
log.error("加载主题失败:"+e.getMessage());
}
}
private void loadUser(){

View File

@ -21,7 +21,7 @@ import java.util.Date;
public class Attachment implements Serializable{
@Id
@GeneratedValue
private Integer attachId;
private Long attachId;
private String attachName;
private String attachPath;
private String attachSmallPath;

View File

@ -20,7 +20,7 @@ import java.util.List;
public class Category implements Serializable{
@Id
@GeneratedValue
private Integer cateId;
private Long cateId;
private String cateName;
private String cateUrl;
private String cateDesc;

View File

@ -0,0 +1,81 @@
package cc.ryanc.halo.model.domain;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @author : RYAN0UP
* @version : 1.0
* @date : 2018/1/22
* description :
*/
@Data
@Entity
@Table(name = "halo_comment")
public class Comment implements Serializable {
/**
* id
*/
@Id
@GeneratedValue
private Long commentId;
/**
*
*/
@ManyToOne(targetEntity = Post.class,fetch = FetchType.EAGER)
@JoinColumn(name = "post_id")
private Post post;
/**
*
*/
private String commentAuthor;
/**
*
*/
private String commentAuthorEmail;
/**
*
*/
private String commentAuthorUrl;
/**
* ip
*/
private String commentAuthorIp;
/**
*
*/
private Date commentDate;
/**
*
*/
@Lob
private String commentContent;
/**
* ua
*/
private String commentAgent;
/**
*
*/
@OneToOne
@JoinColumn(name = "comment_id")
private Comment commentParent;
/**
* 012
*/
private Integer commentStatus=1;
}

View File

@ -20,7 +20,7 @@ import java.io.Serializable;
public class Link implements Serializable{
@Id
@GeneratedValue
private Integer linkId;
private Long linkId;
private String linkName;
private String linkUrl;
private String linkPic;

View File

@ -25,7 +25,7 @@ public class Logs implements Serializable {
*/
@Id
@GeneratedValue
private Integer logId;
private Long logId;
/**
*

View File

@ -1,5 +1,6 @@
package cc.ryanc.halo.model.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import javax.persistence.*;
@ -21,7 +22,7 @@ public class Post implements Serializable{
*/
@Id
@GeneratedValue
private Integer postId;
private Long postId;
/**
*
@ -35,6 +36,13 @@ public class Post implements Serializable{
*/
private String postTitle;
/**
*
* post
* page
*/
private String postType = "post";
/**
* Markdown
*/
@ -76,6 +84,11 @@ public class Post implements Serializable{
inverseJoinColumns = {@JoinColumn(name = "tag_id",nullable = false)})
private List<Tag> tags = new ArrayList<>();
@OneToMany(mappedBy = "post",cascade = {CascadeType.REMOVE},fetch = FetchType.EAGER)
@JsonIgnore
private List<Comment> comments = new ArrayList<>();
/**
*
*/

View File

@ -20,6 +20,6 @@ import java.io.Serializable;
public class PostMeta implements Serializable{
@Id
@GeneratedValue
private Integer metaId;
private Long metaId;
}

View File

@ -20,7 +20,7 @@ import java.util.List;
public class Tag implements Serializable{
@Id
@GeneratedValue
private Integer tagId;
private Long tagId;
private String tagName;
private String tagUrl;

View File

@ -21,7 +21,7 @@ public class User implements Serializable{
/**
*
*/
private Integer userId;
private Long userId;
/**
*
*/

View File

@ -17,8 +17,8 @@ import java.io.Serializable;
public class UserMeta implements Serializable{
@Id
@GeneratedValue
private Integer userMetaId;
private Integer userId;
private Long userMetaId;
private Long userId;
private String userMetaKey;
@Lob
private String userMetaValue;

View File

@ -1,7 +1,6 @@
package cc.ryanc.halo.model.dto;
import cc.ryanc.halo.model.domain.Attachment;
import cc.ryanc.halo.model.domain.Theme;
import cc.ryanc.halo.model.domain.User;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.domain;
package cc.ryanc.halo.model.dto;
import lombok.Data;
@ -12,7 +12,14 @@ import java.io.Serializable;
*/
@Data
public class Theme implements Serializable {
private Integer themeId;
/**
*
*/
private String themeName;
private String themeScreenShot;
/**
*
*/
private boolean hasOptions;
}

View File

@ -11,7 +11,13 @@ import org.springframework.data.jpa.repository.JpaRepository;
* description :
* @date : 2018/1/10
*/
public interface AttachmentRepository extends JpaRepository<Attachment,Integer>{
public interface AttachmentRepository extends JpaRepository<Attachment,Long>{
/**
*
* @param pageable pageable
* @return page
*/
@Override
Page<Attachment> findAll(Pageable pageable);
}

View File

@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @version : 1.0
* description:
*/
public interface CategoryRepository extends JpaRepository<Category,Integer>{
public interface CategoryRepository extends JpaRepository<Category,Long>{
/**
*

View File

@ -0,0 +1,52 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.model.domain.Post;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* @author : RYAN0UP
* @version : 1.0
* description :
* @date : 2018/1/22
*/
public interface CommentRepository extends JpaRepository<Comment,Long> {
/**
*
* @param status Status
* @param pageable pageable
* @return page
*/
Page<Comment> findCommentsByCommentStatus(Integer status, Pageable pageable);
/**
*
* @param post post
* @param pageable pageable
* @return page
*/
Page<Comment> findCommentsByPost(Post post,Pageable pageable);
/**
*
* @param post post
* @param pageable pageable
* @param status status
* @return page
*/
Page<Comment> findCommentsByPostAndCommentStatus(Post post,Pageable pageable,Integer status);
/**
*
* @return list
*/
@Query(value = "SELECT * FROM halo_comment ORDER BY comment_date DESC LIMIT 5",nativeQuery = true)
List<Comment> findTopFive();
}

View File

@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @date : 2017/11/14
* description:
*/
public interface LinkRepository extends JpaRepository<Link,Integer>{
public interface LinkRepository extends JpaRepository<Link,Long>{
}

View File

@ -12,12 +12,12 @@ import java.util.List;
* description :
* @date : 2018/1/19
*/
public interface LogsRepository extends JpaRepository<Logs,Integer> {
public interface LogsRepository extends JpaRepository<Logs,Long> {
/**
*
* @return list
*/
@Query(value = "SELECT * FROM halo_logs ORDER BY log_id DESC LIMIT 5",nativeQuery = true)
@Query(value = "SELECT * FROM halo_logs ORDER BY log_created DESC LIMIT 5",nativeQuery = true)
List<Logs> findTopFive();
}

View File

@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @version : 1.0
* description:
*/
public interface OptionsRepository extends JpaRepository<Options,Integer>{
public interface OptionsRepository extends JpaRepository<Options,Long>{
/**
* keyoption

View File

@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @version : 1.0
* description:
*/
public interface PostMetaRepository extends JpaRepository<PostMeta,Integer>{
public interface PostMetaRepository extends JpaRepository<PostMeta,Long>{
}

View File

@ -18,13 +18,13 @@ import java.util.List;
* @date : 2017/11/14
* description :
*/
public interface PostRepository extends JpaRepository<Post,Integer>{
public interface PostRepository extends JpaRepository<Post,Long>{
/**
*
* @return list
*/
@Query(value = "SELECT * FROM halo_post ORDER BY post_id DESC LIMIT 5",nativeQuery = true)
@Query(value = "SELECT * FROM halo_post ORDER BY post_date DESC LIMIT 5",nativeQuery = true)
List<Post> findTopFive();
/**

View File

@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* description :
* @date : 2018/1/12
*/
public interface TagRepository extends JpaRepository<Tag,Integer>{
public interface TagRepository extends JpaRepository<Tag,Long>{
/**
*

View File

@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @date : 2017/11/14
* description:
*/
public interface UserMetaRepository extends JpaRepository<UserMeta,Integer>{
public interface UserMetaRepository extends JpaRepository<UserMeta,Long>{
UserMeta findByUserMetaKey(String key);
}

View File

@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @version : 1.0
* description:
*/
public interface UserRepository extends JpaRepository<User,Integer>{
public interface UserRepository extends JpaRepository<User,Long>{
/**
*
* @param userName userName
@ -24,5 +24,5 @@ public interface UserRepository extends JpaRepository<User,Integer>{
* @param userPass userpass
* @return User
*/
User findByUserIdAndUserPass(Integer userId,String userPass);
User findByUserIdAndUserPass(Long userId,String userPass);
}

View File

@ -26,6 +26,11 @@ public interface AttachmentService {
*/
List<Attachment> findAllAttachments();
/**
*
* @param pageable pageable
* @return page
*/
Page<Attachment> findAllAttachments(Pageable pageable);
/**
@ -33,12 +38,12 @@ public interface AttachmentService {
* @param attachId attachId
* @return Attachment
*/
Attachment findByAttachId(Integer attachId);
Attachment findByAttachId(Long attachId);
/**
*
* @param attachId attachId
* @return Attachment
*/
Attachment removeByAttachId(Integer attachId);
Attachment removeByAttachId(Long attachId);
}

View File

@ -23,7 +23,7 @@ public interface CategoryService {
* @param cateId
* @return category
*/
Category removeByCateId(Integer cateId);
Category removeByCateId(Long cateId);
/**
*
@ -43,7 +43,7 @@ public interface CategoryService {
* @param cateId
* @return category
*/
Category findByCateId(Integer cateId);
Category findByCateId(Long cateId);
/**
*

View File

@ -0,0 +1,76 @@
package cc.ryanc.halo.service;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.model.domain.Post;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* @author : RYAN0UP
* @version : 1.0
* @date : 2018/1/22
* description :
*/
public interface CommentService {
/**
*
* @param comment comment
*/
void saveByComment(Comment comment);
/**
*
* @param status status
* @param pageable pageable
* @return page
*/
Page<Comment> findAllComments(Integer status, Pageable pageable);
/**
*
* @return
*/
List<Comment> findAllComments();
/**
*
* @param commentId commentId
* @param status status
* @return comment
*/
Comment updateCommentStatus(Long commentId,Integer status);
/**
*
* @param commentId commentId
* @return comment
*/
Comment findCommentById(Long commentId);
/**
*
* @param post post
* @param pageable pageable
* @return page
*/
Page<Comment> findCommentsByPost(Post post,Pageable pageable);
/**
*
* @param post post
* @param pageable pageable
* @param status status
* @return page
*/
Page<Comment> findCommentsByPostAndCommentStatus(Post post,Pageable pageable,Integer status);
/**
*
* @return list
*/
List<Comment> findCommentsLatest();
}

View File

@ -23,7 +23,7 @@ public interface LinkService {
* @param linkId linkId
* @return Link
*/
Link removeByLinkId(Integer linkId);
Link removeByLinkId(Long linkId);
/**
*
@ -43,5 +43,5 @@ public interface LinkService {
* @param linkId linkId
* @return Link
*/
Link findByLinkId(Integer linkId);
Link findByLinkId(Long linkId);
}

View File

@ -25,9 +25,8 @@ public interface LogsService {
/**
*
* @param logsId logsId
* @return Logs
*/
void removeByLogsId(Integer logsId);
void removeByLogsId(Long logsId);
/**
*
@ -52,5 +51,5 @@ public interface LogsService {
* @param logsId logsId
* @return logs
*/
Logs findLogsByLogsId(Integer logsId);
Logs findLogsByLogsId(Long logsId);
}

View File

@ -0,0 +1,11 @@
package cc.ryanc.halo.service;
/**
* @author : RYAN0UP
* @version : 1.0
* description :
* @date : 2018/1/23
*/
public interface MailService {
void sendMail(String to,String subject,String content);
}

View File

@ -28,7 +28,7 @@ public interface PostService {
* @param postId postId
* @return Post
*/
Post removeByPostId(Integer postId);
Post removeByPostId(Long postId);
/**
*
@ -43,7 +43,7 @@ public interface PostService {
* @param status status
* @return Post
*/
Post updatePostStatus(Integer postId,Integer status);
Post updatePostStatus(Long postId,Integer status);
/**
*
@ -90,7 +90,7 @@ public interface PostService {
* @param postId postId
* @return Post
*/
Post findByPostId(Integer postId);
Post findByPostId(Long postId);
/**
*
@ -133,6 +133,12 @@ public interface PostService {
*/
List<Post> findPostByYearAndMonth(String year,String month);
/**
*
* @param year year
* @param month month
* @param pageable pageable
* @return page
*/
Page<Post> findPostByYearAndMonth(@Param("year") String year, @Param("month") String month, Pageable pageable);
}

View File

@ -24,7 +24,7 @@ public interface TagService {
* @param tagId tagId
* @return Tag
*/
Tag removeByTagId(Integer tagId);
Tag removeByTagId(Long tagId);
/**
*
@ -44,7 +44,7 @@ public interface TagService {
* @param tagId tagId
* @return Link
*/
Tag findByTagId(Integer tagId);
Tag findByTagId(Long tagId);
/**
*

View File

@ -36,5 +36,5 @@ public interface UserService {
* @param userPass userpass
* @return user
*/
User findByUserIdAndUserPass(Integer userId,String userPass);
User findByUserIdAndUserPass(Long userId,String userPass);
}

View File

@ -43,12 +43,12 @@ public class AttachmentServiceImpl implements AttachmentService{
}
@Override
public Attachment findByAttachId(Integer attachId) {
public Attachment findByAttachId(Long attachId) {
return attachmentRepository.findOne(attachId);
}
@Override
public Attachment removeByAttachId(Integer attachId) {
public Attachment removeByAttachId(Long attachId) {
Attachment attachment = this.findByAttachId(attachId);
attachmentRepository.delete(attachment);
return attachment;

View File

@ -48,7 +48,7 @@ public class CategoryServiceImpl implements CategoryService{
*/
@CacheEvict(value = CATEGORY_CACHE_NAME,key = CATEGORY_KEY)
@Override
public Category removeByCateId(Integer cateId) {
public Category removeByCateId(Long cateId) {
Category category = this.findByCateId(cateId);
categoryRepository.delete(category);
return category;
@ -83,7 +83,7 @@ public class CategoryServiceImpl implements CategoryService{
*/
@Cacheable(value = CATEGORY_CACHE_NAME,key = "#cateId+'cate'")
@Override
public Category findByCateId(Integer cateId) {
public Category findByCateId(Long cateId) {
return categoryRepository.findOne(cateId);
}
@ -106,7 +106,7 @@ public class CategoryServiceImpl implements CategoryService{
List<Category> categories = new ArrayList<>();
Category category = null;
for(String str:strings){
category = findByCateId(Integer.parseInt(str));
category = findByCateId(Long.parseLong(str));
categories.add(category);
}
return categories;

View File

@ -0,0 +1,116 @@
package cc.ryanc.halo.service.impl;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.repository.CommentRepository;
import cc.ryanc.halo.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author : RYAN0UP
* @version : 1.0
* description :
* @date : 2018/1/22
*/
@Service
public class CommentServiceImpl implements CommentService {
@Autowired
private CommentRepository commentRepository;
/**
*
*
* @param comment comment
*/
@Override
public void saveByComment(Comment comment) {
commentRepository.save(comment);
}
/**
*
*
* @param pageable pageable
* @return page
*/
@Override
public Page<Comment> findAllComments(Integer status, Pageable pageable) {
return commentRepository.findCommentsByCommentStatus(status,pageable);
}
/**
*
*
* @return
*/
@Override
public List<Comment> findAllComments() {
return commentRepository.findAll();
}
/**
*
*
* @param commentId commentId
* @param status status
* @return comment
*/
@Override
public Comment updateCommentStatus(Long commentId, Integer status) {
Comment comment = findCommentById(commentId);
comment.setCommentStatus(status);
return commentRepository.save(comment);
}
/**
*
*
* @param commentId commentId
* @return comment
*/
@Override
public Comment findCommentById(Long commentId) {
return commentRepository.findOne(commentId);
}
/**
*
*
* @param post post
* @param pageable pageable
* @return page
*/
@Override
public Page<Comment> findCommentsByPost(Post post,Pageable pageable) {
return commentRepository.findCommentsByPost(post,pageable);
}
/**
*
*
* @param post post
* @param pageable pageable
* @param status status
* @return page
*/
@Override
public Page<Comment> findCommentsByPostAndCommentStatus(Post post, Pageable pageable, Integer status) {
return commentRepository.findCommentsByPostAndCommentStatus(post,pageable,status);
}
/**
*
*
* @return list
*/
@Override
public List<Comment> findCommentsLatest() {
return commentRepository.findTopFive();
}
}

View File

@ -45,7 +45,7 @@ public class LinkServiceImpl implements LinkService {
*/
@CacheEvict(value = LINK_CACHE_NAME,key = LINK_KEY)
@Override
public Link removeByLinkId(Integer linkId) {
public Link removeByLinkId(Long linkId) {
Link link = this.findByLinkId(linkId);
linkRepository.delete(link);
return link;
@ -80,7 +80,7 @@ public class LinkServiceImpl implements LinkService {
*/
@Cacheable(value = LINK_CACHE_NAME,key = "#linkId+'link'")
@Override
public Link findByLinkId(Integer linkId) {
public Link findByLinkId(Long linkId) {
return linkRepository.findOne(linkId);
}
}

View File

@ -40,7 +40,7 @@ public class LogsServiceImpl implements LogsService {
* @return Logs
*/
@Override
public void removeByLogsId(Integer logsId) {
public void removeByLogsId(Long logsId) {
Logs logs = this.findLogsByLogsId(logsId);
logsRepository.delete(logs);
}
@ -81,7 +81,7 @@ public class LogsServiceImpl implements LogsService {
* @return logs
*/
@Override
public Logs findLogsByLogsId(Integer logsId) {
public Logs findLogsByLogsId(Long logsId) {
return logsRepository.findOne(logsId);
}
}

View File

@ -0,0 +1,81 @@
package cc.ryanc.halo.service.impl;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.service.MailService;
import freemarker.template.Template;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import javax.mail.internet.MimeMessage;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* @author : RYAN0UP
* @version : 1.0
* description :
* @date : 2018/1/23
*/
@Service
public class MailServiceImpl implements MailService{
private static final String HOST = HaloConst.OPTIONS.get("mail_smtp_host");
private static final String USERNAME = HaloConst.OPTIONS.get("mail_smtp_username");
private static final String PASSWORD = HaloConst.OPTIONS.get("mail_smtp_password");
private static final String FROM_EMAIL = HaloConst.OPTIONS.get("mail_smtp_username");
private static final String FROM_NAME = HaloConst.OPTIONS.get("mail_from_name");
private static final JavaMailSenderImpl mailSender = createMailSender();
@Autowired
private FreeMarkerConfigurer freeMarker;
/**
*
* @return JavaMailSenderImpl
*/
private static JavaMailSenderImpl createMailSender() {
JavaMailSenderImpl sender = new JavaMailSenderImpl();
sender.setHost(HOST);
sender.setUsername(USERNAME);
sender.setPassword(PASSWORD);
sender.setDefaultEncoding("utf-8");
Properties p = new Properties();
p.setProperty("mail.smtp.auth", "true");
p.setProperty("mail.smtp.timeout", "25000");
p.setProperty("mail.smtp.starttls.enable","true");
p.setProperty("mail.smtp.starttls.required","true");
sender.setJavaMailProperties(p);
return sender;
}
/**
*
* @param to to
* @param subject subject
* @param content content
*/
@Override
public void sendMail(String to, String subject, String content) {
MimeMessage mimeMessage = mailSender.createMimeMessage();
try {
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true,"UTF-8");
helper.setFrom(FROM_EMAIL,FROM_NAME);
helper.setTo(to);
helper.setSubject(subject);
Template template = freeMarker.getConfiguration().getTemplate("common/mail.ftl");
Map<String,String> map = new HashMap<String,String>();
map.put("hahah","哈哈哈");
map.put("hehehe","呵呵呵");
content = FreeMarkerTemplateUtils.processTemplateIntoString(template,map);
helper.setText(content,true);
mailSender.send(mimeMessage);
}catch (Exception e){
e.printStackTrace();
}
}
}

View File

@ -51,7 +51,7 @@ public class PostServiceImpl implements PostService {
*/
@CacheEvict(value = POST_CACHE_NAME,key = POST_KEY)
@Override
public Post removeByPostId(Integer postId) {
public Post removeByPostId(Long postId) {
Post post = this.findByPostId(postId);
postRepository.delete(post);
return post;
@ -76,7 +76,7 @@ public class PostServiceImpl implements PostService {
*/
@CacheEvict(value = POST_CACHE_NAME,key = POST_KEY)
@Override
public Post updatePostStatus(Integer postId, Integer status) {
public Post updatePostStatus(Long postId, Integer status) {
Post post = this.findByPostId(postId);
post.setPostStatus(status);
return postRepository.save(post);
@ -158,7 +158,7 @@ public class PostServiceImpl implements PostService {
*/
@Cacheable(value = POST_CACHE_NAME,key = "#postId+'post'")
@Override
public Post findByPostId(Integer postId) {
public Post findByPostId(Long postId) {
return postRepository.findOne(postId);
}

View File

@ -38,7 +38,7 @@ public class TagServiceImpl implements TagService {
* @return Tag
*/
@Override
public Tag removeByTagId(Integer tagId) {
public Tag removeByTagId(Long tagId) {
Tag tag = findByTagId(tagId);
tagRepository.delete(tag);
return tag;
@ -72,7 +72,7 @@ public class TagServiceImpl implements TagService {
* @return Link
*/
@Override
public Tag findByTagId(Integer tagId) {
public Tag findByTagId(Long tagId) {
return tagRepository.findOne(tagId);
}

View File

@ -56,7 +56,7 @@ public class UserServiceImpl implements UserService {
* @return User
*/
@Override
public User findByUserIdAndUserPass(Integer userId, String userPass) {
public User findByUserIdAndUserPass(Long userId, String userPass) {
return userRepository.findByUserIdAndUserPass(userId,userPass);
}
}

View File

@ -2,12 +2,14 @@ package cc.ryanc.halo.util;
import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.model.dto.Theme;
import com.sun.syndication.feed.rss.Channel;
import com.sun.syndication.feed.rss.Content;
import com.sun.syndication.feed.rss.Item;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.WireFeedOutput;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ResourceUtils;
import javax.imageio.ImageIO;
@ -176,7 +178,7 @@ public class HaloUtil {
}
/**
*
*
* @param filePath filePath
* @return Map
*/
@ -203,22 +205,55 @@ public class HaloUtil {
}
/**
*
* @return
*
* @return list
*/
public static String getStringDate() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(new Date());
return dateString;
public static List<Theme> getThemes(){
List<Theme> themes = new ArrayList<>();
try {
//获取项目根路径
File basePath = new File(ResourceUtils.getURL("classpath:").getPath());
//获取主题路径
File themesPath = new File(basePath.getAbsolutePath(),"templates/themes");
File[] files = themesPath.listFiles();
if(null!=files) {
Theme theme = null;
for (File file : files) {
if (file.isDirectory()) {
theme = new Theme();
theme.setThemeName(file.getName());
File optionsPath = new File(themesPath.getAbsolutePath(), file.getName() + "/module/options.ftl");
if (optionsPath.exists()) {
theme.setHasOptions(true);
} else {
theme.setHasOptions(false);
}
themes.add(theme);
}
}
}
}catch (Exception e){
log.error("主题获取失败:"+e.getMessage());
}
return themes;
}
public static boolean removeFile(String fileName){
File file = new File(fileName);
if(!file.exists()){
return false;
}else{
return file.delete();
}
}
/**
*
* @return 使线
* @return
*/
public static String getStringDateWithLine(){
SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
String dateString = format.format(new Date());
public static String getStringDate(String format) {
SimpleDateFormat formatter = new SimpleDateFormat(format);
String dateString = formatter.format(new Date());
return dateString;
}
@ -446,4 +481,27 @@ public class HaloUtil {
}
return head+urlBody+"</urlset>";
}
// public static String importMarkdowns(String filePath) throws Exception{
// File file = new File(filePath);
// FileReader reader = new FileReader(file);
// BufferedReader bufferedReader = new BufferedReader(reader);
// StringBuffer stringBuffer = new StringBuffer();
// String s = "";
// while ((s = bufferedReader.readLine())!=null){
// stringBuffer.append(s+"\n");
// }
// bufferedReader.close();
// String str = stringBuffer.toString();
// return str;
// }
//
// public static void main(String[] args) throws Exception{
// String content = importMarkdowns("/Users/ryan0up/Desktop/hello-hexo.md");
// String matter = StringUtils.substringBetween(content,"---","---");
// String[] strs = matter.split("\n");
// for(String str:strs){
// System.out.println(StringUtils.substringBetween("title","\n","\n"));
// }
// }
}

View File

@ -1,7 +1,14 @@
package cc.ryanc.halo.web.controller;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.service.CommentService;
import cc.ryanc.halo.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import javax.servlet.http.HttpSession;
/**
@ -18,7 +25,7 @@ public abstract class BaseController {
public static String THEME = "halo";
@Autowired
private PostService postService;
private CommentService commentService;
/**
*
@ -29,7 +36,15 @@ public abstract class BaseController {
return "themes/"+THEME+"/"+pageName;
}
/**
*
* @param session session
*/
protected void getNewComments(HttpSession session){
session.setAttribute("postTopFive",postService.findPostLatest());
Sort sort = new Sort(Sort.Direction.DESC,"commentDate");
Pageable pageable = new PageRequest(0,999,sort);
Page<Comment> comments = commentService.findAllComments(1,pageable);
session.removeAttribute("newComments");
session.setAttribute("newComments",comments.getContent());
}
}

View File

@ -1,40 +1,40 @@
package cc.ryanc.halo.web.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletRequest;
/**
* @author : RYAN0UP
* @date : 2017/12/26
* @version: 1.0
* description:
*/
@Slf4j
@Controller
public class CommonController implements ErrorController{
private static final String ERROR_PATH = "/error";
@GetMapping(value = ERROR_PATH)
public String handleError(HttpServletRequest request){
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
if(statusCode==404) {
return "common/404";
}else{
return "common/500";
}
}
/**
* Returns the path of the error page.
*
* @return the error path
*/
@Override
public String getErrorPath() {
return ERROR_PATH;
}
}
package cc.ryanc.halo.web.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletRequest;
/**
* @author : RYAN0UP
* @date : 2017/12/26
* @version : 1.0
* description:
*/
@Slf4j
@Controller
public class CommonController implements ErrorController{
private static final String ERROR_PATH = "/error";
@GetMapping(value = ERROR_PATH)
public String handleError(HttpServletRequest request){
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
if(statusCode==404) {
return "common/404";
}else{
return "common/500";
}
}
/**
* Returns the path of the error page.
*
* @return the error path
*/
@Override
public String getErrorPath() {
return ERROR_PATH;
}
}

View File

@ -1,18 +1,12 @@
package cc.ryanc.halo.web.controller;
import cc.ryanc.halo.model.domain.Category;
import cc.ryanc.halo.model.domain.Link;
import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.domain.Tag;
import cc.ryanc.halo.model.domain.*;
import cc.ryanc.halo.model.dto.Archive;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.service.CategoryService;
import cc.ryanc.halo.service.LinkService;
import cc.ryanc.halo.service.PostService;
import cc.ryanc.halo.service.TagService;
import cc.ryanc.halo.service.*;
import cc.ryanc.halo.util.HaloUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.coyote.Response;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -20,11 +14,9 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.PathParam;
import java.util.Date;
import java.util.List;
@ -53,6 +45,11 @@ public class IndexController extends BaseController{
@Autowired
private TagService tagService;
@Autowired
private CommentService commentService;
@Autowired
private MailService mailService;
/**
*
@ -79,10 +76,9 @@ public class IndexController extends BaseController{
//默认显示10条
Integer size = 10;
//尝试加载设置选项,用于设置显示条数
if(HaloUtil.isNotNull(HaloConst.OPTIONS.get("index_posts"))){
if(!StringUtils.isBlank(HaloConst.OPTIONS.get("index_posts"))){
size = Integer.parseInt(HaloConst.OPTIONS.get("index_posts"));
}
//所有文章数据,分页
Pageable pageable = new PageRequest(page-1,size,sort);
Page<Post> posts = postService.findPostByStatus(0,pageable);
@ -98,7 +94,7 @@ public class IndexController extends BaseController{
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
//归档数据,包含[year,month,List<Post>]
//归档数据,包含[year,month,count,List<Post>]
List<Archive> archives = postService.findPostGroupByPostDate();
model.addAttribute("archives",archives);
return this.render("index");
@ -116,7 +112,7 @@ public class IndexController extends BaseController{
//默认显示10条
Integer size = 10;
//尝试加载设置选项,用于设置显示条数
if(HaloUtil.isNotNull(HaloConst.OPTIONS.get("index_posts"))){
if(!StringUtils.isBlank(HaloConst.OPTIONS.get("index_posts"))){
size = Integer.parseInt(HaloConst.OPTIONS.get("index_posts"));
}
@ -164,6 +160,17 @@ public class IndexController extends BaseController{
//所有分类目录
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
//归档数据,包含[year,month,count,List<Post>]
List<Archive> archives = postService.findPostGroupByPostDate();
//该文章的评论
Sort sort = new Sort(Sort.Direction.DESC,"commentDate");
Pageable pageable = new PageRequest(0,10,sort);
Page<Comment> comments = commentService.findCommentsByPostAndCommentStatus(post,pageable,0);
model.addAttribute("comments",comments);
model.addAttribute("archives",archives);
return this.render("post");
}
@ -206,9 +213,15 @@ public class IndexController extends BaseController{
//系统设置
model.addAttribute("options",HaloConst.OPTIONS);
model.addAttribute("user",HaloConst.USER);
//所有分类目录
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
//归档数据,包含[year,month,count,List<Post>]
List<Archive> archives = postService.findPostGroupByPostDate();
model.addAttribute("archives",archives);
return this.render("links");
}
@ -227,6 +240,12 @@ public class IndexController extends BaseController{
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
model.addAttribute("user",HaloConst.USER);
//归档数据,包含[year,month,count,List<Post>]
List<Archive> archives = postService.findPostGroupByPostDate();
model.addAttribute("archives",archives);
//系统设置
model.addAttribute("options",HaloConst.OPTIONS);
return this.render("tags");
@ -318,6 +337,10 @@ public class IndexController extends BaseController{
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories",categories);
//归档数据,包含[year,month,count,List<Post>]
List<Archive> archives = postService.findPostGroupByPostDate();
model.addAttribute("archives",archives);
//是否是归档页,用于判断输出链接
model.addAttribute("isArchives","true");
return this.render("archives");
@ -331,7 +354,7 @@ public class IndexController extends BaseController{
@ResponseBody
public String feed(){
String rssPosts = HaloConst.OPTIONS.get("rss_posts");
if(null==rssPosts || "".equals(rssPosts)){
if(StringUtils.isBlank(rssPosts)){
rssPosts = "20";
}
//获取文章列表并根据时间排序
@ -362,4 +385,22 @@ public class IndexController extends BaseController{
List<Post> posts = postsPage.getContent();
return HaloUtil.getSiteMap(posts);
}
/**
*
* @param comment comment
* @return string
*/
@PostMapping(value = "/newComment")
@ResponseBody
public String newComment(@ModelAttribute("comment") Comment comment,
@ModelAttribute("post") Post post,
HttpServletRequest request){
comment.setPost(post);
comment.setCommentDate(new Date());
comment.setCommentAuthorIp(HaloUtil.getIpAddr(request));
commentService.saveByComment(comment);
return "success";
}
}

View File

@ -1,11 +1,13 @@
package cc.ryanc.halo.web.controller.admin;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.model.domain.Logs;
import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.domain.User;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.model.dto.LogsRecord;
import cc.ryanc.halo.model.dto.RespStatus;
import cc.ryanc.halo.service.CommentService;
import cc.ryanc.halo.service.LogsService;
import cc.ryanc.halo.service.PostService;
import cc.ryanc.halo.service.UserService;
@ -49,6 +51,9 @@ public class AdminController extends BaseController{
@Autowired
private HttpServletRequest request;
@Autowired
private CommentService commentService;
/**
*
* @return freemarker
@ -58,13 +63,21 @@ public class AdminController extends BaseController{
//查询文章条数
Integer postCount = postService.findAllPosts().size();
model.addAttribute("postCount",postCount);
//查询评论的条数
Integer commentCount = commentService.findAllComments().size();
model.addAttribute("commentCount",commentCount);
//查询最新的文章
List<Post> postsLatest = postService.findPostLatest();
model.addAttribute("postTopFive",postsLatest);
model.addAttribute("options", HaloConst.OPTIONS);
model.addAttribute("mediaCount",HaloConst.ATTACHMENTS.size());
//查询最新的日志
List<Logs> logsLatest = logsService.findLogsLatest();
model.addAttribute("logs",logsLatest);
//查询最新的评论
List<Comment> comments = commentService.findCommentsLatest();
model.addAttribute("comments",comments);
model.addAttribute("options", HaloConst.OPTIONS);
model.addAttribute("mediaCount",HaloConst.ATTACHMENTS.size());
this.getNewComments(session);
return "admin/index";
}
@ -147,6 +160,10 @@ public class AdminController extends BaseController{
return "admin/widget/_logs-all";
}
/**
*
* @return return
*/
@GetMapping(value = "/logs/clear")
public String logsClear(){
try {
@ -156,4 +173,15 @@ public class AdminController extends BaseController{
}
return "redirect:/admin";
}
/**
*
* @param model model
* @return string
*/
@GetMapping(value = "/halo")
public String halo(Model model){
model.addAttribute("options",HaloConst.OPTIONS);
return "admin/halo";
}
}

View File

@ -24,7 +24,7 @@ import java.io.File;
* @author : RYAN0UP
* @date : 2017/12/19
* @version : 1.0
* description:
* description:
*/
@Slf4j
@Controller
@ -87,9 +87,9 @@ public class AttachmentController {
*
* @param file file
*/
@RequestMapping(value = "/upload",method = RequestMethod.POST)
@PostMapping(value = "/upload",produces = { "application/json;charset=UTF-8" })
@ResponseBody
public String uploadAttachment(@RequestParam("file") MultipartFile file){
public boolean uploadAttachment(@RequestParam("file") MultipartFile file){
if(!file.isEmpty()){
try{
File basePath = new File(ResourceUtils.getURL("classpath:").getPath());
@ -117,15 +117,14 @@ public class AttachmentController {
updateConst();
log.info("上传文件["+file.getOriginalFilename()+"]到["+mediaPath.getAbsolutePath()+"]成功");
return RespStatus.SUCCESS;
return true;
}catch (Exception e){
log.error("未知错误:"+e.getMessage());
return RespStatus.ERROR;
}
}else {
log.error("文件不能为空");
return RespStatus.ERROR;
}
return false;
}
/**
@ -134,7 +133,7 @@ public class AttachmentController {
* @return string
*/
@GetMapping(value = "/attachment")
public String attachmentDetail(Model model,@PathParam("attachId") Integer attachId){
public String attachmentDetail(Model model,@PathParam("attachId") Long attachId){
Attachment attachment = attachmentService.findByAttachId(attachId);
model.addAttribute("attachment",attachment);
return "admin/widget/_attachment-detail";
@ -147,7 +146,7 @@ public class AttachmentController {
*/
@GetMapping(value = "/remove")
@ResponseBody
public String removeAttachment(@PathParam("attachId") Integer attachId){
public String removeAttachment(@PathParam("attachId") Long attachId){
Attachment attachment = attachmentService.findByAttachId(attachId);
String delFileName = attachment.getAttachName();
String delSmallFileName = delFileName.substring(0,delFileName.lastIndexOf('.'))+"_small"+attachment.getAttachSuffix();

View File

@ -17,9 +17,9 @@ import java.util.List;
/**
* @author : RYAN0UP
* @version : 1.0
* description :
* @date : 2018/1/21
* @version : 1.0
* description :
*/
@Slf4j
@Controller
@ -47,7 +47,7 @@ public class BackupController {
*/
@GetMapping(value = "/backupDb")
public String backupDatabase(){
String fileName = "db_backup_"+HaloUtil.getStringDateWithLine()+".sql";
String fileName = "db_backup_"+HaloUtil.getStringDate("yyyy_MM_dd_HH_mm_ss")+".sql";
try {
File path = new File(ResourceUtils.getURL("classpath:").getPath());
String savePath = path.getAbsolutePath()+"/backup/database";
@ -76,7 +76,7 @@ public class BackupController {
List<Post> posts = postService.findAllPosts();
try {
File path = new File(ResourceUtils.getURL("classpath:").getPath());
String savePath = path.getAbsolutePath()+"/backup/posts/posts_backup_"+HaloUtil.getStringDateWithLine();
String savePath = path.getAbsolutePath()+"/backup/posts/posts_backup_"+HaloUtil.getStringDate("yyyy_MM_dd_HH_mm_ss");
for(Post post : posts){
HaloUtil.dbToFile(post.getPostContentMd(),savePath,post.getPostTitle()+".md");
}

View File

@ -78,7 +78,7 @@ public class CategoryController {
* @return freemarker
*/
@GetMapping(value = "/remove")
public String removeCategory(@PathParam("cateId") Integer cateId){
public String removeCategory(@PathParam("cateId") Long cateId){
try{
Category category = categoryService.removeByCateId(cateId);
log.info("删除的分类目录:"+category);
@ -112,7 +112,7 @@ public class CategoryController {
* @return String
*/
@GetMapping(value = "/edit")
public String toEditCategory(Model model,@PathParam("cateId") Integer cateId){
public String toEditCategory(Model model,@PathParam("cateId") Long cateId){
try{
Category category = categoryService.findByCateId(cateId);
model.addAttribute("category",category);

View File

@ -1,11 +1,26 @@
package cc.ryanc.halo.web.controller.admin;
import cc.ryanc.halo.model.domain.Comment;
import cc.ryanc.halo.model.dto.HaloConst;
import cc.ryanc.halo.service.CommentService;
import cc.ryanc.halo.service.MailService;
import cc.ryanc.halo.service.PostService;
import cc.ryanc.halo.util.HaloUtil;
import cc.ryanc.halo.web.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpSession;
/**
* @author : RYAN0UP
@ -13,12 +28,78 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @version : 1.0
* description :
*/
@Slf4j
@Controller
@RequestMapping(value = "/admin/comment")
@RequestMapping(value = "/admin/comments")
public class CommentController extends BaseController{
@Autowired
private CommentService commentService;
@Autowired
private MailService mailService;
/**
*
* @param model model
* @param status status
* @param page page
* @param size size
* @return string
*/
@GetMapping
public String comments(Model model){
public String comments(Model model,
@RequestParam(value = "status",defaultValue = "0") Integer status,
@RequestParam(value = "page",defaultValue = "0") Integer page,
@RequestParam(value = "size",defaultValue = "10") Integer size){
Sort sort = new Sort(Sort.Direction.DESC,"commentDate");
Pageable pageable = new PageRequest(page,size,sort);
Page<Comment> comments = commentService.findAllComments(status,pageable);
model.addAttribute("comments",comments);
model.addAttribute("publicCount",commentService.findAllComments(0,pageable).getTotalElements());
model.addAttribute("checkCount",commentService.findAllComments(1,pageable).getTotalElements());
model.addAttribute("trashCount",commentService.findAllComments(2,pageable).getTotalElements());
model.addAttribute("status",status);
model.addAttribute("options", HaloConst.OPTIONS);
return "admin/comment";
}
/**
*
* @param commentId commentId
* @return string
*/
@GetMapping(value = "/throw")
public String moveToTrash(@RequestParam("commentId") Long commentId,
HttpSession session){
try {
commentService.updateCommentStatus(commentId,2);
this.getNewComments(session);
}catch (Exception e){
log.error("未知错误:"+e.getMessage());
}
return "redirect:/admin/comments";
}
/**
*
* @param commentId commentId
* @param status status
* @return
*/
@GetMapping("/revert")
public String moveToPublish(@RequestParam("commentId") Long commentId,
@RequestParam("status") Integer status,
HttpSession session){
try{
Comment comment = commentService.updateCommentStatus(commentId,0);
if(status==1){
mailService.sendMail(comment.getCommentAuthorEmail(),"你在"+ HaloConst.OPTIONS.get("site_title")+"的评论已通过审核","你在"+comment.getPost().getPostTitle()+"的评论已经通过审核!");
}
this.getNewComments(session);
}catch (Exception e){
log.error("未知错误:"+e.getMessage());
}
return "redirect:/admin/comments?status="+status;
}
}

View File

@ -31,7 +31,6 @@ public class OptionController {
@GetMapping
public String options(Model model){
model.addAttribute("options", HaloConst.OPTIONS);
log.info("所有的设置选项:"+HaloConst.OPTIONS);
return "admin/option";
}

View File

@ -19,7 +19,7 @@ import java.util.List;
* @author : RYAN0UP
* @date : 2017/12/10
* @version : 1.0
* description :
* description :
*/
@Slf4j
@Controller
@ -58,7 +58,7 @@ public class PageController {
* @return String
*/
@GetMapping(value = "/links/remove")
public String removeLink(@PathParam("linkId") Integer linkId){
public String removeLink(@PathParam("linkId") Long linkId){
try{
Link link = linkService.removeByLinkId(linkId);
log.info("删除的友情链接:"+link);
@ -105,7 +105,7 @@ public class PageController {
* @return String
*/
@GetMapping("/links/edit")
public String toEditLink(Model model,@PathParam("linkId") Integer linkId){
public String toEditLink(Model model,@PathParam("linkId") Long linkId){
Link link = linkService.findByLinkId(linkId);
model.addAttribute("link",link);
model.addAttribute("options", HaloConst.OPTIONS);

View File

@ -69,12 +69,9 @@ public class PostController extends BaseController{
Pageable pageable = new PageRequest(page,size,sort);
Page<Post> posts = postService.findPostByStatus(status,pageable);
model.addAttribute("posts",posts);
List<Post> postsPublish = postService.findPostByStatus(0);
model.addAttribute("publishCount",postsPublish.size());
List<Post> postsDraft = postService.findPostByStatus(1);
model.addAttribute("draftCount",postsDraft.size());
List<Post> postsTrash = postService.findPostByStatus(2);
model.addAttribute("trashCount",postsTrash.size());
model.addAttribute("publishCount",postService.findPostByStatus(0,pageable).getTotalElements());
model.addAttribute("draftCount",postService.findPostByStatus(1,pageable).getTotalElements());
model.addAttribute("trashCount",postService.findPostByStatus(2,pageable).getTotalElements());
model.addAttribute("options", HaloConst.OPTIONS);
model.addAttribute("status",status);
}catch (Exception e){
@ -115,7 +112,7 @@ public class PostController extends BaseController{
* @return freemarker
*/
@GetMapping(value = "/view")
public String viewPost(@PathParam("postId") Integer postId,Model model){
public String viewPost(@PathParam("postId") Long postId,Model model){
Post post = postService.findByPostId(postId);
model.addAttribute("post",post);
model.addAttribute("options", HaloConst.OPTIONS);
@ -179,7 +176,7 @@ public class PostController extends BaseController{
* @return String
*/
@GetMapping("/throw")
public String moveToTrash(@RequestParam("postId") Integer postId){
public String moveToTrash(@RequestParam("postId") Long postId){
try{
postService.updatePostStatus(postId,2);
log.info("编号为"+postId+"的文章已被移到回收站");
@ -195,7 +192,7 @@ public class PostController extends BaseController{
* @return String
*/
@GetMapping("/revert")
public String moveToPublish(@RequestParam("postId") Integer postId,
public String moveToPublish(@RequestParam("postId") Long postId,
@RequestParam("status") Integer status){
try{
postService.updatePostStatus(postId,0);
@ -212,7 +209,7 @@ public class PostController extends BaseController{
* @return
*/
@GetMapping(value = "/remove")
public String removePost(@PathParam("postId") Integer postId){
public String removePost(@PathParam("postId") Long postId){
try{
Post post = postService.findByPostId(postId);
postService.removeByPostId(postId);
@ -231,7 +228,7 @@ public class PostController extends BaseController{
* @return String
*/
@GetMapping(value = "/edit")
public String editPost(@PathParam("postId") Integer postId, Model model){
public String editPost(@PathParam("postId") Long postId, Model model){
try {
Post post = postService.findByPostId(postId);
model.addAttribute("post",post);

View File

@ -17,7 +17,7 @@ import java.util.List;
* @author : RYAN0UP
* @date : 2017/12/10
* @version : 1.0
* description:
* description:
*/
@Slf4j
@Controller
@ -78,7 +78,7 @@ public class TagController {
* @return string
*/
@GetMapping(value = "/remove")
public String removeTag(@PathParam("tagId") Integer tagId){
public String removeTag(@PathParam("tagId") Long tagId){
try{
Tag tag = tagService.removeByTagId(tagId);
log.info("删除的标签:"+tag);
@ -95,7 +95,7 @@ public class TagController {
* @return string
*/
@GetMapping(value = "/edit")
public String toEditTag(Model model,@PathParam("tagId") Integer tagId){
public String toEditTag(Model model,@PathParam("tagId") Long tagId){
try{
Tag tag = tagService.findByTagId(tagId);
model.addAttribute("tag",tag);

View File

@ -19,7 +19,7 @@ import java.io.File;
* @author : RYAN0UP
* @date : 2017/12/16
* @version : 1.0
* description:
* description:
*/
@Slf4j
@Controller
@ -28,19 +28,18 @@ public class ThemeController extends BaseController{
@Autowired
private OptionsService optionsService;
/**
*
* @return String
*/
@GetMapping
public String themes(Model model){
try {
model.addAttribute("theme",BaseController.THEME);
model.addAttribute("options", HaloConst.OPTIONS);
log.info("当前的主题为:"+BaseController.THEME);
}catch (Exception e){
log.error("未知错误:"+e.getMessage());
model.addAttribute("activeTheme",BaseController.THEME);
if(null!=HaloConst.THEMES){
model.addAttribute("themes",HaloConst.THEMES);
}
model.addAttribute("options", HaloConst.OPTIONS);
return "admin/theme";
}
@ -72,7 +71,7 @@ public class ThemeController extends BaseController{
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@ResponseBody
public void uploadTheme(@RequestParam("file") MultipartFile file){
public boolean uploadTheme(@RequestParam("file") MultipartFile file){
try {
if(!file.isEmpty()) {
//获取项目根路径
@ -81,12 +80,18 @@ public class ThemeController extends BaseController{
file.transferTo(themePath);
log.info("上传主题成功,路径:" + themePath.getAbsolutePath());
HaloUtil.unZip(themePath.getAbsolutePath(),new File(basePath.getAbsolutePath(),"templates/themes/").getAbsolutePath());
HaloUtil.removeFile(themePath.getAbsolutePath());
System.out.println(themePath);
HaloConst.THEMES.clear();
HaloConst.THEMES = HaloUtil.getThemes();
return true;
}else{
log.error("上传失败,没有选择文件");
}
}catch (Exception e){
log.error("上传失败:"+e.getMessage());
}
return false;
}
/**
@ -96,6 +101,7 @@ public class ThemeController extends BaseController{
@GetMapping(value = "/options")
public String setting(Model model,@RequestParam("theme") String theme){
model.addAttribute("options",HaloConst.OPTIONS);
model.addAttribute("themeDir",theme);
return "themes/"+theme+"/module/options";
}
}

View File

@ -17,7 +17,7 @@ import javax.servlet.http.HttpSession;
* @author : RYAN0UP
* @date : 2017/12/24
* @version : 1.0
* description:
* description:
*/
@Slf4j
@Controller
@ -72,7 +72,7 @@ public class UserController {
@ResponseBody
public String changePass(@ModelAttribute("beforePass") String beforePass,
@ModelAttribute("newPass") String newPass,
@ModelAttribute("userId") Integer userId,
@ModelAttribute("userId") Long userId,
HttpSession session){
try {
User user = userService.findByUserIdAndUserPass(userId,HaloUtil.getMD5(beforePass));

View File

@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse;
* @author : RYAN0UP
* @date : 2017/12/13
* @version : 1.0
* description:
* description:
*/
@Component
public class LoginInterceptor implements HandlerInterceptor{

View File

@ -33,7 +33,18 @@ spring:
http:
multipart:
max-file-size: 10Mb
max-request-size: 20Mb
max-request-size:
mail:
host: smtp.exmail.qq.com
username: i@ryanc.cc
password: Wangdashen666
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
# TODO config this ehcache
cache:
ehcache:
@ -43,3 +54,4 @@ logging:
file: ./logs/log.log

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -73,7 +73,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -81,7 +81,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -41,8 +41,8 @@
<span>
永久链接:
<a href="#">https://ryanc.cc/archives/<span id="postUrl"></span>/</a>
<button class="btn btn-default btn-sm" id="btn_input_postUrl">编辑</button>
<button class="btn btn-default btn-sm" id="btn_change_postUrl" onclick="UrlOnBlurAuto()" style="display: none;">确定</button>
<button class="btn btn-default btn-sm btn-flat" id="btn_input_postUrl">编辑</button>
<button class="btn btn-default btn-sm btn-flat" id="btn_change_postUrl" onclick="UrlOnBlurAuto()" style="display: none;">确定</button>
</span>
</div>
<div class="box box-primary">
@ -69,8 +69,8 @@
</div>
</div>
<div class="box-footer">
<button onclick="push(1)" class="btn btn-default btn-sm">保存草稿</button>
<button onclick="push(0)" class="btn btn-primary btn-sm pull-right" data-loading-text="发布中...">${btnPush}</button>
<button onclick="push(1)" class="btn btn-default btn-sm btn-flat">保存草稿</button>
<button onclick="push(0)" class="btn btn-primary btn-sm pull-right btn-flat" data-loading-text="发布中...">${btnPush}</button>
</div>
</div>
<div class="box box-primary">
@ -121,7 +121,7 @@
<div class="box-body">
<div>
<img class="img-responsive selectData">
<button class="btn btn-primary btn-sm" onclick="openAttach()">选择</button>
<button class="btn btn-primary btn-sm btn-flat" onclick="openAttach()">选择</button>
</div>
</div>
</div>
@ -257,6 +257,5 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>

View File

@ -130,7 +130,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -68,7 +68,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -9,6 +9,7 @@
<#include "module/_sidebar.ftl">
<div class="content-wrapper">
<link rel="stylesheet" href="/static/plugins/fileinput/fileinput.min.css">
<link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css">
<style type="text/css" rel="stylesheet">
#showForm{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out}
#showForm:hover{background:#3c8dbc;color:#fff}
@ -81,6 +82,27 @@
maxFileCount: 100,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data==true){
$("#uploadForm").hide(400);
$.toast({
text: "上传成功!",
heading: '提示',
icon: 'success',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff',
afterHidden: function () {
window.location.reload();
}
});
}
});
});
});
@ -99,7 +121,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -21,6 +21,5 @@
</section>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>

View File

@ -47,7 +47,7 @@
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary">确定添加</button>
<button type="submit" class="btn btn-primary btn-flat">确定添加</button>
</div>
</form>
</div>
@ -76,8 +76,8 @@
<td>${(cate.cateDesc)!}</td>
<td>2</td>
<td>
<a href="/admin/category/edit?cateId=${cate.cateId}" class="btn btn-primary btn-xs">修改</a>
<button class="btn btn-danger btn-xs" onclick="modelShow('/admin/category/remove?cateId=${cate.cateId}')">删除</button>
<a href="/admin/category/edit?cateId=${cate.cateId}" class="btn btn-primary btn-xs btn-flat">修改</a>
<button class="btn btn-danger btn-xs btn-flat" onclick="modelShow('/admin/category/remove?cateId=${cate.cateId}')">删除</button>
</td>
</tr>
</#list>
@ -101,8 +101,8 @@
</div>
<div class="modal-footer">
<input type="hidden" id="url"/>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<a onclick="removeIt()" class="btn btn-danger" data-dismiss="modal">确定</a>
<button type="button" class="btn btn-default btn-flat" data-dismiss="modal">取消</button>
<a onclick="removeIt()" class="btn btn-danger btn-flat" data-dismiss="modal">确定</a>
</div>
</div>
</div>
@ -145,7 +145,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -1,11 +1,14 @@
<#include "module/_macro.ftl">
<@head title="Halo后台管理"></@head>
<@head title="Halo后台管理-评论管理"></@head>
<div class="wrapper">
<!-- 顶部栏模块 -->
<#include "module/_header.ftl">
<!-- 菜单栏模块 -->
<#include "module/_sidebar.ftl">
<div class="content-wrapper">
<style type="text/css" rel="stylesheet">
.draft,.publish,.trash{list-style:none;float:left;margin:0;padding-bottom:10px}s
</style>
<section class="content-header">
<h1>评论<small></small></h1>
<ol class="breadcrumb">
@ -16,10 +19,107 @@
</ol>
</section>
<section class="content container-fluid">
<ul style="list-style: none;padding-left: 0">
<li class="publish">
<a href="/admin/comments">已发布<span class="count">(${publicCount?default("0")})</span></a>&nbsp;|&nbsp;
</li>
<li class="draft">
<a href="/admin/comments?status=1">待审核<span class="count">(${checkCount?default("0")})</span></a>&nbsp;|&nbsp;
</li>
<li class="trash">
<a href="/admin/comments?status=2">回收站<span class="count">(${trashCount?default("0")})</span></a>
</li>
</ul>
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>评论者</th>
<th>评论内容</th>
<th>评论页面</th>
<th>日期</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<#list comments.content as comment>
<tr>
<td>${comment.commentAuthor}</td>
<td>${comment.commentContent}</td>
<td>
<a target="_blank" href="/article/${comment.post.postUrl}">${comment.post.postTitle}</a>
</td>
<td>${comment.commentDate}</td>
<td>
<#switch comment.commentStatus>
<#case 0>
<button class="btn btn-info btn-sm btn-flat" onclick="modelShow('/admin/comments/throw?commentId=${comment.commentId}','确定移动到回收站?')">回复</button>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/comments/throw?commentId=${comment.commentId}','确定移动到回收站?')">丢弃</button>
<#break >
<#case 1>
<a class="btn btn-info btn-sm btn-flat" href="/admin/comments/revert?commentId=${comment.commentId}&status=1">通过</a>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/comments/throw?commentId=${comment.commentId}','确定移动到回收站?')">删除</button>
<#break >
<#case 2>
<a class="btn btn-info btn-sm btn-flat" href="/admin/comments/revert?commentId=${comment.commentId}&status=2">还原</a>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/comments/throw?commentId=${comment.commentId}','确定移动到回收站?')">删除</button>
<#break >
</#switch>
</td>
</tr>
</#list>
</tbody>
</table>
</div>
<div class="box-footer clearfix">
<div class="no-margin pull-left">
第${comments.number+1}/${comments.totalPages}页
</div>
<ul class="pagination no-margin pull-right">
<li><a class="btn btn-sm <#if !comments.hasPrevious()>disabled</#if>" href="/admin/comments?status=${status}">首页</a> </li>
<li><a class="btn btn-sm <#if !comments.hasPrevious()>disabled</#if>" href="/admin/comments?status=${status}&page=${comments.number-1}">上页</a></li>
<li><a class="btn btn-sm <#if !comments.hasNext()>disabled</#if>" href="/admin/comments?status=${status}&page=${comments.number+1}">下页</a></li>
<li><a class="btn btn-sm <#if !comments.hasNext()>disabled</#if>" href="/admin/comments?status=${status}&page=${comments.totalPages-1}">尾页</a> </li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- 删除确认弹出层 -->
<div class="modal fade" id="removePostModal">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">提示信息</h4>
</div>
<div class="modal-body">
<p id="message"></p>
</div>
<div class="modal-footer">
<input type="hidden" id="url"/>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<a onclick="removeIt()" class="btn btn-danger" data-dismiss="modal">确定</a>
</div>
</div>
</div>
</div>
<script>
function modelShow(url,message) {
$('#url').val(url);
$('#message').html(message);
$('#removePostModal').modal();
}
function removeIt(){
var url=$.trim($("#url").val());
window.location.href=url;
}
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>

View File

@ -0,0 +1,26 @@
<#include "module/_macro.ftl">
<@head title="Halo后台管理-关于Halo"></@head>
<div class="wrapper">
<!-- 顶部栏模块 -->
<#include "module/_header.ftl">
<!-- 菜单栏模块 -->
<#include "module/_sidebar.ftl">
<div class="content-wrapper">
<section class="content-header">
<h1 style="display: inline-block;">关于Halo</h1>
<ol class="breadcrumb">
<li>
<a href="/admin"><i class="fa fa-dashboard"></i> 首页</a>
</li>
<li class="active">关于Halo</li>
</ol>
</section>
<section class="content container-fluid">
<p>
非常感谢你使用Halo进行创作。
</p>
</section>
</div>
<#include "module/_footer.ftl">
</div>
<@footer></@footer>

View File

@ -41,10 +41,10 @@
<label for="widgetPostCount" class="col-sm-4 control-label">文章总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_postcount" id="widgetPostCount" value="true" ${((options.widget_postcount?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_postcount" id="widgetPostCount" value="true" ${((options.widget_postcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_postcount" id="widgetPostCount" value="false" ${((options.widget_postcount?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_postcount" id="widgetPostCount" value="false" ${((options.widget_postcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -52,10 +52,10 @@
<label for="widgetCommentCount" class="col-sm-4 control-label">评论总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="true" ${((options.widget_commentcount?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="true" ${((options.widget_commentcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="false" ${((options.widget_commentcount?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="false" ${((options.widget_commentcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -63,10 +63,10 @@
<label for="widgetAttachmentCount" class="col-sm-4 control-label">附件总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="true" ${((options.widget_attachmentcount?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="true" ${((options.widget_attachmentcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="false" ${((options.widget_attachmentcount?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="false" ${((options.widget_attachmentcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -74,10 +74,10 @@
<label for="widgetVisitorCount" class="col-sm-4 control-label">访客总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_visitorcount" id="widgetVisitorCount" value="true" ${((options.widget_visitorcount?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_visitorcount" id="widgetVisitorCount" value="true" ${((options.widget_visitorcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_visitorcount" id="widgetVisitorCount" value="false" ${((options.widget_visitorcount?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_visitorcount" id="widgetVisitorCount" value="false" ${((options.widget_visitorcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -87,10 +87,10 @@
<label for="widgetPostLastest" class="col-sm-4 control-label">最新文章:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_postlastest" id="widgetPostLastest" value="true" ${((options.widget_postlastest?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_postlastest" id="widgetPostLastest" value="true" ${((options.widget_postlastest?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_postlastest" id="widgetPostLastest" value="false" ${((options.widget_postlastest?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_postlastest" id="widgetPostLastest" value="false" ${((options.widget_postlastest?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -98,10 +98,10 @@
<label for="widgetCommentLastest" class="col-sm-4 control-label">最新评论:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_commentlastest" id="widgetCommentLastest" value="true" ${((options.widget_commentlastest?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_commentlastest" id="widgetCommentLastest" value="true" ${((options.widget_commentlastest?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_commentlastest" id="widgetCommentLastest" value="false" ${((options.widget_commentlastest?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_commentlastest" id="widgetCommentLastest" value="false" ${((options.widget_commentlastest?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -109,10 +109,10 @@
<label for="widgetLogsLastest" class="col-sm-4 control-label">最新日志:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_logslastest" id="widgetLogsLastest" value="true" ${((options.widget_logslastest?if_exists)=='true')?string('checked','')}> 显示
<input type="radio" name="widget_logslastest" id="widgetLogsLastest" value="true" ${((options.widget_logslastest?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_logslastest" id="widgetLogsLastest" value="false" ${((options.widget_logslastest?if_exists)=='false')?string('checked','')}> 隐藏
<input type="radio" name="widget_logslastest" id="widgetLogsLastest" value="false" ${((options.widget_logslastest?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
@ -138,9 +138,9 @@
<div class="col-lg-3 col-xs-6" id="widgetCommentCountBody">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner"><h3>53</h3><p>评论</p></div>
<div class="inner"><h3>${commentCount?default(0)}</h3><p>评论</p></div>
<div class="icon"><i class="ion ion-stats-bars"></i></div>
<a href="#" class="small-box-footer">查看所有 <i class="fa fa-arrow-circle-right"></i></a>
<a href="/admin/comments" class="small-box-footer">查看所有 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</#if>
@ -182,13 +182,20 @@
</div>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover text-center">
<thead>
<tr>
<th>标题</th>
<th>状态</th>
<th>日期</th>
</tr>
</thead>
<tbody>
<#if postTopFive??>
<tr>
<#list postTopFive as post>
<tr>
<td><a target="_blank" href="/admin/posts/view?postId=${post.postId}">${post.postTitle}</a></td>
<td><a target="_blank" href="/article/${post.postUrl}">${post.postTitle}</a></td>
<td class="text-center">
<#if post.postStatus==0>
<span class="label bg-green">已发布</span>
@ -223,9 +230,46 @@
</div>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover text-center">
<thead>
<th>评论者</th>
<th>评论页面</th>
<th>内容</th>
<th>状态</th>
<th>时间</th>
</thead>
<tbody>
<tr><th>暂无数据</th></tr>
<#if comments??>
<tr>
<#list comments as comment>
<tr>
<td>${comment.commentAuthor}</td>
<td>
<a href="/article/${comment.post.getPostUrl()}">${comment.post.postTitle}</a>
</td>
<td>
<a href="/admin/comments">${comment.commentContent}</a>
</td>
<td>
<#switch comment.commentStatus>
<#case 0>
<span class="label bg-green">已发布</span>
<#break >
<#case 1>
<span class="label bg-yellow">待审核</span>
<#break >
<#case 2>
<span class="label bg-red">回收站</span>
<#break >
</#switch>
</td>
<td>${comment.commentDate}</td>
</tr>
</#list>
</tr>
<#else>
<tr><td>暂无数据</td></tr>
</#if>
</tbody>
</table>
</div>
@ -245,11 +289,14 @@
<li><a href="#" onclick="openAllLogs()">查看所有</a></li>
<li><a href="/admin/logs/clear">清空日志</a></li>
</ul>
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<table class="table table-bordered table-hover text-center">
<thead>
<th>事件</th>
<th>结果</th>
@ -325,6 +372,5 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>

View File

@ -115,7 +115,6 @@
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -71,7 +71,7 @@
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 5,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
@ -88,7 +88,7 @@
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 2000,
stack: 5,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,

View File

@ -1,4 +1,4 @@
<footer class="main-footer">
<div class="pull-right hidden-xs"><a target="_blank" href="https://ryanc.cc">1.0 Beta</a></div>
Thanks for using <strong><a href="https://ryanc.cc">Halo</a>.</strong>
Thanks for using <strong><a href="/admin/halo">Halo</a>.</strong>
</footer>

View File

@ -13,37 +13,39 @@
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success">4</span>
<#if newComments?size gt 0>
<span class="label label-success">${newComments?size}</span>
</#if>
</a>
<ul class="dropdown-menu">
<li class="header">你有4条新评论</li>
<li class="header">你有${newComments?size}条新评论</li>
<li>
<ul class="menu">
<#list postTopFive! as post>
<#list newComments! as comment>
<li>
<a href="#">
<a href="/admin/comments?status=1">
<div class="pull-left">
<img src="/static/images/ryan0up.png" class="img-circle" alt="User Image">
</div>
<h4>Support Team<small><i class="fa fa-clock-o"></i> 5 mins</small></h4>
<p>${post.postTitle!}</p>
<h4>${comment.commentAuthor}<small>${comment.commentDate}</small></h4>
<p>${comment.commentContent}</p>
</a>
</li>
</#list>
</ul>
</li>
<li class="footer"><a href="#">查看所有评论</a></li>
<li class="footer"><a href="/admin/comments">查看所有评论</a></li>
</ul>
</li>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="<#if user.userAvatar!="">${user.userAvatar?if_exists}<#else >/static/images/default.png</#if>" class="user-image" alt="User Image">
<img src="<#if user.userAvatar?if_exists!="">${user.userAvatar}<#else >/static/images/default.png</#if>" class="user-image" alt="User Image">
<span class="hidden-xs">${user.userDisplayName?if_exists}</span>
</a>
<ul class="dropdown-menu">
<li class="user-header">
<img src="<#if user.userAvatar!="">${user.userAvatar?if_exists}<#else >/static/images/default.png</#if>" class="img-circle" alt="User Image">
<p>${user.userDisplayName?if_exists}-${user.userDesc?if_exists}<small></small></p>
<img src="<#if user.userAvatar?if_exists!="">${user.userAvatar}<#else >/static/images/default.png</#if>" class="img-circle" alt="User Image">
<p>${user.userDisplayName?if_exists}</p>
</li>
<li class="user-footer">
<div class="pull-left"><a href="/admin/profile" class="btn btn-default btn-flat">个人资料</a></div>
@ -51,10 +53,6 @@
</li>
</ul>
</li>
<!-- 工具栏 TODO: 暂时先不做 -->
<!--
<li><a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a></li>
-->
</ul>
</div>
</nav>

View File

@ -2,7 +2,7 @@
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="<#if user.userAvatar!="">${user.userAvatar?if_exists}<#else >/static/images/default.png</#if>" class="img-circle" alt="User Image">
<img src="<#if user.userAvatar?if_exists!="">${user.userAvatar?if_exists}<#else >/static/images/default.png</#if>" class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p>${user.userDisplayName?if_exists}</p><a href="/admin/profile"><i class="fa fa-circle text-success"></i>编辑</a>
@ -59,11 +59,13 @@
</a>
</li>
<li>
<a href="/admin/comment">
<a href="/admin/comments">
<i class="fa fa-comment"></i>
<span>评论</span>
<span class="pull-right-container">
<span class="label label-primary pull-right">4</span>
<#if newComments?size gt 0>
<span class="label label-primary pull-right">${newComments?size}</span>
</#if>
</span>
</a>
</li>

View File

@ -50,6 +50,9 @@
<li>
<a href="#admin" data-toggle="tab">后台设置</a>
</li>
<li>
<a href="#email" data-toggle="tab">邮箱设置</a>
</li>
<li>
<a href="#other" data-toggle="tab">其他设置</a>
</li>
@ -81,7 +84,7 @@
<div class="input-group">
<input type="text" class="form-control selectData" id="siteLogo" name="site_logo" value="${options.site_logo?if_exists}">
<span class="input-group-btn">
<button class="btn btn-default" type="button" onclick="openAttach()" style="border-radius: 0">选择</button>
<button class="btn btn-default btn-flat" type="button" onclick="openAttach()">选择</button>
</span>
</div>
</div>
@ -98,7 +101,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('commonOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('commonOptions')">保存</button>
</div>
</form>
</div>
@ -134,7 +137,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('seoOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('seoOptions')">保存</button>
</div>
</form>
</div>
@ -164,25 +167,25 @@
<div class="input-group">
<input type="text" class="form-control" id="postSummary" name="post_summary" value="${options.post_summary?default('50')}">
<span class="input-group-btn">
<button class="btn btn-default" id="btn_update_summary" onclick="updateAllSummary()" type="button" style="border-radius: 0">更新</button>
<button class="btn btn-default btn-flat" id="btn_update_summary" onclick="updateAllSummary()" type="button">更新</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<label for="sharePost" class="col-sm-2 control-label">文章分享:</label>
<label class="col-sm-2 control-label">文章分享:</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="share_post" id="sharePost" value="true" ${((options.share_post?default('true'))=='true')?string('checked','')}> 开启
<input type="radio" name="share_post" value="true" ${((options.share_post?default('true'))=='true')?string('checked','')}> 开启
</label>
<label class="radio-inline">
<input type="radio" name="share_post" id="sharePost" value="false" ${((options.share_post?default('true'))=='false')?string('checked','')}> 关闭
<input type="radio" name="share_post" value="false" ${((options.share_post?default('true'))=='false')?string('checked','')}> 关闭
</label>
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('postOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('postOptions')">保存</button>
</div>
</form>
</div>
@ -192,26 +195,26 @@
<form method="post" class="form-horizontal" id="commentOptions">
<div class="box-body">
<div class="form-group">
<label for="CommentSystem" class="col-sm-2 control-label">评论系统:
<label class="col-sm-2 control-label">评论系统:
<span data-toggle="tooltip" data-placement="top" title="其他第三方评论系统在后台无法管理" style="cursor: pointer">
<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="native" ${((options.comment_system?default('native'))=='native')?string('checked','')}> 原生
<input type="radio" name="comment_system" value="native" ${((options.comment_system?default('native'))=='native')?string('checked','')}> 原生
</label>
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="valine" ${((options.comment_system?default('native'))=='valine')?string('checked','')}> Valine
<input type="radio" name="comment_system" value="valine" ${((options.comment_system?default('native'))=='valine')?string('checked','')}> Valine
</label>
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="disqus" ${((options.comment_system?default('native'))=='disqus')?string('checked','')}> Disqus
<input type="radio" name="comment_system" value="disqus" ${((options.comment_system?default('native'))=='disqus')?string('checked','')}> Disqus
</label>
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="livere" ${((options.comment_system?default('native'))=='livere')?string('checked','')}> Livere
<input type="radio" name="comment_system" value="livere" ${((options.comment_system?default('native'))=='livere')?string('checked','')}> Livere
</label>
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="changyan" ${((options.comment_system?default('native'))=='changyan')?string('checked','')}> 畅言
<input type="radio" name="comment_system" value="changyan" ${((options.comment_system?default('native'))=='changyan')?string('checked','')}> 畅言
</label>
</div>
</div>
@ -219,17 +222,17 @@
<!-- 原生设置 -->
<div class="native-options" style="display: none">
<div class="form-group">
<label for="CommentSystem" class="col-sm-2 control-label">是否启用:
<label class="col-sm-2 control-label">是否启用:
<span data-toggle="tooltip" data-placement="top" title="其他第三方评论系统在后台无法管理" style="cursor: pointer">
<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="native" disabled> 启用
<input type="radio" name="comment_system" value="native" disabled> 启用
</label>
<label class="radio-inline">
<input type="radio" name="comment_system" id="CommentSystem" value="valine"> 禁用
<input type="radio" name="comment_system" value="valine"> 禁用
</label>
</div>
</div>
@ -340,7 +343,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('commentOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('commentOptions')">保存</button>
</div>
</form>
</div>
@ -350,24 +353,24 @@
<form method="post" class="form-horizontal" id="adminOptions">
<div class="box-body">
<div class="form-group">
<label for="adminPjax" class="col-sm-2 control-label">启用pjax</label>
<label class="col-sm-2 control-label">启用pjax</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="admin_pjax" id="adminPjax" value="true" ${((options.admin_pjax?default('true'))=='true')?string('checked','')}> 启用
<input type="radio" name="admin_pjax" value="true" ${((options.admin_pjax?default('true'))=='true')?string('checked','')}> 启用
</label>
<label class="radio-inline">
<input type="radio" name="admin_pjax" id="adminPjax" value="false" ${((options.admin_pjax?if_exists)=='false')?string('checked','')}> 禁用
<input type="radio" name="admin_pjax" value="false" ${((options.admin_pjax?if_exists)=='false')?string('checked','')}> 禁用
</label>
</div>
</div>
<div class="form-group">
<label for="adminLayout" class="col-sm-2 control-label">后台布局:</label>
<label class="col-sm-2 control-label">后台布局:</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="admin_layout" id="adminLayout" value="" ${((options.admin_layout?default(''))=='')?string('checked','')}> 正常布局
<input type="radio" name="admin_layout" value="" ${((options.admin_layout?default(''))=='')?string('checked','')}> 正常布局
</label>
<label class="radio-inline">
<input type="radio" name="admin_layout" id="adminLayout" value="layout-boxed" ${((options.admin_layout?default(''))=='layout-boxed')?string('checked','')}> 盒子布局
<input type="radio" name="admin_layout" value="layout-boxed" ${((options.admin_layout?default(''))=='layout-boxed')?string('checked','')}> 盒子布局
</label>
</div>
</div>
@ -391,13 +394,13 @@
</div>
</div>
<div class="form-group">
<label for="sidebarStyle" class="col-sm-2 control-label">侧边栏样式:</label>
<label class="col-sm-2 control-label">侧边栏样式:</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="sidebar_style" id="sidebarStyle" value="" ${((options.sidebar_style?default(''))=='')?string('checked','')}> 展开
<input type="radio" name="sidebar_style" value="" ${((options.sidebar_style?default(''))=='')?string('checked','')}> 展开
</label>
<label class="radio-inline">
<input type="radio" name="sidebar_style" id="sidebarStyle" value="sidebar-collapse" ${((options.sidebar_style?default(''))=='sidebar-collapse')?string('checked','')}> 收拢
<input type="radio" name="sidebar_style" value="sidebar-collapse" ${((options.sidebar_style?default(''))=='sidebar-collapse')?string('checked','')}> 收拢
</label>
</div>
</div>
@ -429,11 +432,51 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('adminOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('adminOptions')">保存</button>
</div>
</form>
</div>
<!-- 邮箱设置 -->
<div class="tab-pane" id="email">
<form method="post" class="form-horizontal" id="emailOptions">
<div class="box-body">
<div class="form-group">
<label for="emailSmtpHost" class="col-sm-2 control-label">SMTP地址</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="emailSmtpHost" name="mail_smtp_host" value="${options.mail_smtp_host?if_exists}">
</div>
</div>
</div>
<div class="box-body">
<div class="form-group">
<label for="emailSmtpUserName" class="col-sm-2 control-label">邮箱账号:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="emailSmtpUserName" name="mail_smtp_username" value="${options.mail_smtp_username?if_exists}">
</div>
</div>
</div>
<div class="box-body">
<div class="form-group">
<label for="emailSmtpPassword" class="col-sm-2 control-label">邮箱密码:</label>
<div class="col-sm-4">
<input type="password" class="form-control" id="emailSmtpPassword" name="mail_smtp_password" value="${options.mail_smtp_password?if_exists}">
</div>
</div>
</div>
<div class="box-body">
<div class="form-group">
<label for="emailFromName" class="col-sm-2 control-label">发件姓名:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="emailFromName" name="mail_from_name" value="${options.mail_from_name?if_exists}">
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('emailOptions')">保存</button>
</div>
</form>
</div>
<!-- 其他设置 -->
<div class="tab-pane" id="other">
<form method="post" class="form-horizontal" id="otherOptions">
@ -450,7 +493,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('otherOptions')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveOptions('otherOptions')">保存</button>
</div>
</form>
</div>
@ -579,7 +622,6 @@
</@compress>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -9,15 +9,14 @@
<#include "module/_sidebar.ftl">
<div class="content-wrapper">
<style type="text/css" rel="stylesheet">
.form-horizontal .control-label{
text-align: left;
}
.nav-tabs-custom > .nav-tabs > li.active {
border-top-color: #d2d6de;
}
#btnNewPage{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out}
#btnNewPage:hover{background:#3c8dbc;color:#fff}
</style>
<section class="content-header">
<h1>页面<small></small></h1>
<h1 style="display: inline-block;">页面<small></small></h1>
<a id="btnNewPage" href="/admin/posts/new">
新建页面
</a>
<ol class="breadcrumb">
<li>
<a href="/admin"><i class="fa fa-dashboard"></i> 首页</a>
@ -51,18 +50,26 @@
<tbody>
<tr>
<td>友情链接</td>
<td>/link</td>
<td>/links</td>
<td>
<a href="/links" class="btn btn-info btn-sm" target="_blank">预览</a>
<a href="/admin/page/links" class="btn btn-primary btn-sm">配置</a>
<a href="/links" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/page/links" class="btn btn-primary btn-sm btn-flat">配置</a>
</td>
</tr>
<tr>
<td>图库页面</td>
<td>/about</td>
<td>
<a href="/gallery" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/page/gallery" class="btn btn-primary btn-sm btn-flat">配置</a>
</td>
</tr>
<tr>
<td>关于页面</td>
<td>/about</td>
<td>
<a href="#" class="btn btn-info btn-sm" target="_blank">预览</a>
<a href="/admin/page/about" class="btn btn-primary btn-sm">配置</a>
<a href="/about" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/page/about" class="btn btn-primary btn-sm btn-flat">配置</a>
</td>
</tr>
</tbody>
@ -70,43 +77,38 @@
</div>
</div>
<div class="tab-pane" id="pages">
<form method="post" class="form-horizontal" id="seoOptions">
<div class="box-body">
<div class="form-group">
<label for="keywords" class="col-sm-2 control-label">QQ</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="keywords" name="seo_keywords" value="">
</div>
</div>
<div class="form-group">
<label for="desc" class="col-sm-2 control-label">微信:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="desc" name="seo_desc" value="">
</div>
</div>
<div class="form-group">
<label for="siteMap" class="col-sm-2 control-label">站点地图:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="siteMap" name="seo_site_map" value="">
</div>
</div>
<div class="form-group">
<label for="baiduToken" class="col-sm-2 control-label">百度推送token</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="baiduToken" name="seo_baidu_token" value="">
</div>
</div>
<div class="form-group">
<label for="seoRobots" class="col-sm-2 control-label">robots.txt</label>
<div class="col-sm-4">
<textarea class="form-control" rows="5" id="seoRobots" name="seo_robots" style="resize: none"></textarea>
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveOptions('seoOptions')">保存</button>
</div>
</form>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>标题</th>
<th>路径</th>
<th>日期</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>友情链接</td>
<td>/link</td>
<th>日期</th>
<td>
<a href="/links" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/page/links" class="btn btn-primary btn-sm btn-flat">配置</a>
</td>
</tr>
<tr>
<td>关于页面</td>
<td>/about</td>
<th>日期</th>
<td>
<a href="#" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/page/about" class="btn btn-primary btn-sm btn-flat">配置</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@ -115,7 +117,6 @@
</section>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -41,20 +41,6 @@
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<!--
<div class="box-header">
<div class="box-tools">
<form action="/admin/posts/search" method="post">
<div class="input-group input-group-sm" style="width: 200px;">
<input type="text" name="keyword" class="form-control pull-right">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div>
</div>
-->
<div class="box-body table-responsive">
<table class="table table-bordered table-hover">
<thead>
@ -69,37 +55,43 @@
</thead>
<tbody>
<#list posts.content as post>
<tr>
<td>${post.postTitle}</td>
<td>
<#if post.categories??>
<#list post.categories as cate>
${cate.cateName}
</#list>
</#if>
</td>
<td>无标签</td>
<td>0</td>
<td>${post.postDate?if_exists?string("yyyy-MM-dd HH:mm")}</td>
<td>
<#switch post.postStatus>
<#case 0>
<a href="/admin/posts/view?postId=${post.postId}" class="btn btn-info btn-sm" target="_blank">预览</a>
<a href="/admin/posts/edit?postId=${post.postId}" class="btn btn-primary btn-sm">修改</a>
<button class="btn btn-danger btn-sm" onclick="modelShow('/admin/posts/throw?postId=${post.postId}','确定移到回收站?')">丢弃</button>
<#break >
<#case 1>
<a href="/admin/posts/view?postId=${post.postId}" class="btn btn-info btn-sm" target="_blank">预览</a>
<a href="/admin/posts/edit?postId=${post.postId}" class="btn btn-primary btn-sm">修改</a>
<button class="btn btn-danger btn-sm" onclick="modelShow('/admin/posts/revert?postId=${post.postId}&status=1','确定发布该文章?')">发布</button>
<#break >
<#case 2>
<a href="/admin/posts/revert?postId=${post.postId}&status=2" class="btn btn-info btn-sm">还原</a>
<button class="btn btn-danger btn-sm" onclick="modelShow('/admin/posts/remove?postId=${post.postId}','确定永久删除?(不可逆)')">永久删除</button>
<#break >
</#switch>
</td>
</tr>
<tr>
<td>${post.postTitle}</td>
<td>
<#if post.categories?size gt 0>
<#list post.categories as cate>
${cate.cateName}
</#list>
<#else >
无分类
</#if>
</td>
<td>无标签</td>
<td>
<#if post.getComments()??>
${post.getComments()?size}
</#if>
</td>
<td>${post.postDate?if_exists?string("yyyy-MM-dd HH:mm")}</td>
<td>
<#switch post.postStatus>
<#case 0>
<a href="/admin/posts/view?postId=${post.postId}" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/posts/edit?postId=${post.postId}" class="btn btn-primary btn-sm btn-flat">修改</a>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/posts/throw?postId=${post.postId}','确定移到回收站?')">丢弃</button>
<#break >
<#case 1>
<a href="/admin/posts/view?postId=${post.postId}" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a href="/admin/posts/edit?postId=${post.postId}" class="btn btn-primary btn-sm btn-flat">修改</a>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/posts/revert?postId=${post.postId}&status=1','确定发布该文章?')">发布</button>
<#break >
<#case 2>
<a href="/admin/posts/revert?postId=${post.postId}&status=2" class="btn btn-info btn-sm btn-flat">还原</a>
<button class="btn btn-danger btn-sm btn-flat" onclick="modelShow('/admin/posts/remove?postId=${post.postId}','确定永久删除?(不可逆)')">永久删除</button>
<#break >
</#switch>
</td>
</tr>
</#list>
</tbody>
</table>
@ -151,7 +143,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -77,7 +77,7 @@
<div class="input-group">
<input type="text" class="form-control selectData" id="userAvatar" name="userAvatar" value="${user.userAvatar?if_exists}">
<span class="input-group-btn">
<button class="btn btn-default" type="button" style="border-radius: 0" onclick="openAttach()">选择</button>
<button class="btn btn-default btn-flat" type="button" onclick="openAttach()">选择</button>
</span>
</div>
</div>
@ -94,7 +94,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="saveUser('profileForm')">保存</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="saveUser('profileForm')">保存</button>
</div>
</form>
</div>
@ -122,7 +122,7 @@
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm" onclick="changPass()">修改</button>
<button type="button" class="btn btn-primary btn-sm btn-flat" onclick="changPass()">修改</button>
</div>
</form>
</div>
@ -224,7 +224,6 @@
</@compress>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -43,7 +43,7 @@
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn btn-primary">添加新标签</button>
<button type="submit" class="btn btn-primary btn-flat">添加新标签</button>
</div>
</form>
</div>
@ -70,8 +70,8 @@
<td>${tag.tagUrl}</td>
<td>2</td>
<td>
<a class="btn btn-danger btn-xs" href="/admin/tag/edit?tagId=${tag.tagId}">修改</a>
<button class="btn btn-primary btn-xs" onclick="modelShow('/admin/tag/remove?tagId=${tag.tagId}')">删除</button>
<a class="btn btn-danger btn-xs btn-flat" href="/admin/tag/edit?tagId=${tag.tagId}">修改</a>
<button class="btn btn-primary btn-xs btn-flat" onclick="modelShow('/admin/tag/remove?tagId=${tag.tagId}')">删除</button>
</td>
</tr>
</#list>
@ -95,8 +95,8 @@
</div>
<div class="modal-footer">
<input type="hidden" id="url"/>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<a onclick="removeIt()" class="btn btn-danger" data-dismiss="modal">确定</a>
<button type="button" class="btn btn-default btn-flat" data-dismiss="modal">取消</button>
<a onclick="removeIt()" class="btn btn-danger btn-flat" data-dismiss="modal">确定</a>
</div>
</div>
</div>
@ -138,7 +138,6 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>
</#compress>

View File

@ -80,48 +80,35 @@
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<div class="box-body theme-thumbnail" style="background-image: url(/static/images/boxed-bg.jpg)"></div>
<div class="box-footer">
<span class="theme-title">Halo</span>
<button class="btn btn-primary btn-sm pull-right" onclick="openSetting('halo')">设置</button>
<#if theme == "halo">
<button class="btn btn-primary btn-sm pull-right" disabled>已启用</button>
<#else >
<button onclick="setTheme('halo')" class="btn btn-primary btn-sm pull-right">启用</button>
</#if>
<#if themes?? && (themes?size>0)>
<#list themes as theme>
<div class="col-md-3">
<div class="box box-solid">
<div class="box-body theme-thumbnail" style="background-image: url(/${theme.themeName?if_exists}/screenshot.png)"></div>
<div class="box-footer">
<span class="theme-title">${theme.themeName?if_exists}</span>
<#if theme.hasOptions==true>
<button class="btn btn-primary btn-sm pull-right btn-flat" onclick="openSetting('${theme.themeName?if_exists}')">设置</button>
</#if>
<#if activeTheme == "${theme.themeName?if_exists}">
<button class="btn btn-primary btn-sm pull-right btn-flat" disabled>已启用</button>
<#else >
<button onclick="setTheme('${theme.themeName?if_exists}')" class="btn btn-primary btn-sm pull-right btn-flat">启用</button>
</#if>
</div>
</div>
</div>
</#list>
<#else>
<div class="col-md-12">
<h2>居然没有主题?</h2>
<h2>你仿佛在逗我?</h2>
<h2>赶紧去上传一个主题,不然前台会报错!</h2>
<h2>No themes?</h2>
<h2>You fang fu is douing me?</h2>
<h2>Please upload a theme,Otherwise the page will be incorrect.</h2>
</div>
</div>
<div class="col-md-3">
<div class="box box-solid">
<div class="box-body theme-thumbnail" style="background-image: url(/static/images/material.png)"></div>
<div class="box-footer">
<span class="theme-title">Material</span>
<button class="btn btn-primary btn-sm pull-right" onclick="openSetting('material')">设置</button>
<#if theme == "material">
<button class="btn btn-primary btn-sm pull-right" disabled>已启用</button>
<#else >
<button onclick="setTheme('material')" class="btn btn-primary btn-sm pull-right">启用</button>
</#if>
</div>
</div>
</div>
<div class="col-md-3">
<div class="box box-solid">
<div class="box-body theme-thumbnail" style="background-image: url(/static/images/material.png)"></div>
<div class="box-footer">
<span class="theme-title">Anatole</span>
<button class="btn btn-primary btn-sm pull-right" onclick="openSetting('Anatole')">设置</button>
<#if theme == "Anatole">
<button class="btn btn-primary btn-sm pull-right" disabled>已启用</button>
<#else >
<button onclick="setTheme('Anatole')" class="btn btn-primary btn-sm pull-right">启用</button>
</#if>
</div>
</div>
</div>
</#if>
</div>
</section>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
@ -133,11 +120,32 @@
$('#uploadTheme').fileinput({
language: 'zh',
uploadUrl: '/admin/themes/upload',
allowedFileExtensions: ['zip'],
allowedFileExtensions: ['zip','jpg'],
maxFileCount: 1,
enctype: 'multipart/form-data',
dropZoneTitle: '拖拽文件到这里 &hellip;<br>此模式不支持多文件同时上传',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data==true){
$("#uploadForm").hide(400);
$.toast({
text: "上传成功!",
heading: '提示',
icon: 'success',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff',
afterHidden: function () {
window.location.reload();
}
});
}
});
});
});
@ -197,6 +205,5 @@
</script>
</div>
<#include "module/_footer.ftl">
<div class="control-sidebar-bg"></div>
</div>
<@footer></@footer>

View File

@ -64,6 +64,7 @@
<script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/plugins/fileinput/fileinput.min.js"></script>
<script src="/static/plugins/fileinput/zh.min.js"></script>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
<script>
$('#uploadImg').fileinput({
language: 'zh',
@ -73,6 +74,27 @@
maxFileCount: 10,
enctype : 'multipart/form-data',
showClose: false
}).on("fileuploaded",function (event,data,previewId,index) {
var data = data.jqXHR.responseJSON;
if(data==true){
$("#uploadForm").hide(400);
$.toast({
text: "上传成功!",
heading: '提示',
icon: 'success',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff',
afterHidden: function () {
window.location.reload();
}
});
}
});
function doTransport(url) {
parent.$('.selectData').val(url);

View File

@ -0,0 +1,176 @@
<style>
input[type=text],textarea{
width: 100%;
outline: none;
font-size: 16px;
}
input[type=text]{
height: 40px;
font-size: 16px;
opacity: 0.8;
border-top: none;
border-left: none;
border-right: none;
border-bottom: 1px dashed #70c09f;
}
input[type=text]:focus{
border-bottom: 1px dashed red;
}
textarea{
opacity: 0.8;
border: 1px dashed #70c09f;
}
#native-comment{
padding : 10px;
}
#inputAuthor,#inputAuthorEmail,#inputAuthorUrl,#inputContent{
padding: 0;
margin-bottom: 10px;
}
#btn-push{
border: 1px solid #000;
background: transparent;
width: 65px;
height: 35px;
transition: all .5s ease-in-out;
}
#btn-push:hover{
border: none;
background: #000;
color: #fff;
}
#comments-list ul{
width: 100%;
list-style: none;
margin: 0 auto;
padding: 0;
font-weight: 400;
letter-spacing: 0;
font-size: 14px;
}
.vcard{
padding-top: 1.5rem;
position: relative;
display: block;
list-style: none;
margin: 0 auto;
padding: 0;
}
.vimg{
width: 2.5rem;
height: 2.5rem;
float: left;
border-radius: 50%;
margin-right: .7525rem;
}
.v .vlist .vcard section {
overflow: hidden;
padding-bottom: 1.5rem;
border-bottom: 1px dashed #f5f5f5;
}
.vhead {
line-height: 1.5;
margin-bottom: .625rem;
margin-top: 0;
}
.vcontent {
word-wrap: break-word;
word-break: break-all;
text-align: justify;
color: #4a4a4a;
font-size: .875rem;
line-height: 2;
position: relative;
margin-bottom: .75rem;
}
.vsys {
display: inline-block;
padding: .2rem .5rem;
background: #ededed;
color: #b3b1b1;
font-size: .75rem;
border-radius: .2rem;
margin-right: .3rem;
}
.vtime {
color: #b3b3b3;
font-size: .75rem;
margin-right: .875rem;
}
</style>
<div id="native-comment">
<div class="row" style="margin: 0">
<form action="/newComment" method="post" id="comment-form">
<input type="hidden" name="postId" value="${post.postId}">
<div class="col-lg-12 col-xs-12" id="inputContent">
<textarea rows="5" name="commentContent" placeholder="赶快评论一个吧!" style="resize: none;"></textarea>
</div>
<div class="col-lg-4 col-xs-12" id="inputAuthor">
<input name="commentAuthor" type="text" placeholder="昵称">
</div>
<div class="col-lg-4 col-xs-12" id="inputAuthorEmail">
<input name="commentAuthorEmail" type="text" placeholder="邮箱">
</div>
<div class="col-lg-4 col-xs-12" id="inputAuthorUrl">
<input name="commentAuthorUrl" type="text" placeholder="链接(http/https)">
</div>
<div class="col-lg-12" style="padding: 0;">
<input class="pull-right" type="button" id="btn-push" value="提交">
</div>
</form>
<div class="commentCount" style="display:block;">
<div class="vcount col">
<span class="vnum">${comments.totalElements}</span> 评论
</div>
</div>
<div class="col-lg-12" style="padding: 0;">
<div id="comments-list">
<ul>
<#list comments.content as comment>
<li class="vcard">
<img class="vimg" src="https://gravatar.cat.net/avatar/36a181c9a5a9ab58f0212a216ac677f4?d=identicon">
<section>
<div class="vhead">
<a class="vname" rel="nofollow" href="https://ryanc.cc" target="_blank">${comment.commentAuthor}</a>
<span class="vsys">Chrome 63.0.3239.84</span>
<span class="vsys">Mac OS 10.12.6</span>
</div>
<div class="vcontent">
<p>${comment.commentContent?if_exists}</p>
</div>
<div class="vfooter">
<span class="vtime">${comment.commentDate?string("yyyy-MM-dd")}</span>
<div>
</div>
</div>
</section>
</li>
</#list>
</ul>
</div>
</div>
</div>
</div>
<script src="/static/plugins/jquery/jquery.min.js"></script>
<script>
$('#btn-push').click(function () {
$.ajax({
type: 'POST',
url: '/newComment',
async: false,
data:{
'postId' : $('input[name=postId]').val(),
'commentContent' : $('textarea[name=commentContent]').val(),
'commentAuthor' : $('input[name=commentAuthor]').val(),
'commentAuthorEmail' : $('input[name=commentAuthorEmail]').val(),
'commentAuthorUrl' : $('input[name=commentAuthorUrl]').val()
},
success: function (data) {
if(data=="success"){
window.location.reload();
}
}
});
});
</script>

View File

@ -0,0 +1,14 @@
<html>
<body>
<table border="2 red solid">
<tr>
<td>发件人</td>
<td>事件</td>
</tr>
<tr>
<td>${hahah}</td>
<td>${hehehe}</td>
</tr>
</table>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,6 @@
<#include "../../../common/comment/_livere_comment.ftl">
<#elseif (options.comment_system!)=='changyan'>
<#include "../../../common/comment/_changyan_comment.ftl">
<#elseif (options.comment_system!)=='native'>
<#include "../../../common/comment/_native_comment.ftl">
</#if>

View File

@ -0,0 +1,29 @@
<#macro head title="" keywords="" description="">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<title>${title?default("Anatole")}</title>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<meta name="renderer" content="webkit">
<meta name="author" content="${keywords?default("Anatole")}" />
<meta name="keywords" content=""/>
<meta name="description" content="${description?default("Anatole")}" />
<link rel="shortcut icon" href="/anatole/source/images/favicon.png" type="image/x-icon" />
<link href="/anatole/source/css/font-awesome.min.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="/anatole/source/css/blog_basic.css?version=88107691fe">
<link href="/anatole/source/css/style.css" type="text/css" rel="stylesheet" />
<link rel="alternate" type="application/rss+xml" title="atom 1.0" href="/feed.xml">
</head>
<body>
</#macro>
<#macro footer>
<script type="text/javascript" src="/anatole/source/js/jquery.js"></script>
<script type="text/javascript" src="/anatole/source/js/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="/anatole/source/js/jquery.appear.js"></script>
</body>
</html>
</#macro>

View File

@ -0,0 +1,131 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="/static/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css">
<link rel="stylesheet" href="/static/css/AdminLTE.min.css">
<style>
.themeSetting,.themeImg{
padding-top: 15px;
padding-bottom: 15px;
}
.form-horizontal .control-label{
text-align: left;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 themeImg">
<img src="/${themeDir}/screenshot.png" style="width: 100%;">
</div>
<div class="col-md-6 themeSetting">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active">
<a href="#sns" data-toggle="tab">社交资料</a>
</li>
<li>
<a href="#about" data-toggle="tab">关于</a>
</li>
</ul>
<div class="tab-content">
<!-- 社交资料 -->
<div class="tab-pane active" id="sns">
<form method="post" class="form-horizontal" id="anatoleSnsOptions">
<div class="box-body">
<div class="form-group">
<label for="anatoleSnsTwitter" class="col-sm-4 control-label">Twitter</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsTwitter" name="theme_anatole_sns_twitter" value="${options.theme_anatole_sns_twitter?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsFacebook" class="col-sm-4 control-label">Facebook</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsFacebook" name="theme_anatole_sns_facebook" value="${options.theme_anatole_sns_facebook?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsInstagram" class="col-sm-4 control-label">Instagram</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsInstagram" name="theme_anatole_sns_instagram" value="${options.theme_anatole_sns_instagram?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsDribbble" class="col-sm-4 control-label">Dribbble</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsDribbble" name="theme_anatole_sns_dribbble" value="${options.theme_anatole_sns_dribbble?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsWeibo" class="col-sm-4 control-label">Weibo</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsWeibo" name="theme_anatole_sns_weibo" value="${options.theme_anatole_sns_weibo?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsEmail" class="col-sm-4 control-label">Email</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsEmail" name="theme_anatole_sns_email" value="${options.theme_anatole_sns_email?if_exists}" >
</div>
</div>
<div class="form-group">
<label for="anatoleSnsGithub" class="col-sm-4 control-label">Github</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="anatoleSnsGithub" name="theme_anatole_sns_github" value="${options.theme_anatole_sns_github?if_exists}" >
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-primary btn-sm pull-right" onclick="saveThemeOptions('anatoleSnsOptions')">保存设置</button>
</div>
</form>
</div>
<!-- 关于该主题 -->
<div class="tab-pane" id="about">
<div class="box box-widget widget-user-2">
<div class="widget-user-header bg-blue">
<div class="widget-user-image">
<img class="img-circle" src="/anatole/source/images/logo@2x.png" alt="User Avatar">
</div>
<h3 class="widget-user-username">CAICAI</h3>
<h5 class="widget-user-desc">A other farbox theme</h5>
</div>
<div class="box-footer no-padding">
<ul class="nav nav-stacked">
<li><a target="_blank" href="https://www.caicai.me/">作者主页</a></li>
<li><a target="_blank" href="https://github.com/hi-caicai/farbox-theme-Anatole">原主题地址</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="/static/plugins/jquery/jquery.min.js"></script>
<script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/js/app.js"></script>
<script>
function saveThemeOptions(option) {
var param = $('#'+option).serialize();
$.ajax({
type: 'post',
url: '/admin/option/save',
data: param,
success: function (data) {
showMsg("保存成功!","success",1000);
}
});
}
</script>
</html>

View File

@ -0,0 +1,26 @@
<div class="page-top animated fadeInDown">
<div class="nav">
<li>
<a href="/" class="current">Home </a>
</li>
<li>
<a href="/about">About</a>
</li>
<li>
<a href="/archives">Archive</a>
</li>
<li>
<a href="/links">Links</a>
</li>
</div>
<div class="information">
<div class="back_btn">
<li>
<a onclick="window.history.go(-1)" style="display:none;" class="fa fa-chevron-left"></a>
</li>
</div>
<div class="avatar">
<img src="/anatole/source/images/favicon.png" />
</div>
</div>
</div>

View File

@ -0,0 +1,31 @@
<#list posts.content as post>
<div class="post animated fadeInDown">
<div class="post-title">
<h3>
<a href="/post/${post.postUrl}">${post.postTitle}</a>
</h3>
</div>
<div class="post-content">
<div class="p_part">
<p>${post.postSummary?if_exists}...</p>
</div>
<div class="p_part">
<p></p>
</div>
</div>
<div class="post-footer">
<div class="meta">
<div class="info">
<i class="fa fa-sun-o"></i>
<span class="date">${post.postDate?string("yyyy-MM-dd")}</span>
<i class="fa fa-comment-o"></i>
<a href="/post/${post.postUrl}#comment_widget">Comments</a>
<i class="fa fa-tag"></i>
<a href="/tags/App" class="tag">&nbsp;App</a>
<a href="/tags/Evernote" class="tag">&nbsp;Evernote</a>
<a href="/tags/Mac" class="tag">&nbsp;Mac</a>
</div>
</div>
</div>
</div>
</#list>

View File

@ -0,0 +1,23 @@
<div class="sidebar animated fadeInDown">
<div class="logo-title">
<div class="title">
<img src="/anatole/source/images/logo@2x.png" style="width:127px;" />
<h3 title="">
<a href="/">${options.site_title?default("ANATOLE")}</a>
</h3>
<div class="description">
<p>${user.userDesc?default("A other farbox theme")}</p>
</div>
</div>
</div>
<#include "social-list.ftl">
<div class="footer">
<a target="_blank" href="http://None">
<span>Designed by </span>
<a href="https://www.caicai.me">CaiCai</a>
<div class="by_farbox">
<a href="http://www.farbox.com" target="_blank">Proudly published with Halo&#65281;</a>
</div>
</a>
</div>
</div>

View File

@ -0,0 +1,57 @@
<ul class="social-links">
<#if options.theme_anatole_sns_twitter??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_twitter}">
<i class="fa fa-twitter"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_facebook??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_facebook}">
<i class="fa fa-facebook"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_instagram??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_instagram}">
<i class="fa fa-instagram"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_dribbble??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_dribbble}">
<i class="fa fa-dribbble"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_weibo??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_weibo}">
<i class="fa fa-weibo"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_email??>
<li>
<a target="_blank" href="mailto:${options.theme_anatole_sns_email}">
<i class="fa fa-envelope"></i>
</a>
</li>
</#if>
<#if options.theme_anatole_sns_github??>
<li>
<a target="_blank" href="${options.theme_anatole_sns_github}">
<i class="fa fa-github"></i>
</a>
</li>
</#if>
</ul>

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

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