From da1f5d8ab2a969d9e55edf42a7dc4f23106a50c8 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 27 Apr 2014 15:59:29 +0200 Subject: [PATCH] Split long lines in views --- lib/chibi-core | 2 +- public_html/media/css/comment-small.css | 8 +-- public_html/media/css/core.css | 2 +- public_html/media/css/logs.css | 4 +- public_html/media/css/post-view.css | 11 ++- src/Helpers/TextHelper.php | 7 -- src/Views/auth-login.phtml | 10 +-- src/Views/comment-add.phtml | 6 +- src/Views/comment-edit.phtml | 10 ++- src/Views/comment-list.phtml | 11 +-- src/Views/comment-small.phtml | 16 +++-- src/Views/index-index.phtml | 16 +++-- src/Views/layout-file.phtml | 1 + src/Views/layout-normal.phtml | 5 +- src/Views/log-view.phtml | 15 ++-- src/Views/post-edit.phtml | 85 ++++++++++++++++++---- src/Views/post-file-render.phtml | 20 +++++- src/Views/post-list-wrapper.phtml | 26 ++++--- src/Views/post-list.phtml | 6 +- src/Views/post-small.phtml | 30 +++++--- src/Views/post-upload.phtml | 19 ++++- src/Views/post-view.phtml | 29 ++++---- src/Views/tag-mass-tag.phtml | 43 +++++++++-- src/Views/tag-merge.phtml | 8 ++- src/Views/tag-rename.phtml | 8 ++- src/Views/top-navigation.phtml | 29 ++++++-- src/Views/user-delete.phtml | 12 +++- src/Views/user-edit.phtml | 91 +++++++++++++++++------ src/Views/user-registration.phtml | 44 ++++++++++-- src/Views/user-select.phtml | 7 +- src/Views/user-view.phtml | 95 +++++++++++++++++++------ 31 files changed, 519 insertions(+), 157 deletions(-) diff --git a/lib/chibi-core b/lib/chibi-core index c660801c..b6097259 160000 --- a/lib/chibi-core +++ b/lib/chibi-core @@ -1 +1 @@ -Subproject commit c660801c2b1d9dcd1807270f2a3ad18dcdcabc6f +Subproject commit b6097259d4da7f337718c1afe9a285daa7185f19 diff --git a/public_html/media/css/comment-small.css b/public_html/media/css/comment-small.css index 4224ae62..e138feb8 100644 --- a/public_html/media/css/comment-small.css +++ b/public_html/media/css/comment-small.css @@ -32,14 +32,14 @@ .comment .delete { font-size: small; } -.comment .edit:before, -.comment .delete:before { +.comment .edit a:before, +.comment .delete a:before { margin-left: 0.2em; content: ' ['; color: silver; } -.comment .edit:after, -.comment .delete:after { +.comment .edit a:after, +.comment .delete a:after { content: ']'; color: silver; } diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 8649caef..f8c2ab56 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -164,7 +164,7 @@ footer a { #sidebar .key { - padding-right: 0.5em; + padding-right: 0.3em; } #sidebar .key-value { max-width: 100%; diff --git a/public_html/media/css/logs.css b/public_html/media/css/logs.css index bb96f81b..bff50336 100644 --- a/public_html/media/css/logs.css +++ b/public_html/media/css/logs.css @@ -7,11 +7,11 @@ max-width: 50%; } -pre { +code { font-size: 11pt; margin: 0; } -pre strong { +code strong { background: #fee; } diff --git a/public_html/media/css/post-view.css b/public_html/media/css/post-view.css index b065b38c..97be76a2 100644 --- a/public_html/media/css/post-view.css +++ b/public_html/media/css/post-view.css @@ -88,6 +88,15 @@ embed { font-weight: bold; } +#sidebar .score a:first-of-type:before { + content: '['; + color: black; +} +#sidebar .score a:last-of-type:after { + content: ']'; + color: black; +} + #sidebar .left a, #sidebar .right a { display: inline-block; @@ -140,7 +149,7 @@ i.icon-fav { vertical-align: middle; } .hl-option span { - padding-left: 0.6em; + padding-left: 0.4em; vertical-align: middle; } .permalink .ext:after { diff --git a/src/Helpers/TextHelper.php b/src/Helpers/TextHelper.php index 825e09e8..bdb0904a 100644 --- a/src/Helpers/TextHelper.php +++ b/src/Helpers/TextHelper.php @@ -222,13 +222,6 @@ class TextHelper return $path; } - public static function secureWhitespace($text) - { - $text = str_replace(["\r\n", "\r", "\n"], ' ', $text); - $text = str_replace(' ', ' ', $text); - return $text; - } - const HTML_OPEN = 1; const HTML_CLOSE = 2; const HTML_LEAF = 3; diff --git a/src/Views/auth-login.phtml b/src/Views/auth-login.phtml index 015d914c..5dd50076 100644 --- a/src/Views/auth-login.phtml +++ b/src/Views/auth-login.phtml @@ -4,7 +4,10 @@ CustomAssetViewDecorator::addStylesheet('auth.css'); ?>
-

If you don't have an account yet,
click here to create a new one.

+

+ If you don't have an account yet,
+ click here to create a new one. +

@@ -22,10 +25,7 @@ CustomAssetViewDecorator::addStylesheet('auth.css');   - +
diff --git a/src/Views/comment-add.phtml b/src/Views/comment-add.phtml index 51d57001..f8c93c4f 100644 --- a/src/Views/comment-add.phtml +++ b/src/Views/comment-add.phtml @@ -3,7 +3,11 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css'); CustomAssetViewDecorator::addScript('comment-edit.js'); ?> - + +

add comment

diff --git a/src/Views/comment-edit.phtml b/src/Views/comment-edit.phtml index 59c3b543..e362060f 100644 --- a/src/Views/comment-edit.phtml +++ b/src/Views/comment-edit.phtml @@ -3,13 +3,19 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css'); CustomAssetViewDecorator::addScript('comment-edit.js'); ?> - + +

edit comment

-
+
+ +
diff --git a/src/Views/comment-list.phtml b/src/Views/comment-list.phtml index 50e28046..dc781837 100644 --- a/src/Views/comment-list.phtml +++ b/src/Views/comment-list.phtml @@ -17,17 +17,20 @@ CustomAssetViewDecorator::setSubTitle('comments'); context->transport->posts as $post): ?>
- context->post = $post ?> + context->post = $post; + $comments = array_reverse($post->getComments()); + $commentsToDisplay = array_slice($comments, 0, $this->config->comments->maxCommentsInList); + ?> renderFile('post-small') ?>
- getComments()) ?> - config->comments->maxCommentsInList) as $comment): ?> + context->comment = $comment ?> renderFile('comment-small') ?> - $this->config->comments->maxCommentsInList): ?> + count($commentsToDisplay)): ?> (more…) diff --git a/src/Views/comment-small.phtml b/src/Views/comment-small.phtml index df455292..2d57b1bb 100644 --- a/src/Views/comment-small.phtml +++ b/src/Views/comment-small.phtml @@ -12,7 +12,9 @@ CustomAssetViewDecorator::addScript('comment-edit.js'); <?= $commenter->name ?> - <?= UserModel::getAnonymousName() ?> + <?= UserModel::getAnonymousName() ?>
@@ -32,7 +34,9 @@ CustomAssetViewDecorator::addScript('comment-edit.js'); context->comment->commentDate, false) ?> - + edit @@ -40,9 +44,13 @@ CustomAssetViewDecorator::addScript('comment-edit.js'); - + - + delete diff --git a/src/Views/index-index.phtml b/src/Views/index-index.phtml index 6a147602..27e32d8a 100644 --- a/src/Views/index-index.phtml +++ b/src/Views/index-index.phtml @@ -12,8 +12,12 @@ CustomAssetViewDecorator::addStylesheet('index-index.css'); context->featuredPost)): ?>
- context->imageLink = \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?> - context->transport->post = $this->context->featuredPost ?> + context->transport->post = $this->context->featuredPost; + $this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', [ + 'id' => $this->context->featuredPost->id]); + ?> + renderFile('post-file-render') ?>
@@ -34,10 +38,14 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
- Featured + Featured context->featuredPostUser): ?> - by context->featuredPostUser->name ?>, + by + + context->featuredPostUser->name ?> + , + context->featuredPostDate) / (24 * 3600.)) ?> today diff --git a/src/Views/layout-file.phtml b/src/Views/layout-file.phtml index 7a4f4386..2faecd18 100644 --- a/src/Views/layout-file.phtml +++ b/src/Views/layout-file.phtml @@ -35,6 +35,7 @@ else 'Content-Type', $this->context->transport->mimeType); + if (strtotime($ifModifiedSince) == $lastModified or $eTagHeader == $eTag) { header('HTTP/1.1 304 Not Modified'); diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index ca175547..30db4ea1 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -16,7 +16,10 @@ CustomAssetViewDecorator::addScript('core.js');