Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/bloggy/sql/bloggy.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 0 additions & 1 deletion samples/bloggy/src/main/java/bloggy/dao/PostDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ public interface PostDao {
List<Post> findByUser(User user);
void insert(Post post);
void update(Post post);
String findNote();
}
9 changes: 2 additions & 7 deletions samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ public Post find(long id) {

@Override
public List<Post> findAll() {
return findBy("NOT deleted ORDER BY updateTime DESC");
return findBy("NOT deleted ORDER BY updateTime DESC, id DESC");
}

@Override
public List<Post> 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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ private void putPosts(List<Post> posts) {

private void putPostIds(List<Post> posts) {
put("postIds", posts.stream().map(Post::getId).collect(Collectors.toList()));
put("note", postDao.findNote());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<script>
</script>

<#--noinspection HtmlDeprecatedAttribute-->
<style type="text/less">
._enter-box {
margin: 3em auto;
Expand Down
17 changes: 10 additions & 7 deletions samples/bloggy/src/main/webapp/WEB-INF/templates/PostViewFrame.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,35 @@

<script>
$("._full").css("cursor", "pointer").click(function () {
var $post = $(this).closest("article._post");
const $post = $(this).closest("article._post");
$post.find("._preview").hide();
$post.find("._complete").show();

return false;
});
</script>

<#--noinspection HtmlDeprecatedAttribute-->
<style type="text/less">
._post {
margin-bottom: @larger-gap-size;
margin-bottom: var(--larger-gap-size);

header {
font-size: @smaller-font-size;
color: @muted-color;
font-size: var(--smaller-font-size);
color: var(--muted-color);
}

._title {
font-size: @title-font-size;
font-size: var(--title-font-size);

a {
color: @caption-color;
color: var(--caption-color);
text-decoration: none;
}
}

._full {
font-size: @smaller-font-size;
font-size: var(--smaller-font-size);
}

._complete {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<script>
</script>

<#--noinspection HtmlDeprecatedAttribute-->
<style type="text/less">
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
</template>

<script>
$("._full").css("cursor", "pointer").click(function () {
var $post = $(this).closest("article._post");
$post.find("._preview").hide();
$post.find("._complete").show();
});
</script>

<#--noinspection HtmlDeprecatedAttribute-->
<style type="text/less">
._userpic {
text-align: center;
margin: @smallest-gap-size;
margin: var(--smallest-gap-size);

img {
display: block;
Expand Down
4 changes: 2 additions & 2 deletions samples/bloggy/src/main/webapp/WEB-INF/templates/common.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
};

$(function () {
var message = getMessage();
let message = getMessage();
if (!message) {
<#if message??>
message = "${message?js_string}";
</#if>
}
if (message) {
removeMessage();
var $message = $(".middle .message").text(message).show();
const $message = $(".middle .message").text(message).show();
setTimeout(function () {
$message.fadeOut("slow");
}, 5000);
Expand Down
3 changes: 1 addition & 2 deletions samples/bloggy/src/main/webapp/assets/css/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
}

.form-box .button-field {
margin: 1.5rem;
margin-left: 12rem;
margin: 1.5rem 1.5rem 1.5rem 12rem;
}

.form-box .button-field input {
Expand Down
6 changes: 6 additions & 0 deletions samples/bloggy/src/main/webapp/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
--datatable-dark-cell-color: #f8f8f8;
--muted-color: gray;
--highlight-color: #B3E5FC;
--title-font-size: 24px;
--smaller-font-size: 14px;
--smallest-gap-size: 10px;
--smaller-gap-size: 15px;
--gap-size: 20px;
--larger-gap-size: 30px;
color: var(--black-color);
font-family: Verdana, sans-serif;
font-size: 16px;
Expand Down
23 changes: 9 additions & 14 deletions samples/bloggy/src/main/webapp/assets/css/style.less
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
@border-color: rgb(185, 185, 185);
@border-radius: 6px;
@black-color: #333;
@caption-color: #3B5998;
@error-color: red;
@datatable-color: #E1E1E1;
@datatable-dark-cell-color: #f8f8f8;
@muted-color: gray;
@title-font-size: 24px;
@smaller-font-size: 14px;
@smallest-gap-size: 10px;
@smaller-gap-size: 15px;
@gap-size: 20px;
@larger-gap-size: 30px;
/*
This file is intentionally left empty.

We no longer keep design constants in LESS:
they are defined as CSS custom properties (var(--...)) in the root stylesheet.

However, some components still rely on the LESS for proper rendering,
so this file remains as a placeholder/entry point and must not be removed.
*/