From 88cf14ab96ed3977fc021e1493e6dd35b31153ae Mon Sep 17 00:00:00 2001 From: Aleksandr Grekhov Date: Mon, 2 Mar 2026 14:48:34 +0300 Subject: [PATCH 1/4] db initial sql fixed --- samples/bloggy/sql/bloggy.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bloggy/sql/bloggy.sql b/samples/bloggy/sql/bloggy.sql index 977f457..62820cc 100644 --- a/samples/bloggy/sql/bloggy.sql +++ b/samples/bloggy/sql/bloggy.sql @@ -50,9 +50,9 @@ INSERT INTO `Post` (`id`, `userId`, `title`, `text`, `deleted`, `updateTime`, `c (5, 2, 'Merchandising revenue dispute', 'Pooh videos, soft toys and other merchandise generate substantial annual revenues for Disney. The size of Pooh stuffed toys ranges from Beanie and miniature to human-sized. In addition to the stylised Disney Pooh, Disney markets Classic Pooh merchandise which more closely resembles E.H. Shepard\'s illustrations.\r\n\r\nIn 1991, Stephen Slesinger, Inc. filed a lawsuit against Disney which alleged that Disney had breached their 1983 agreement by again failing to accurately report revenue from Winnie the Pooh sales. Under this agreement, Disney was to retain approximately 98% of gross worldwide revenues while the remaining 2% was to be paid to Slesinger. In addition, the suit alleged that Disney had failed to pay required royalties on all commercial exploitation of the product name.[24] Though the Disney corporation was sanctioned by a judge for destroying forty boxes of evidential documents,[25] the suit was later terminated by another judge when it was discovered that Slesinger\'s investigator had rummaged through Disney\'s garbage to retrieve the discarded evidence.[26] Slesinger appealed the termination and, on 26 September 2007, a three-judge panel upheld the lawsuit dismissal.[27]\r\n\r\nAfter the Copyright Term Extension Act of 1998, Clare Milne, Christopher Milne\'s daughter, attempted to terminate any future U.S. copyrights for Stephen Slesinger, Inc.[28] After a series of legal hearings, Judge Florence-Marie Cooper of the U.S. District Court in California found in favour of Stephen Slesinger, Inc., as did the United States Court of Appeals for the Ninth Circuit. On 26 June 2006, the U.S. Supreme Court refused to hear the case, sustaining the ruling and ensuring the defeat of the suit.[29]\r\n\r\nOn 19 February 2007 Disney lost a court case in Los Angeles which ruled their \"misguided claims\" to dispute the licensing agreements with Slesinger, Inc. were unjustified,[30] but a federal ruling of 28 September 2009, again from Judge Florence-Marie Cooper, determined that the Slesinger family had granted all trademarks and copyrights to Disney, although Disney must pay royalties for all future use of the characters. Both parties have expressed satisfaction with the outcome.[31][32]', 0, '2019-05-05 18:29:17', '2019-05-06 00:29:17'); CREATE TABLE `User` ( - `id` bigint(20) NOT NULL, + `id` bigint(20) NOT NULL AUTO_INCREMENT, `login` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `passwordSha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `passwordSha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `updateTime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `creationTime` datetime NOT NULL DEFAULT current_timestamp(), From 436815dd0d17680c7b89ea612908d7f30054f861 Mon Sep 17 00:00:00 2001 From: Aleksandr Grekhov Date: Mon, 2 Mar 2026 15:28:07 +0300 Subject: [PATCH 2/4] post code cleaned up from legacy + posts order fix --- samples/bloggy/src/main/java/bloggy/dao/PostDao.java | 1 - .../src/main/java/bloggy/dao/impl/PostDaoImpl.java | 9 ++------- .../src/main/java/bloggy/web/frame/PostsViewFrame.java | 1 - .../src/main/webapp/WEB-INF/templates/PostViewFrame.ftl | 2 ++ 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/samples/bloggy/src/main/java/bloggy/dao/PostDao.java b/samples/bloggy/src/main/java/bloggy/dao/PostDao.java index c803cda..3dbef9e 100644 --- a/samples/bloggy/src/main/java/bloggy/dao/PostDao.java +++ b/samples/bloggy/src/main/java/bloggy/dao/PostDao.java @@ -11,5 +11,4 @@ public interface PostDao { List findByUser(User user); void insert(Post post); void update(Post post); - String findNote(); } diff --git a/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java b/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java index 78751d7..3f64c8a 100644 --- a/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java +++ b/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java @@ -16,16 +16,11 @@ public Post find(long id) { @Override public List findAll() { - return findBy("NOT deleted ORDER BY updateTime DESC"); + return findBy("NOT deleted ORDER BY updateTime DESC, id DESC"); } @Override public List findByUser(User user) { - return findBy("userId=? AND NOT deleted ORDER BY updateTime DESC", user.getId()); - } - - @Override - public String findNote() { - return "note11"; + return findBy("userId=? AND NOT deleted ORDER BY updateTime DESC, id DESC", user.getId()); } } diff --git a/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java b/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java index d647f6b..4f723ba 100644 --- a/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java +++ b/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java @@ -35,6 +35,5 @@ private void putPosts(List posts) { private void putPostIds(List posts) { put("postIds", posts.stream().map(Post::getId).collect(Collectors.toList())); - put("note", postDao.findNote()); } } diff --git a/samples/bloggy/src/main/webapp/WEB-INF/templates/PostViewFrame.ftl b/samples/bloggy/src/main/webapp/WEB-INF/templates/PostViewFrame.ftl index b8cd141..1e885c7 100644 --- a/samples/bloggy/src/main/webapp/WEB-INF/templates/PostViewFrame.ftl +++ b/samples/bloggy/src/main/webapp/WEB-INF/templates/PostViewFrame.ftl @@ -35,6 +35,8 @@ var $post = $(this).closest("article._post"); $post.find("._preview").hide(); $post.find("._complete").show(); + + return false; }); From 6f20c00db9790049a2385697a6498483b82a3516 Mon Sep 17 00:00:00 2001 From: Sagiman Date: Tue, 3 Mar 2026 21:49:21 +0300 Subject: [PATCH 3/4] refactor styles: replace LESS constants with CSS vars + cleanup warnings --- .../webapp/WEB-INF/templates/EnterPage.ftl | 1 + .../WEB-INF/templates/PostViewFrame.ftl | 13 ++++++----- .../webapp/WEB-INF/templates/PostViewPage.ftl | 1 + .../webapp/WEB-INF/templates/UserpicFrame.ftl | 3 ++- .../src/main/webapp/assets/css/form.css | 3 +-- .../src/main/webapp/assets/css/style.css | 6 +++++ .../src/main/webapp/assets/css/style.less | 23 ++++++++----------- 7 files changed, 27 insertions(+), 23 deletions(-) diff --git a/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl b/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl index 4075919..61a3eba 100644 --- a/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl +++ b/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl @@ -41,6 +41,7 @@ +<#--noinspection HtmlDeprecatedAttribute--> diff --git a/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl b/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl index 3cde01a..9cc233c 100644 --- a/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl +++ b/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl @@ -18,10 +18,11 @@ }); +<#--noinspection HtmlDeprecatedAttribute-->