From 02c16d3b027924a752908f589e713a425cc81d04 Mon Sep 17 00:00:00 2001 From: Roman Parpalak Date: Thu, 28 Mar 2024 18:34:32 +0200 Subject: [PATCH] Updated blog admin styles. --- _extensions/s2_blog/admin.css | 71 ++++++++++++++-------- _extensions/s2_blog/blog.js | 10 ++- _extensions/s2_blog/blog_lib.php | 21 +++++-- _extensions/s2_blog/hooks/ai_pre_edit.php | 4 +- _extensions/s2_blog/i/icons.png | Bin 1784 -> 0 bytes _extensions/s2_blog/i/index.html | 8 --- 6 files changed, 67 insertions(+), 47 deletions(-) delete mode 100644 _extensions/s2_blog/i/icons.png delete mode 100644 _extensions/s2_blog/i/index.html diff --git a/_extensions/s2_blog/admin.css b/_extensions/s2_blog/admin.css index 8416894d..f9ecd5f1 100644 --- a/_extensions/s2_blog/admin.css +++ b/_extensions/s2_blog/admin.css @@ -1,38 +1,29 @@ -.bitbtn.add_post, #blog_tab:before, .sort .buttons .favorite, .sort .buttons .notfavorite { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABFCAYAAABDsGYlAAAGv0lEQVRYw9WWeVCUZRzH12aa/qgZ/cMOm04PsukYr0xSxqMhyzTPjDDlyCsz0xobslG8BqTdhJBDQCwEWglIt5ANdrmPFpBDluVeDiFWLllgYRHY99vze+uldeVFUf/xnfnOszvv+/u83+f3vL/f80gASO5FY96MiMgPPnMmS3pXAH//7EVXrlRzGo2Wk0qTXx03IDQ0LaapqRGNjQ2QSn87PS7AsWOq5xIScgcrKqpRWVmFqChl94EDUZNEAczi+rCwrEC5PO83uTw789y5pLaKihqUlOhQXKxjYzlOnYoxBAT8muntHfHLV1/JpG5unu+NABQKjaWzsxcNDQbU1DShvLyeBVXi8mUdCgrKUFhYAa22FjpdPXPUjJYWE/z9I0wjgOPH477RaKq52toWlJbWoaiomgVX8CoqqkJGRjESE/OgVhcxUDMUikzL5s17d96UA0/PmF0qVaGlqsrAbOtZYC1ycnSIjFTj9OlEhIerIZdr4O19bmjLlr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2R6gQVZWFtLS0tiGomIbayJsp/ZfTiaMAKxvCg8LTvr6+mA0Gnkn7e3towOEQK1Wy3bnYra1X2Y7US6ys7ORnp6O1NRUpKSkoLu7e2yAtQvhP01NyAm5EZ0C3aiqqmInER07aJSyU0oJn5OCggLk5+fzuSGQqAPrtbfNB60OidyM6aC+vh56vR7V1XRCq2TnpXKUlZXxuSFXBKBnRXNg7cD6zSTh/5gOmpub0dTUxA6YjezU1oC6ujpe5IpGATyaA87Whe1vq9xYKMa6FuaxufVRPdguoy2Agtk0eqkArQHPEuQOylkQlf6zD8AB4wEC3JemyqrMyNbXYv0ZW4uqMCAgQLypUjD1P6p3QdQ8qAu1siMqQQwGAwIDA0dvqvQANUxqYzSSent7+VbW1tbGA4QmGxIScmtTFXqgIAJQALV16oO2Uxq1GoWSFX4LDZWmQnsCOWlpaREH2MoaQk4oH52dnXcOsIbQdCgnBBoXQOjKlBeCkMYNIBeJmljsD3HF9pOr4fb9Cixytzs9JsC6Fyqyo3Ek1g0JZYEoaUmGr2oXPvJ9DW9+PkV2WwDZd5eugELrB0U5nfwBmXobfNU7CGC+7SqQVn43G4llZ2B9/V4aSABYAzixHCzeNxXSZHd4J7vywd5Jrv87EJoqy/JIU7VVkMIL62Uz8UPyVv7NNNJ/Pgd32lRfd348Yv6uKX1km8Y5bk8GUew/Mdr9Q60MAuMAAAAASUVORK5CYII=); +.sort .buttons .favorite:before { + content: '★'; + color: #ffbf00; + font-size: 20px; + line-height: 16px; + } +.sort .buttons .notfavorite:before { + content: '☆'; + font-size: 20px; + line-height: 16px; } - .find_posts:before { content: '🔍'; vertical-align: -1px; padding: 0 1px; } - -#blog_tab:before { - background-position: 0 -32px; - } - -.sort .buttons .favorite { - background-position: 0 -16px; - } -.sort .buttons .notfavorite { - background-position: 0 0; +.add_post:before { + content: '➕'; + vertical-align: -1px; + padding: 0 1px; } -.tags_list span { - color: #fff; - font-weight: bold; - background: #093; - } - .tags_list span:not(:empty) { - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - padding: 0 1px; - } - -.bitbtn.add_post { - background-position: 1px -51px; +#blog_tab:before { + content: '📄'; + background: none; + margin: 0 4px 0 0; } #blog_wrapper { @@ -47,4 +38,30 @@ .s2_blog_tags, .s2_blog_label { white-space: nowrap; + } + +.hidden .s2_blog_title { + text-decoration-line: line-through; + } + +.s2_blog_title_cell { + display: flex; + text-overflow: ellipsis; + overflow: hidden; + margin-right: 1em; + } + .s2_blog_title { + flex: 0 0 auto; + } + .s2_blog_text_extra { + margin: 0 0 0 2em; + color: #b4b4b4; + white-space: nowrap; + flex: 1 1 auto; + max-width: 10vw; + } + + +@media screen and (max-width: 850px) { + .s2_blog_text_extra {display: none;} } \ No newline at end of file diff --git a/_extensions/s2_blog/blog.js b/_extensions/s2_blog/blog.js index b1f0402c..8e1a0c3e 100644 --- a/_extensions/s2_blog/blog.js +++ b/_extensions/s2_blog/blog.js @@ -73,13 +73,11 @@ function ToggleFavBlog (eItem, iId) { GETAsyncRequest(sUrl + "action=flip_favorite_post&id=" + iId, function (http) { - var temp = eItem.getAttribute('data-class'); - eItem.setAttribute('data-class', eItem.getAttribute('class')); - eItem.setAttribute('class', temp); + eItem.classList.toggle('favorite'); + eItem.classList.toggle('notfavorite'); - temp = eItem.getAttribute('data-alt'); - eItem.setAttribute('data-alt', eItem.getAttribute('alt')); - eItem.setAttribute('alt', temp); + temp = eItem.getAttribute('data-title'); + eItem.setAttribute('data-title', eItem.getAttribute('title')); eItem.setAttribute('title', temp); }); return false; diff --git a/_extensions/s2_blog/blog_lib.php b/_extensions/s2_blog/blog_lib.php index 54e0e505..e2e1ac74 100644 --- a/_extensions/s2_blog/blog_lib.php +++ b/_extensions/s2_blog/blog_lib.php @@ -541,7 +541,7 @@ function s2_blog_output_post_list ($criteria) $raw_sub_query = $s2_db->build($sub_query); $query = array( - 'SELECT' => 'id, title, published, commented, ('.$raw_sub_query.') as comment_count, create_time, label, favorite, user_id', + 'SELECT' => 'id, title, published, commented, ('.$raw_sub_query.') as comment_count, create_time, label, favorite, user_id, SUBSTR(text, 1, 200) AS text', 'FROM' => 's2_blog_posts AS p', 'WHERE' => $condition, 'ORDER BY' => 'create_time DESC' @@ -581,7 +581,7 @@ function s2_blog_output_post_list ($criteria) $buttons = array(); if ($s2_user['edit_site']) - $buttons['favorite'] = ''.($row['favorite'] ? Lang::get('Undo favorite', 's2_blog') : Lang::get('Do favorite', 's2_blog')).''; + $buttons['favorite'] = ''; if ($s2_user['edit_site'] || $s2_user['id'] == $row['user_id']) $buttons['delete'] = ''.$lang_admin['Delete'].''; @@ -593,10 +593,23 @@ function s2_blog_output_post_list ($criteria) ($hook = s2_hook('fn_s2_blog_output_post_list_pre_row_mrg')) ? eval($hook) : null; - $body .= ''.s2_htmlencode($row['title']).''.$date.''.$tags.''.$row['label'].''.$comment.''.$buttons.''; + $body .= '' . + '' . s2_htmlencode($row['title']) . '' . s2_htmlencode(strip_tags($row['text'])) . '' . + '' . $date . '' . + '' . $tags . '' . + '' . $row['label'] . '' . + '' . $comment . '' . + '' . $buttons . '' . + ''; } - echo ''.$body.'
'.Lang::get('Post', 's2_blog').''.$lang_admin['Date'].''.Lang::get('Tags').''.Lang::get('Label', 's2_blog').''.Lang::get('Comments').' 
'; + echo '' . + '' . + '' . + '' . + '' . + '' . '' . + '' . $body . '
' . Lang::get('Post', 's2_blog') . '' . $lang_admin['Date'] . '' . Lang::get('Tags') . '' . Lang::get('Label', 's2_blog') . '' . Lang::get('Comments') . ' 
'; } else echo '

'.Lang::get('No posts found', 's2_blog').'

'; diff --git a/_extensions/s2_blog/hooks/ai_pre_edit.php b/_extensions/s2_blog/hooks/ai_pre_edit.php index 19a27b73..1d6b8985 100644 --- a/_extensions/s2_blog/hooks/ai_pre_edit.php +++ b/_extensions/s2_blog/hooks/ai_pre_edit.php @@ -30,7 +30,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/_extensions/s2_blog/i/icons.png b/_extensions/s2_blog/i/icons.png deleted file mode 100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