Skip to content

Commit cf21a9b

Browse files
redesign
1 parent 5bae385 commit cf21a9b

File tree

5 files changed

+44
-115
lines changed

5 files changed

+44
-115
lines changed

Client/ContentsViewer/ContentsViewerStandard.css

Lines changed: 8 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -14,87 +14,18 @@ body {
1414
margin: 0;
1515
}
1616

17-
.new-box {
18-
border: 2px solid #f3cbd0;
19-
border-radius: 5px;
20-
margin: 40px 5px 5px 5px;
21-
padding: 20px 20px 10px 20px;
22-
position: relative;
23-
}
24-
25-
.new-box:before {
26-
background-color: #ef858c;
27-
border-radius: 5px;
28-
color: #fff;
29-
content: "New!!";
30-
padding: 5px 20px;
31-
position: absolute;
32-
left: -10px;
33-
top: -20px;
34-
}
35-
36-
.new-box:after {
37-
border-top: 12px solid #ef858c;
38-
border-right: 12px solid transparent;
39-
border-left: 12px solid transparent;
40-
content: "";
41-
position: absolute;
42-
top: 10px;
43-
left: 15px;
17+
.recent-list>div {
18+
border-left: 4px solid #fb6d76c7;
19+
padding: 0 0 0 12px;
4420
}
45-
46-
ol.new-list {
47-
counter-reset: list;
21+
.recent-list ul{
4822
list-style-type: none;
49-
/* font-size: 14px; */
50-
font: 14px/1.6 "arial narrow", sans-serif;
51-
padding: 0;
52-
margin: 0;
23+
font-size: 0.875em;
5324
}
54-
55-
ol.new-list li {
56-
position: relative;
57-
padding: 7px 0 7px 20px;
25+
.recent-list ul li{
26+
line-height: 1.23;
5827
margin: 0;
59-
font-weight: bold;
60-
font-size: 14px;
61-
border-bottom: dashed 1px #f6a38b;
62-
}
63-
64-
ol.new-list li:before {
65-
counter-increment: list;
66-
content: "";
67-
display: block;
68-
position: absolute;
69-
left: 0px;
70-
height: 15px;
71-
width: 15px;
72-
border-radius: 50%;
73-
background: #f6a38b;
74-
top: 50%;
75-
-moz-transform: translateY(-50%);
76-
-webkit-transform: translateY(-50%);
77-
-o-transform: translateY(-50%);
78-
-ms-transform: translateY(-50%);
79-
transform: translateY(-50%);
80-
}
81-
82-
ol.new-list li:after {
83-
content: "";
84-
display: block;
85-
position: absolute;
86-
left: 6px;
87-
height: 0;
88-
width: 0;
89-
border-top: 4px solid transparent;
90-
border-bottom: 4px solid transparent;
91-
border-left: 5px solid #fff;
92-
top: 50%;
93-
-moz-transform: translateY(-50%);
94-
-webkit-transform: translateY(-50%);
95-
-o-transform: translateY(-50%);
96-
-ms-transform: translateY(-50%);
97-
transform: translateY(-50%);
28+
padding: 4px 0;
9829
}
9930

10031
ul.tag-list {
@@ -1983,17 +1914,6 @@ a.directory .name, a.file .name{
19831914
ul.tagline li a::after {
19841915
background-color: white !important;
19851916
}
1986-
.new-box:before {
1987-
background-color: white;
1988-
border-radius: 5px;
1989-
border: 2px solid #ef858c;
1990-
color: #000;
1991-
content: "New!!";
1992-
padding: 5px 20px;
1993-
position: absolute;
1994-
left: -10px;
1995-
top: -20px;
1996-
}
19971917
ul.tag-list li span {
19981918
background-color: white;
19991919
color: #606060;
@@ -2166,21 +2086,6 @@ a.directory .name, a.file .name{
21662086
background-color: rgba(255, 255, 255, 0.1);
21672087
color: var(--main-font-color);
21682088
}
2169-
[theme="dark"] .new-box {
2170-
border: 2px solid #f3cbd087;
2171-
}
2172-
[theme="dark"] .new-box:before {
2173-
background-color: #bb6c71;
2174-
}
2175-
[theme="dark"] .new-box:after {
2176-
border-top: 12px solid #bb6c71;
2177-
}
2178-
[theme="dark"] ol.new-list li:before {
2179-
background-color: #f6a38bc9;
2180-
}
2181-
[theme="dark"] ol.new-list li {
2182-
border-bottom: dashed 1px #f6a38bc9;
2183-
}
21842089
[theme="dark"] ul.tag-list li a {
21852090
color: var(--main-font-color);
21862091
}

Frontend/viewer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
<div id="content-summary" class="summary">
189189
<?=$vars['contentSummary']?>
190190
<?php if (isset($vars['latestContents'])): ?>
191-
<?=CreateNewBox($vars['latestContents'])?>
191+
<?=CreateRecentList($vars['latestContents'])?>
192192
<?php endif;?>
193193
<?php if (isset($vars['tagList'])): ?>
194194
<h3><?=Localization\Localize('tagmap', 'TagMap')?></h3>

Locales/ja/translations.core.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"invalidParameter": "無効なパラメータです.",
4343
"authenticationFailed": "認証に失敗しました.",
4444
"temporarilyUnavailable": "一時的に利用できません",
45+
"recentChanges": "最近の更新",
4546
"retrievedFrom": "「{0}」から取得",
4647
"sorryLongTimeToGeneratePageAndReport":
4748
"申し訳ございません m(. _ . )m<br> ページの生成に時間がかかったようです.<br>品質向上のためこの問題は管理者に報告されます."

Module/ContentTextParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static function ParseContentLink($matches, $context) {
7777
$title = '';
7878
$parent = $content->Parent();
7979
if($parent !== false) {
80-
$title .= NotBlankText([$parent->title, basename($parent->path)]) . '-';
80+
$title .= NotBlankText([$parent->title, basename($parent->path)]) . '/';
8181
}
8282
$title .= NotBlankText([$content->title, basename($content->path)]);
8383
$href = CreateContentHREF($content->path);

Module/ContentsViewerUtils.php

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,45 @@ function CreateFileHREF($filePath){
7676
* @param array $latestContents
7777
* array of Content
7878
*/
79-
function CreateNewBox($latestContents) {
80-
$newBoxElement = "<div class='new-box'><ol class='new-list'>";
79+
function CreateRecentList($latestContents) {
80+
$html = '<div class="recent-list">';
81+
$html .= '<h3>' . Localization\Localize('recentChanges', 'Recent Changes') . '</h3>';
8182

8283
$displayCount = count($latestContents);
8384
if($displayCount > 16) $displayCount = 16;
8485

85-
for($i = 0; $i < $displayCount; $i++){
86+
/**
87+
* [
88+
* '2020-06-08' => [Content, Content, ...],
89+
* ...
90+
* ]
91+
*/
92+
$dateGroup = [];
93+
for($i = 0; $i < $displayCount; $i++) {
8694
$content = $latestContents[$i];
87-
$parent = $content->Parent();
88-
$title = "[" . date("Y-m-d", $content->modifiedTime) . "] " . NotBlankText([$content->title, basename($content->path)]) .
89-
($parent === false ? '' : ' | ' . NotBlankText([$parent->title, basename($parent->path)]));
90-
$newBoxElement .= "<li><a href='" . CreateContentHREF($content->path) . "'>" . $title . "</a></li>";
95+
$date = date("Y-m-d", $content->modifiedTime);
96+
if(!array_key_exists($date, $dateGroup)) {
97+
$dateGroup[$date] = [];
98+
}
99+
$dateGroup[$date][] = $content;
91100
}
92-
93-
$newBoxElement .= "</ol></div>";
94-
return $newBoxElement;
101+
$html .= '<div>';
102+
foreach($dateGroup as $date => $group) {
103+
$html .= '<h4>' . $date . '</h4>';
104+
$html .= '<ul>';
105+
foreach($group as $content) {
106+
$title = '';
107+
$parent = $content->Parent();
108+
if($parent !== false) {
109+
$title .= NotBlankText([$parent->title, basename($parent->path)]) . '/';
110+
}
111+
$title .= NotBlankText([$content->title, basename($content->path)]);
112+
$html .= '<li><a href="' . CreateContentHREF($content->path) . '">' . $title . '</a></li>';
113+
}
114+
$html .= '</ul>';
115+
}
116+
$html .= '</div></div>';
117+
return $html;
95118
}
96119

97120
function CreateTagListElement($tag2path, $rootDirectory, $layerName, $parentTagPathParts = []) {

0 commit comments

Comments
 (0)